qid int64 1 74.7M | question stringlengths 0 58.3k | date stringlengths 10 10 | metadata list | response_j stringlengths 2 48.3k | response_k stringlengths 2 40.5k |
|---|---|---|---|---|---|
55,424 | I feel like this may be already out there somewhere, but I really did think this up on my own. What does this rebus puzzle mean?
>
> GO GO GO GO GO GO GO GO
>
>
>
That's really it! No additional hints exist in any of the content not in block quotes.
Hint:
>
> The answer has 5 words.
>
>
> | 2017/09/27 | [
"https://puzzling.stackexchange.com/questions/55424",
"https://puzzling.stackexchange.com",
"https://puzzling.stackexchange.com/users/30254/"
] | Is it
>
> Forgot to go
>
>
>
Implying
>
> 4 GO x 2 GO = 8 GO (Four-go-two-go) = forgot to go
>
>
> | I think the answer is
>
> Everything is a go
>
>
>
meaning
>
> All preparations are complete
>
>
> |
55,424 | I feel like this may be already out there somewhere, but I really did think this up on my own. What does this rebus puzzle mean?
>
> GO GO GO GO GO GO GO GO
>
>
>
That's really it! No additional hints exist in any of the content not in block quotes.
Hint:
>
> The answer has 5 words.
>
>
> | 2017/09/27 | [
"https://puzzling.stackexchange.com/questions/55424",
"https://puzzling.stackexchange.com",
"https://puzzling.stackexchange.com/users/30254/"
] | Probably
>
> **GO**es in line...
>
>
>
> with?
>
>
>
As in:
>
> Rhymes with.
>
>
> | I feel,
(EDITED ANSWER):
>
> Goes online (that is LIVE!)
>
>
>
based on pronounciation mainly
>
> 8 GOs arranged in a line
>
>
>
a common phrase of usage. |
55,424 | I feel like this may be already out there somewhere, but I really did think this up on my own. What does this rebus puzzle mean?
>
> GO GO GO GO GO GO GO GO
>
>
>
That's really it! No additional hints exist in any of the content not in block quotes.
Hint:
>
> The answer has 5 words.
>
>
> | 2017/09/27 | [
"https://puzzling.stackexchange.com/questions/55424",
"https://puzzling.stackexchange.com",
"https://puzzling.stackexchange.com/users/30254/"
] | Is it
>
> Forgot to go
>
>
>
Implying
>
> 4 GO x 2 GO = 8 GO (Four-go-two-go) = forgot to go
>
>
> | I feel,
(EDITED ANSWER):
>
> Goes online (that is LIVE!)
>
>
>
based on pronounciation mainly
>
> 8 GOs arranged in a line
>
>
>
a common phrase of usage. |
55,424 | I feel like this may be already out there somewhere, but I really did think this up on my own. What does this rebus puzzle mean?
>
> GO GO GO GO GO GO GO GO
>
>
>
That's really it! No additional hints exist in any of the content not in block quotes.
Hint:
>
> The answer has 5 words.
>
>
> | 2017/09/27 | [
"https://puzzling.stackexchange.com/questions/55424",
"https://puzzling.stackexchange.com",
"https://puzzling.stackexchange.com/users/30254/"
] | Could it be:
>
> It takes two to tango?
>
>
>
Rather cryptically, the rebus puzzle depicts:
>
> It takes two (more go) to (get) ten go.
>
>
> | I think the answer is
>
> Everything is a go
>
>
>
meaning
>
> All preparations are complete
>
>
> |
55,424 | I feel like this may be already out there somewhere, but I really did think this up on my own. What does this rebus puzzle mean?
>
> GO GO GO GO GO GO GO GO
>
>
>
That's really it! No additional hints exist in any of the content not in block quotes.
Hint:
>
> The answer has 5 words.
>
>
> | 2017/09/27 | [
"https://puzzling.stackexchange.com/questions/55424",
"https://puzzling.stackexchange.com",
"https://puzzling.stackexchange.com/users/30254/"
] | Any Chance it'd be:
>
> Go Wait in a line
>
>
>
as in
>
> Go \* 8 in a line
>
>
> | Perhaps a bit of a stretch, but
>
> Great Times
>
>
>
Because
>
> *'"GO" eight times'* if said quickly, would sound something like 'go-wait times'\*. For someone with a [rhotacism](https://en.wikipedia.org/wiki/Rhotacism_(speech_impediment)), like Elmer Fudd, this would be pronounced almost identical to *'gre... |
55,424 | I feel like this may be already out there somewhere, but I really did think this up on my own. What does this rebus puzzle mean?
>
> GO GO GO GO GO GO GO GO
>
>
>
That's really it! No additional hints exist in any of the content not in block quotes.
Hint:
>
> The answer has 5 words.
>
>
> | 2017/09/27 | [
"https://puzzling.stackexchange.com/questions/55424",
"https://puzzling.stackexchange.com",
"https://puzzling.stackexchange.com/users/30254/"
] | I guess the answer you're after is:
>
> to forego
>
>
>
because indeed
>
> 2 \* GO GO GO GO = two (four GO)
>
>
> | Is it
>
> Forgot to go
>
>
>
Implying
>
> 4 GO x 2 GO = 8 GO (Four-go-two-go) = forgot to go
>
>
> |
4,946,177 | I'm working on a simple lightbox script for my website, that wraps a link (A) around a image. The link URL should then be the SRC of the image, but slightly manipulated.
The image URL could look like this: "pb028855\_copy\_147x110.jpg" and I want it to delete "*147x110", from after "copy*" to before ".jpg" that is.
M... | 2011/02/09 | [
"https://Stackoverflow.com/questions/4946177",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/315200/"
] | If you're not certain exactly what the numbers will be, you could use the [`replace()`*(docs)*](https://developer.mozilla.org/en/JavaScript/Reference/Global_Objects/String/replace) method with a regular expression.
```
$(function(){
$('img.withCaption').each(function(){
var $imgSrc = this.src.replace(/_\d+... | They are several ways of manipulating strings, depends of what you exactly want, for example:
```
$imgSrc = $imgSrc.replace(/thumb/, 'big');
``` |
4,946,177 | I'm working on a simple lightbox script for my website, that wraps a link (A) around a image. The link URL should then be the SRC of the image, but slightly manipulated.
The image URL could look like this: "pb028855\_copy\_147x110.jpg" and I want it to delete "*147x110", from after "copy*" to before ".jpg" that is.
M... | 2011/02/09 | [
"https://Stackoverflow.com/questions/4946177",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/315200/"
] | If you're not certain exactly what the numbers will be, you could use the [`replace()`*(docs)*](https://developer.mozilla.org/en/JavaScript/Reference/Global_Objects/String/replace) method with a regular expression.
```
$(function(){
$('img.withCaption').each(function(){
var $imgSrc = this.src.replace(/_\d+... | The attr method simply returns a string, you can manipulate it just like any other one. So a regex replace would work.
```
$(function(){
$('img.withCaption').each(function(){
var imgSrc = $(this).attr("src")*.replace(/_copy_\d+x\d+\.jpg$/, "_copy.jpg")*;
$(this).wrap($('<a rel="lightBox" />').attr(... |
32,964,257 | I am trying to build gstreamer for IMX53 Evk board.
I downloaded Yocto from <http://freescale.github.io/#download> and run the following commands.
```
#MACHINE=imx53qsb
#source setup-environment build
#bitbake core-image-minimal
```
It built the u-boot, kernel and filesystem. The file system doesn't have gstreamer. ... | 2015/10/06 | [
"https://Stackoverflow.com/questions/32964257",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/3693586/"
] | You may add just
```
IMAGE_INSTALL_append += "gstreamer"
```
Long answer is that you should add the package name that usually stored in PN recipe variable. You may read about PN variable [here](http://www.yoctoproject.org/docs/1.6/ref-manual/ref-manual.html#var-PN). Package names may also be managed with PACKAGES [... | Advice is correct on getting package name. First find recipe. bitbake-layers is useful for this. Then check that PN and PACKAGES variables are not set, if they are things get tricky. For gstreamer they are not
If you're new to Yocto, I'd go with adding package in local.conf. Entry in should be be IMAGE\_INSTALL\_appen... |
32,964,257 | I am trying to build gstreamer for IMX53 Evk board.
I downloaded Yocto from <http://freescale.github.io/#download> and run the following commands.
```
#MACHINE=imx53qsb
#source setup-environment build
#bitbake core-image-minimal
```
It built the u-boot, kernel and filesystem. The file system doesn't have gstreamer. ... | 2015/10/06 | [
"https://Stackoverflow.com/questions/32964257",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/3693586/"
] | You may add just
```
IMAGE_INSTALL_append += "gstreamer"
```
Long answer is that you should add the package name that usually stored in PN recipe variable. You may read about PN variable [here](http://www.yoctoproject.org/docs/1.6/ref-manual/ref-manual.html#var-PN). Package names may also be managed with PACKAGES [... | You either use
`IMAGE_INSTALL_append = " gstreamer"`
or
`IMAGE_INSTALL += " gstreamer"`
They do the same things but `IMAGE_INSTALL_append` is best when using with this variable.
The space in front of gstreamer is important because.
let's say IMAGE\_INSTALL is a string: `"opkg qtbase"`
and if we do not add a sp... |
32,964,257 | I am trying to build gstreamer for IMX53 Evk board.
I downloaded Yocto from <http://freescale.github.io/#download> and run the following commands.
```
#MACHINE=imx53qsb
#source setup-environment build
#bitbake core-image-minimal
```
It built the u-boot, kernel and filesystem. The file system doesn't have gstreamer. ... | 2015/10/06 | [
"https://Stackoverflow.com/questions/32964257",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/3693586/"
] | You either use
`IMAGE_INSTALL_append = " gstreamer"`
or
`IMAGE_INSTALL += " gstreamer"`
They do the same things but `IMAGE_INSTALL_append` is best when using with this variable.
The space in front of gstreamer is important because.
let's say IMAGE\_INSTALL is a string: `"opkg qtbase"`
and if we do not add a sp... | Advice is correct on getting package name. First find recipe. bitbake-layers is useful for this. Then check that PN and PACKAGES variables are not set, if they are things get tricky. For gstreamer they are not
If you're new to Yocto, I'd go with adding package in local.conf. Entry in should be be IMAGE\_INSTALL\_appen... |
14,071,294 | So I'm trying to run collectstatic to push some files to AWS, but I keep getting a "unknown command" error. When running manage.py help I get a list of subcommands, and sure enough collectstatic is not there. I have looked also in the installed apps part of settings.py and the staticfiles app is installed. Python is ve... | 2012/12/28 | [
"https://Stackoverflow.com/questions/14071294",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1934710/"
] | Check settings.py for `django.contrib.staticfiles` in `INSTALLED_APPS` and `django.core.context_processors.static` in `TEMPLATE_CONTEXT_PROCESSORS` | For those for whom the accepted answer did not work, doing
`python manage.py collectstatic`
**worked** while
`python django-admin.py collecstatic` *did not*.
Maybe that can help some. |
72,813,471 | Data:
```
+---------------------+------------------+--+
| date_add | fnv_wa | |
+---------------------+------------------+--+
| 2022-06-24 06:00:16 | 46.216866 | |
| 2022-06-24 07:00:16 | 46.216866 | |
| 2022-06-24 08:00:16 | 45.685139 | |
| 2022-06-24 09:00:16 | 45.63393... | 2022/06/30 | [
"https://Stackoverflow.com/questions/72813471",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/16154762/"
] | Which value to you use for `n`?
Your code is working quite fine with `n=3`:
```
from scipy.signal import argrelextrema
n = 3
df['min'] = df.iloc[argrelextrema(df['fnv_wa'].values, np.less_equal,
order=n)[0]]['fnv_wa']
df['max'] = df.iloc[argrelextrema(df['fnv_wa'].values, np.greater_equal,
... | Rudimentary approach (will probably perform poorly at scale)
```
local_minima = []
local_maxima = []
for i, row in df.iterrows():
if i > 0 and i < len(df)-1:
if df.loc[i,"fnv_wa"] < df.loc[i-1,"fnv_wa"] and df.loc[i,"fnv_wa"] < df.loc[i+1,"fnv_wa"]:
local_minima.append(i)
elif df.loc[i,... |
2,772,017 | This is my query:
```
from forum in Forums
join post in Posts on forum equals post.Forum into postGroup
from p in postGroup
where p.ParentPostID==0
select new
{
forum.Title,
forum.ForumID,
LastPostTitle = p.Title,
LastPostAddedDate = p.AddedDate ... | 2010/05/05 | [
"https://Stackoverflow.com/questions/2772017",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/332590/"
] | ```
var allforums = from f in context.Fora.Include("Posts")
select f;
```
This query produces the same results as
```
var allForums = from f in context.Fora
select new ForumPosts
{
F... | ```
public class ForumPosts
{
public Forum Forum { get; set; }
public IQueryable<Post> Posts { get; set; }
}
public class DisplaySet
{
public string Name { get; set; }
public string PostTile { get; set; }
}
//left outer join
using (ClassLib... |
2,772,017 | This is my query:
```
from forum in Forums
join post in Posts on forum equals post.Forum into postGroup
from p in postGroup
where p.ParentPostID==0
select new
{
forum.Title,
forum.ForumID,
LastPostTitle = p.Title,
LastPostAddedDate = p.AddedDate ... | 2010/05/05 | [
"https://Stackoverflow.com/questions/2772017",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/332590/"
] | Here is some code to help you to work out Left Join with Link
```
private class EntityRole
{
public int EntityId { get; set; }
public int RoleId { get; set; }
}
private IList<EntityRole> GetSourceEntityRole()
{
var list = new List<EntityRole>() {new EntityRole(){EntityId = ... | ```
public class ForumPosts
{
public Forum Forum { get; set; }
public IQueryable<Post> Posts { get; set; }
}
public class DisplaySet
{
public string Name { get; set; }
public string PostTile { get; set; }
}
//left outer join
using (ClassLib... |
2,772,017 | This is my query:
```
from forum in Forums
join post in Posts on forum equals post.Forum into postGroup
from p in postGroup
where p.ParentPostID==0
select new
{
forum.Title,
forum.ForumID,
LastPostTitle = p.Title,
LastPostAddedDate = p.AddedDate ... | 2010/05/05 | [
"https://Stackoverflow.com/questions/2772017",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/332590/"
] | ```
Forums
.GroupJoin(PostGroup, f => f.ID, p => p.ForumID, (f, p) => new { Forum = f, PostList = p })
.Where(anon => anon.PostList.Any(pl => pl.ParentPostID.Equals(0)))
.OrderBy(anon => anon.Forum.ForumID)
.Select(anon => new
{
Title = anon.Forum.Title,
ForumID = anon.Forum.ForumID,... | ```
public class ForumPosts
{
public Forum Forum { get; set; }
public IQueryable<Post> Posts { get; set; }
}
public class DisplaySet
{
public string Name { get; set; }
public string PostTile { get; set; }
}
//left outer join
using (ClassLib... |
2,772,017 | This is my query:
```
from forum in Forums
join post in Posts on forum equals post.Forum into postGroup
from p in postGroup
where p.ParentPostID==0
select new
{
forum.Title,
forum.ForumID,
LastPostTitle = p.Title,
LastPostAddedDate = p.AddedDate ... | 2010/05/05 | [
"https://Stackoverflow.com/questions/2772017",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/332590/"
] | Try something like this:
```
from forum in Forums
join post in Posts on forum equals post.Forum into postGroup
// from p in postGroup
// where p.ParentPostID==0
select new
{
forum.Title,
forum.ForumID,
LastPostTitle = postGroup.FirstOrDefault(p => p.ParentPostID==0).Title,
LastPo... | ```
public class ForumPosts
{
public Forum Forum { get; set; }
public IQueryable<Post> Posts { get; set; }
}
public class DisplaySet
{
public string Name { get; set; }
public string PostTile { get; set; }
}
//left outer join
using (ClassLib... |
2,772,017 | This is my query:
```
from forum in Forums
join post in Posts on forum equals post.Forum into postGroup
from p in postGroup
where p.ParentPostID==0
select new
{
forum.Title,
forum.ForumID,
LastPostTitle = p.Title,
LastPostAddedDate = p.AddedDate ... | 2010/05/05 | [
"https://Stackoverflow.com/questions/2772017",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/332590/"
] | if not mistake:
```
var list = from forum in Forums.DefaultItIfEmpty()
from post in Posts.DefaultItIfEmpty()
where forum.forum_id == post.forum_id && post.ParentPostID==0
select new
{
forum.Title,
forum.ForumID,
LastPostTitle = p.Title,
LastPostAddedDate = p.AddedDate
}).OrderBy(o=>o.Forum... | ```
public class ForumPosts
{
public Forum Forum { get; set; }
public IQueryable<Post> Posts { get; set; }
}
public class DisplaySet
{
public string Name { get; set; }
public string PostTile { get; set; }
}
//left outer join
using (ClassLib... |
2,772,017 | This is my query:
```
from forum in Forums
join post in Posts on forum equals post.Forum into postGroup
from p in postGroup
where p.ParentPostID==0
select new
{
forum.Title,
forum.ForumID,
LastPostTitle = p.Title,
LastPostAddedDate = p.AddedDate ... | 2010/05/05 | [
"https://Stackoverflow.com/questions/2772017",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/332590/"
] | Did you try something like:
```
from forum in Forums
from posts in (Posts.Where(qPosts=> forum.ForumId == qPosts.ForumId)).DefaultIfEmpty()
where posts.ParentPostID == 0
orderby forum.ForumId
select new
{
forum.Title,
forum.ForumID,
LastPostTitle = posts.Title,
LastPostAddedDate = posts.AddedDate
}
`... | ```
public class ForumPosts
{
public Forum Forum { get; set; }
public IQueryable<Post> Posts { get; set; }
}
public class DisplaySet
{
public string Name { get; set; }
public string PostTile { get; set; }
}
//left outer join
using (ClassLib... |
41,626 | Есть ли такое выражение "трудно недооценить" и что оно значит? | 2014/11/03 | [
"https://rus.stackexchange.com/questions/41626",
"https://rus.stackexchange.com",
"https://rus.stackexchange.com/users/4302/"
] | Очень странное выражение. Говорят обычно **"трудно переоценить"**.
Хотя, если вдуматься, понять и эту фразу можно. ***Трудно недооценить*** - значит вероятна только высокая, достойная оценка чего-то. В современном русском языке, однако, такое выражение встречается крайне редко. | По моему легко "недо" и "пере", то есть не попасть. НЕ прыгнуть куда надо. Попасть - это трудно. А вот перепрыгнуть действительно трудно. Но можно и легко. Оценить - трудно, переоценить, если вам это надо, то легко. Трудно переоценивать, бывает, если лень. Трудно недооценить, это когда раздумья, сколько заломить денег ... |
41,626 | Есть ли такое выражение "трудно недооценить" и что оно значит? | 2014/11/03 | [
"https://rus.stackexchange.com/questions/41626",
"https://rus.stackexchange.com",
"https://rus.stackexchange.com/users/4302/"
] | Сложно = трудно переоценить - трудно завысить оценку, потому что что-то заслуживает самой высокой оценки. Как бы высоко ни оценили - всё будет верно.
Трудно (сложно) недооценить - немного другой смысл. Это не "сложно занизить оценку", а "трудно не признать качество чего-то", трудно не заметить хорошего качества.
Недо... | По моему легко "недо" и "пере", то есть не попасть. НЕ прыгнуть куда надо. Попасть - это трудно. А вот перепрыгнуть действительно трудно. Но можно и легко. Оценить - трудно, переоценить, если вам это надо, то легко. Трудно переоценивать, бывает, если лень. Трудно недооценить, это когда раздумья, сколько заломить денег ... |
41,626 | Есть ли такое выражение "трудно недооценить" и что оно значит? | 2014/11/03 | [
"https://rus.stackexchange.com/questions/41626",
"https://rus.stackexchange.com",
"https://rus.stackexchange.com/users/4302/"
] | Чаще, конечно, встречается фраза **нельзя недооценить, недооценивать**. Она прменима в различных ситуациях: и в качестве совета, предостережения, и в качестве комплимента. А вот **трудно недооценить** то, что что очевидно, как **трудно непонять**, и это может походить на сарказм. Например: - Вы недооцениваеете мои умст... | По моему легко "недо" и "пере", то есть не попасть. НЕ прыгнуть куда надо. Попасть - это трудно. А вот перепрыгнуть действительно трудно. Но можно и легко. Оценить - трудно, переоценить, если вам это надо, то легко. Трудно переоценивать, бывает, если лень. Трудно недооценить, это когда раздумья, сколько заломить денег ... |
41,626 | Есть ли такое выражение "трудно недооценить" и что оно значит? | 2014/11/03 | [
"https://rus.stackexchange.com/questions/41626",
"https://rus.stackexchange.com",
"https://rus.stackexchange.com/users/4302/"
] | На мой взгляд - это бессмысленное выражение. Трудно означает степень старания. Можно потрудиться в даче превосходной оценки (трудно переоценить) и отсюда следует, что любая фиксированная оценка является недооценкой (сплошная недооценка). Но чтобы трудиться в плане недооценки... | По моему легко "недо" и "пере", то есть не попасть. НЕ прыгнуть куда надо. Попасть - это трудно. А вот перепрыгнуть действительно трудно. Но можно и легко. Оценить - трудно, переоценить, если вам это надо, то легко. Трудно переоценивать, бывает, если лень. Трудно недооценить, это когда раздумья, сколько заломить денег ... |
41,626 | Есть ли такое выражение "трудно недооценить" и что оно значит? | 2014/11/03 | [
"https://rus.stackexchange.com/questions/41626",
"https://rus.stackexchange.com",
"https://rus.stackexchange.com/users/4302/"
] | Чаще, конечно, встречается фраза **нельзя недооценить, недооценивать**. Она прменима в различных ситуациях: и в качестве совета, предостережения, и в качестве комплимента. А вот **трудно недооценить** то, что что очевидно, как **трудно непонять**, и это может походить на сарказм. Например: - Вы недооцениваеете мои умст... | Очень странное выражение. Говорят обычно **"трудно переоценить"**.
Хотя, если вдуматься, понять и эту фразу можно. ***Трудно недооценить*** - значит вероятна только высокая, достойная оценка чего-то. В современном русском языке, однако, такое выражение встречается крайне редко. |
41,626 | Есть ли такое выражение "трудно недооценить" и что оно значит? | 2014/11/03 | [
"https://rus.stackexchange.com/questions/41626",
"https://rus.stackexchange.com",
"https://rus.stackexchange.com/users/4302/"
] | Чаще, конечно, встречается фраза **нельзя недооценить, недооценивать**. Она прменима в различных ситуациях: и в качестве совета, предостережения, и в качестве комплимента. А вот **трудно недооценить** то, что что очевидно, как **трудно непонять**, и это может походить на сарказм. Например: - Вы недооцениваеете мои умст... | Сложно = трудно переоценить - трудно завысить оценку, потому что что-то заслуживает самой высокой оценки. Как бы высоко ни оценили - всё будет верно.
Трудно (сложно) недооценить - немного другой смысл. Это не "сложно занизить оценку", а "трудно не признать качество чего-то", трудно не заметить хорошего качества.
Недо... |
41,626 | Есть ли такое выражение "трудно недооценить" и что оно значит? | 2014/11/03 | [
"https://rus.stackexchange.com/questions/41626",
"https://rus.stackexchange.com",
"https://rus.stackexchange.com/users/4302/"
] | Чаще, конечно, встречается фраза **нельзя недооценить, недооценивать**. Она прменима в различных ситуациях: и в качестве совета, предостережения, и в качестве комплимента. А вот **трудно недооценить** то, что что очевидно, как **трудно непонять**, и это может походить на сарказм. Например: - Вы недооцениваеете мои умст... | На мой взгляд - это бессмысленное выражение. Трудно означает степень старания. Можно потрудиться в даче превосходной оценки (трудно переоценить) и отсюда следует, что любая фиксированная оценка является недооценкой (сплошная недооценка). Но чтобы трудиться в плане недооценки... |
4,757 | I'm studying certain graph editing problems and I'd like to determine the complexity of this problem:
Input: Balanced bipartite graph $G(A \bigcup B, E)$, $|A|=|B|=n$, integer $k$
Problem: Is there $r$ edit operations that transform the input graph into balanced bipartite $n/2$-regular graph ($r \leq k$).
An edit op... | 2011/02/06 | [
"https://cstheory.stackexchange.com/questions/4757",
"https://cstheory.stackexchange.com",
"https://cstheory.stackexchange.com/users/495/"
] | Transform G into a weighted flow network N: connect the source s to all nodes in A by arcs of capacity n/2 and cost 0, connect all nodes in B to the sink t by arcs of capacity n/2 and cost 0, and connect each A-node u to each B-node v by an arc of capacity 1, with cost -1 if (u,v) is in G and 1 otherwise.
The maximum ... | For each node $N \in A$ and $M \in B$, set
$\textrm{diff}(N) = \deg(N) - n/2$ and $\textrm{diff}(M) = \deg(M) - n/2$.
Note that
$$\sum\_{N \in A} \textrm{diff}(N) = \sum\_{M \in B} \textrm{diff}(M)$$
(the graph is bipartite.)
The problem can be reformulated as:
>
> What is the minimum number of operations requir... |
9,868,109 | I'm trying to convert an input date string to a date format and then to a datetime format.
As a test, I gave an input of an incorrect date format, but this doesn't seem to be throwing any parse exceptions and gives me the wrong output. Any thoughts on what my code below is doing wrong?
```
String OLD_FORMA... | 2012/03/26 | [
"https://Stackoverflow.com/questions/9868109",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/656523/"
] | "03/01211/2012" => Jun 24 00:00:00 IST 2015 ... why?
My guess is that June 24th, 2015 is 1211 days from March 1st, 2012.
Excessive rollover, reads it as March 1211th.
You should be able to turn this off with:
```
sdf.setLenient(false)
```
>
> public void setLenient(boolean lenient)
>
>
> Specify whether or not ... | You can set strict format
[SimpleDateFormat.setLenient(false)](http://docs.oracle.com/javase/1.4.2/docs/api/java/text/DateFormat.html#setLenient%28boolean%29)
Specify whether or not date/time parsing is to be lenient. With lenient parsing, the parser may use heuristics to interpret inputs that do not precisely match ... |
9,868,109 | I'm trying to convert an input date string to a date format and then to a datetime format.
As a test, I gave an input of an incorrect date format, but this doesn't seem to be throwing any parse exceptions and gives me the wrong output. Any thoughts on what my code below is doing wrong?
```
String OLD_FORMA... | 2012/03/26 | [
"https://Stackoverflow.com/questions/9868109",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/656523/"
] | "03/01211/2012" => Jun 24 00:00:00 IST 2015 ... why?
My guess is that June 24th, 2015 is 1211 days from March 1st, 2012.
Excessive rollover, reads it as March 1211th.
You should be able to turn this off with:
```
sdf.setLenient(false)
```
>
> public void setLenient(boolean lenient)
>
>
> Specify whether or not ... | Without looking at the source code, I assume `01211` is parsed to 1211 days which are added to 2012-03-01 thus resulting in 2015-06-24. As @Thilo said `sdf.setLenient(false)` should help here.
The problem is that by default the parser is more tolerant to wrong input (lenient mode is on by default) and thus won't throw... |
1,496,826 | What is the best way to check if a single character is a whitespace?
I know how to check this through a regex.
But I am not sure if this is the best way if I only have a single character.
Isn't there a better way (concerning performance) for checking if it's a whitespace?
If I do something like this. I would miss w... | 2009/09/30 | [
"https://Stackoverflow.com/questions/1496826",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/168387/"
] | this covers spaces, tabs and newlines:
```
if ((ch == ' ') || (ch == '\t') || (ch == '\n'))
```
this should be best for performance. put the whitespace character you expect to be most likely, first.
if performance is really important, probably best to consider the bigger picture than individual operations like this... | ```
function hasWhiteSpace(s) {
return /\s/g.test(s);
}
```
This will work
or
you can also use this indexOf():
```
function hasWhiteSpace(s) {
return s.indexOf(' ') >= 0;
}
``` |
1,496,826 | What is the best way to check if a single character is a whitespace?
I know how to check this through a regex.
But I am not sure if this is the best way if I only have a single character.
Isn't there a better way (concerning performance) for checking if it's a whitespace?
If I do something like this. I would miss w... | 2009/09/30 | [
"https://Stackoverflow.com/questions/1496826",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/168387/"
] | While it's not entirely correct, I use this pragmatic and fast solution:
```
if (ch.charCodeAt(0) <= 32) {...
``` | ```
function hasWhiteSpace(s) {
return /\s/g.test(s);
}
```
This will work
or
you can also use this indexOf():
```
function hasWhiteSpace(s) {
return s.indexOf(' ') >= 0;
}
``` |
1,496,826 | What is the best way to check if a single character is a whitespace?
I know how to check this through a regex.
But I am not sure if this is the best way if I only have a single character.
Isn't there a better way (concerning performance) for checking if it's a whitespace?
If I do something like this. I would miss w... | 2009/09/30 | [
"https://Stackoverflow.com/questions/1496826",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/168387/"
] | this covers spaces, tabs and newlines:
```
if ((ch == ' ') || (ch == '\t') || (ch == '\n'))
```
this should be best for performance. put the whitespace character you expect to be most likely, first.
if performance is really important, probably best to consider the bigger picture than individual operations like this... | @jake 's answer above -- using the `trim()` method -- is the best option. If you have a single character ch as a hex number:
```
String.fromCharCode(ch).trim() === ""
```
will return true for all whitespace characters.
Unfortunately, comparison like `<=32` will not catch all whitespace characters. For example; `0xA... |
1,496,826 | What is the best way to check if a single character is a whitespace?
I know how to check this through a regex.
But I am not sure if this is the best way if I only have a single character.
Isn't there a better way (concerning performance) for checking if it's a whitespace?
If I do something like this. I would miss w... | 2009/09/30 | [
"https://Stackoverflow.com/questions/1496826",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/168387/"
] | I have referenced the set of whitespace characters matched by PHP's [trim](http://php.net/trim) function without shame (minus the null byte, I have no idea how well browsers will handle that).
```
if (' \t\n\r\v'.indexOf(ch) > -1) {
// ...
}
```
This looks like premature optimization to me though. | @jake 's answer above -- using the `trim()` method -- is the best option. If you have a single character ch as a hex number:
```
String.fromCharCode(ch).trim() === ""
```
will return true for all whitespace characters.
Unfortunately, comparison like `<=32` will not catch all whitespace characters. For example; `0xA... |
1,496,826 | What is the best way to check if a single character is a whitespace?
I know how to check this through a regex.
But I am not sure if this is the best way if I only have a single character.
Isn't there a better way (concerning performance) for checking if it's a whitespace?
If I do something like this. I would miss w... | 2009/09/30 | [
"https://Stackoverflow.com/questions/1496826",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/168387/"
] | Based on [this](https://jsbench.me/b1ku0bggvi/1) benchmark, it appears the following method would be most performant:
***For Performance:***
```js
function isWhitespace(c) {
return c === ' '
|| c === '\n'
|| c === '\t'
|| c === '\r'
|| c === '\f'
|| c === '\v'
|| c ... | ```
function hasWhiteSpace(s) {
return /\s/g.test(s);
}
```
This will work
or
you can also use this indexOf():
```
function hasWhiteSpace(s) {
return s.indexOf(' ') >= 0;
}
``` |
1,496,826 | What is the best way to check if a single character is a whitespace?
I know how to check this through a regex.
But I am not sure if this is the best way if I only have a single character.
Isn't there a better way (concerning performance) for checking if it's a whitespace?
If I do something like this. I would miss w... | 2009/09/30 | [
"https://Stackoverflow.com/questions/1496826",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/168387/"
] | ```
var testWhite = (x) {
var white = new RegExp(/^\s$/);
return white.test(x.charAt(0));
};
```
This small function will allow you to enter a string of variable length as an argument and it will report "true" if the first character is white space or "false" otherwise. You can easily put any character from a ... | how about this one :
((1L << ch) & ((ch - 64) >> 31) & 0x100002600L) != 0L |
1,496,826 | What is the best way to check if a single character is a whitespace?
I know how to check this through a regex.
But I am not sure if this is the best way if I only have a single character.
Isn't there a better way (concerning performance) for checking if it's a whitespace?
If I do something like this. I would miss w... | 2009/09/30 | [
"https://Stackoverflow.com/questions/1496826",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/168387/"
] | The regex approach is a solid way to go. But here's what I do when I'm lazy and forget the proper regex syntax:
```
str.trim() === '' ? alert('just whitespace') : alert('not whitespace');
``` | @jake 's answer above -- using the `trim()` method -- is the best option. If you have a single character ch as a hex number:
```
String.fromCharCode(ch).trim() === ""
```
will return true for all whitespace characters.
Unfortunately, comparison like `<=32` will not catch all whitespace characters. For example; `0xA... |
1,496,826 | What is the best way to check if a single character is a whitespace?
I know how to check this through a regex.
But I am not sure if this is the best way if I only have a single character.
Isn't there a better way (concerning performance) for checking if it's a whitespace?
If I do something like this. I would miss w... | 2009/09/30 | [
"https://Stackoverflow.com/questions/1496826",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/168387/"
] | The regex approach is a solid way to go. But here's what I do when I'm lazy and forget the proper regex syntax:
```
str.trim() === '' ? alert('just whitespace') : alert('not whitespace');
``` | I have referenced the set of whitespace characters matched by PHP's [trim](http://php.net/trim) function without shame (minus the null byte, I have no idea how well browsers will handle that).
```
if (' \t\n\r\v'.indexOf(ch) > -1) {
// ...
}
```
This looks like premature optimization to me though. |
1,496,826 | What is the best way to check if a single character is a whitespace?
I know how to check this through a regex.
But I am not sure if this is the best way if I only have a single character.
Isn't there a better way (concerning performance) for checking if it's a whitespace?
If I do something like this. I would miss w... | 2009/09/30 | [
"https://Stackoverflow.com/questions/1496826",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/168387/"
] | @jake 's answer above -- using the `trim()` method -- is the best option. If you have a single character ch as a hex number:
```
String.fromCharCode(ch).trim() === ""
```
will return true for all whitespace characters.
Unfortunately, comparison like `<=32` will not catch all whitespace characters. For example; `0xA... | ```
var testWhite = (x) {
var white = new RegExp(/^\s$/);
return white.test(x.charAt(0));
};
```
This small function will allow you to enter a string of variable length as an argument and it will report "true" if the first character is white space or "false" otherwise. You can easily put any character from a ... |
1,496,826 | What is the best way to check if a single character is a whitespace?
I know how to check this through a regex.
But I am not sure if this is the best way if I only have a single character.
Isn't there a better way (concerning performance) for checking if it's a whitespace?
If I do something like this. I would miss w... | 2009/09/30 | [
"https://Stackoverflow.com/questions/1496826",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/168387/"
] | If you only want to test for certain whitespace characters, do so manually, otherwise, use a regular expression, ie
```
/\s/.test(ch)
```
Keep in mind that different browsers match different characters, eg in Firefox, `\s` is equivalent to ([source](https://developer.mozilla.org/en/Core_JavaScript_1.5_Guide/Regular_... | While it's not entirely correct, I use this pragmatic and fast solution:
```
if (ch.charCodeAt(0) <= 32) {...
``` |
27,139,224 | I love the "after" (`+`) selector, it's good to style things after specific elements.
Such as:
```
.title+div {
background-color: yellow;
}
```
would make the background color of the div following the element with `.title` class, yellow.
However, I need a more dynamic way of selecting things.
How would you exp... | 2014/11/26 | [
"https://Stackoverflow.com/questions/27139224",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1806399/"
] | You can't select non-inline properties in CSS, so something like `div[visibility:visible]` wouldn't work unless you explicitly stated the property inside the style attribute for the element.
The best way to select an element like this is to select the *class* with the styles applied to it (if there is one).
```
.titl... | This is *potentially* possible, albeit it's very, *very* fragile and has some requirements.
First, the `visibility:visible` must appear in the element's inline `style` attribute, like so:
```
<span style="visibility:visible">element text</span>
```
Second you must know the *exact* string, if a space is added you'll... |
27,139,224 | I love the "after" (`+`) selector, it's good to style things after specific elements.
Such as:
```
.title+div {
background-color: yellow;
}
```
would make the background color of the div following the element with `.title` class, yellow.
However, I need a more dynamic way of selecting things.
How would you exp... | 2014/11/26 | [
"https://Stackoverflow.com/questions/27139224",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1806399/"
] | Well as you know there isn't only one type of selector in CSS. In the link below you can find more complex selector such as Attribute Selector:
```css
div[target]{background-color:yellow}
.firstgroup
{
height:50px;
width:50px;
background-color:lightblue;
margin:10px;
}
.secondgroup
{
hei... | This is *potentially* possible, albeit it's very, *very* fragile and has some requirements.
First, the `visibility:visible` must appear in the element's inline `style` attribute, like so:
```
<span style="visibility:visible">element text</span>
```
Second you must know the *exact* string, if a space is added you'll... |
12,178,453 | I'm having issues with 2008 and Bulk Insert. I can't get it to behave with variable length records (specifically headers).
Given the following file lines:
---
* 1,2,3,4,5,6,7,9,10
* 1,2,3,4,5,6,7,9,10,1,2,3,4,5,6,7,9,10
* 1,2,3,4,5,6,7,9,10,1,2,3,4,5,6,7,9,10
* 1,2,3,4,5,6,7,9,10,1,2,3,4,5,6,7,9,10
* 1,2,3,4,5,6,7,9... | 2012/08/29 | [
"https://Stackoverflow.com/questions/12178453",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1285450/"
] | The classes generated should be `partial` classes so you should be able to externally manage enhancements by making your own `partial` class with the same namespace and name. | In the model first approach, using the default code generation strategy on you `EDMX` file, the classes generated for you `DbContext` and `Entity` classes are all partial classes.
So, depending on your type of changes, if you want to extend these generated classes, just create a new partial class with you custom code ... |
2,504,564 | I tried to find this in the relevant RFC, [IETF RFC 3986](https://www.rfc-editor.org/rfc/rfc3986), but couldn't figure it.
Do URIs for HTTP allow Unicode, or non-ASCII of any kind?
Can you please cite the section and the RFC that supports your answer.
*NB: For those who might think this is not programming related - ... | 2010/03/24 | [
"https://Stackoverflow.com/questions/2504564",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/48082/"
] | Here is an example: ☃.net.
In terms of the relevant section of RFC 3986, I think you are looking at [2.5](https://www.rfc-editor.org/rfc/rfc3986#section-2.5).
EDIT:
Apparently stack overflow doesn't detect this as a proper URL. You'll have to copy&paste into your browser. | Used to be that non english characters were not allowed in DNS and URL/URI. There was a hack to allow them by using % encoding in URI. However many countries such us russia and china are starting to implement DNS using non latin characters. Here is a reference to one of these [standards](http://en.wikipedia.org/wiki/In... |
2,504,564 | I tried to find this in the relevant RFC, [IETF RFC 3986](https://www.rfc-editor.org/rfc/rfc3986), but couldn't figure it.
Do URIs for HTTP allow Unicode, or non-ASCII of any kind?
Can you please cite the section and the RFC that supports your answer.
*NB: For those who might think this is not programming related - ... | 2010/03/24 | [
"https://Stackoverflow.com/questions/2504564",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/48082/"
] | No, they are not allowed. Just check the ABNF in RFC 3986. | RFC 3986 is being replaced with RFC 3987, which fully supports Unicode, and provides mappings rules to/from RFC 3986 style URIs. |
2,504,564 | I tried to find this in the relevant RFC, [IETF RFC 3986](https://www.rfc-editor.org/rfc/rfc3986), but couldn't figure it.
Do URIs for HTTP allow Unicode, or non-ASCII of any kind?
Can you please cite the section and the RFC that supports your answer.
*NB: For those who might think this is not programming related - ... | 2010/03/24 | [
"https://Stackoverflow.com/questions/2504564",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/48082/"
] | Here is an example: ☃.net.
In terms of the relevant section of RFC 3986, I think you are looking at [2.5](https://www.rfc-editor.org/rfc/rfc3986#section-2.5).
EDIT:
Apparently stack overflow doesn't detect this as a proper URL. You'll have to copy&paste into your browser. | RFC 3986 is being replaced with RFC 3987, which fully supports Unicode, and provides mappings rules to/from RFC 3986 style URIs. |
2,504,564 | I tried to find this in the relevant RFC, [IETF RFC 3986](https://www.rfc-editor.org/rfc/rfc3986), but couldn't figure it.
Do URIs for HTTP allow Unicode, or non-ASCII of any kind?
Can you please cite the section and the RFC that supports your answer.
*NB: For those who might think this is not programming related - ... | 2010/03/24 | [
"https://Stackoverflow.com/questions/2504564",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/48082/"
] | <http://en.wikipedia.org/wiki/Internationalized_domain_name> | Here is an example: ☃.net.
In terms of the relevant section of RFC 3986, I think you are looking at [2.5](https://www.rfc-editor.org/rfc/rfc3986#section-2.5).
EDIT:
Apparently stack overflow doesn't detect this as a proper URL. You'll have to copy&paste into your browser. |
2,504,564 | I tried to find this in the relevant RFC, [IETF RFC 3986](https://www.rfc-editor.org/rfc/rfc3986), but couldn't figure it.
Do URIs for HTTP allow Unicode, or non-ASCII of any kind?
Can you please cite the section and the RFC that supports your answer.
*NB: For those who might think this is not programming related - ... | 2010/03/24 | [
"https://Stackoverflow.com/questions/2504564",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/48082/"
] | Here is an example: ☃.net.
In terms of the relevant section of RFC 3986, I think you are looking at [2.5](https://www.rfc-editor.org/rfc/rfc3986#section-2.5).
EDIT:
Apparently stack overflow doesn't detect this as a proper URL. You'll have to copy&paste into your browser. | Many browsers are not support URIs with Unicode characters (I've implemented them on a website I've build called -- blogvani.com) and Google duly scans and keeps them intact. I don't think that works on top-level domains though, at least not with the registrar and not directly.
For top-level domains if you have a doma... |
2,504,564 | I tried to find this in the relevant RFC, [IETF RFC 3986](https://www.rfc-editor.org/rfc/rfc3986), but couldn't figure it.
Do URIs for HTTP allow Unicode, or non-ASCII of any kind?
Can you please cite the section and the RFC that supports your answer.
*NB: For those who might think this is not programming related - ... | 2010/03/24 | [
"https://Stackoverflow.com/questions/2504564",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/48082/"
] | <http://en.wikipedia.org/wiki/Internationalized_domain_name> | RFC 3986 is being replaced with RFC 3987, which fully supports Unicode, and provides mappings rules to/from RFC 3986 style URIs. |
2,504,564 | I tried to find this in the relevant RFC, [IETF RFC 3986](https://www.rfc-editor.org/rfc/rfc3986), but couldn't figure it.
Do URIs for HTTP allow Unicode, or non-ASCII of any kind?
Can you please cite the section and the RFC that supports your answer.
*NB: For those who might think this is not programming related - ... | 2010/03/24 | [
"https://Stackoverflow.com/questions/2504564",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/48082/"
] | <http://en.wikipedia.org/wiki/Internationalized_domain_name> | Many browsers are not support URIs with Unicode characters (I've implemented them on a website I've build called -- blogvani.com) and Google duly scans and keeps them intact. I don't think that works on top-level domains though, at least not with the registrar and not directly.
For top-level domains if you have a doma... |
2,504,564 | I tried to find this in the relevant RFC, [IETF RFC 3986](https://www.rfc-editor.org/rfc/rfc3986), but couldn't figure it.
Do URIs for HTTP allow Unicode, or non-ASCII of any kind?
Can you please cite the section and the RFC that supports your answer.
*NB: For those who might think this is not programming related - ... | 2010/03/24 | [
"https://Stackoverflow.com/questions/2504564",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/48082/"
] | Used to be that non english characters were not allowed in DNS and URL/URI. There was a hack to allow them by using % encoding in URI. However many countries such us russia and china are starting to implement DNS using non latin characters. Here is a reference to one of these [standards](http://en.wikipedia.org/wiki/In... | Many browsers are not support URIs with Unicode characters (I've implemented them on a website I've build called -- blogvani.com) and Google duly scans and keeps them intact. I don't think that works on top-level domains though, at least not with the registrar and not directly.
For top-level domains if you have a doma... |
2,504,564 | I tried to find this in the relevant RFC, [IETF RFC 3986](https://www.rfc-editor.org/rfc/rfc3986), but couldn't figure it.
Do URIs for HTTP allow Unicode, or non-ASCII of any kind?
Can you please cite the section and the RFC that supports your answer.
*NB: For those who might think this is not programming related - ... | 2010/03/24 | [
"https://Stackoverflow.com/questions/2504564",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/48082/"
] | No, they are not allowed. Just check the ABNF in RFC 3986. | Used to be that non english characters were not allowed in DNS and URL/URI. There was a hack to allow them by using % encoding in URI. However many countries such us russia and china are starting to implement DNS using non latin characters. Here is a reference to one of these [standards](http://en.wikipedia.org/wiki/In... |
2,504,564 | I tried to find this in the relevant RFC, [IETF RFC 3986](https://www.rfc-editor.org/rfc/rfc3986), but couldn't figure it.
Do URIs for HTTP allow Unicode, or non-ASCII of any kind?
Can you please cite the section and the RFC that supports your answer.
*NB: For those who might think this is not programming related - ... | 2010/03/24 | [
"https://Stackoverflow.com/questions/2504564",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/48082/"
] | No, they are not allowed. Just check the ABNF in RFC 3986. | Here is an example: ☃.net.
In terms of the relevant section of RFC 3986, I think you are looking at [2.5](https://www.rfc-editor.org/rfc/rfc3986#section-2.5).
EDIT:
Apparently stack overflow doesn't detect this as a proper URL. You'll have to copy&paste into your browser. |
23,755,390 | I'm trying to update a database users table.
I made an HTML table which contains the data of the users in my database.
this HTML table contains 3 columns and in each row there is a button. when I click this button I should update the users database table with the information contained in the input and select field in ... | 2014/05/20 | [
"https://Stackoverflow.com/questions/23755390",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1526621/"
] | You can use [`closest('tr')`](http://api.jquery.com/closest/) to get the row for current button and use [index()](http://api.jquery.com/index/) to get the index of the row.
**[Live Demo](http://jsfiddle.net/rajaadil/3rU7b/)**
```
$(this).closest('tr').index()
``` | You can use parents() function for the same.
```
var tr = $(this).parents('tr');
```
this would give your row on which button was clicked.
```
<tr>
<td><input type="text" name ="name"/></td>
<td>
<select name="select_job">
<option value="1"> Engineer </option>
<option value="2"> Doctor <... |
23,755,390 | I'm trying to update a database users table.
I made an HTML table which contains the data of the users in my database.
this HTML table contains 3 columns and in each row there is a button. when I click this button I should update the users database table with the information contained in the input and select field in ... | 2014/05/20 | [
"https://Stackoverflow.com/questions/23755390",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1526621/"
] | You can use like this
```
$("button").click(function () {
var inputValue = $(this).closest("tr").find("input[type=text]").val();
var selectValuse = $(this).closest("tr").find("[name='select_job']").val();
var index = $(this).closest("tr").index();
});
``` | You can use [`closest('tr')`](http://api.jquery.com/closest/) to get the row for current button and use [index()](http://api.jquery.com/index/) to get the index of the row.
**[Live Demo](http://jsfiddle.net/rajaadil/3rU7b/)**
```
$(this).closest('tr').index()
``` |
23,755,390 | I'm trying to update a database users table.
I made an HTML table which contains the data of the users in my database.
this HTML table contains 3 columns and in each row there is a button. when I click this button I should update the users database table with the information contained in the input and select field in ... | 2014/05/20 | [
"https://Stackoverflow.com/questions/23755390",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1526621/"
] | You can use [`closest('tr')`](http://api.jquery.com/closest/) to get the row for current button and use [index()](http://api.jquery.com/index/) to get the index of the row.
**[Live Demo](http://jsfiddle.net/rajaadil/3rU7b/)**
```
$(this).closest('tr').index()
``` | May be something like the code below will help you to get the required information.
```
$("button").click(function () {
var $row = $(this).parent().parent(); //tr
var $columns = $row.find('td');
var rowIndex = $row.index();
var values = new Array();
for (var i = 0; i < $columns.length - 1; i++) {
... |
23,755,390 | I'm trying to update a database users table.
I made an HTML table which contains the data of the users in my database.
this HTML table contains 3 columns and in each row there is a button. when I click this button I should update the users database table with the information contained in the input and select field in ... | 2014/05/20 | [
"https://Stackoverflow.com/questions/23755390",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1526621/"
] | You can use like this
```
$("button").click(function () {
var inputValue = $(this).closest("tr").find("input[type=text]").val();
var selectValuse = $(this).closest("tr").find("[name='select_job']").val();
var index = $(this).closest("tr").index();
});
``` | You can use parents() function for the same.
```
var tr = $(this).parents('tr');
```
this would give your row on which button was clicked.
```
<tr>
<td><input type="text" name ="name"/></td>
<td>
<select name="select_job">
<option value="1"> Engineer </option>
<option value="2"> Doctor <... |
23,755,390 | I'm trying to update a database users table.
I made an HTML table which contains the data of the users in my database.
this HTML table contains 3 columns and in each row there is a button. when I click this button I should update the users database table with the information contained in the input and select field in ... | 2014/05/20 | [
"https://Stackoverflow.com/questions/23755390",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1526621/"
] | You can use like this
```
$("button").click(function () {
var inputValue = $(this).closest("tr").find("input[type=text]").val();
var selectValuse = $(this).closest("tr").find("[name='select_job']").val();
var index = $(this).closest("tr").index();
});
``` | May be something like the code below will help you to get the required information.
```
$("button").click(function () {
var $row = $(this).parent().parent(); //tr
var $columns = $row.find('td');
var rowIndex = $row.index();
var values = new Array();
for (var i = 0; i < $columns.length - 1; i++) {
... |
71,114,461 | I want a function taking an unevaluated expression containing variable names into a new expression containing string for the variable names.
`c(a,b)`
should be converted to
`c("a","b")`
How can this be done?
Let me explain in more detail what I want to achieve.
```
my_tibble <-
tibble(a=rep(c("a","b"),each=4),
... | 2022/02/14 | [
"https://Stackoverflow.com/questions/71114461",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/2813067/"
] | If you want to write a sub query then you can try this
```
INSERT INTO Person
(
AddressKey,
FirstName,
LastName,
DateofBirth
)
SELECT a.AddressKey, 'Theresa', 'May', '1956-10-01' FROM Address a WHERE a.PostCode = 'SL1 1AA' AND a.HouseNumber = 32;
``` | Try this:
```
INSERT INTO Person
SELECT
AddressKey = (SELECT AddressKey FROM Address WHERE Postcode = 'SW1A 2AA' AND HouseNumber = 10)
, FirstName = 'Boris'
, LastName = 'Johnson'
, DateofBirth = '1964-06-19'
;
INSERT INTO Person
SELECT
AddressKey = (SELECT Ad... |
19,914 | It's well known that if E is a vector bundle with Chern roots $a\_1,\ldots, a\_r$,
then the Chern roots of the $p$th exterior power of E consist of all sums of $k$ distinct $a\_i$'s. I would like to say the same is true if E is just a torsion-free coherent sheaf on $P^n$. It seems non-obvious, though, maybe because an ... | 2010/03/31 | [
"https://mathoverflow.net/questions/19914",
"https://mathoverflow.net",
"https://mathoverflow.net/users/5045/"
] | My guess would be that the formula you want does not extend to the case of coherent sheaves. As indicated in Mariano and David answers (which has unfortunately been deleted), the best hope to compute is via a resolution $\mathcal F$ of $E$ by vector bundles. In general, for 2 perfect complexes $\mathcal F, \mathcal G$ ... | This is really a reference for the problem in Graham's comment, rather than an answer to the question. See
* Tchernev, Alexandre B. Acyclicity of symmetric and exterior powers of complexes. J. Algebra 184 (1996), no. 3, 1113--1135. [MR1407888](http://www.ams.org/mathscinet-getitem?mr=MR1407888)
* Weyman, Jerzy. Resolu... |
2,384,460 | I'm new to jedit, and I haven't yet found out how to open a new window. For example, I want to be editing one set of files in one space on my Mac, and edit a different set of files in another. Does anyone know how to open a new instance/window of jedit to make this possible?
Thanks | 2010/03/05 | [
"https://Stackoverflow.com/questions/2384460",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/262000/"
] | You should set **Buffer Sets** scope to "**View**"
See also: [Buffer Sets](http://www.jedit.org/users-guide/buffersets.html) | I wish there was an answer for this, since I'm constantly trying to open new instances of JEdit (despite being a daily user for several years now). But, as far as I can tell, you can't.
I have to assume this is another example of a good project getting over-architected.
Instead of allowing separate instances which lo... |
2,384,460 | I'm new to jedit, and I haven't yet found out how to open a new window. For example, I want to be editing one set of files in one space on my Mac, and edit a different set of files in another. Does anyone know how to open a new instance/window of jedit to make this possible?
Thanks | 2010/03/05 | [
"https://Stackoverflow.com/questions/2384460",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/262000/"
] | You should set **Buffer Sets** scope to "**View**"
See also: [Buffer Sets](http://www.jedit.org/users-guide/buffersets.html) | It's a new feature to 4.3. It's under View | Buffer Sets. You click on either the "View Scope" or "EditPane Scope" buffer sets checkbox.
When you open a new View, it's a separate window instance. It has a buffer set and an edit pane. With more than one View open, you can decide to share buffer sets (global scope) or ... |
2,384,460 | I'm new to jedit, and I haven't yet found out how to open a new window. For example, I want to be editing one set of files in one space on my Mac, and edit a different set of files in another. Does anyone know how to open a new instance/window of jedit to make this possible?
Thanks | 2010/03/05 | [
"https://Stackoverflow.com/questions/2384460",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/262000/"
] | You should set **Buffer Sets** scope to "**View**"
See also: [Buffer Sets](http://www.jedit.org/users-guide/buffersets.html) | It is possible to really Open a new instance of jEdit, and not only to open a new set of buffers in the same instance.
You have to launch jEdit with the -noserver option.
"Do not attempt to connect to a running edit server, and do not start one either."
Please see documentation here :
<http://www.jedit.org/users-gu... |
2,384,460 | I'm new to jedit, and I haven't yet found out how to open a new window. For example, I want to be editing one set of files in one space on my Mac, and edit a different set of files in another. Does anyone know how to open a new instance/window of jedit to make this possible?
Thanks | 2010/03/05 | [
"https://Stackoverflow.com/questions/2384460",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/262000/"
] | You should set **Buffer Sets** scope to "**View**"
See also: [Buffer Sets](http://www.jedit.org/users-guide/buffersets.html) | The following command line invocation will solve your problem:
jedit -noserver
You can create an alias for jedit that contains the above.
In the Jedit help, see Chapter 2, "Starting Jedit", in the section on Command Line Usage, Edit Server Options, and you will find the -noserver description. |
2,384,460 | I'm new to jedit, and I haven't yet found out how to open a new window. For example, I want to be editing one set of files in one space on my Mac, and edit a different set of files in another. Does anyone know how to open a new instance/window of jedit to make this possible?
Thanks | 2010/03/05 | [
"https://Stackoverflow.com/questions/2384460",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/262000/"
] | It's a new feature to 4.3. It's under View | Buffer Sets. You click on either the "View Scope" or "EditPane Scope" buffer sets checkbox.
When you open a new View, it's a separate window instance. It has a buffer set and an edit pane. With more than one View open, you can decide to share buffer sets (global scope) or ... | I wish there was an answer for this, since I'm constantly trying to open new instances of JEdit (despite being a daily user for several years now). But, as far as I can tell, you can't.
I have to assume this is another example of a good project getting over-architected.
Instead of allowing separate instances which lo... |
2,384,460 | I'm new to jedit, and I haven't yet found out how to open a new window. For example, I want to be editing one set of files in one space on my Mac, and edit a different set of files in another. Does anyone know how to open a new instance/window of jedit to make this possible?
Thanks | 2010/03/05 | [
"https://Stackoverflow.com/questions/2384460",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/262000/"
] | It is possible to really Open a new instance of jEdit, and not only to open a new set of buffers in the same instance.
You have to launch jEdit with the -noserver option.
"Do not attempt to connect to a running edit server, and do not start one either."
Please see documentation here :
<http://www.jedit.org/users-gu... | I wish there was an answer for this, since I'm constantly trying to open new instances of JEdit (despite being a daily user for several years now). But, as far as I can tell, you can't.
I have to assume this is another example of a good project getting over-architected.
Instead of allowing separate instances which lo... |
2,384,460 | I'm new to jedit, and I haven't yet found out how to open a new window. For example, I want to be editing one set of files in one space on my Mac, and edit a different set of files in another. Does anyone know how to open a new instance/window of jedit to make this possible?
Thanks | 2010/03/05 | [
"https://Stackoverflow.com/questions/2384460",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/262000/"
] | It's a new feature to 4.3. It's under View | Buffer Sets. You click on either the "View Scope" or "EditPane Scope" buffer sets checkbox.
When you open a new View, it's a separate window instance. It has a buffer set and an edit pane. With more than one View open, you can decide to share buffer sets (global scope) or ... | The following command line invocation will solve your problem:
jedit -noserver
You can create an alias for jedit that contains the above.
In the Jedit help, see Chapter 2, "Starting Jedit", in the section on Command Line Usage, Edit Server Options, and you will find the -noserver description. |
2,384,460 | I'm new to jedit, and I haven't yet found out how to open a new window. For example, I want to be editing one set of files in one space on my Mac, and edit a different set of files in another. Does anyone know how to open a new instance/window of jedit to make this possible?
Thanks | 2010/03/05 | [
"https://Stackoverflow.com/questions/2384460",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/262000/"
] | It is possible to really Open a new instance of jEdit, and not only to open a new set of buffers in the same instance.
You have to launch jEdit with the -noserver option.
"Do not attempt to connect to a running edit server, and do not start one either."
Please see documentation here :
<http://www.jedit.org/users-gu... | The following command line invocation will solve your problem:
jedit -noserver
You can create an alias for jedit that contains the above.
In the Jedit help, see Chapter 2, "Starting Jedit", in the section on Command Line Usage, Edit Server Options, and you will find the -noserver description. |
2,789,276 | I'm trying to get image from gallery.
```
Intent intent = new Intent();
intent.setType("image/*");
intent.setAction(Intent.ACTION_GET_CONTENT);
startActivityForResult(Intent.createChooser(intent, "Select picture"), resultCode );
```
After I returned from this activity I have a data, which contains Uri. It looks lik... | 2010/05/07 | [
"https://Stackoverflow.com/questions/2789276",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/332311/"
] | This is what I do:
```
Uri selectedImageURI = data.getData();
imageFile = new File(getRealPathFromURI(selectedImageURI));
```
and:
```
private String getRealPathFromURI(Uri contentURI) {
String result;
Cursor cursor = getContentResolver().query(contentURI, null, null, null, null);
if (cursor == null) { ... | Hii here is my complete code for taking image from camera or galeery
//My variable declaration
```
protected static final int CAMERA_REQUEST = 0;
protected static final int GALLERY_REQUEST = 1;
Bitmap bitmap;
Uri uri;
Intent picIntent = null;
```
//Onclick
```
if (v.getId()==R.id.image_id){
... |
2,789,276 | I'm trying to get image from gallery.
```
Intent intent = new Intent();
intent.setType("image/*");
intent.setAction(Intent.ACTION_GET_CONTENT);
startActivityForResult(Intent.createChooser(intent, "Select picture"), resultCode );
```
After I returned from this activity I have a data, which contains Uri. It looks lik... | 2010/05/07 | [
"https://Stackoverflow.com/questions/2789276",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/332311/"
] | One easy and best method copy file to the real path and then get their path I checked it 10 devices on **android API-16 to API-30** working fine.
```
@Nullable
public static String createCopyAndReturnRealPath(
@NonNull Context context, @NonNull Uri uri) {
final ContentResolver contentResolver = context.getC... | Hii here is my complete code for taking image from camera or galeery
//My variable declaration
```
protected static final int CAMERA_REQUEST = 0;
protected static final int GALLERY_REQUEST = 1;
Bitmap bitmap;
Uri uri;
Intent picIntent = null;
```
//Onclick
```
if (v.getId()==R.id.image_id){
... |
2,789,276 | I'm trying to get image from gallery.
```
Intent intent = new Intent();
intent.setType("image/*");
intent.setAction(Intent.ACTION_GET_CONTENT);
startActivityForResult(Intent.createChooser(intent, "Select picture"), resultCode );
```
After I returned from this activity I have a data, which contains Uri. It looks lik... | 2010/05/07 | [
"https://Stackoverflow.com/questions/2789276",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/332311/"
] | This is what I do:
```
Uri selectedImageURI = data.getData();
imageFile = new File(getRealPathFromURI(selectedImageURI));
```
and:
```
private String getRealPathFromURI(Uri contentURI) {
String result;
Cursor cursor = getContentResolver().query(contentURI, null, null, null, null);
if (cursor == null) { ... | **Note** This is an improvement in [@user3516549 answer](https://stackoverflow.com/questions/2789276/android-get-real-path-by-uri-getpath/33074944#33074944) and I have check it on Moto G3 with Android 6.0.1
I have this issue so I have tried answer of @user3516549 but in some cases it was not working properly.
I have... |
2,789,276 | I'm trying to get image from gallery.
```
Intent intent = new Intent();
intent.setType("image/*");
intent.setAction(Intent.ACTION_GET_CONTENT);
startActivityForResult(Intent.createChooser(intent, "Select picture"), resultCode );
```
After I returned from this activity I have a data, which contains Uri. It looks lik... | 2010/05/07 | [
"https://Stackoverflow.com/questions/2789276",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/332311/"
] | @Rene Juuse - above in comments... Thanks for this link !
.
the code to get the real path is a bit different from one SDK to another so below we have three methods that deals with different SDKs.
***getRealPathFromURI\_API19(): returns real path for API 19 (or above but not tested)
getRealPathFromURI\_API11to18(): re... | This helped me to get uri from Gallery and convert to a file for Multipart upload
```
File file = FileUtils.getFile(this, fileUri);
```
<https://github.com/iPaulPro/aFileChooser/blob/master/aFileChooser/src/com/ipaulpro/afilechooser/utils/FileUtils.java> |
2,789,276 | I'm trying to get image from gallery.
```
Intent intent = new Intent();
intent.setType("image/*");
intent.setAction(Intent.ACTION_GET_CONTENT);
startActivityForResult(Intent.createChooser(intent, "Select picture"), resultCode );
```
After I returned from this activity I have a data, which contains Uri. It looks lik... | 2010/05/07 | [
"https://Stackoverflow.com/questions/2789276",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/332311/"
] | **Note** This is an improvement in [@user3516549 answer](https://stackoverflow.com/questions/2789276/android-get-real-path-by-uri-getpath/33074944#33074944) and I have check it on Moto G3 with Android 6.0.1
I have this issue so I have tried answer of @user3516549 but in some cases it was not working properly.
I have... | One easy and best method copy file to the real path and then get their path I checked it 10 devices on **android API-16 to API-30** working fine.
```
@Nullable
public static String createCopyAndReturnRealPath(
@NonNull Context context, @NonNull Uri uri) {
final ContentResolver contentResolver = context.getC... |
2,789,276 | I'm trying to get image from gallery.
```
Intent intent = new Intent();
intent.setType("image/*");
intent.setAction(Intent.ACTION_GET_CONTENT);
startActivityForResult(Intent.createChooser(intent, "Select picture"), resultCode );
```
After I returned from this activity I have a data, which contains Uri. It looks lik... | 2010/05/07 | [
"https://Stackoverflow.com/questions/2789276",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/332311/"
] | **Note** This is an improvement in [@user3516549 answer](https://stackoverflow.com/questions/2789276/android-get-real-path-by-uri-getpath/33074944#33074944) and I have check it on Moto G3 with Android 6.0.1
I have this issue so I have tried answer of @user3516549 but in some cases it was not working properly.
I have... | This code work for me in android 11 and 12
```
private static String getRealPathFromURI(Uri uri, Context context) {
Uri returnUri = uri;
Cursor returnCursor = context.getContentResolver().query(returnUri, null, null, null, null);
int nameIndex = returnCursor.getColumnInd... |
2,789,276 | I'm trying to get image from gallery.
```
Intent intent = new Intent();
intent.setType("image/*");
intent.setAction(Intent.ACTION_GET_CONTENT);
startActivityForResult(Intent.createChooser(intent, "Select picture"), resultCode );
```
After I returned from this activity I have a data, which contains Uri. It looks lik... | 2010/05/07 | [
"https://Stackoverflow.com/questions/2789276",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/332311/"
] | **EDIT:**
Use this Solution here: <https://stackoverflow.com/a/20559175/2033223>
Works perfect!
First of, thank for your solution @luizfelipetx
I changed your solution a little bit. This works for me:
```
public static String getRealPathFromDocumentUri(Context context, Uri uri){
String filePath = "";
Patter... | This helped me to get uri from Gallery and convert to a file for Multipart upload
```
File file = FileUtils.getFile(this, fileUri);
```
<https://github.com/iPaulPro/aFileChooser/blob/master/aFileChooser/src/com/ipaulpro/afilechooser/utils/FileUtils.java> |
2,789,276 | I'm trying to get image from gallery.
```
Intent intent = new Intent();
intent.setType("image/*");
intent.setAction(Intent.ACTION_GET_CONTENT);
startActivityForResult(Intent.createChooser(intent, "Select picture"), resultCode );
```
After I returned from this activity I have a data, which contains Uri. It looks lik... | 2010/05/07 | [
"https://Stackoverflow.com/questions/2789276",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/332311/"
] | Is it really necessary for you to get a physical path?
For example, `ImageView.setImageURI()` and `ContentResolver.openInputStream()` allow you to access the contents of a file without knowing its real path. | Hii here is my complete code for taking image from camera or galeery
//My variable declaration
```
protected static final int CAMERA_REQUEST = 0;
protected static final int GALLERY_REQUEST = 1;
Bitmap bitmap;
Uri uri;
Intent picIntent = null;
```
//Onclick
```
if (v.getId()==R.id.image_id){
... |
2,789,276 | I'm trying to get image from gallery.
```
Intent intent = new Intent();
intent.setType("image/*");
intent.setAction(Intent.ACTION_GET_CONTENT);
startActivityForResult(Intent.createChooser(intent, "Select picture"), resultCode );
```
After I returned from this activity I have a data, which contains Uri. It looks lik... | 2010/05/07 | [
"https://Stackoverflow.com/questions/2789276",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/332311/"
] | @Rene Juuse - above in comments... Thanks for this link !
.
the code to get the real path is a bit different from one SDK to another so below we have three methods that deals with different SDKs.
***getRealPathFromURI\_API19(): returns real path for API 19 (or above but not tested)
getRealPathFromURI\_API11to18(): re... | **EDIT:**
Use this Solution here: <https://stackoverflow.com/a/20559175/2033223>
Works perfect!
First of, thank for your solution @luizfelipetx
I changed your solution a little bit. This works for me:
```
public static String getRealPathFromDocumentUri(Context context, Uri uri){
String filePath = "";
Patter... |
2,789,276 | I'm trying to get image from gallery.
```
Intent intent = new Intent();
intent.setType("image/*");
intent.setAction(Intent.ACTION_GET_CONTENT);
startActivityForResult(Intent.createChooser(intent, "Select picture"), resultCode );
```
After I returned from this activity I have a data, which contains Uri. It looks lik... | 2010/05/07 | [
"https://Stackoverflow.com/questions/2789276",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/332311/"
] | One easy and best method copy file to the real path and then get their path I checked it 10 devices on **android API-16 to API-30** working fine.
```
@Nullable
public static String createCopyAndReturnRealPath(
@NonNull Context context, @NonNull Uri uri) {
final ContentResolver contentResolver = context.getC... | This helped me to get uri from Gallery and convert to a file for Multipart upload
```
File file = FileUtils.getFile(this, fileUri);
```
<https://github.com/iPaulPro/aFileChooser/blob/master/aFileChooser/src/com/ipaulpro/afilechooser/utils/FileUtils.java> |
34,436,987 | below my dropdown is working fine in firefox, chrome. but in Internet explore while selecting the 2 value , dropdown box (first time) selected first value only , Thanks in advance
for ref check below link in IE :
<http://jsfiddle.net/ExpertSystem/fDdwe/>
```js
var app = angular.module('myApp', []);
app.controller(... | 2015/12/23 | [
"https://Stackoverflow.com/questions/34436987",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/2181236/"
] | ```js
var app = angular.module('myApp', []);
app.controller('myCtrl', function ($scope) {
$scope.users = [
{id: 1, name: 'Me'},
{id: 2, name: 'You'}
];
});
app.directive('select', function () {
return {
restrict: 'E',
require: '?ngModel',
priority: 10,
... | Add an empty option to the select list.
```
<select name="select1"
ng-model="userId"
ng-options="user.id as user.name for user in users"
ng-init="userId=3"
required>
<option value=""></option>
</select>
```
Note however that you may have to play around with it to get your invalid logic to work as you exp... |
57,048,245 | I have a class that contains an attribute char \* variable name that points to an allocated char array from new char[] that contains a C style text string. I'm using overloaded constructor that has attribute char[] variable name\_val and is equal to "emtpy".In member initialization list, i have initialized private clas... | 2019/07/15 | [
"https://Stackoverflow.com/questions/57048245",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/11536892/"
] | >
> Initialization class member using initializer list results a memory leak
>
>
> I am also seeing a memory leak.
>
>
>
There is no memory leak in the shown program. It is unclear why you would think that you see it.
>
> Can someone please explain, what is the purpose of const in this case?
>
>
>
Object b... | When you write:
```
Person(char name_val[]="empty")
```
it is equivalent to writing:
```
Person(char *name_val="empty")
```
and now you can see that you are assigning a string constant to non-const `char *`, hence the warning. The solution (obviously) is to write:
```
Person(const char *name_val="empty")
```
a... |
41,946,794 | I have a longer jQuery function for an image gallery slider. I have about 5 directives (all using he same slider with different pictures). As I didn't want to copy paste the same jQuery code into all 5 controllers, I did it using a factory.
I put the jQuery code into a factory, then called the factory in each controlle... | 2017/01/30 | [
"https://Stackoverflow.com/questions/41946794",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/6417391/"
] | Google refuses to show images with data url in Gmail's web interface. It's a known problem (in Google's view a security measure) for a long time highly criticized.
The good news is that you have another option except for using external images.
Using an inline attachment with a Content-ID works with Gmail.
After addi... | **tl;dr**
Gmail and certain other clients don't like `base64` encoded images.
**Full Story**
The very first thing I did was view "Show Original" in Gmail. To my surprise, raw content still has your embedded image data:
[](https://i.stack.imgur.com/... |
41,946,794 | I have a longer jQuery function for an image gallery slider. I have about 5 directives (all using he same slider with different pictures). As I didn't want to copy paste the same jQuery code into all 5 controllers, I did it using a factory.
I put the jQuery code into a factory, then called the factory in each controlle... | 2017/01/30 | [
"https://Stackoverflow.com/questions/41946794",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/6417391/"
] | **tl;dr**
Gmail and certain other clients don't like `base64` encoded images.
**Full Story**
The very first thing I did was view "Show Original" in Gmail. To my surprise, raw content still has your embedded image data:
[](https://i.stack.imgur.com/... | Are you using nodemailer?
If yes, there is the solution!
NPM has a package called [nodemailer-plugin-inline-base64](https://www.npmjs.com/package/nodemailer-plugin-inline-base64) that allow you to send an image with data uri to all emails providers like gmail, outlook, an others.
Setup:
```
yarn add nodemailer node... |
41,946,794 | I have a longer jQuery function for an image gallery slider. I have about 5 directives (all using he same slider with different pictures). As I didn't want to copy paste the same jQuery code into all 5 controllers, I did it using a factory.
I put the jQuery code into a factory, then called the factory in each controlle... | 2017/01/30 | [
"https://Stackoverflow.com/questions/41946794",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/6417391/"
] | Google refuses to show images with data url in Gmail's web interface. It's a known problem (in Google's view a security measure) for a long time highly criticized.
The good news is that you have another option except for using external images.
Using an inline attachment with a Content-ID works with Gmail.
After addi... | After lot trials and failures I have found reason why Gmail does not show inline pictures.
Originally I used this html:
```
"Some HTML text and an image \<img src="cid:image1"\>Nifty!"
```
and attached picture with this command (in python, but details are not important):
```
msg.add_related(img.read(), 'image', 'pn... |
41,946,794 | I have a longer jQuery function for an image gallery slider. I have about 5 directives (all using he same slider with different pictures). As I didn't want to copy paste the same jQuery code into all 5 controllers, I did it using a factory.
I put the jQuery code into a factory, then called the factory in each controlle... | 2017/01/30 | [
"https://Stackoverflow.com/questions/41946794",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/6417391/"
] | Google refuses to show images with data url in Gmail's web interface. It's a known problem (in Google's view a security measure) for a long time highly criticized.
The good news is that you have another option except for using external images.
Using an inline attachment with a Content-ID works with Gmail.
After addi... | Are you using nodemailer?
If yes, there is the solution!
NPM has a package called [nodemailer-plugin-inline-base64](https://www.npmjs.com/package/nodemailer-plugin-inline-base64) that allow you to send an image with data uri to all emails providers like gmail, outlook, an others.
Setup:
```
yarn add nodemailer node... |
41,946,794 | I have a longer jQuery function for an image gallery slider. I have about 5 directives (all using he same slider with different pictures). As I didn't want to copy paste the same jQuery code into all 5 controllers, I did it using a factory.
I put the jQuery code into a factory, then called the factory in each controlle... | 2017/01/30 | [
"https://Stackoverflow.com/questions/41946794",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/6417391/"
] | After lot trials and failures I have found reason why Gmail does not show inline pictures.
Originally I used this html:
```
"Some HTML text and an image \<img src="cid:image1"\>Nifty!"
```
and attached picture with this command (in python, but details are not important):
```
msg.add_related(img.read(), 'image', 'pn... | Are you using nodemailer?
If yes, there is the solution!
NPM has a package called [nodemailer-plugin-inline-base64](https://www.npmjs.com/package/nodemailer-plugin-inline-base64) that allow you to send an image with data uri to all emails providers like gmail, outlook, an others.
Setup:
```
yarn add nodemailer node... |
45,819,337 | On a Linux computer, following [**doParallel**'s vignette](https://cran.r-project.org/web/packages/doParallel/vignettes/gettingstartedParallel.pdf), I use `doParallel::registerDoParallel()` and then I use `options(cores = N)` where `N` is the number of cores I want to use with `foreach`.
I can verify with `foreach::g... | 2017/08/22 | [
"https://Stackoverflow.com/questions/45819337",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/6103040/"
] | The answer from the maintainer of package **doParallel**, Rich Calaway:
>
> Windows does not support forking, which is what the parallel (and doParallel) packages use the “cores” argument for. So, on Windows, all “cores” arguments are set to 1. To use multiple cores on Windows with doParallel, use makeCluster to crea... | You will have to configure it by using both `parallel` and `doParallel` package.
* first create cluster
* register do parallel with that
```
library(parallel)
library(doParallel)
cluster <- makeCluster(3)
registerDoParallel(cluster)
foreach::getDoParWorkers()
[1] 3
``` |
45,819,337 | On a Linux computer, following [**doParallel**'s vignette](https://cran.r-project.org/web/packages/doParallel/vignettes/gettingstartedParallel.pdf), I use `doParallel::registerDoParallel()` and then I use `options(cores = N)` where `N` is the number of cores I want to use with `foreach`.
I can verify with `foreach::g... | 2017/08/22 | [
"https://Stackoverflow.com/questions/45819337",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/6103040/"
] | The answer from the maintainer of package **doParallel**, Rich Calaway:
>
> Windows does not support forking, which is what the parallel (and doParallel) packages use the “cores” argument for. So, on Windows, all “cores” arguments are set to 1. To use multiple cores on Windows with doParallel, use makeCluster to crea... | What about to stop the cluster and create a new process??
For example:
```
stops<-function(cl,n){
stopCluster(cl)
cl<-makeCluster(n)
doParallel::registerDoParallel(cl)
}
``` |
465,412 | I am looking to build a compute workstation. I want to install the newest version of Scientific Linux. The issue is that the currently planned hardware does not include graphics (external or integrated) I have tried googling if installing linux in runmode 3 is possible without a graphics chip, however I have found conf... | 2012/08/23 | [
"https://superuser.com/questions/465412",
"https://superuser.com",
"https://superuser.com/users/134546/"
] | There isn't a standard name really
* RJ45 Module
* Snap-in CAT5E RJ45 Module
* Keystone Jack
* RJ45 Keystone module | That part is called a **rj45 wall jack** |
40,929,109 | I have a very generic extension method to show any type of list within a console:
```
public static void ShowList<T>(this IEnumerable<T> Values)
{
foreach (T item in Values)
{
Console.WriteLine(item);
}
}
```
Not when I have a `string` I can use this Method
```
string text = "test";
text.ShowLi... | 2016/12/02 | [
"https://Stackoverflow.com/questions/40929109",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/6887468/"
] | This feels like a bit of an odd requirement to start with, to be honest - if something should work for any sequence of characters, then it should work for a string, which *is* a sequence of characters.
If you really want to make it fail to compile, you could add an overload accepting `string` which is marked as obsole... | You can create another overload of `ShowList()` that is specific for `string` and mark it as `[Obsolete]`:
```
[Obsolete("Not intended for strings", true)]
public static void ShowList(this string val)
{
}
```
By passing `true` to the `IsError` parameter, the compiler will prevent you from using the method.
See [Obs... |
40,929,109 | I have a very generic extension method to show any type of list within a console:
```
public static void ShowList<T>(this IEnumerable<T> Values)
{
foreach (T item in Values)
{
Console.WriteLine(item);
}
}
```
Not when I have a `string` I can use this Method
```
string text = "test";
text.ShowLi... | 2016/12/02 | [
"https://Stackoverflow.com/questions/40929109",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/6887468/"
] | You can create another overload of `ShowList()` that is specific for `string` and mark it as `[Obsolete]`:
```
[Obsolete("Not intended for strings", true)]
public static void ShowList(this string val)
{
}
```
By passing `true` to the `IsError` parameter, the compiler will prevent you from using the method.
See [Obs... | For silent ignore you could use this:
```
public static void ShowList<T>(this IEnumerable<T> Values)
{
if (Values is String) return;
// ...
}
```
Or if you want to also write the string:
```
public static void ShowList<T>(this IEnumerable<T> Values)
{
if (Values is String)
Console.WriteLine(Valu... |
40,929,109 | I have a very generic extension method to show any type of list within a console:
```
public static void ShowList<T>(this IEnumerable<T> Values)
{
foreach (T item in Values)
{
Console.WriteLine(item);
}
}
```
Not when I have a `string` I can use this Method
```
string text = "test";
text.ShowLi... | 2016/12/02 | [
"https://Stackoverflow.com/questions/40929109",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/6887468/"
] | This feels like a bit of an odd requirement to start with, to be honest - if something should work for any sequence of characters, then it should work for a string, which *is* a sequence of characters.
If you really want to make it fail to compile, you could add an overload accepting `string` which is marked as obsole... | For silent ignore you could use this:
```
public static void ShowList<T>(this IEnumerable<T> Values)
{
if (Values is String) return;
// ...
}
```
Or if you want to also write the string:
```
public static void ShowList<T>(this IEnumerable<T> Values)
{
if (Values is String)
Console.WriteLine(Valu... |
28,624,768 | HTML5 allows some tags to be written more liberally i.e without corresponding END tags. e.g. `input` need not be closed `</input>`.However if choose **template mode** `HTML5` in Thymeleaf the Thymeleaf engine complains about this and does not parse the HTML template. I want to override this default Strict tag checking ... | 2015/02/20 | [
"https://Stackoverflow.com/questions/28624768",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1474211/"
] | All you have to do is run Thymeleaf in "LEGACYHTML5" mode and it works like a charm. Thanks to [this](https://github.com/spring-projects/spring-boot/issues/1270) and [this](http://forum.thymeleaf.org/HTML-tags-strict-checking-td4028045.html) post, I found the solution and am documenting in SO so others do not have to g... | Here is how you can do it in a neat way
**Step 1:** Add thymeleaf mode to your application.properties file.
>
> resources/application.properties
>
>
>
```
spring.thymeleaf.mode=LEGACYHTML5
```
**Step 2:** Add nekohtml dependency to your pom.xml file.
>
> pom.xml
>
>
>
```
<dependency>
<groupId>net.so... |
28,624,768 | HTML5 allows some tags to be written more liberally i.e without corresponding END tags. e.g. `input` need not be closed `</input>`.However if choose **template mode** `HTML5` in Thymeleaf the Thymeleaf engine complains about this and does not parse the HTML template. I want to override this default Strict tag checking ... | 2015/02/20 | [
"https://Stackoverflow.com/questions/28624768",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1474211/"
] | All you have to do is run Thymeleaf in "LEGACYHTML5" mode and it works like a charm. Thanks to [this](https://github.com/spring-projects/spring-boot/issues/1270) and [this](http://forum.thymeleaf.org/HTML-tags-strict-checking-td4028045.html) post, I found the solution and am documenting in SO so others do not have to g... | Using `LEGACYHTML5` worked for me as well.
Also it is necessary to add
```
<dependency>
<groupId>net.sourceforge.nekohtml</groupId>
<artifactId>nekohtml</artifactId>
</dependency>
```
to pom.xml as stated above. But there is one more step which might occur. After doing those two steps I was getting:
```... |
28,624,768 | HTML5 allows some tags to be written more liberally i.e without corresponding END tags. e.g. `input` need not be closed `</input>`.However if choose **template mode** `HTML5` in Thymeleaf the Thymeleaf engine complains about this and does not parse the HTML template. I want to override this default Strict tag checking ... | 2015/02/20 | [
"https://Stackoverflow.com/questions/28624768",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1474211/"
] | Here is how you can do it in a neat way
**Step 1:** Add thymeleaf mode to your application.properties file.
>
> resources/application.properties
>
>
>
```
spring.thymeleaf.mode=LEGACYHTML5
```
**Step 2:** Add nekohtml dependency to your pom.xml file.
>
> pom.xml
>
>
>
```
<dependency>
<groupId>net.so... | Using `LEGACYHTML5` worked for me as well.
Also it is necessary to add
```
<dependency>
<groupId>net.sourceforge.nekohtml</groupId>
<artifactId>nekohtml</artifactId>
</dependency>
```
to pom.xml as stated above. But there is one more step which might occur. After doing those two steps I was getting:
```... |
4,224,372 | Hi guys I am writing some code using the object literal pattern, I have function that returns a value:
```
'currentLocation': function() {
var cL = 0;
return cL;
},
```
I then need to update the variable 'cL' from another function like this:
```
teamStatus.currentLocation() = teamStatus.currentLocation(... | 2010/11/19 | [
"https://Stackoverflow.com/questions/4224372",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/270528/"
] | You're writing `teamStatus.currentLocation() =`, which calls the function `teamStatus.currentLocation` and tries to assign to the return value. That isn't valid. You want just `teamStatus.currentLocation =` — no function call. | The variable inside your function is completely private to that function (and any functions defined within it). If you need to create a number of functions that share a set of private variables, you can do that with a closure. For instance:
```
var Thing = (function() {
var thingWideData;
function getData() {... |
4,224,372 | Hi guys I am writing some code using the object literal pattern, I have function that returns a value:
```
'currentLocation': function() {
var cL = 0;
return cL;
},
```
I then need to update the variable 'cL' from another function like this:
```
teamStatus.currentLocation() = teamStatus.currentLocation(... | 2010/11/19 | [
"https://Stackoverflow.com/questions/4224372",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/270528/"
] | You're writing `teamStatus.currentLocation() =`, which calls the function `teamStatus.currentLocation` and tries to assign to the return value. That isn't valid. You want just `teamStatus.currentLocation =` — no function call. | What your code produces is:
```
0 = 0 + <some number>
```
Which variable do you want to update? `cL`? You are declaring it in the function, you cannot assign a value to it from outside. Depending on the rest of your code, you might be better off with [`getters and setters`](https://developer.mozilla.org/en/Core_Java... |
2,596,879 | I have a cool snippet of code that works well, except one thing.
The code will take an icon I want to add to an existing picture. I can position it where I want too! Which is exactly what I need to do.
However, I'm stuck on one thing, concerning the placement.
The code "starting position" (on the main image: navIco... | 2010/04/08 | [
"https://Stackoverflow.com/questions/2596879",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/271619/"
] | ```
X(?:A()|B()){2}\1\2Y
```
Basically, you use an empty capturing group to check off each item when it's matched, then the back-references ensure that everything's been checked off.
Be aware that this relies on undocumented regex behavior, so there's no guarantee that it will work in your regex flavor--and if it do... | If there are several strings, with any kind of characters in there, you'll be better with:
```
X(.)+Y
```
Only numbers then
```
X([0-9])+Y
```
Only letters
```
X([a-zA-Z])+Y
```
Letters and numbers
```
X([a-zA-Z][0-9])+Y
``` |
2,596,879 | I have a cool snippet of code that works well, except one thing.
The code will take an icon I want to add to an existing picture. I can position it where I want too! Which is exactly what I need to do.
However, I'm stuck on one thing, concerning the placement.
The code "starting position" (on the main image: navIco... | 2010/04/08 | [
"https://Stackoverflow.com/questions/2596879",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/271619/"
] | You can store regex pieces in variables, and do:
```
A=/* relevant regex pattern */
B=/* other regex pattern */
regex = X($A$B|$B$A)Y
```
This way you only have to specify each regex once, on its own line, which should make it easier to maintain.
Sidenote: You're trying to find permutations, which is ok since you'r... | If there are several strings, with any kind of characters in there, you'll be better with:
```
X(.)+Y
```
Only numbers then
```
X([0-9])+Y
```
Only letters
```
X([a-zA-Z])+Y
```
Letters and numbers
```
X([a-zA-Z][0-9])+Y
``` |
2,596,879 | I have a cool snippet of code that works well, except one thing.
The code will take an icon I want to add to an existing picture. I can position it where I want too! Which is exactly what I need to do.
However, I'm stuck on one thing, concerning the placement.
The code "starting position" (on the main image: navIco... | 2010/04/08 | [
"https://Stackoverflow.com/questions/2596879",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/271619/"
] | ```
X(?:A()|B()){2}\1\2Y
```
Basically, you use an empty capturing group to check off each item when it's matched, then the back-references ensure that everything's been checked off.
Be aware that this relies on undocumented regex behavior, so there's no guarantee that it will work in your regex flavor--and if it do... | You can store regex pieces in variables, and do:
```
A=/* relevant regex pattern */
B=/* other regex pattern */
regex = X($A$B|$B$A)Y
```
This way you only have to specify each regex once, on its own line, which should make it easier to maintain.
Sidenote: You're trying to find permutations, which is ok since you'r... |
2,596,879 | I have a cool snippet of code that works well, except one thing.
The code will take an icon I want to add to an existing picture. I can position it where I want too! Which is exactly what I need to do.
However, I'm stuck on one thing, concerning the placement.
The code "starting position" (on the main image: navIco... | 2010/04/08 | [
"https://Stackoverflow.com/questions/2596879",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/271619/"
] | ```
X(?:A()|B()){2}\1\2Y
```
Basically, you use an empty capturing group to check off each item when it's matched, then the back-references ensure that everything's been checked off.
Be aware that this relies on undocumented regex behavior, so there's no guarantee that it will work in your regex flavor--and if it do... | try this
```
X((A|B){2})Y
``` |
2,596,879 | I have a cool snippet of code that works well, except one thing.
The code will take an icon I want to add to an existing picture. I can position it where I want too! Which is exactly what I need to do.
However, I'm stuck on one thing, concerning the placement.
The code "starting position" (on the main image: navIco... | 2010/04/08 | [
"https://Stackoverflow.com/questions/2596879",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/271619/"
] | You can store regex pieces in variables, and do:
```
A=/* relevant regex pattern */
B=/* other regex pattern */
regex = X($A$B|$B$A)Y
```
This way you only have to specify each regex once, on its own line, which should make it easier to maintain.
Sidenote: You're trying to find permutations, which is ok since you'r... | try this
```
X((A|B){2})Y
``` |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.