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 |
|---|---|---|---|---|---|
5,988,457 | I'm compiling a trivial C++ file `Temp.cpp`:
```
#include <string>
int main() { std::wstring s; }
```
With the command line:
```
cl.exe /MD /Iinc\api\crt\stl60 /Iinc\crt /Iinc\api C:\Temp.cpp
/LibPath:lib\wxp\i386 /LibPath:lib\crt\i386
/link /LibPath:lib\wxp\i386 /LibPath:lib\crt\i386
```
in the WDK... | 2011/05/13 | [
"https://Stackoverflow.com/questions/5988457",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/541686/"
] | The likely fix would be to set /Zc:wchar\_t- to turn off wchar\_t as an intrinsic type. STL6 doesn't have great support for /Zc:wchar\_t which is the default since at least VC7.1, perhaps earlier.
Meta: Please don't use the STL60 version of STL. This version from 1998 lacks a large number of bug fixes, performance imp... | VC6 doesn't support the `wchar_t` *type* , it had a `typedef` for `unsigned short`. The linker would only be able to find `std::basic_string<unsigned short>` in the "stl60" lib. |
1,061,449 | I have a directory containing thousands of files with names
```
t_00xx_000xxx.png
```
I want to change their names to `00xx_000xxx_t.png`
so take the prefix and put it as a postfix, can this be done in only one command | 2018/08/01 | [
"https://askubuntu.com/questions/1061449",
"https://askubuntu.com",
"https://askubuntu.com/users/837988/"
] | This is possible with the [`rename`](http://manpages.ubuntu.com/manpages/bionic/en/man1/prename.1p.html) command:
First check what *would* be done (by suppliying `-n`). If it looks good, drop the `-n` and run again:
```
rename -n 's/t_(.+)\.png$/$1_t.png/' *.png # check only
rename 's/t_(.+)\.png$/$1_t.png/' *.pn... | `mmv` (available from the `universe` repository) is nice for this kind of thing, where simple shell globs rather than regular expression can do the job
Ex.
```
mmv -n -- '*_*_*.png' '#2_#3_#1.png'
t_00xx_000xxx.png -> 00xx_000xxx_t.png
```
Remove the `-n` once you are happy that it's working right. |
1,061,449 | I have a directory containing thousands of files with names
```
t_00xx_000xxx.png
```
I want to change their names to `00xx_000xxx_t.png`
so take the prefix and put it as a postfix, can this be done in only one command | 2018/08/01 | [
"https://askubuntu.com/questions/1061449",
"https://askubuntu.com",
"https://askubuntu.com/users/837988/"
] | If the prefix is separated by an underscore (`_`), you can do the following:
```
rename -n 's/^([^_]*)_(.*)\.(.*)$/$2_$1.$3/' file(s)
```
It will work with any prefix and any extension.
Remove the `-n` to perform the rename if you're happy with the result.
---
**Explanation:**
* `s/search_pattern/replace_pattern... | `mmv` (available from the `universe` repository) is nice for this kind of thing, where simple shell globs rather than regular expression can do the job
Ex.
```
mmv -n -- '*_*_*.png' '#2_#3_#1.png'
t_00xx_000xxx.png -> 00xx_000xxx_t.png
```
Remove the `-n` once you are happy that it's working right. |
17,618,051 | My setup is as follows: Windows 7, XAMPP with Apache and PHP enabled I have a PHP script in which I call an external program to do run a conversion. This external program is an EXE file, which requires 3 attributes:
* The source file
* The destination file
* Additional flags (conversion type etc)
When I use the comma... | 2013/07/12 | [
"https://Stackoverflow.com/questions/17618051",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/2029689/"
] | The default driver for Capybara is Rack::Test. Your page probably requires javacript which means that Capybara's default driver is not rendering everything correctly. Just set `Capybara.default_driver = :selenium`. This way the javascript is run correctly.
See also [link](http://www.opinionatedprogrammer.com/2011/02/... | I needed to add to `spec_helper.rb` the line
```
require 'capybara/rspec'
```
and use default browser driver |
6,604,814 | Well, I've finally decided that I'm not crazy. So, that leaves DataMapper.
Here's what I'm doing. I have a model Msrun which `has 1` Metric.
```
tmp = Msrun.first_or_create # I'll skip the boring details
tmp.metric = Metric.first_or_create( {msrun_id: tmp.id}, {metric_input_file: @metricsfile} )
p tmp.metric # => #... | 2011/07/07 | [
"https://Stackoverflow.com/questions/6604814",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/654245/"
] | I'm probably missing something here (more of those boring details might help) but if the metric exists, it's metric\_input\_file shouldn't be updated, i.e., it's only set when new. If you're after updating then you can do
```
.first_or_create(msrun_id: tmp.id).update(metric_input_file: @metricsfile)
```
Or if not h... | In addition to the answer above, I've seen this call die (like, literally halt all execution) with no error when I was doing a find\_or\_create that would have created an object that violated the primary key constraint. This is because the datamapper model was not in sync with the actual database schema. |
38,620,944 | I have a function onload which is just a simple console.log
```
<script>
onload = function(){
console.log('Hello');
}
</script>
```
I call it in my body like so
```
<body window.onload="onload();">
```
which after the page loads correctly prints
```
Hello
```
But I am trying to make it so when I click on my it... | 2016/07/27 | [
"https://Stackoverflow.com/questions/38620944",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/2770808/"
] | solve it like this
```
import { Http, Response } from '@angular/http';
export class LoginService {
constructor(private http: Http) {
}
}
```
or use it like this
```
public constructor(@Inject(Http) private http: Http) {}
``` | Assuming `requester` is a service.
Each `Component` which uses your service `requester` have to reference `HTTP_PROVIDERS`:
```
import {HTTP_PROVIDERS} from '@angular2/http';
@Component({
...
providers: [HTTP_PROVIDERS, requester],
...
})
export class MyComponent{
constructor(private _req: requester) {
}
... |
38,620,944 | I have a function onload which is just a simple console.log
```
<script>
onload = function(){
console.log('Hello');
}
</script>
```
I call it in my body like so
```
<body window.onload="onload();">
```
which after the page loads correctly prints
```
Hello
```
But I am trying to make it so when I click on my it... | 2016/07/27 | [
"https://Stackoverflow.com/questions/38620944",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/2770808/"
] | try this one
```
import {Http, HTTP_PROVIDERS} from '@angular2/http';
@Component({
....
providers: [HTTP_PROVIDERS]
....})
export class requester {
constructor(private http:Http){}
...
}
```
Assuming missing providers for your request | Assuming `requester` is a service.
Each `Component` which uses your service `requester` have to reference `HTTP_PROVIDERS`:
```
import {HTTP_PROVIDERS} from '@angular2/http';
@Component({
...
providers: [HTTP_PROVIDERS, requester],
...
})
export class MyComponent{
constructor(private _req: requester) {
}
... |
423 | Somebody answered this question instead of the question [here](https://mathoverflow.net/questions/410/what-is-an-example-of-a-smooth-variety-over-a-finite-field-fp-which-does-not-emb), so I am asking this with the hope that they will cut and paste their solution. | 2009/10/13 | [
"https://mathoverflow.net/questions/423",
"https://mathoverflow.net",
"https://mathoverflow.net/users/2/"
] | Examples are also in my paper "Murphy's Law in Algebraic Geometry", which you can get from my [preprints page](http://math.stanford.edu/~vakil/preprints.html)
Here is a short (not quite complete) description of a construction, with two explanations of why it works. I hope I am remembering this correctly!
In characte... | There is an article by Illusie in *Fundamental Algebraic Geometry: Grothendieck's FGA Explained* that contains a construction of a non-liftable surface. The article is online ([pdf](http://www.math.u-psud.fr/~illusie/illusie_trieste.pdf)
- see section 6) and the construction is rather complicated. There are additional ... |
14,261,656 | I'm using `@Html.Action()` to render a child action within my view.
The `_ViewStart.cshtml` file specifies that all views should use a particular layout like this:
```
@{
Layout = "~/Views/Shared/_Layout.cshtml";
}
```
Problem is, that layout is getting applied to my child action too, so the final page ends up ... | 2013/01/10 | [
"https://Stackoverflow.com/questions/14261656",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/164923/"
] | 2 possibilities:
1. `return PartialView()` from the corresponding controller action instead of a `return View()`
2. Blank out the layout in the view itself
```
@{
Layout = null;
}
``` | Seems you want to use `ChildActionOnly` and don't want to pass the model from view then you can not user PartialView.
If it is so, you need to remove the layout manually
```
@{
Layout = "";
}
``` |
18,248,384 | Anyone point out the issue?
Keep getting "The specified type member 'Date' is not supported in LINQ to Entities. Only initializers, entity members, and entity navigation properties are supported."
```
public IEnumerable<Appointment> FindAllAppointmentsWithReminders()
{
DateTime reminderDate = DateTime.Today.Date;
... | 2013/08/15 | [
"https://Stackoverflow.com/questions/18248384",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1401620/"
] | Remove all the `.Date` from your method but this:
```
DateTime reminderDate = DateTime.Today.Date;
```
EntityFramework doesn't support the `.Date` property of `Datetime`. For this reason there is the pseudo-function `EntityFunctions.TruncateTime`, and for the `reminderDate` you already remove the time in the `DateTi... | Try this
```
public IEnumerable<Appointment> FindAllAppointmentsWithReminders()
{
DateTime reminderDate = DateTime.Today.Date;
**DateTime NewDate =reminderDate.Date;**
IEnumerable<Appointment> apps = RepositorySet
.OfType<Appointment>()
.Include("Client")
.Where(c => EntityFunction... |
33,182 | I'm currently getting to grips with the new (3.1) ArcGIS JavaScript API and how it bundles Dojo and relies on Dojo's Asynchronous Module Definition (AMD) approach.
I'm familiar with AMD and recently completed a project using Require, Backbone, and OpenLayers in combination - overall a very pleasant experience.
Howeve... | 2012/09/11 | [
"https://gis.stackexchange.com/questions/33182",
"https://gis.stackexchange.com",
"https://gis.stackexchange.com/users/2788/"
] | Since esri does not ship source code you cannot build one layer package with all your classes. You will have to push out the esri api locally or using the CDN and then pull down your layer file. So you will have 2 and then the extra's that esri forgot to bundle or chose not to.
We've put together a discard layer so th... | while ago I was wondering the same question. But on last Esri Developer Summit 2012 I saw a presentation about JS api. Person that was presenting the subject explained how to create basic OO dojo plugin/module. You can watch whole video here: <http://proceedings.esri.com/library/userconf/devsummit12/index.html> |
14,787,571 | I found this post on [Bootstrap Tutorial for Blog Design](http://www.9lessons.info/2012/03/bootstrap-tutorial-for-blog-design.html).
I am planning to use it for one of my project for the responsive layout that it provides.
I have found an issue in the page hosted for [demo](http://demos.9lessons.info/bootstrap/index.h... | 2013/02/09 | [
"https://Stackoverflow.com/questions/14787571",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/328911/"
] | In the css files its stated that the first span-element to have no margin on the left.
bootstrap-responsive.css on line 232:
```
.row-fluid [class*="span"]:first-child {
margin-left: 0px;
}
```
bootstrap.css on line 419:
```
.row-fluid [class*="span"]:first-child {
margin-left: 0px;
}
```
Remove or com... | Add this stylesheet (*prefered at the bottom*)
```
.row > [class*="span"]:first-child {
padding-left: 20px;
}
```
If you want you can add this jQuery
```
$('.row > [class*="span"]:first-child').css('padding-left','20px');
``` |
14,787,571 | I found this post on [Bootstrap Tutorial for Blog Design](http://www.9lessons.info/2012/03/bootstrap-tutorial-for-blog-design.html).
I am planning to use it for one of my project for the responsive layout that it provides.
I have found an issue in the page hosted for [demo](http://demos.9lessons.info/bootstrap/index.h... | 2013/02/09 | [
"https://Stackoverflow.com/questions/14787571",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/328911/"
] | You can get it resolved by using jquery selector
```
$('.row > [class*="span"]:first-child').css({"padding-left":"20px"});
``` | In the css files its stated that the first span-element to have no margin on the left.
bootstrap-responsive.css on line 232:
```
.row-fluid [class*="span"]:first-child {
margin-left: 0px;
}
```
bootstrap.css on line 419:
```
.row-fluid [class*="span"]:first-child {
margin-left: 0px;
}
```
Remove or com... |
14,787,571 | I found this post on [Bootstrap Tutorial for Blog Design](http://www.9lessons.info/2012/03/bootstrap-tutorial-for-blog-design.html).
I am planning to use it for one of my project for the responsive layout that it provides.
I have found an issue in the page hosted for [demo](http://demos.9lessons.info/bootstrap/index.h... | 2013/02/09 | [
"https://Stackoverflow.com/questions/14787571",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/328911/"
] | You can get it resolved by using jquery selector
```
$('.row > [class*="span"]:first-child').css({"padding-left":"20px"});
``` | Add this stylesheet (*prefered at the bottom*)
```
.row > [class*="span"]:first-child {
padding-left: 20px;
}
```
If you want you can add this jQuery
```
$('.row > [class*="span"]:first-child').css('padding-left','20px');
``` |
29,424,655 | I have a directive and now I want to send same data to other controller's methods and this controller is totally independent of this directive. this other controller is actually resides out the current directory.
How can I do this in angularjs? | 2015/04/03 | [
"https://Stackoverflow.com/questions/29424655",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/2561567/"
] | Create an angular service and inject in both the controllers. Update a variable in that service from controller 1 and retrieve in controller 2. Something like this -
```
myApp.factory('myFactory', function () {
// declare and store the value in a local variable here
var prop = '';
return {
getPro... | In angularjs there is an idea about directive scope.It lets you to use data for directive with 3 ways.
1) string @
2) biDirectional =
3) functional &
I think you have heard about these.This link maybe can help you.
<https://docs.angularjs.org/api/ng/service/>$compile#directive-definition-object |
67,510,810 | I have the query below. How come with the invoice\_dt set between 1/1/2021 - 5/31/2021... the output display ALL date ranges. How would I set it to look for dups based on pay\_cte within the date range?
```
with pay_cte( vendor_id,invoice_id, pay_amt,pay_cnt ) as (
select vendor_id,invoice_id, pay_amt,count(*)
from ps... | 2021/05/12 | [
"https://Stackoverflow.com/questions/67510810",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/12081754/"
] | The reason your query is returning all dates is due to the fact that your actual select statement that uses the `WITH` clause does not have any filtering for dates. It is likely that your `ps_voucher` table has records in it that have `INVOICE_DT` values that are out of the range of dates about which you are curious.
... | You have to change your date for this format "yyyy-mm-dd" |
19,235,348 | I have the following line of code, which conditionally redirects that I would like to include in my Rails controller and execute only in the case that the request is an HTML request.
I would like to skip this logic in the case that the request is JSON. How does one do this in conjunction with the `respond_to :html, :j... | 2013/10/07 | [
"https://Stackoverflow.com/questions/19235348",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/165448/"
] | You want something like this:
```
class SomeController < ApplicationController
def index
@pages = Pages.find(:all)
respond_to do |format|
format.html do
redirect_to other_controller and return if @pages.empty
# ... other logic ...
end
format.json { render json: @pages }
... | You mean just branch logic by HTTP request format.
```
respond_to do |format|
format.html {your_html_logic }
format.json { your_json_logic }
end
``` |
19,235,348 | I have the following line of code, which conditionally redirects that I would like to include in my Rails controller and execute only in the case that the request is an HTML request.
I would like to skip this logic in the case that the request is JSON. How does one do this in conjunction with the `respond_to :html, :j... | 2013/10/07 | [
"https://Stackoverflow.com/questions/19235348",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/165448/"
] | You should use the `respond_to` block:
```
respond_to do |format|
format.html { redirect_to some_controller }
format.json { render json: @data }
end
```
This will redirect to `some_controller` after an HTML request, and render JSON data after a JSON request. | You mean just branch logic by HTTP request format.
```
respond_to do |format|
format.html {your_html_logic }
format.json { your_json_logic }
end
``` |
19,235,348 | I have the following line of code, which conditionally redirects that I would like to include in my Rails controller and execute only in the case that the request is an HTML request.
I would like to skip this logic in the case that the request is JSON. How does one do this in conjunction with the `respond_to :html, :j... | 2013/10/07 | [
"https://Stackoverflow.com/questions/19235348",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/165448/"
] | You want something like this:
```
class SomeController < ApplicationController
def index
@pages = Pages.find(:all)
respond_to do |format|
format.html do
redirect_to other_controller and return if @pages.empty
# ... other logic ...
end
format.json { render json: @pages }
... | You should use the `respond_to` block:
```
respond_to do |format|
format.html { redirect_to some_controller }
format.json { render json: @data }
end
```
This will redirect to `some_controller` after an HTML request, and render JSON data after a JSON request. |
61,716,602 | I have a button that triggers my view state. As I have now added a network call, I would like my view model to replace the @State with its @Publihed variable to perform the same changes.
How to use my @Published in the place of my @State variable?
So this is my SwiftUI view:
```
struct ContentView: View {
@Obser... | 2020/05/10 | [
"https://Stackoverflow.com/questions/61716602",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/10408494/"
] | Remove state and use view model member directly, as below
```
struct ContentView: View {
@ObservedObject var viewModel = OnboardingViewModel()
var body: some View {
ZStack {
Button(action: {
self.viewModel.demoLogin()
}) {
Text("Log in")
}
if viewModel.isLoggedIn { ... | Hey Roland I think that what you are looking for is this:
```
$viewMode.isLoggedIn
```
Adding the $ before the var will ensure that SwiftUI is aware of its value changes.
```
struct ContentView: View {
@ObservedObject var viewModel = OnboardingViewModel()
var body: some View {
ZStack {
Button(action... |
6,248,351 | If i have the following structure in an MVC site.
```
Areas
+ Documents
+ Controllers
+ Models
+ Views
+ Shared
+ icons
icon.png
```
I am trying to use `img src='@url.Content("~/Areas/Documents/Views/Shared/icons/icon.png")'`/>
Why is this image unavailable?
Is there another ... | 2011/06/06 | [
"https://Stackoverflow.com/questions/6248351",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/231821/"
] | Yes. I don't know how to override that as default the css and images has to go to the Content folder.
**UPDATED**: I correct what I said above, the images cannot be inside the Views\Shared folder without any special coding. You have to put the images in the outside folder but the folder can be named any instead of "Co... | The Shared folder in MVC is used as a default location for views. When your routing request is rendered the process will check the Controller's view folder for the correct view, if it is not present, the it will check the Shared folder for the view.
There is nothing stopping you from putting an image in your Views fol... |
6,248,351 | If i have the following structure in an MVC site.
```
Areas
+ Documents
+ Controllers
+ Models
+ Views
+ Shared
+ icons
icon.png
```
I am trying to use `img src='@url.Content("~/Areas/Documents/Views/Shared/icons/icon.png")'`/>
Why is this image unavailable?
Is there another ... | 2011/06/06 | [
"https://Stackoverflow.com/questions/6248351",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/231821/"
] | This works for me
img src='@Url.Content("../../Content/Images/6.jpg")' alt="" style="width: 100px; height: 100px" />
Yet my problem is getting the corresponding image to the product I am trying to show, no luck so far, I have tried hard coding too. | Yes. I don't know how to override that as default the css and images has to go to the Content folder.
**UPDATED**: I correct what I said above, the images cannot be inside the Views\Shared folder without any special coding. You have to put the images in the outside folder but the folder can be named any instead of "Co... |
6,248,351 | If i have the following structure in an MVC site.
```
Areas
+ Documents
+ Controllers
+ Models
+ Views
+ Shared
+ icons
icon.png
```
I am trying to use `img src='@url.Content("~/Areas/Documents/Views/Shared/icons/icon.png")'`/>
Why is this image unavailable?
Is there another ... | 2011/06/06 | [
"https://Stackoverflow.com/questions/6248351",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/231821/"
] | This works for me
img src='@Url.Content("../../Content/Images/6.jpg")' alt="" style="width: 100px; height: 100px" />
Yet my problem is getting the corresponding image to the product I am trying to show, no luck so far, I have tried hard coding too. | The Shared folder in MVC is used as a default location for views. When your routing request is rendered the process will check the Controller's view folder for the correct view, if it is not present, the it will check the Shared folder for the view.
There is nothing stopping you from putting an image in your Views fol... |
18,414,075 | This question is chiefly about LINQ and possibly covariance.
Two of my Entities implement the **IDatedItem** interface. I'd like to union, then sort these, for enumerating as a single list. I must retain entity-specific properties at enumeration-time.
To clarify by example, one approach I tried was:
```
Context.Tabl... | 2013/08/24 | [
"https://Stackoverflow.com/questions/18414075",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/608220/"
] | This requires more space than a comment offers. On the other hand, this is not really an answer, because there is no satisfying answer, really.
For a `Union` to succeed, both collections must have the same type (or have intrinsic conversions to common types, that's what covariance is about).
So a first go at getting ... | Here's the working code. My solution was to ensure all data was local, to keep LINQ-to-EF from trying to do all manner of things it knows it can't that were causing many unclear errors. Then a simple type declaration on the generic Union can take hold.
That means that, aside from the annoyances of LINQ-to-EF, the main... |
4,553,304 | `Qt` has a flexible and powerful layout mechanism to handle view of desktop application's windows.
But it is so flexible, that it nearly cannot be understood, when something goes wrong and needs fine tuning. And so powerful, that it can beat anyone in their tries to overwhelm Qt's opinion of how form should look.
So,... | 2010/12/29 | [
"https://Stackoverflow.com/questions/4553304",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/286291/"
] | Layouts are actually easy to understand "I think". :)
A simple explanation of layouts can be found in the QT book "**[C++ Gui programming with QT 2nd edition](https://web.archive.org/web/20090822161435/qt.nokia.com/developer/books/cpp-gui-programming-with-qt-4-2nd-edition/)**"
**What you should be aware of regardin... | You can use QT Style Sheets to control the widgets height
and other properties in an easy customizable way.
<http://doc.qt.io/archives/qt-4.7/stylesheet.html>
As for the layouts you need to use them wisely and strongly
coupled with spacers in order to make the widgets behave
exactly the way you want them to.
<http:... |
4,553,304 | `Qt` has a flexible and powerful layout mechanism to handle view of desktop application's windows.
But it is so flexible, that it nearly cannot be understood, when something goes wrong and needs fine tuning. And so powerful, that it can beat anyone in their tries to overwhelm Qt's opinion of how form should look.
So,... | 2010/12/29 | [
"https://Stackoverflow.com/questions/4553304",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/286291/"
] | According to its [docs](https://doc.qt.io/qt-5/layout.html#adding-widgets-to-a-layout):
>
> When you add widgets to a layout, the layout process works as follows:
>
>
> 1. All the widgets will initially be allocated an amount of space in accordance with their QWidget::sizePolicy() and QWidget::sizeHint().
> 2. If a... | You can use QT Style Sheets to control the widgets height
and other properties in an easy customizable way.
<http://doc.qt.io/archives/qt-4.7/stylesheet.html>
As for the layouts you need to use them wisely and strongly
coupled with spacers in order to make the widgets behave
exactly the way you want them to.
<http:... |
4,553,304 | `Qt` has a flexible and powerful layout mechanism to handle view of desktop application's windows.
But it is so flexible, that it nearly cannot be understood, when something goes wrong and needs fine tuning. And so powerful, that it can beat anyone in their tries to overwhelm Qt's opinion of how form should look.
So,... | 2010/12/29 | [
"https://Stackoverflow.com/questions/4553304",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/286291/"
] | Layouts are actually easy to understand "I think". :)
A simple explanation of layouts can be found in the QT book "**[C++ Gui programming with QT 2nd edition](https://web.archive.org/web/20090822161435/qt.nokia.com/developer/books/cpp-gui-programming-with-qt-4-2nd-edition/)**"
**What you should be aware of regardin... | According to its [docs](https://doc.qt.io/qt-5/layout.html#adding-widgets-to-a-layout):
>
> When you add widgets to a layout, the layout process works as follows:
>
>
> 1. All the widgets will initially be allocated an amount of space in accordance with their QWidget::sizePolicy() and QWidget::sizeHint().
> 2. If a... |
405,123 | I know that Hamel bases have a couple of defects for the purposes of doing analysis in infinite dimensions:
(1) Every Hamel basis of a complete normed space must be uncountable.
(2) For every Hamel basis of a complete normed space, all but finitely many of the coordinate functionals are discontinuous.
I also know bo... | 2021/09/29 | [
"https://mathoverflow.net/questions/405123",
"https://mathoverflow.net",
"https://mathoverflow.net/users/150527/"
] | The following perhaps could be a comment, but I thought that maybe I should state it as an answer so it can get positive or negative feedback.
To my mind, whenever I have taught linear algebra in the past, I emphasises that the great power of having a basis B for a vector space V, to study a linear map T from V to som... | This is an addition to Yemon Choi's answer.
In fact, a real-valued function $f$ defined on a Hamel basis $H$ of $\mathbb{R}$ over $\mathbb{Q}$, for instance, extends uniquely to ad *additive* function, not to a linear function (it only needs to be linear over $\mathbb{Q}$). This can be seen readily defining $$F(x)=\su... |
405,123 | I know that Hamel bases have a couple of defects for the purposes of doing analysis in infinite dimensions:
(1) Every Hamel basis of a complete normed space must be uncountable.
(2) For every Hamel basis of a complete normed space, all but finitely many of the coordinate functionals are discontinuous.
I also know bo... | 2021/09/29 | [
"https://mathoverflow.net/questions/405123",
"https://mathoverflow.net",
"https://mathoverflow.net/users/150527/"
] | The following perhaps could be a comment, but I thought that maybe I should state it as an answer so it can get positive or negative feedback.
To my mind, whenever I have taught linear algebra in the past, I emphasises that the great power of having a basis B for a vector space V, to study a linear map T from V to som... | Historically, bases in functional analysis arose from reflection on a collection of concrete examples, such as trigonometric functions, orthogonal polynomials, spherical harmonics, eigenfunctions of the Laplacian, etc.
What's in common in these examples is that each appeared as a tool to solve a concrete problem by **... |
405,123 | I know that Hamel bases have a couple of defects for the purposes of doing analysis in infinite dimensions:
(1) Every Hamel basis of a complete normed space must be uncountable.
(2) For every Hamel basis of a complete normed space, all but finitely many of the coordinate functionals are discontinuous.
I also know bo... | 2021/09/29 | [
"https://mathoverflow.net/questions/405123",
"https://mathoverflow.net",
"https://mathoverflow.net/users/150527/"
] | Historically, bases in functional analysis arose from reflection on a collection of concrete examples, such as trigonometric functions, orthogonal polynomials, spherical harmonics, eigenfunctions of the Laplacian, etc.
What's in common in these examples is that each appeared as a tool to solve a concrete problem by **... | This is an addition to Yemon Choi's answer.
In fact, a real-valued function $f$ defined on a Hamel basis $H$ of $\mathbb{R}$ over $\mathbb{Q}$, for instance, extends uniquely to ad *additive* function, not to a linear function (it only needs to be linear over $\mathbb{Q}$). This can be seen readily defining $$F(x)=\su... |
29,591,304 | I am developing an android application where I need to detect the blinking of eyes. So far I have been able to detect the face and eyes using OpenCV. But now I need to check if the eyes are open or close. I read somewhere that one of the ways I can do that is by measuring the pixel intensities (grey levels). But it was... | 2015/04/12 | [
"https://Stackoverflow.com/questions/29591304",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/4216014/"
] | I already worked on this problem and this algorithm. It's implemented (C++) here: <https://github.com/maz/blinking-angel> with algorithm here: <http://www.cs.bu.edu/techreports/pdf/2005-012-blink-detection.pdf> .
As far as I can remember:
* You get B&W current and 100ms ago frames
* You do new - old (see 154 in githu... | Generally there is no obvious solution for this problem, but the number of approaches is quite big, so i'm sure that after a bit of serching you will find something good enough for you. For example you can use algorithm which i mentioned [here](https://stackoverflow.com/a/28811258/1598485) (there is a link to this ques... |
29,591,304 | I am developing an android application where I need to detect the blinking of eyes. So far I have been able to detect the face and eyes using OpenCV. But now I need to check if the eyes are open or close. I read somewhere that one of the ways I can do that is by measuring the pixel intensities (grey levels). But it was... | 2015/04/12 | [
"https://Stackoverflow.com/questions/29591304",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/4216014/"
] | What I did was that I converted the eye region from RGB to HSV and applied skin detection. I found out the range of skin color in HSV. If the percentage of skin pixels is greater than threshold value that means Eye is close otherwise it is open. Though there is still some accuracy issue due to amount of light present. ... | Generally there is no obvious solution for this problem, but the number of approaches is quite big, so i'm sure that after a bit of serching you will find something good enough for you. For example you can use algorithm which i mentioned [here](https://stackoverflow.com/a/28811258/1598485) (there is a link to this ques... |
9,609,672 | Is it possible to edit the text within a cell in datatables. So that when the user double clicks on the cell it becomes editable ?
Thanks | 2012/03/07 | [
"https://Stackoverflow.com/questions/9609672",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/470184/"
] | No. I've seen all three. Personally, I use
```
if (!str[0])
```
Using strlen is a waste of processor time and not safe unless you can guarantee the string is terminated. | All of your examples are fine. It should be clear from the fact that all three are in your codebase that there is no "commonly agreed upon" method. |
9,609,672 | Is it possible to edit the text within a cell in datatables. So that when the user double clicks on the cell it becomes editable ?
Thanks | 2012/03/07 | [
"https://Stackoverflow.com/questions/9609672",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/470184/"
] | 1. `if(strlen(str) == 0)` -> it will **crash** if `str==NULL` (you need to check it before you use `strlen`)
2. `if(str[0] != 0)` -> the same as above
3. `if(!*str)` -> this is actually doing the same thing as **2)**
To summarise: if you want to do it safely:
```
if(!str || !(*str)) { /* empty string or NULL */ }
``... | All of your examples are fine. It should be clear from the fact that all three are in your codebase that there is no "commonly agreed upon" method. |
9,609,672 | Is it possible to edit the text within a cell in datatables. So that when the user double clicks on the cell it becomes editable ?
Thanks | 2012/03/07 | [
"https://Stackoverflow.com/questions/9609672",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/470184/"
] | If you already know that `str` is non-null:
```
if (!*str) {
// empty string
}
```
Otherwise:
```
if (!str || !*str) {
// empty string
}
```
Forget about `strlen()`. | All of your examples are fine. It should be clear from the fact that all three are in your codebase that there is no "commonly agreed upon" method. |
9,609,672 | Is it possible to edit the text within a cell in datatables. So that when the user double clicks on the cell it becomes editable ?
Thanks | 2012/03/07 | [
"https://Stackoverflow.com/questions/9609672",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/470184/"
] | No. I've seen all three. Personally, I use
```
if (!str[0])
```
Using strlen is a waste of processor time and not safe unless you can guarantee the string is terminated. | I would definitely go with `strlen(str) == 0`, just for clarity.
The function should be implemented something like this:
```
int strlen(char *s) {
int len = 0;
while(*(s++)) len++;
return len;
}
```
so there will be no big overhead.
**Edit:** assuming you are sure that the string is actually zero terminated. |
9,609,672 | Is it possible to edit the text within a cell in datatables. So that when the user double clicks on the cell it becomes editable ?
Thanks | 2012/03/07 | [
"https://Stackoverflow.com/questions/9609672",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/470184/"
] | No. I've seen all three. Personally, I use
```
if (!str[0])
```
Using strlen is a waste of processor time and not safe unless you can guarantee the string is terminated. | 1. `if(strlen(str) == 0)` -> it will **crash** if `str==NULL` (you need to check it before you use `strlen`)
2. `if(str[0] != 0)` -> the same as above
3. `if(!*str)` -> this is actually doing the same thing as **2)**
To summarise: if you want to do it safely:
```
if(!str || !(*str)) { /* empty string or NULL */ }
``... |
9,609,672 | Is it possible to edit the text within a cell in datatables. So that when the user double clicks on the cell it becomes editable ?
Thanks | 2012/03/07 | [
"https://Stackoverflow.com/questions/9609672",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/470184/"
] | No. I've seen all three. Personally, I use
```
if (!str[0])
```
Using strlen is a waste of processor time and not safe unless you can guarantee the string is terminated. | If you already know that `str` is non-null:
```
if (!*str) {
// empty string
}
```
Otherwise:
```
if (!str || !*str) {
// empty string
}
```
Forget about `strlen()`. |
9,609,672 | Is it possible to edit the text within a cell in datatables. So that when the user double clicks on the cell it becomes editable ?
Thanks | 2012/03/07 | [
"https://Stackoverflow.com/questions/9609672",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/470184/"
] | 1. `if(strlen(str) == 0)` -> it will **crash** if `str==NULL` (you need to check it before you use `strlen`)
2. `if(str[0] != 0)` -> the same as above
3. `if(!*str)` -> this is actually doing the same thing as **2)**
To summarise: if you want to do it safely:
```
if(!str || !(*str)) { /* empty string or NULL */ }
``... | I would definitely go with `strlen(str) == 0`, just for clarity.
The function should be implemented something like this:
```
int strlen(char *s) {
int len = 0;
while(*(s++)) len++;
return len;
}
```
so there will be no big overhead.
**Edit:** assuming you are sure that the string is actually zero terminated. |
9,609,672 | Is it possible to edit the text within a cell in datatables. So that when the user double clicks on the cell it becomes editable ?
Thanks | 2012/03/07 | [
"https://Stackoverflow.com/questions/9609672",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/470184/"
] | If you already know that `str` is non-null:
```
if (!*str) {
// empty string
}
```
Otherwise:
```
if (!str || !*str) {
// empty string
}
```
Forget about `strlen()`. | I would definitely go with `strlen(str) == 0`, just for clarity.
The function should be implemented something like this:
```
int strlen(char *s) {
int len = 0;
while(*(s++)) len++;
return len;
}
```
so there will be no big overhead.
**Edit:** assuming you are sure that the string is actually zero terminated. |
9,609,672 | Is it possible to edit the text within a cell in datatables. So that when the user double clicks on the cell it becomes editable ?
Thanks | 2012/03/07 | [
"https://Stackoverflow.com/questions/9609672",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/470184/"
] | 1. `if(strlen(str) == 0)` -> it will **crash** if `str==NULL` (you need to check it before you use `strlen`)
2. `if(str[0] != 0)` -> the same as above
3. `if(!*str)` -> this is actually doing the same thing as **2)**
To summarise: if you want to do it safely:
```
if(!str || !(*str)) { /* empty string or NULL */ }
``... | If you already know that `str` is non-null:
```
if (!*str) {
// empty string
}
```
Otherwise:
```
if (!str || !*str) {
// empty string
}
```
Forget about `strlen()`. |
12,088 | Which book is more a beginner to learn to program in c++ (or GML) and more fun: "Game Maker 8 Cookbook" (available for pre-order), or "The Game Maker's Companion" ? | 2011/05/09 | [
"https://gamedev.stackexchange.com/questions/12088",
"https://gamedev.stackexchange.com",
"https://gamedev.stackexchange.com/users/7193/"
] | I created a game in Game Maker long ago, and was frustrated with the lack of control over many of the game elements. They try to take the programming out of game making. So I'm afraid you won't find Game Maker to be much help if you're trying to learn C++, or really programming in general.
I would recommend going with ... | I don't think either of them look all that great, and certainly they don't appear to teach C++ at all (focusing instead entirely on Game Maker and GML, it's internal language).
"Cookbook" style books tend to be more focused around isolated, individual techniques rather than providing a unifying educational "narrative... |
12,088 | Which book is more a beginner to learn to program in c++ (or GML) and more fun: "Game Maker 8 Cookbook" (available for pre-order), or "The Game Maker's Companion" ? | 2011/05/09 | [
"https://gamedev.stackexchange.com/questions/12088",
"https://gamedev.stackexchange.com",
"https://gamedev.stackexchange.com/users/7193/"
] | I created a game in Game Maker long ago, and was frustrated with the lack of control over many of the game elements. They try to take the programming out of game making. So I'm afraid you won't find Game Maker to be much help if you're trying to learn C++, or really programming in general.
I would recommend going with ... | Both books will teach you Game Maker's drag and drop, neither will teach you C++.
Im not sure if the cookbook teaches you GML, though i know the companion does.
Both books have their own style of teaching. So on that matter, purely subjective.
The Cookbook is slightly cheaper (thought not much)
The Companion is out alr... |
9,434,956 | So my CoreData model has one entity for the time being. It has several attributes, for testing purpose I set these attributes in the applicationdidfinishlaunching method. As soon as I set an NSNumber (Integer 16 or float) attribute it gets a EXC\_BAD\_ACCESS exception.
The string attributes work and gets stored, I tes... | 2012/02/24 | [
"https://Stackoverflow.com/questions/9434956",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/871561/"
] | You are passing in an 'int' and not an NSNumber.
Try this:
```
reminderSchedule.unit = [NSNumber numberWithInt:1]; // this won't crash
```
You can also reformat your @property to NSInteger. This will allow you to pass in a straight integer. | ```
reminderSchedule.unit = [NSNumber numberWithInt:1];
```
This will save an NSObject of type: NSNumber, rather than a raw integer. |
9,434,956 | So my CoreData model has one entity for the time being. It has several attributes, for testing purpose I set these attributes in the applicationdidfinishlaunching method. As soon as I set an NSNumber (Integer 16 or float) attribute it gets a EXC\_BAD\_ACCESS exception.
The string attributes work and gets stored, I tes... | 2012/02/24 | [
"https://Stackoverflow.com/questions/9434956",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/871561/"
] | If any of them need to be doubles you can wrap them in an NSNumber object like this:
```
reminderSchedule.quantity = [NSNumber numberWithDouble:(double)]];
```
just declare the double first. | ```
reminderSchedule.unit = [NSNumber numberWithInt:1];
```
This will save an NSObject of type: NSNumber, rather than a raw integer. |
1,565,826 | High School student here. I have been trying to derive a formula for an egg shaped curve. There are plenty of examples of egg shaped curves in the internet. Apparently it is a common topic.
I noticed Mr. Itou's approach for said curve as a section made by cutting a Pseudo-sphere by means of inclined plane. ([link](htt... | 2015/12/08 | [
"https://math.stackexchange.com/questions/1565826",
"https://math.stackexchange.com",
"https://math.stackexchange.com/users/296974/"
] | You show that $x<\tan x$ when $0<x<\pi/2$ by taking the path:
$$(\cos 2x,\sin 2x),(1,\tan x),(1,0)$$
This path, aside from the endpoints, is outside the unit disk. The two segments are tangent to the circle. There is a theorem which says that therefore it has to be longer than the shortest arc on the boundary of the ... | You can also note that (for small, positive $x$) we have $$\sin(x)<x<\tan(x)$$then divide through by $\sin(x)$ and squeeze. This gives the limit of $\frac{x}{\sin x}$. |
1,565,826 | High School student here. I have been trying to derive a formula for an egg shaped curve. There are plenty of examples of egg shaped curves in the internet. Apparently it is a common topic.
I noticed Mr. Itou's approach for said curve as a section made by cutting a Pseudo-sphere by means of inclined plane. ([link](htt... | 2015/12/08 | [
"https://math.stackexchange.com/questions/1565826",
"https://math.stackexchange.com",
"https://math.stackexchange.com/users/296974/"
] | I don't see anything circular in comparing areas to get the inequality $\sin x < x < \tan x$ for $0 < x < \pi/2$. However we need to be very cautious in defining the symbols $\sin x, \tan x$ properly given $x$ a real number.
The approach based on areas goes like this. Using the concept of definite integrals it can be ... | You can also note that (for small, positive $x$) we have $$\sin(x)<x<\tan(x)$$then divide through by $\sin(x)$ and squeeze. This gives the limit of $\frac{x}{\sin x}$. |
1,565,826 | High School student here. I have been trying to derive a formula for an egg shaped curve. There are plenty of examples of egg shaped curves in the internet. Apparently it is a common topic.
I noticed Mr. Itou's approach for said curve as a section made by cutting a Pseudo-sphere by means of inclined plane. ([link](htt... | 2015/12/08 | [
"https://math.stackexchange.com/questions/1565826",
"https://math.stackexchange.com",
"https://math.stackexchange.com/users/296974/"
] | You show that $x<\tan x$ when $0<x<\pi/2$ by taking the path:
$$(\cos 2x,\sin 2x),(1,\tan x),(1,0)$$
This path, aside from the endpoints, is outside the unit disk. The two segments are tangent to the circle. There is a theorem which says that therefore it has to be longer than the shortest arc on the boundary of the ... | $\sin x$ is easy to define, but not $x$! You won't find a more elementary
rigorous definition of the $\sin$ function other that is the inverse of
the $\sin^{-1}$ function, where $\sin^{-1} y$ is defined for not too large
$y$ as the length of the arc in the circle between $(1, 0)$ and
$(\sqrt{(1-y^2)}, y)$. This is just... |
1,565,826 | High School student here. I have been trying to derive a formula for an egg shaped curve. There are plenty of examples of egg shaped curves in the internet. Apparently it is a common topic.
I noticed Mr. Itou's approach for said curve as a section made by cutting a Pseudo-sphere by means of inclined plane. ([link](htt... | 2015/12/08 | [
"https://math.stackexchange.com/questions/1565826",
"https://math.stackexchange.com",
"https://math.stackexchange.com/users/296974/"
] | I don't see anything circular in comparing areas to get the inequality $\sin x < x < \tan x$ for $0 < x < \pi/2$. However we need to be very cautious in defining the symbols $\sin x, \tan x$ properly given $x$ a real number.
The approach based on areas goes like this. Using the concept of definite integrals it can be ... | You show that $x<\tan x$ when $0<x<\pi/2$ by taking the path:
$$(\cos 2x,\sin 2x),(1,\tan x),(1,0)$$
This path, aside from the endpoints, is outside the unit disk. The two segments are tangent to the circle. There is a theorem which says that therefore it has to be longer than the shortest arc on the boundary of the ... |
1,565,826 | High School student here. I have been trying to derive a formula for an egg shaped curve. There are plenty of examples of egg shaped curves in the internet. Apparently it is a common topic.
I noticed Mr. Itou's approach for said curve as a section made by cutting a Pseudo-sphere by means of inclined plane. ([link](htt... | 2015/12/08 | [
"https://math.stackexchange.com/questions/1565826",
"https://math.stackexchange.com",
"https://math.stackexchange.com/users/296974/"
] | I don't see anything circular in comparing areas to get the inequality $\sin x < x < \tan x$ for $0 < x < \pi/2$. However we need to be very cautious in defining the symbols $\sin x, \tan x$ properly given $x$ a real number.
The approach based on areas goes like this. Using the concept of definite integrals it can be ... | $\sin x$ is easy to define, but not $x$! You won't find a more elementary
rigorous definition of the $\sin$ function other that is the inverse of
the $\sin^{-1}$ function, where $\sin^{-1} y$ is defined for not too large
$y$ as the length of the arc in the circle between $(1, 0)$ and
$(\sqrt{(1-y^2)}, y)$. This is just... |
44,562,560 | Where I can disable **"Unclosed comment"** inspection in PhpStorm?
[](https://i.stack.imgur.com/sFLY3.png)
I can't find this inspection settings
```
<script type="text/javascript">
$(function () {
/*// Typeahead
var a = $.parseJSON('<?php... | 2017/06/15 | [
"https://Stackoverflow.com/questions/44562560",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/6625548/"
] | It's a known issue.
<https://youtrack.jetbrains.com/issue/WEB-22461> -- watch this ticket (star/vote/comment) to get notified on any progress.
Possible workaround -- use single line comments instead of block comments. | I had this issue too. PHPStorm seems to have trouble with inspecting mixed HTML/PHP files.
Until they fix the issue, you can disable real-time inspections:
[Picture I took as a test](https://i.stack.imgur.com/1NRWG.png)
If this concerns you, you can always just run a manual code inspection by navigating the menus to... |
38,433,834 | Below are the xml file
```
<maindata>
<publication-reference>
<document-id document-id-type="docdb">
<country>US</country>
<doc-number>9820394ASD</doc-number>
<date>20111101</date>
</document-id>
<document-id document-id-type="docmain">
... | 2016/07/18 | [
"https://Stackoverflow.com/questions/38433834",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/2257288/"
] | Change your method `getdoc()` so that it create only a `Biblio` object for 'docmain` types.
```
private static Biblio getdoc(Node node) {
Biblio bib = null;
if (node.getNodeType() == Node.ELEMENT_NODE) {
Element element = (Element) node;
String type = element.getAttribute("document-id-type");
if(type !... | thanks for the Help, following are the code
```
String Number = xPath.compile("//publication-reference//document-id[@document-id-type=\"docmain\"]/doc-number").evaluate(xmlDocument);
``` |
38,433,834 | Below are the xml file
```
<maindata>
<publication-reference>
<document-id document-id-type="docdb">
<country>US</country>
<doc-number>9820394ASD</doc-number>
<date>20111101</date>
</document-id>
<document-id document-id-type="docmain">
... | 2016/07/18 | [
"https://Stackoverflow.com/questions/38433834",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/2257288/"
] | The value could be retrieved with [following](http://xpathfiddle.net/1J17R9) XPath using the [DOM and XPath API](https://stackoverflow.com/questions/2811001/how-to-read-xml-using-xpath-in-java).
```
DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance();
DocumentBuilder builder = factory.newDoc... | thanks for the Help, following are the code
```
String Number = xPath.compile("//publication-reference//document-id[@document-id-type=\"docmain\"]/doc-number").evaluate(xmlDocument);
``` |
29,117,951 | I have this [Website](http://avocat.dac-proiect.ro/wp/?page_id=10)
**HTML:**
```css
.lista_sus li {
display: inline-block;
position: relative;
margin: 0 9px 5px 0;
background-color: #041067;
}
.lista_sus li p {
position: absolute;
top: 0;
left: 0;
color: white;
}
.hide {
display: none;... | 2015/03/18 | [
"https://Stackoverflow.com/questions/29117951",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/4684429/"
] | Create HTML `background Image`
Or change structure for HTML code and use `float` for this. | Usually you make a div with position relative. And in it you have a img, and a text element that is absolute positioned where you wan't it. |
29,117,951 | I have this [Website](http://avocat.dac-proiect.ro/wp/?page_id=10)
**HTML:**
```css
.lista_sus li {
display: inline-block;
position: relative;
margin: 0 9px 5px 0;
background-color: #041067;
}
.lista_sus li p {
position: absolute;
top: 0;
left: 0;
color: white;
}
.hide {
display: none;... | 2015/03/18 | [
"https://Stackoverflow.com/questions/29117951",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/4684429/"
] | [Here is a working example](http://codepen.io/palashbasak/pen/NPEJax)
```css
ul {
list-style: none;
margin: 0;
padding: 0;
}
ul li {
display: block;
background-color: blue;
color: #fff;
}
ul li img {
width: 500px;
position: absolute;
z-index: 10;
}
ul li... | Usually you make a div with position relative. And in it you have a img, and a text element that is absolute positioned where you wan't it. |
29,117,951 | I have this [Website](http://avocat.dac-proiect.ro/wp/?page_id=10)
**HTML:**
```css
.lista_sus li {
display: inline-block;
position: relative;
margin: 0 9px 5px 0;
background-color: #041067;
}
.lista_sus li p {
position: absolute;
top: 0;
left: 0;
color: white;
}
.hide {
display: none;... | 2015/03/18 | [
"https://Stackoverflow.com/questions/29117951",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/4684429/"
] | Option1: Use background Image
=============================
You could set the image in the background of a div, and have text within the image:
```css
div {
display: inline-block;
height: 300px;
width: 300px;
background: url(http://placekitten.com/g/300/300);
}
```
```html
<div>This is some text</div>
`... | Usually you make a div with position relative. And in it you have a img, and a text element that is absolute positioned where you wan't it. |
29,117,951 | I have this [Website](http://avocat.dac-proiect.ro/wp/?page_id=10)
**HTML:**
```css
.lista_sus li {
display: inline-block;
position: relative;
margin: 0 9px 5px 0;
background-color: #041067;
}
.lista_sus li p {
position: absolute;
top: 0;
left: 0;
color: white;
}
.hide {
display: none;... | 2015/03/18 | [
"https://Stackoverflow.com/questions/29117951",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/4684429/"
] | ```css
.picture {
background: url("http://www.wallpaperup.com/uploads/wallpapers/2012/09/07/13037/big_thumb_97f1fdc4221e259ac57c475977627b9d.jpg") no-repeat center center fixed;
background-size: 100%;
display:inline-block;
}
```
```html
<div class="picture">TEXT HERE</div>
``` | Usually you make a div with position relative. And in it you have a img, and a text element that is absolute positioned where you wan't it. |
29,117,951 | I have this [Website](http://avocat.dac-proiect.ro/wp/?page_id=10)
**HTML:**
```css
.lista_sus li {
display: inline-block;
position: relative;
margin: 0 9px 5px 0;
background-color: #041067;
}
.lista_sus li p {
position: absolute;
top: 0;
left: 0;
color: white;
}
.hide {
display: none;... | 2015/03/18 | [
"https://Stackoverflow.com/questions/29117951",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/4684429/"
] | Create HTML `background Image`
Or change structure for HTML code and use `float` for this. | Option1: Use background Image
=============================
You could set the image in the background of a div, and have text within the image:
```css
div {
display: inline-block;
height: 300px;
width: 300px;
background: url(http://placekitten.com/g/300/300);
}
```
```html
<div>This is some text</div>
`... |
29,117,951 | I have this [Website](http://avocat.dac-proiect.ro/wp/?page_id=10)
**HTML:**
```css
.lista_sus li {
display: inline-block;
position: relative;
margin: 0 9px 5px 0;
background-color: #041067;
}
.lista_sus li p {
position: absolute;
top: 0;
left: 0;
color: white;
}
.hide {
display: none;... | 2015/03/18 | [
"https://Stackoverflow.com/questions/29117951",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/4684429/"
] | Create HTML `background Image`
Or change structure for HTML code and use `float` for this. | ```css
.picture {
background: url("http://www.wallpaperup.com/uploads/wallpapers/2012/09/07/13037/big_thumb_97f1fdc4221e259ac57c475977627b9d.jpg") no-repeat center center fixed;
background-size: 100%;
display:inline-block;
}
```
```html
<div class="picture">TEXT HERE</div>
``` |
29,117,951 | I have this [Website](http://avocat.dac-proiect.ro/wp/?page_id=10)
**HTML:**
```css
.lista_sus li {
display: inline-block;
position: relative;
margin: 0 9px 5px 0;
background-color: #041067;
}
.lista_sus li p {
position: absolute;
top: 0;
left: 0;
color: white;
}
.hide {
display: none;... | 2015/03/18 | [
"https://Stackoverflow.com/questions/29117951",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/4684429/"
] | [Here is a working example](http://codepen.io/palashbasak/pen/NPEJax)
```css
ul {
list-style: none;
margin: 0;
padding: 0;
}
ul li {
display: block;
background-color: blue;
color: #fff;
}
ul li img {
width: 500px;
position: absolute;
z-index: 10;
}
ul li... | Option1: Use background Image
=============================
You could set the image in the background of a div, and have text within the image:
```css
div {
display: inline-block;
height: 300px;
width: 300px;
background: url(http://placekitten.com/g/300/300);
}
```
```html
<div>This is some text</div>
`... |
29,117,951 | I have this [Website](http://avocat.dac-proiect.ro/wp/?page_id=10)
**HTML:**
```css
.lista_sus li {
display: inline-block;
position: relative;
margin: 0 9px 5px 0;
background-color: #041067;
}
.lista_sus li p {
position: absolute;
top: 0;
left: 0;
color: white;
}
.hide {
display: none;... | 2015/03/18 | [
"https://Stackoverflow.com/questions/29117951",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/4684429/"
] | [Here is a working example](http://codepen.io/palashbasak/pen/NPEJax)
```css
ul {
list-style: none;
margin: 0;
padding: 0;
}
ul li {
display: block;
background-color: blue;
color: #fff;
}
ul li img {
width: 500px;
position: absolute;
z-index: 10;
}
ul li... | ```css
.picture {
background: url("http://www.wallpaperup.com/uploads/wallpapers/2012/09/07/13037/big_thumb_97f1fdc4221e259ac57c475977627b9d.jpg") no-repeat center center fixed;
background-size: 100%;
display:inline-block;
}
```
```html
<div class="picture">TEXT HERE</div>
``` |
10,546,302 | How can I find all indexes of a pattern in a string using c#?
For example I want to find all `##` pattern indexes in a string like this `45##78$$#56$$JK01UU` | 2012/05/11 | [
"https://Stackoverflow.com/questions/10546302",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1269997/"
] | Edited the code to make it a cleaner function.
```
public IEnumerable<int> FindAllIndexes(string str, string pattern)
{
int prevIndex = -pattern.Length; // so we start at index 0
int index;
while((index = str.IndexOf(pattern, prevIndex + pattern.Length)) != -1)
{
prevIndex = index;
yiel... | Another one that tries to be efficient:
```
public IEnumerable<int> FindPatternIndexes(string input, string search)
{
var sb = new StringBuilder(input);
for (var i = 0; search.Length <= sb.Length; i++)
{
if (sb.ToString().StartsWith(search)) yield return i;
sb.Remove(0,1);
}
}
``` |
10,546,302 | How can I find all indexes of a pattern in a string using c#?
For example I want to find all `##` pattern indexes in a string like this `45##78$$#56$$JK01UU` | 2012/05/11 | [
"https://Stackoverflow.com/questions/10546302",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1269997/"
] | Edited the code to make it a cleaner function.
```
public IEnumerable<int> FindAllIndexes(string str, string pattern)
{
int prevIndex = -pattern.Length; // so we start at index 0
int index;
while((index = str.IndexOf(pattern, prevIndex + pattern.Length)) != -1)
{
prevIndex = index;
yiel... | Tested. Worked. But somewhat dumb.
```
string foo = "45##78$$#56$$JK01UU";
char[] fooChar = foo.ToCharArray();
int i = 0;
bool register = false;
foreach (char fc in fooChar)
{
if (fc == '#' && register == true)
{
MessageBox.Show("Index: " + (i-1));
}
else if (fc == '#')
{
register... |
10,546,302 | How can I find all indexes of a pattern in a string using c#?
For example I want to find all `##` pattern indexes in a string like this `45##78$$#56$$JK01UU` | 2012/05/11 | [
"https://Stackoverflow.com/questions/10546302",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1269997/"
] | ```
string pattern = "##";
string sentence = "45##78$$#56$$J##K01UU";
IList<int> indeces = new List<int>();
foreach (Match match in Regex.Matches(sentence, pattern))
{
indeces.Add(match.Index);
}
```
indeces will have 2, 14 | Edited the code to make it a cleaner function.
```
public IEnumerable<int> FindAllIndexes(string str, string pattern)
{
int prevIndex = -pattern.Length; // so we start at index 0
int index;
while((index = str.IndexOf(pattern, prevIndex + pattern.Length)) != -1)
{
prevIndex = index;
yiel... |
10,546,302 | How can I find all indexes of a pattern in a string using c#?
For example I want to find all `##` pattern indexes in a string like this `45##78$$#56$$JK01UU` | 2012/05/11 | [
"https://Stackoverflow.com/questions/10546302",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1269997/"
] | You can get all the indices of a pattern in a string by using a regex search like this.
```
string input = "45##78$$#56$$JK01UU", pattern = Regex.Escape("##");
Regex rx = new Regex(pattern);
var indices = new List<int>();
var matches = rx.Matches(s);
for (int i=0 ; i<matches.Length ; i++)
{
indices.Add(matches[i].... | Another one that tries to be efficient:
```
public IEnumerable<int> FindPatternIndexes(string input, string search)
{
var sb = new StringBuilder(input);
for (var i = 0; search.Length <= sb.Length; i++)
{
if (sb.ToString().StartsWith(search)) yield return i;
sb.Remove(0,1);
}
}
``` |
10,546,302 | How can I find all indexes of a pattern in a string using c#?
For example I want to find all `##` pattern indexes in a string like this `45##78$$#56$$JK01UU` | 2012/05/11 | [
"https://Stackoverflow.com/questions/10546302",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1269997/"
] | You can get all the indices of a pattern in a string by using a regex search like this.
```
string input = "45##78$$#56$$JK01UU", pattern = Regex.Escape("##");
Regex rx = new Regex(pattern);
var indices = new List<int>();
var matches = rx.Matches(s);
for (int i=0 ; i<matches.Length ; i++)
{
indices.Add(matches[i].... | Tested. Worked. But somewhat dumb.
```
string foo = "45##78$$#56$$JK01UU";
char[] fooChar = foo.ToCharArray();
int i = 0;
bool register = false;
foreach (char fc in fooChar)
{
if (fc == '#' && register == true)
{
MessageBox.Show("Index: " + (i-1));
}
else if (fc == '#')
{
register... |
10,546,302 | How can I find all indexes of a pattern in a string using c#?
For example I want to find all `##` pattern indexes in a string like this `45##78$$#56$$JK01UU` | 2012/05/11 | [
"https://Stackoverflow.com/questions/10546302",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1269997/"
] | ```
string pattern = "##";
string sentence = "45##78$$#56$$J##K01UU";
IList<int> indeces = new List<int>();
foreach (Match match in Regex.Matches(sentence, pattern))
{
indeces.Add(match.Index);
}
```
indeces will have 2, 14 | You can get all the indices of a pattern in a string by using a regex search like this.
```
string input = "45##78$$#56$$JK01UU", pattern = Regex.Escape("##");
Regex rx = new Regex(pattern);
var indices = new List<int>();
var matches = rx.Matches(s);
for (int i=0 ; i<matches.Length ; i++)
{
indices.Add(matches[i].... |
10,546,302 | How can I find all indexes of a pattern in a string using c#?
For example I want to find all `##` pattern indexes in a string like this `45##78$$#56$$JK01UU` | 2012/05/11 | [
"https://Stackoverflow.com/questions/10546302",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1269997/"
] | ```
string pattern = "##";
string sentence = "45##78$$#56$$J##K01UU";
IList<int> indeces = new List<int>();
foreach (Match match in Regex.Matches(sentence, pattern))
{
indeces.Add(match.Index);
}
```
indeces will have 2, 14 | Another one that tries to be efficient:
```
public IEnumerable<int> FindPatternIndexes(string input, string search)
{
var sb = new StringBuilder(input);
for (var i = 0; search.Length <= sb.Length; i++)
{
if (sb.ToString().StartsWith(search)) yield return i;
sb.Remove(0,1);
}
}
``` |
10,546,302 | How can I find all indexes of a pattern in a string using c#?
For example I want to find all `##` pattern indexes in a string like this `45##78$$#56$$JK01UU` | 2012/05/11 | [
"https://Stackoverflow.com/questions/10546302",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1269997/"
] | ```
string pattern = "##";
string sentence = "45##78$$#56$$J##K01UU";
IList<int> indeces = new List<int>();
foreach (Match match in Regex.Matches(sentence, pattern))
{
indeces.Add(match.Index);
}
```
indeces will have 2, 14 | Tested. Worked. But somewhat dumb.
```
string foo = "45##78$$#56$$JK01UU";
char[] fooChar = foo.ToCharArray();
int i = 0;
bool register = false;
foreach (char fc in fooChar)
{
if (fc == '#' && register == true)
{
MessageBox.Show("Index: " + (i-1));
}
else if (fc == '#')
{
register... |
13,768,049 | Is there a way to use instanceof based on the passed argument of a method? Example
```
doSomething(myClass.class); /* I would like to call this also with other classes */
public void doSomething(/*generic parameter that accepts all classes, not just myClass */) {
if (myObject instanceOf /* the generic parameter */ ... | 2012/12/07 | [
"https://Stackoverflow.com/questions/13768049",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/511477/"
] | You're looking for the [`Class.isInstance()` method](http://docs.oracle.com/javase/7/docs/api/java/lang/Class.html#isInstance(java.lang.Object)).
```
public void doSomething(Class<?> c, Object myObject) {
if (c.isInstance(myObject)) {...}
}
``` | This is the way to do it, as far as I know:
```
public static <T> boolean doInstanceOf(Object object,Class<T> clz) {
return clz.isInstance(object);
}
```
Usage:
```
System.out.println(doInstanceOf(myObject,MyClass.class));
``` |
11,047,344 | I'm trying to check network available or not.
But in my emulator it always shows `connected` (after disconnecting internet also)
Is there any mistake in my code.I am connecting with **wifi**.
*Code:*
```
public class AndroidConnectivityActivity extends Activity
{
Button checkBtn;
/** Called when the activity is f... | 2012/06/15 | [
"https://Stackoverflow.com/questions/11047344",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1453422/"
] | use below code
```
public static boolean isInternetAvailable(Context context)
{
boolean isInternetAvailable = false;
try
{
ConnectivityManager connectivityManager = (ConnectivityManager) context.getSystemService(Context.CONNECTIVITY_SERVICE);
NetworkInfo networkIn... | Use mehod shoen below
```
public static boolean isInternetAvailable(Context context) {
ConnectivityManager cm =
(ConnectivityManager) context.getSystemService(Context.CONNECTIVITY_SERVICE);
NetworkInfo netInfo = cm.getActiveNetworkInfo();
if (netInfo != null && netI... |
11,047,344 | I'm trying to check network available or not.
But in my emulator it always shows `connected` (after disconnecting internet also)
Is there any mistake in my code.I am connecting with **wifi**.
*Code:*
```
public class AndroidConnectivityActivity extends Activity
{
Button checkBtn;
/** Called when the activity is f... | 2012/06/15 | [
"https://Stackoverflow.com/questions/11047344",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1453422/"
] | use below code
```
public static boolean isInternetAvailable(Context context)
{
boolean isInternetAvailable = false;
try
{
ConnectivityManager connectivityManager = (ConnectivityManager) context.getSystemService(Context.CONNECTIVITY_SERVICE);
NetworkInfo networkIn... | use this:
```
private boolean getOnlineState() {
ConnectivityManager myConnectivityManager = (ConnectivityManager) getSystemService(Context.CONNECTIVITY_SERVICE);
NetworkInfo myNetworkInfo = myConnectivityManager
.getActiveNetworkInfo();
if (myNetworkInfo != null
... |
11,047,344 | I'm trying to check network available or not.
But in my emulator it always shows `connected` (after disconnecting internet also)
Is there any mistake in my code.I am connecting with **wifi**.
*Code:*
```
public class AndroidConnectivityActivity extends Activity
{
Button checkBtn;
/** Called when the activity is f... | 2012/06/15 | [
"https://Stackoverflow.com/questions/11047344",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1453422/"
] | Use mehod shoen below
```
public static boolean isInternetAvailable(Context context) {
ConnectivityManager cm =
(ConnectivityManager) context.getSystemService(Context.CONNECTIVITY_SERVICE);
NetworkInfo netInfo = cm.getActiveNetworkInfo();
if (netInfo != null && netI... | use this:
```
private boolean getOnlineState() {
ConnectivityManager myConnectivityManager = (ConnectivityManager) getSystemService(Context.CONNECTIVITY_SERVICE);
NetworkInfo myNetworkInfo = myConnectivityManager
.getActiveNetworkInfo();
if (myNetworkInfo != null
... |
145,015 | How to evaluate the following definite integral:
$$\int\_{-1}^1 \exp\left(\frac1{x^2-1}\right) \, dx$$
It seems that indefinite integral also cannot be expressed in standard functions. I would like any solution in popular elementary or non-elementary functions. | 2012/05/14 | [
"https://math.stackexchange.com/questions/145015",
"https://math.stackexchange.com",
"https://math.stackexchange.com/users/2513/"
] | I have the best approach:
$\int\_{-1}^1e^{\frac{1}{x^2-1}}~dx$
$=\int\_{-1}^0e^{\frac{1}{x^2-1}}~dx+\int\_0^1e^{\frac{1}{x^2-1}}~dx$
$=\int\_1^0e^{\frac{1}{(-x)^2-1}}~d(-x)+\int\_0^1e^{\frac{1}{x^2-1}}~dx$
$=\int\_0^1e^{\frac{1}{x^2-1}}~dx+\int\_0^1e^{\frac{1}{x^2-1}}~dx$
$=2\int\_0^1e^{\frac{1}{x^2-1}}~dx$
$=2\i... | The symmetry of the integrand and variable substitution $t=1/(1-x^2)-1$ can be used to transform your integral as follows:
$$
I=\int\_{-1}^1 \exp\left(\frac{1}{x^2-1}\right)dx=\int\_0^1 2\exp\left(\frac{1}{x^2-1}\right)dx
=\frac{1}{e}\int\_0^{\infty}\frac{e^{-t}dt}{\sqrt{t}(1+t)^{3/2}}\,,
$$
Maple can evaluate this int... |
145,015 | How to evaluate the following definite integral:
$$\int\_{-1}^1 \exp\left(\frac1{x^2-1}\right) \, dx$$
It seems that indefinite integral also cannot be expressed in standard functions. I would like any solution in popular elementary or non-elementary functions. | 2012/05/14 | [
"https://math.stackexchange.com/questions/145015",
"https://math.stackexchange.com",
"https://math.stackexchange.com/users/2513/"
] | I have the best approach:
$\int\_{-1}^1e^{\frac{1}{x^2-1}}~dx$
$=\int\_{-1}^0e^{\frac{1}{x^2-1}}~dx+\int\_0^1e^{\frac{1}{x^2-1}}~dx$
$=\int\_1^0e^{\frac{1}{(-x)^2-1}}~d(-x)+\int\_0^1e^{\frac{1}{x^2-1}}~dx$
$=\int\_0^1e^{\frac{1}{x^2-1}}~dx+\int\_0^1e^{\frac{1}{x^2-1}}~dx$
$=2\int\_0^1e^{\frac{1}{x^2-1}}~dx$
$=2\i... | Using the symmetry $x \to -x$ and change of variables $t = 1/\sqrt{1-x^2}$ we get
$2 \int\_1^\infty \dfrac{e^{-t^2}}{t^2 \sqrt{t^2-1}} dt$, which Maple 16 can then evaluate as
${{\rm e}^{-1/2}} \left( {{\rm K}\_1\left(1/2\right)}-
{{\rm K}\_0\left(1/2\right)} \right) $. |
8,794,937 | I know how to create bundle using console. Now I want to add second controller to generated bundle, how can I do it from console. (php app/console generate:controller doesn't work) | 2012/01/09 | [
"https://Stackoverflow.com/questions/8794937",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/783353/"
] | You can use `php app/console doctrine:generate:crud` to create forms and a CRUD (create, read, update, delete) controller based on an existing Doctrine entity (which, incidentally, you can generate with the `php app/console doctrine:generate:entity` command). | `php app/console list` shows there are no such command to generate controllers.
You may go for manual process. |
8,794,937 | I know how to create bundle using console. Now I want to add second controller to generated bundle, how can I do it from console. (php app/console generate:controller doesn't work) | 2012/01/09 | [
"https://Stackoverflow.com/questions/8794937",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/783353/"
] | Since version `2.2` you can use
```
php app/console generate:controller
```
Documentation [here](http://symfony.com/doc/current/bundles/SensioGeneratorBundle/commands/generate_controller.html). | You can use `php app/console doctrine:generate:crud` to create forms and a CRUD (create, read, update, delete) controller based on an existing Doctrine entity (which, incidentally, you can generate with the `php app/console doctrine:generate:entity` command). |
8,794,937 | I know how to create bundle using console. Now I want to add second controller to generated bundle, how can I do it from console. (php app/console generate:controller doesn't work) | 2012/01/09 | [
"https://Stackoverflow.com/questions/8794937",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/783353/"
] | Since version `2.2` you can use
```
php app/console generate:controller
```
Documentation [here](http://symfony.com/doc/current/bundles/SensioGeneratorBundle/commands/generate_controller.html). | `php app/console list` shows there are no such command to generate controllers.
You may go for manual process. |
389,953 | You often *plunge* into the sea or *plunge* you hands into your pockets.
Can the word be used to describe a "horizontal immersion"?
Example sentence:
>
> She opened the door and **plunged** into the blinding sun.
>
>
>
If not, what's a more appropriate word? | 2017/05/19 | [
"https://english.stackexchange.com/questions/389953",
"https://english.stackexchange.com",
"https://english.stackexchange.com/users/202294/"
] | It's perfectly acceptable, but you might want to consider the "literal baggage," for lack of a better word, that the figurative term carries with it.
Take the OED literal definition that this derives from:
>
> To thrust, throw, or drop into or in a liquid, penetrable substance, deep pit, container, etc.; to immerse,... | Almost all definitions of Plunging seem to imply that it's a word describing vertical descent.
[Merriam Webster](https://www.merriam-webster.com/thesaurus/plunge) thesaurus includes the following words as related:
>
> dip, immersion, submersion; fall, plump, slip, spill, stumble, tumble; descent, drop; belly flop, he... |
389,953 | You often *plunge* into the sea or *plunge* you hands into your pockets.
Can the word be used to describe a "horizontal immersion"?
Example sentence:
>
> She opened the door and **plunged** into the blinding sun.
>
>
>
If not, what's a more appropriate word? | 2017/05/19 | [
"https://english.stackexchange.com/questions/389953",
"https://english.stackexchange.com",
"https://english.stackexchange.com/users/202294/"
] | It's perfectly acceptable, but you might want to consider the "literal baggage," for lack of a better word, that the figurative term carries with it.
Take the OED literal definition that this derives from:
>
> To thrust, throw, or drop into or in a liquid, penetrable substance, deep pit, container, etc.; to immerse,... | "Plunged" is a good word to use, but "sunlight" would be much better then "sun".
Otherwise, you could say "emerged" into the sunlight.
One historical example shows both "plunged" and "emerged" would be good choices:
[Reports of Observations of the Total Eclipse of the Sun, August 7, 1869](https://books.google.com... |
389,953 | You often *plunge* into the sea or *plunge* you hands into your pockets.
Can the word be used to describe a "horizontal immersion"?
Example sentence:
>
> She opened the door and **plunged** into the blinding sun.
>
>
>
If not, what's a more appropriate word? | 2017/05/19 | [
"https://english.stackexchange.com/questions/389953",
"https://english.stackexchange.com",
"https://english.stackexchange.com/users/202294/"
] | The OED's first meaning of ***plunge*** involves transitively thrusting, throwing or dropping something (or oneself) into a liquid - from the French ***plonger*** - *to jump into water, to submerge, or sink*
However, sense 4 (intransitive) of the verb covers precisely the circumstance you relate:
>
> 4. intr. To mov... | Almost all definitions of Plunging seem to imply that it's a word describing vertical descent.
[Merriam Webster](https://www.merriam-webster.com/thesaurus/plunge) thesaurus includes the following words as related:
>
> dip, immersion, submersion; fall, plump, slip, spill, stumble, tumble; descent, drop; belly flop, he... |
389,953 | You often *plunge* into the sea or *plunge* you hands into your pockets.
Can the word be used to describe a "horizontal immersion"?
Example sentence:
>
> She opened the door and **plunged** into the blinding sun.
>
>
>
If not, what's a more appropriate word? | 2017/05/19 | [
"https://english.stackexchange.com/questions/389953",
"https://english.stackexchange.com",
"https://english.stackexchange.com/users/202294/"
] | The OED's first meaning of ***plunge*** involves transitively thrusting, throwing or dropping something (or oneself) into a liquid - from the French ***plonger*** - *to jump into water, to submerge, or sink*
However, sense 4 (intransitive) of the verb covers precisely the circumstance you relate:
>
> 4. intr. To mov... | "Plunged" is a good word to use, but "sunlight" would be much better then "sun".
Otherwise, you could say "emerged" into the sunlight.
One historical example shows both "plunged" and "emerged" would be good choices:
[Reports of Observations of the Total Eclipse of the Sun, August 7, 1869](https://books.google.com... |
59,893,690 | ```
$scope.vergleich = function () {
if ($scope.relrechtsform.indexOf(dataService.dic.alt.rechtsformKanlei || dataService.dic.neu.rechtsformKanlei ) !== -1) {
return true
} else {
return false; }
}
}
```
I am currently student and intelliJ tells me I have to simplify this... | 2020/01/24 | [
"https://Stackoverflow.com/questions/59893690",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/-1/"
] | The simplification is probably that, if `condition` is a boolean, :
```
if (condition) {
return true;
}
else {
return false;
}
```
is equivalent to
```
return condition;
```
**However** there also seems to be a logical error in your test.
```
$scope.relrechtsform.indexOf(dataService.dic.alt.rechtsformKan... | You can just use your condition instead of using `IF else` statement -:
```
$scope.vergleich = function () {
return ($scope.relrechtsform.indexOf(dataService.dic.alt.rechtsformKanlei ||
dataService.dic.neu.rechtsformKanlei ) !== -1);
};
``` |
59,893,690 | ```
$scope.vergleich = function () {
if ($scope.relrechtsform.indexOf(dataService.dic.alt.rechtsformKanlei || dataService.dic.neu.rechtsformKanlei ) !== -1) {
return true
} else {
return false; }
}
}
```
I am currently student and intelliJ tells me I have to simplify this... | 2020/01/24 | [
"https://Stackoverflow.com/questions/59893690",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/-1/"
] | The simplification is probably that, if `condition` is a boolean, :
```
if (condition) {
return true;
}
else {
return false;
}
```
is equivalent to
```
return condition;
```
**However** there also seems to be a logical error in your test.
```
$scope.relrechtsform.indexOf(dataService.dic.alt.rechtsformKan... | [Tân's version](https://stackoverflow.com/a/59893737/6320039) is a correct answer to your question. However, with recent JavaScript you can simplify even more thanks to [`array.includes`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/includes):
```js
$scope.vergleich = () =>
... |
59,893,690 | ```
$scope.vergleich = function () {
if ($scope.relrechtsform.indexOf(dataService.dic.alt.rechtsformKanlei || dataService.dic.neu.rechtsformKanlei ) !== -1) {
return true
} else {
return false; }
}
}
```
I am currently student and intelliJ tells me I have to simplify this... | 2020/01/24 | [
"https://Stackoverflow.com/questions/59893690",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/-1/"
] | Maybe you're looking for this:
```
$scope.vergleich = function () {
return $scope.relrechtsform.indexOf(dataService.dic.alt.rechtsformKanlei || dataService.dic.neu.rechtsformKanlei ) !== -1;
};
``` | You can just use your condition instead of using `IF else` statement -:
```
$scope.vergleich = function () {
return ($scope.relrechtsform.indexOf(dataService.dic.alt.rechtsformKanlei ||
dataService.dic.neu.rechtsformKanlei ) !== -1);
};
``` |
59,893,690 | ```
$scope.vergleich = function () {
if ($scope.relrechtsform.indexOf(dataService.dic.alt.rechtsformKanlei || dataService.dic.neu.rechtsformKanlei ) !== -1) {
return true
} else {
return false; }
}
}
```
I am currently student and intelliJ tells me I have to simplify this... | 2020/01/24 | [
"https://Stackoverflow.com/questions/59893690",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/-1/"
] | Maybe you're looking for this:
```
$scope.vergleich = function () {
return $scope.relrechtsform.indexOf(dataService.dic.alt.rechtsformKanlei || dataService.dic.neu.rechtsformKanlei ) !== -1;
};
``` | [Tân's version](https://stackoverflow.com/a/59893737/6320039) is a correct answer to your question. However, with recent JavaScript you can simplify even more thanks to [`array.includes`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/includes):
```js
$scope.vergleich = () =>
... |
59,893,690 | ```
$scope.vergleich = function () {
if ($scope.relrechtsform.indexOf(dataService.dic.alt.rechtsformKanlei || dataService.dic.neu.rechtsformKanlei ) !== -1) {
return true
} else {
return false; }
}
}
```
I am currently student and intelliJ tells me I have to simplify this... | 2020/01/24 | [
"https://Stackoverflow.com/questions/59893690",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/-1/"
] | [Tân's version](https://stackoverflow.com/a/59893737/6320039) is a correct answer to your question. However, with recent JavaScript you can simplify even more thanks to [`array.includes`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/includes):
```js
$scope.vergleich = () =>
... | You can just use your condition instead of using `IF else` statement -:
```
$scope.vergleich = function () {
return ($scope.relrechtsform.indexOf(dataService.dic.alt.rechtsformKanlei ||
dataService.dic.neu.rechtsformKanlei ) !== -1);
};
``` |
58,843,192 | I have two different JSON object. One object is empList and other one is holidayList.
I want to add hours from each JSON object.Andthe sum of hours should be pushed to sumHoursList JSON object.I am doing this using Angular6.
I am not getting exactly how to iterate this to get the required result.
**Basically I want to ... | 2019/11/13 | [
"https://Stackoverflow.com/questions/58843192",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/4675072/"
] | Try modifying your ingress objects rewrite-target & path as below:
```
nginx.ingress.kubernetes.io/rewrite-target: /$1
path: /(.*)
```
and make sure you checked this [documentation](https://kubernetes.github.io/ingress-nginx/examples/rewrite/#rewrite-target)
Once you tried this let me know. | If you dont want to use @kishorebjv's solution another way would be to make the change in the `nginx.conf` itself.
```
location /home/?(.*) {
try_files $1 $1/ /index.html =404;
}
``` |
299,535 | Chrome always quit when I click on the `X` button on a tab, without asking me anything!
Even when I close Chrome he do not alert me if I am willing to relay close it?
Many times it happened that accidentally I clicked on `X` button. | 2011/06/20 | [
"https://superuser.com/questions/299535",
"https://superuser.com",
"https://superuser.com/users/71640/"
] | If you accidently close all your tabs you can reload Chrome and press `CTRL` + `SHIFT` + `T`.
This will restore your previous session for all your tabs.
You could also look for a Chrome extension such as [Windows Close Protector](https://chrome.google.com/webstore/detail/lnpifgapnmpninomacbhdlconlpikdai). | You can also "restore the last session," which will include text in text boxes, if you closed the program accidentally.
* Go to your Chrome shortcut, right click, select "send to desktop (create shortcut)"
* The new shortcut will be named Google Chrome (2), rename this to Restore Last Session
* Right click and select... |
299,535 | Chrome always quit when I click on the `X` button on a tab, without asking me anything!
Even when I close Chrome he do not alert me if I am willing to relay close it?
Many times it happened that accidentally I clicked on `X` button. | 2011/06/20 | [
"https://superuser.com/questions/299535",
"https://superuser.com",
"https://superuser.com/users/71640/"
] | If you accidently close all your tabs you can reload Chrome and press `CTRL` + `SHIFT` + `T`.
This will restore your previous session for all your tabs.
You could also look for a Chrome extension such as [Windows Close Protector](https://chrome.google.com/webstore/detail/lnpifgapnmpninomacbhdlconlpikdai). | If you don't mind installing a Chrome extension...
The Chrome Toolbox extension, written by Google, has an option called "Confirm before closing multiple tabs." You can find it here:
<https://chrome.google.com/webstore/detail/fjccknnhdnkbanjilpjddjhmkghmachn>
It has a number of other interesting options also. |
299,535 | Chrome always quit when I click on the `X` button on a tab, without asking me anything!
Even when I close Chrome he do not alert me if I am willing to relay close it?
Many times it happened that accidentally I clicked on `X` button. | 2011/06/20 | [
"https://superuser.com/questions/299535",
"https://superuser.com",
"https://superuser.com/users/71640/"
] | Just to update this answer, Chrome now has a menu option for this. You can require a long press of CMD-Q so that any accidental press won't exit chrome.
On Mac click on the Chrome menu and check: "Warn Before Quitting" | You can also "restore the last session," which will include text in text boxes, if you closed the program accidentally.
* Go to your Chrome shortcut, right click, select "send to desktop (create shortcut)"
* The new shortcut will be named Google Chrome (2), rename this to Restore Last Session
* Right click and select... |
299,535 | Chrome always quit when I click on the `X` button on a tab, without asking me anything!
Even when I close Chrome he do not alert me if I am willing to relay close it?
Many times it happened that accidentally I clicked on `X` button. | 2011/06/20 | [
"https://superuser.com/questions/299535",
"https://superuser.com",
"https://superuser.com/users/71640/"
] | If you don't mind installing a Chrome extension...
The Chrome Toolbox extension, written by Google, has an option called "Confirm before closing multiple tabs." You can find it here:
<https://chrome.google.com/webstore/detail/fjccknnhdnkbanjilpjddjhmkghmachn>
It has a number of other interesting options also. | You can also "restore the last session," which will include text in text boxes, if you closed the program accidentally.
* Go to your Chrome shortcut, right click, select "send to desktop (create shortcut)"
* The new shortcut will be named Google Chrome (2), rename this to Restore Last Session
* Right click and select... |
299,535 | Chrome always quit when I click on the `X` button on a tab, without asking me anything!
Even when I close Chrome he do not alert me if I am willing to relay close it?
Many times it happened that accidentally I clicked on `X` button. | 2011/06/20 | [
"https://superuser.com/questions/299535",
"https://superuser.com",
"https://superuser.com/users/71640/"
] | Just to update this answer, Chrome now has a menu option for this. You can require a long press of CMD-Q so that any accidental press won't exit chrome.
On Mac click on the Chrome menu and check: "Warn Before Quitting" | If you don't mind installing a Chrome extension...
The Chrome Toolbox extension, written by Google, has an option called "Confirm before closing multiple tabs." You can find it here:
<https://chrome.google.com/webstore/detail/fjccknnhdnkbanjilpjddjhmkghmachn>
It has a number of other interesting options also. |
20,699,509 | This html form and the related php code works pretty well together. I need to add a word counter. Any suggestions.
```
<form action="form.php" method="POST">
<fieldset>
<input type="hidden" name='counter' value='2'/>
<p><label for="heading1"></label>
<input type="text" name="heading1" size="60" /></p>
<p>... | 2013/12/20 | [
"https://Stackoverflow.com/questions/20699509",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/2714362/"
] | Example:
```
<textarea name="input1" onkeyup="window.alert(document.getElementsByName('input1')[0].value.trim().split(' ').length);"></textarea>
``` | Use javascript, with an event on the change in the textarea(s).
Then you count the word when typing and update the counter. |
20,699,509 | This html form and the related php code works pretty well together. I need to add a word counter. Any suggestions.
```
<form action="form.php" method="POST">
<fieldset>
<input type="hidden" name='counter' value='2'/>
<p><label for="heading1"></label>
<input type="text" name="heading1" size="60" /></p>
<p>... | 2013/12/20 | [
"https://Stackoverflow.com/questions/20699509",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/2714362/"
] | Like this:
```
var output = document.getElementById("counter"),
textarea = document.getElementById("textarea");
textarea.onkeyup = function (event) {
var words = textarea.value.split(" ");
output.value = words.length;
};
```
To make it easier, add IDs to your HTML elements like this:
```
<input type="... | Use javascript, with an event on the change in the textarea(s).
Then you count the word when typing and update the counter. |
20,699,509 | This html form and the related php code works pretty well together. I need to add a word counter. Any suggestions.
```
<form action="form.php" method="POST">
<fieldset>
<input type="hidden" name='counter' value='2'/>
<p><label for="heading1"></label>
<input type="text" name="heading1" size="60" /></p>
<p>... | 2013/12/20 | [
"https://Stackoverflow.com/questions/20699509",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/2714362/"
] | Like this:
```
var output = document.getElementById("counter"),
textarea = document.getElementById("textarea");
textarea.onkeyup = function (event) {
var words = textarea.value.split(" ");
output.value = words.length;
};
```
To make it easier, add IDs to your HTML elements like this:
```
<input type="... | Example:
```
<textarea name="input1" onkeyup="window.alert(document.getElementsByName('input1')[0].value.trim().split(' ').length);"></textarea>
``` |
11,240,723 | I have an issue of alphabetically sorting the contacts picked from the address book into section headers . I can arrange them alphabetically without the section headers but how to put them according to the names of the contacts ? I do not want to use the NSDictionary as I am able to do the sorting without it. Please vi... | 2012/06/28 | [
"https://Stackoverflow.com/questions/11240723",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1479368/"
] | You can achieve this in following way -
1.Create an index array that contains all the required index -
```
NSArray *indexArray = [NSArray arrayWithObjects:@"A",@"B",@"C",@"D",@"E",@"F",@"G",@"H",@"I",@"J",@"K",@"L",@"M",@"N",@"O",@"P",@"Q",@"R",@"S",@"T",@"U",@"V",@"W",@"X",@"Y",@"Z", nil];
```
2.For Each index yo... | Try this code in table delegate methode.
```
1) - (NSInteger)numberOfSectionsInTableView:(UITableView *)tableView {
return [dataArray1 count];
}
```
**return number of section in your table view.**
```
2) -(NSMutableArray *)selectedarray:(NSString *)countrynmae
... |
17,649,574 | I am migrating some plugin from `Linux` to `Windows`.
Plugin is written using `Perl` and it has the function called `system()` that will execute the shell commands.
But I am migrating to Windows now. Any way I can run the linux command in windows using system() Per function?
Some `Perl Module` avail for this ? | 2013/07/15 | [
"https://Stackoverflow.com/questions/17649574",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/799046/"
] | You can run the `system()` command but there are caveats. A nice description is contained in [*Using system or exec safely on Windows*](http://blogs.perl.org/users/graham_knop/2011/12/using-system-or-exec-safely-on-windows.html). This article resulted in the [Win32::ShellQuote](http://p3rl.org/Win32%3a%3aShellQuote) mo... | You want to run a linux command vie Perl in a windows shell? If so, try a Linux environment like Cygwin ([www.cygwin.com](http://www.cygwin.com)). Otherwise you have to migrate your system calls as well. |
45,988 | On Windows I can use Utilu Firefox collection (there also ie collection on his site).
How can I use multiple browser versions to see how my website works in different versions of different browsers in OS X?
For example I want to install [browsers with biggest market share](https://en.wikipedia.org/wiki/Browser_market... | 2012/03/26 | [
"https://apple.stackexchange.com/questions/45988",
"https://apple.stackexchange.com",
"https://apple.stackexchange.com/users/14692/"
] | Firefox
-------
[Firefoxes](https://github.com/omgmog/install-all-firefox) is a shell scripts that will install all major versions of Firefox on OS X, and set up separate profiles so you can use them simultaneously. Currently it installs:
* Firefox 2.0.0.20
* Firefox 3.0.19
* Firefox 3.5.9
* Firefox 3.6.28
* Firefox ... | [MultiFirefox](http://davemartorana.com/multifirefox/) supports what you need, and seems to have good reviews. A drawback with it is that it doesn't support keeping multiple versions open simultaneously. |
45,988 | On Windows I can use Utilu Firefox collection (there also ie collection on his site).
How can I use multiple browser versions to see how my website works in different versions of different browsers in OS X?
For example I want to install [browsers with biggest market share](https://en.wikipedia.org/wiki/Browser_market... | 2012/03/26 | [
"https://apple.stackexchange.com/questions/45988",
"https://apple.stackexchange.com",
"https://apple.stackexchange.com/users/14692/"
] | Firefox
-------
[Firefoxes](https://github.com/omgmog/install-all-firefox) is a shell scripts that will install all major versions of Firefox on OS X, and set up separate profiles so you can use them simultaneously. Currently it installs:
* Firefox 2.0.0.20
* Firefox 3.0.19
* Firefox 3.5.9
* Firefox 3.6.28
* Firefox ... | Internet Explorer
=================
Of course there is [Internet Explorer for Mac (PPC)](https://en.wikipedia.org/wiki/Internet_Explorer_for_Mac) but it's not very useful because it's based on different rendering engine (Tasman). It will run on OSX versions with Rosetta support. It can be downloaded from [Internet Arc... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.