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 |
|---|---|---|---|---|---|
9,201,161 | I spoke about this in a previous question, but I have since narrowed down the issue to make it possible to be answered. First, some background.
I have an ASP.net website that functions normally on the local server, but when it's on the live server and accessed externally, it has some session data issues that make occa... | 2012/02/08 | [
"https://Stackoverflow.com/questions/9201161",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/812647/"
] | Sure, use `mktime` and `date`:
```
$days = 322;
$year = 2009;
echo date('Y-m-d', mktime( 0, 0, 0, 1, $days, $year));
```
**[Output:](http://codepad.viper-7.com/JSVWem)** 2009-11-18 | ```
$newformat = new DateTime::createFromFormat('Y z', "2009 322")->format('Y-M-d');
```
Relevant docs here: <http://php.net/manual/en/datetime.createfromformat.php> |
9,201,161 | I spoke about this in a previous question, but I have since narrowed down the issue to make it possible to be answered. First, some background.
I have an ASP.net website that functions normally on the local server, but when it's on the live server and accessed externally, it has some session data issues that make occa... | 2012/02/08 | [
"https://Stackoverflow.com/questions/9201161",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/812647/"
] | ```
$newformat = new DateTime::createFromFormat('Y z', "2009 322")->format('Y-M-d');
```
Relevant docs here: <http://php.net/manual/en/datetime.createfromformat.php> | The hard way ( and as a bonus, I parse the input example you gave :p ):
```
list($day, $foo, $year, $bar) = sscanf("322 days 2009 year", "%d %s %d %s");
$timestamp = mktime (0,0,0, 1, $day, $year);
echo date('Y-m-d', $timestamp);
``` |
9,201,161 | I spoke about this in a previous question, but I have since narrowed down the issue to make it possible to be answered. First, some background.
I have an ASP.net website that functions normally on the local server, but when it's on the live server and accessed externally, it has some session data issues that make occa... | 2012/02/08 | [
"https://Stackoverflow.com/questions/9201161",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/812647/"
] | ```
$newformat = new DateTime::createFromFormat('Y z', "2009 322")->format('Y-M-d');
```
Relevant docs here: <http://php.net/manual/en/datetime.createfromformat.php> | We do have [`strtotime()`](http://php.net/manual/en/function.strtotime.php) in php, which can easily pull timestamp from year:
```
echo $time = strtotime( '1.1.2009');
// 1230764400
```
And chain it with adding days:
```
echo $newTime = strtotime( '+322 days', $time);
// 1258585200
echo date( 'r', $newTime);
// Thu... |
9,201,161 | I spoke about this in a previous question, but I have since narrowed down the issue to make it possible to be answered. First, some background.
I have an ASP.net website that functions normally on the local server, but when it's on the live server and accessed externally, it has some session data issues that make occa... | 2012/02/08 | [
"https://Stackoverflow.com/questions/9201161",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/812647/"
] | Sure, use `mktime` and `date`:
```
$days = 322;
$year = 2009;
echo date('Y-m-d', mktime( 0, 0, 0, 1, $days, $year));
```
**[Output:](http://codepad.viper-7.com/JSVWem)** 2009-11-18 | Try this
[strtotime function](http://php.net/manual/en/function.strtotime.php) |
9,201,161 | I spoke about this in a previous question, but I have since narrowed down the issue to make it possible to be answered. First, some background.
I have an ASP.net website that functions normally on the local server, but when it's on the live server and accessed externally, it has some session data issues that make occa... | 2012/02/08 | [
"https://Stackoverflow.com/questions/9201161",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/812647/"
] | Sure, use `mktime` and `date`:
```
$days = 322;
$year = 2009;
echo date('Y-m-d', mktime( 0, 0, 0, 1, $days, $year));
```
**[Output:](http://codepad.viper-7.com/JSVWem)** 2009-11-18 | The hard way ( and as a bonus, I parse the input example you gave :p ):
```
list($day, $foo, $year, $bar) = sscanf("322 days 2009 year", "%d %s %d %s");
$timestamp = mktime (0,0,0, 1, $day, $year);
echo date('Y-m-d', $timestamp);
``` |
9,201,161 | I spoke about this in a previous question, but I have since narrowed down the issue to make it possible to be answered. First, some background.
I have an ASP.net website that functions normally on the local server, but when it's on the live server and accessed externally, it has some session data issues that make occa... | 2012/02/08 | [
"https://Stackoverflow.com/questions/9201161",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/812647/"
] | Sure, use `mktime` and `date`:
```
$days = 322;
$year = 2009;
echo date('Y-m-d', mktime( 0, 0, 0, 1, $days, $year));
```
**[Output:](http://codepad.viper-7.com/JSVWem)** 2009-11-18 | We do have [`strtotime()`](http://php.net/manual/en/function.strtotime.php) in php, which can easily pull timestamp from year:
```
echo $time = strtotime( '1.1.2009');
// 1230764400
```
And chain it with adding days:
```
echo $newTime = strtotime( '+322 days', $time);
// 1258585200
echo date( 'r', $newTime);
// Thu... |
1,055,574 | What is the reason to use g:textField in Grails if you're already familiar with standard HTML form tags?
If I understand correctly the following two markup alternatives are equivalent:
```
<input type="text" name="name" value="${params.name}" id="name" />
<g:textField name="name" value="${params.name}" />
```
Are t... | 2009/06/28 | [
"https://Stackoverflow.com/questions/1055574",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/58394/"
] | The textField tag is provided as a convenience (slightly shorter than writing the HTML input) and is there to provide a full set of form tags. Personally I prefer to write as much plain HTML as possible in my Grails views and only tend to use the tags that really offer a benefit such as the form tag. I have not found a... | `<g:textField />` is not shorter as plain text field tag, except id attribute will be attached automatically.
However, I recommend you to use customized tags associating the bean values with input fields. That shortens the code a lot. For more information you can read <http://www.jtict.com/blog/shorter-grails-textfiel... |
16,903,131 | This is a NSTableView with IB bindings to a NSArrayController, it displays all values correctly.
However it sorts the numbers only by their first char value e.g. it will put 115.31 below 2.5, and 23.9 below 4.71, etc.
It takes values from a retained NSMutableArray with Strings in it, I also tried by converting all ... | 2013/06/03 | [
"https://Stackoverflow.com/questions/16903131",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/2351760/"
] | I'm surprised that you aren't getting a compiler warning at:
```
NSNumber *number = strNum;
```
You probably want:
```
NSNumber *number = [NSNumber numberWithDouble:[strNum doubleValue]];
```
Or, more simply:
```
NSNumber *number = @([strNum doubleValue]);
```
---
If you don't want to deal with number convers... | Without seeing more code this is what i think:
If i understood correctly, you have your NSArrayController as data source.
You need to sort your data before attaching it to your table.
You have [NSArrayController](https://developer.apple.com/library/mac/#documentation/cocoa/reference/ApplicationKit/Classes/NSArrayCon... |
5,385,885 | I was trying to use following code with GWT 2.2.0:
```
//in my UiBinderFile
<ui:style field="myStyle" src="MyCssFile.css"/>
.
.
<g:Label ui:field="aboutMainHeader" styleName="{myStyle.decorFont}"></g:Label>
```
and also in MyCssFile.css in same directory as UiBInder xml,
```
//entire MyCssFile.css
@font-face {
... | 2011/03/22 | [
"https://Stackoverflow.com/questions/5385885",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/126382/"
] | See <http://code.google.com/p/google-web-toolkit/issues/detail?id=5247>
You'd have to put your `@font-face` declaration in an external (not-`CssResource`) stylesheet (could be inlined in you HTML host page for instance) | Because of the limitation [Thomas has noted](https://stackoverflow.com/a/5396034/9686) I've developed a small project to define font resources into GWT clientbundle's. It's still a beta but hopes you like it.
It's on <http://code.google.com/p/gwt-webfonts/> |
23,472 | Can I use a nonbasic land that taps and gives me either a red or white mana if I only have red mana in my deck? | 2015/03/19 | [
"https://boardgames.stackexchange.com/questions/23472",
"https://boardgames.stackexchange.com",
"https://boardgames.stackexchange.com/users/12155/"
] | Yes, as long as you're not playing Commander
--------------------------------------------
In normal decks, you can use whatever (format legal) cards you want in any combination. You can play a Plains in an all Red deck if you really want to, though it's probably a bad idea.
If you're playing [Commander](http://mtgsal... | Quoting from the [basic rulebook](https://media.wizards.com/images/magic/resources/rules/EN_MTGM14_PrintedRulebook_LR.pdf), page 15 ("Building Your Own Deck"):
>
> You build [your deck] using whichever **Magic** cards you want. There are two rules: your deck must have at least 60 cards, and your deck can't have more ... |
2,488,677 | File `a.hpp`:
```
class a;
typedef boost::shared_ptr<a> aPtr
class a{
public:
static aPtr CreateImp();
virtual void Foo() = 0 ;
....
};
```
File `aImp.hpp`:
```
class aImp : public a{
virtual void Foo();
};
```
File `aImp.cpp`:
```
aPtr a::CreateImp()
{
return aPtr(new aImp());
}
void aI... | 2010/03/21 | [
"https://Stackoverflow.com/questions/2488677",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/271362/"
] | This looks like a normal implementation if the [Factory Method](http://en.wikipedia.org/wiki/Factory_method) design pattern. The return of `boost::shared_ptr` just makes life of the programmer using this API easier in terms of memory management and exception safety and guards against simple mistakes like calling the fu... | Looks like good encapsulation, although I don't actually see anything preventing a from being used otherwise. (For example, private constructor and friend class aImp).
No compile unit using class a will have any knowledge of the implementation details except for aImp.cpp itself. So changes to aImp.hpp won't induce rec... |
2,488,677 | File `a.hpp`:
```
class a;
typedef boost::shared_ptr<a> aPtr
class a{
public:
static aPtr CreateImp();
virtual void Foo() = 0 ;
....
};
```
File `aImp.hpp`:
```
class aImp : public a{
virtual void Foo();
};
```
File `aImp.cpp`:
```
aPtr a::CreateImp()
{
return aPtr(new aImp());
}
void aI... | 2010/03/21 | [
"https://Stackoverflow.com/questions/2488677",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/271362/"
] | This looks like a normal implementation if the [Factory Method](http://en.wikipedia.org/wiki/Factory_method) design pattern. The return of `boost::shared_ptr` just makes life of the programmer using this API easier in terms of memory management and exception safety and guards against simple mistakes like calling the fu... | If the intention is using the PIMPL idiom, then it is not the most idiomatic way. Inheritance is the second strongest coupling relationship in C++ and should be avoided if other solutions are available (i.e. composition).
Now, there might be other requirements that force the use of dynamic allocation, and/or the use o... |
2,488,677 | File `a.hpp`:
```
class a;
typedef boost::shared_ptr<a> aPtr
class a{
public:
static aPtr CreateImp();
virtual void Foo() = 0 ;
....
};
```
File `aImp.hpp`:
```
class aImp : public a{
virtual void Foo();
};
```
File `aImp.cpp`:
```
aPtr a::CreateImp()
{
return aPtr(new aImp());
}
void aI... | 2010/03/21 | [
"https://Stackoverflow.com/questions/2488677",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/271362/"
] | If the intention is using the PIMPL idiom, then it is not the most idiomatic way. Inheritance is the second strongest coupling relationship in C++ and should be avoided if other solutions are available (i.e. composition).
Now, there might be other requirements that force the use of dynamic allocation, and/or the use o... | Looks like good encapsulation, although I don't actually see anything preventing a from being used otherwise. (For example, private constructor and friend class aImp).
No compile unit using class a will have any knowledge of the implementation details except for aImp.cpp itself. So changes to aImp.hpp won't induce rec... |
2,799,405 | I'm trying to execute a stored procedure (against SQL Server 2005 through the ODBC driver) and I recieve the following error:
>
> Procedure or Function 'GetNodeID' expects parameter '@ID', which was not supplied.
>
>
>
@ID is the OUTPUT parameter for my procedure, there is an input @machine which is specified and... | 2010/05/09 | [
"https://Stackoverflow.com/questions/2799405",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/172871/"
] | Try replacing :
```
OdbcCommand Cmd = new OdbcCommand("GetNodeID", _Connection);
Cmd.CommandType = CommandType.StoredProcedure;
```
With :
```
OdbcCommand Cmd = new OdbcCommand("{call GetNodeID(?,?)}", _Connection);
```
More info :
<http://support.microsoft.com/kb/310130> | I'm not exactly sure what you mean by
>
> there is an input @machine which is
> specified and is set to null in the
> stored procedure
>
>
>
In your proc's signature, this line:
```
@machine nvarchar(32) = null
```
doesn't mean that you're setting `@machine` to null inside the proc - it means you're assignin... |
2,799,405 | I'm trying to execute a stored procedure (against SQL Server 2005 through the ODBC driver) and I recieve the following error:
>
> Procedure or Function 'GetNodeID' expects parameter '@ID', which was not supplied.
>
>
>
@ID is the OUTPUT parameter for my procedure, there is an input @machine which is specified and... | 2010/05/09 | [
"https://Stackoverflow.com/questions/2799405",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/172871/"
] | Try replacing :
```
OdbcCommand Cmd = new OdbcCommand("GetNodeID", _Connection);
Cmd.CommandType = CommandType.StoredProcedure;
```
With :
```
OdbcCommand Cmd = new OdbcCommand("{call GetNodeID(?,?)}", _Connection);
```
More info :
<http://support.microsoft.com/kb/310130> | **Stored procedure with input parameters and ODBC Connection:**
**create a stored procedure:**
>
> create procedure proc\_name @parm1 varchar(20), @parm2 varchar(10) as begin insert into table\_name values(@parm1,@parm2);end
>
>
>
---
This code works in `SQL Server.`
```
private void button1_Click(object s... |
16,024,161 | I'm trying to use <http://github.com/TheLevelUp/ZXingObjC> to create QR codes on my Mac app.
It works for every barcode types, but returns nil on QRcode! both 'result' and 'error' is empty. here's my code:
```
NSError* error = nil;
ZXMultiFormatWriter* writer = [[ZXMultiFormatWriter alloc] init];
ZXBitMatrix* result ... | 2013/04/15 | [
"https://Stackoverflow.com/questions/16024161",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1151000/"
] | I had the same issue. Here is workaround for this.
1. Open file `ZXingObjC\qrcode\encoder\ZXEncoder.m`
2. Find this row: `int minPenalty = NSIntegerMax;`. There must be a warning on it: **Implicit conversion from 'long' to 'int' changes 9223372036854775807 to -1**. That's the reason of the problem. `NSIntegerMax` retu... | Try to use another method, not this with HINTS, use just:
`[writer encode:@"yourmeganumber" format:kBarcodeFormatQRCode width:xxxx height:xxxx error:&error];`
This works for me
Try and let me know |
68,788,047 | I am building a project just for fun and I want to turn it into an exe but it gives me the error
`PyInstaller.exceptions.ImportErrorWhenRunningHook: Failed to import module __PyInstaller_hooks_0_IPython required by hook for module c:\users\waddy\appdata\local\programs\python\python39\lib\site-packages\_pyinstaller_hoo... | 2021/08/15 | [
"https://Stackoverflow.com/questions/68788047",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/14941611/"
] | In my case this exception was caused by missing `text-unidecode` package.
It was resolved by
```
pip install text-unidecode
```
Look complete traceback of exception and see if there is any other package missing in your case. | Try to uninstall `pyinstaller` and re-install it using `pip`
And if it doesn't work for you, this may will:
<https://github.com/pyinstaller/pyinstaller/issues/2114> |
68,788,047 | I am building a project just for fun and I want to turn it into an exe but it gives me the error
`PyInstaller.exceptions.ImportErrorWhenRunningHook: Failed to import module __PyInstaller_hooks_0_IPython required by hook for module c:\users\waddy\appdata\local\programs\python\python39\lib\site-packages\_pyinstaller_hoo... | 2021/08/15 | [
"https://Stackoverflow.com/questions/68788047",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/14941611/"
] | In my case this exception was caused by missing `text-unidecode` package.
It was resolved by
```
pip install text-unidecode
```
Look complete traceback of exception and see if there is any other package missing in your case. | In my case the exception was caused by missing the numpy module. Resolved by
```
pip install numpy
``` |
55,797 | I'm trying to design a visual representation of a child's sleep schedule for a given week.
I was thinking of making a chart with the time of day on the y-axis and the days of the week on the x-axis and then blocking in the time intervals much like a calendar app would.
What are some alternate ways of representing thi... | 2014/04/15 | [
"https://ux.stackexchange.com/questions/55797",
"https://ux.stackexchange.com",
"https://ux.stackexchange.com/users/23162/"
] | I agree with [Charles](https://ux.stackexchange.com/users/19574/charles-wesley); the same chart but with the axes reversed makes more sense to me. I tend to think of time in terms of timelines, which your chart just isn't doing for me right now. I also think you want some way to indicate continuities within broken time... | Another alternative - one that gets rid of the discontinuity at midnight (or 10am) - would be a spiral visualization, with one day per circuit.
Here's a picture of a spiral visualisation from [an earlier UX answer](https://ux.stackexchange.com/a/4113/376) of mine:
textField:(UITextField *)textField shouldChangeCharactersInRange:(NSRange)range replacementString:(NSString *)string {
NSString *finalString = [textField.text stringByReplacingCharactersInRange:range withString:string];
if ( [finalString length] > 0 ) {
textField.text = string;
UI... | Try this *add notification* in ViewDidLoad,
```
[[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(limitTextField:) name:@"UITextFieldTextDidChangeNotification" object:txtField1];
- (void)limitTextField:(NSNotification *)note {
if(txtField1.tag==1)
{
if ([[txtField1 text] length... |
6,097,074 | I have 8 uitextfields that are for a password. Each textfield contains one letter from password. When I type one letter and after that when I press the 2nd key then focus moves to next textfield. But I want that, as soon as I finished typing first character, the focus should move to the next text field without pressing... | 2011/05/23 | [
"https://Stackoverflow.com/questions/6097074",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/765979/"
] | ```
- (BOOL)textField:(UITextField *)textField shouldChangeCharactersInRange:(NSRange)range replacementString:(NSString *)string {
NSString *finalString = [textField.text stringByReplacingCharactersInRange:range withString:string];
if ( [finalString length] > 0 ) {
textField.text = string;
UI... | ```
-(BOOL)textFieldShouldReturn:(UITextField *)textField {
if (textField ==firstTextField) {
[secondTextField becomeFirstResponder];
}else if ( textField == secondTextField){
[thirdTextField becomeFirstResponder];
}else if ( textField == thirdTextField){
[fourthTextField becomeFirs... |
558,583 | I am dealing with a really slow shell connection. It is in the cloud and I am very far from the server. My connection also breaks sometimes as it is over the internet and I may also be using shared Wifi or 3G. Is there a way to see what I type instantly? Trying to type commands and waiting for each character is atrocio... | 2013/12/02 | [
"https://serverfault.com/questions/558583",
"https://serverfault.com",
"https://serverfault.com/users/16322/"
] | Try [Mosh](http://mosh.mit.edu/).
>
> **Mosh (mobile shell)**
>
> Remote terminal application that allows roaming, supports intermittent connectivity, and provides intelligent local echo and line editing of user keystrokes.
>
>
> Mosh is a replacement for SSH. It's more robust and responsive, especially over Wi... | an alternative (and also in addition) to dmourati answer: use `screen` or `tmux` or other things, to keep sessions alive when you are disconnected. (You simply re-attach to the session after you reconnect, and see the terminal as you left it, even with full screen programs [vi, etc]). It also have many other benefits (... |
558,583 | I am dealing with a really slow shell connection. It is in the cloud and I am very far from the server. My connection also breaks sometimes as it is over the internet and I may also be using shared Wifi or 3G. Is there a way to see what I type instantly? Trying to type commands and waiting for each character is atrocio... | 2013/12/02 | [
"https://serverfault.com/questions/558583",
"https://serverfault.com",
"https://serverfault.com/users/16322/"
] | Try [Mosh](http://mosh.mit.edu/).
>
> **Mosh (mobile shell)**
>
> Remote terminal application that allows roaming, supports intermittent connectivity, and provides intelligent local echo and line editing of user keystrokes.
>
>
> Mosh is a replacement for SSH. It's more robust and responsive, especially over Wi... | You should see where the latency/bottleneck(s) are. You should try to get better access to infrastructure... either locally or at the provider's side. You wrap your important or critical sessions in `tmux` or `screen` multiplexers...
Please give us numbers. It takes a particularly-bad connection for simple SSH session... |
558,583 | I am dealing with a really slow shell connection. It is in the cloud and I am very far from the server. My connection also breaks sometimes as it is over the internet and I may also be using shared Wifi or 3G. Is there a way to see what I type instantly? Trying to type commands and waiting for each character is atrocio... | 2013/12/02 | [
"https://serverfault.com/questions/558583",
"https://serverfault.com",
"https://serverfault.com/users/16322/"
] | Try [Mosh](http://mosh.mit.edu/).
>
> **Mosh (mobile shell)**
>
> Remote terminal application that allows roaming, supports intermittent connectivity, and provides intelligent local echo and line editing of user keystrokes.
>
>
> Mosh is a replacement for SSH. It's more robust and responsive, especially over Wi... | For future readers of this thread, @lowellheddings' tip in his [blog](https://www.howtogeek.com/howto/linux/keep-your-linux-ssh-session-from-disconnecting/), together with the use of [screen](https://linux.die.net/man/1/screen), could help overcome this issue:
You can configure the ssh client to automatically send a ... |
558,583 | I am dealing with a really slow shell connection. It is in the cloud and I am very far from the server. My connection also breaks sometimes as it is over the internet and I may also be using shared Wifi or 3G. Is there a way to see what I type instantly? Trying to type commands and waiting for each character is atrocio... | 2013/12/02 | [
"https://serverfault.com/questions/558583",
"https://serverfault.com",
"https://serverfault.com/users/16322/"
] | an alternative (and also in addition) to dmourati answer: use `screen` or `tmux` or other things, to keep sessions alive when you are disconnected. (You simply re-attach to the session after you reconnect, and see the terminal as you left it, even with full screen programs [vi, etc]). It also have many other benefits (... | You should see where the latency/bottleneck(s) are. You should try to get better access to infrastructure... either locally or at the provider's side. You wrap your important or critical sessions in `tmux` or `screen` multiplexers...
Please give us numbers. It takes a particularly-bad connection for simple SSH session... |
558,583 | I am dealing with a really slow shell connection. It is in the cloud and I am very far from the server. My connection also breaks sometimes as it is over the internet and I may also be using shared Wifi or 3G. Is there a way to see what I type instantly? Trying to type commands and waiting for each character is atrocio... | 2013/12/02 | [
"https://serverfault.com/questions/558583",
"https://serverfault.com",
"https://serverfault.com/users/16322/"
] | an alternative (and also in addition) to dmourati answer: use `screen` or `tmux` or other things, to keep sessions alive when you are disconnected. (You simply re-attach to the session after you reconnect, and see the terminal as you left it, even with full screen programs [vi, etc]). It also have many other benefits (... | For future readers of this thread, @lowellheddings' tip in his [blog](https://www.howtogeek.com/howto/linux/keep-your-linux-ssh-session-from-disconnecting/), together with the use of [screen](https://linux.die.net/man/1/screen), could help overcome this issue:
You can configure the ssh client to automatically send a ... |
1,898,804 | I have added HTML to my page using the .after() method using HTML that is retrieved from a .GET() 'Ajax' call.
I have a button in my retrieved HTML and an event that is set to be triggered when this button is clicked. However the method that handles the .click event is never triggered. When I put the same button into ... | 2009/12/14 | [
"https://Stackoverflow.com/questions/1898804",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/69803/"
] | Use [.live('click', fn)](http://docs.jquery.com/Events/live) instead of .click(fn) to wire up your event handler. A regular .click(fn) wireup in $(document).ready() will only affect elements in the DOM during the initial page load. | Sounds like you need to check out the .live() function.
<http://docs.jquery.com/Events/live> |
1,898,804 | I have added HTML to my page using the .after() method using HTML that is retrieved from a .GET() 'Ajax' call.
I have a button in my retrieved HTML and an event that is set to be triggered when this button is clicked. However the method that handles the .click event is never triggered. When I put the same button into ... | 2009/12/14 | [
"https://Stackoverflow.com/questions/1898804",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/69803/"
] | Sounds like you need to check out the .live() function.
<http://docs.jquery.com/Events/live> | Try `$("#btn").live("click", function(){...})` instead of `$("#btn").click(function(){...})` |
1,898,804 | I have added HTML to my page using the .after() method using HTML that is retrieved from a .GET() 'Ajax' call.
I have a button in my retrieved HTML and an event that is set to be triggered when this button is clicked. However the method that handles the .click event is never triggered. When I put the same button into ... | 2009/12/14 | [
"https://Stackoverflow.com/questions/1898804",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/69803/"
] | Sounds like you need to check out the .live() function.
<http://docs.jquery.com/Events/live> | If you have `<script>` tags contained in your data that you retrieve with `.get()` they will not be executed when added to the page with `.after()`.
You can either attach the code after the fact:
```
$.get('/url', {key:value}, function(data){
$("#wrapper").after(data);
$("#new_id a").click(function(){ ... }... |
1,898,804 | I have added HTML to my page using the .after() method using HTML that is retrieved from a .GET() 'Ajax' call.
I have a button in my retrieved HTML and an event that is set to be triggered when this button is clicked. However the method that handles the .click event is never triggered. When I put the same button into ... | 2009/12/14 | [
"https://Stackoverflow.com/questions/1898804",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/69803/"
] | Use [.live('click', fn)](http://docs.jquery.com/Events/live) instead of .click(fn) to wire up your event handler. A regular .click(fn) wireup in $(document).ready() will only affect elements in the DOM during the initial page load. | Try `$("#btn").live("click", function(){...})` instead of `$("#btn").click(function(){...})` |
1,898,804 | I have added HTML to my page using the .after() method using HTML that is retrieved from a .GET() 'Ajax' call.
I have a button in my retrieved HTML and an event that is set to be triggered when this button is clicked. However the method that handles the .click event is never triggered. When I put the same button into ... | 2009/12/14 | [
"https://Stackoverflow.com/questions/1898804",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/69803/"
] | Use [.live('click', fn)](http://docs.jquery.com/Events/live) instead of .click(fn) to wire up your event handler. A regular .click(fn) wireup in $(document).ready() will only affect elements in the DOM during the initial page load. | If you have `<script>` tags contained in your data that you retrieve with `.get()` they will not be executed when added to the page with `.after()`.
You can either attach the code after the fact:
```
$.get('/url', {key:value}, function(data){
$("#wrapper").after(data);
$("#new_id a").click(function(){ ... }... |
283,663 | I have a VPS and a domain name registered with the provider.
When I enter www.example.com my site is displayed correctly, but entering example.com does not work. I am able to ping www.example.com.
I added the following line to my apache2 default vhosts file:
```
ServerName example.com
ServerAlias www.example.com
``... | 2011/06/23 | [
"https://serverfault.com/questions/283663",
"https://serverfault.com",
"https://serverfault.com/users/85543/"
] | To get DNS resolution to work, you need to have an A record for 'example.com', not just 'www.example.com'. Once that's there, what you've done so far will probably work. This sounds like an DNS issue so far. | To answer the second part of your question. The answer you link to is indeed a good example of doing the redirect. The first RewriteCond may not be required if you're not using SSL, but it should not do any harm. |
22,769,480 | I'm trying to bubble sort string data that was input into an array in descending and ascending order.
The following is the code so far:
```
import java.util.*;
public class nextLineArray
{
public static void main(String[] args)
{
Scanner input = new Scanner(System.in);
String names[]=new Stri... | 2014/03/31 | [
"https://Stackoverflow.com/questions/22769480",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/3385542/"
] | Take a look at the method
```
public static String bubbleSortDesc(String[] names)
```
The return of that method is supposed to be a String (only one), but you are returning the parameter "names", which is an array of strings. The "[]" after the String identifies it as an array.
I am not going to do your homework fo... | public static String bubbleSortDesc(String[] names)
should be
public static String[] bubbleSortDesc(String[] names)
and also declare descSort as String array.
Also you are just printing the array objects. This will not print the list for you. You have iterate over the array.
Include this in you code:
```
for (Str... |
22,769,480 | I'm trying to bubble sort string data that was input into an array in descending and ascending order.
The following is the code so far:
```
import java.util.*;
public class nextLineArray
{
public static void main(String[] args)
{
Scanner input = new Scanner(System.in);
String names[]=new Stri... | 2014/03/31 | [
"https://Stackoverflow.com/questions/22769480",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/3385542/"
] | Take a look at the method
```
public static String bubbleSortDesc(String[] names)
```
The return of that method is supposed to be a String (only one), but you are returning the parameter "names", which is an array of strings. The "[]" after the String identifies it as an array.
I am not going to do your homework fo... | There are 2 points to fix. First you should return String array
```
public static String[] bubbleSortDesc(String[] names)
```
and therefore you should define it like this:
```
String descSort[];
``` |
22,769,480 | I'm trying to bubble sort string data that was input into an array in descending and ascending order.
The following is the code so far:
```
import java.util.*;
public class nextLineArray
{
public static void main(String[] args)
{
Scanner input = new Scanner(System.in);
String names[]=new Stri... | 2014/03/31 | [
"https://Stackoverflow.com/questions/22769480",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/3385542/"
] | Take a look at the method
```
public static String bubbleSortDesc(String[] names)
```
The return of that method is supposed to be a String (only one), but you are returning the parameter "names", which is an array of strings. The "[]" after the String identifies it as an array.
I am not going to do your homework fo... | You can fix your print command by changing it to the following:
```
System.out.println("Names listed sorted in descending order (via BubbleSort): "+ java.util.Arrays.deepToString(descSort));
```
If you want the nitty gritty, descSort is a String[]. In Java when you convert String[] into a String it gives you that cr... |
56,875 | Say you are working in an office where English is not a native language for people but some English terms are used very often (e.g. an IT department). And your boss always pronounces English terms incorrectly.
The question. Is it appropriate to pronounce the terms correctly when speaking to the boss or one should use ... | 2015/10/31 | [
"https://workplace.stackexchange.com/questions/56875",
"https://workplace.stackexchange.com",
"https://workplace.stackexchange.com/users/5415/"
] | First and foremost, **you don't need to correct every mistake**. Focusing on his pronunciation is likely causing you to miss some of the message he is trying to communicate to you.
If your manager interacts with other English-speaking professionals, you would be doing him a favor by helping him learn to pronounce thi... | It's less important how he pronounces it then it is that you understand him. Lots of people have lots of different accents. There is no reason I can think of for a person to mispronounce on purpose.
So I would just pronounce the word/s correctly as I know them. I live in a country where my accent is very different, ov... |
56,875 | Say you are working in an office where English is not a native language for people but some English terms are used very often (e.g. an IT department). And your boss always pronounces English terms incorrectly.
The question. Is it appropriate to pronounce the terms correctly when speaking to the boss or one should use ... | 2015/10/31 | [
"https://workplace.stackexchange.com/questions/56875",
"https://workplace.stackexchange.com",
"https://workplace.stackexchange.com/users/5415/"
] | As long as you are not gratuitously using the words, you should always aim at correct pronunciation. Knowingly imitating an incorrect pronunciation is dishonorable and groveling behavior. Correct behavior is to pronounce words correctly and ignore other people who may be pronouncing the word incorrectly.
The only thin... | First and foremost, **you don't need to correct every mistake**. Focusing on his pronunciation is likely causing you to miss some of the message he is trying to communicate to you.
If your manager interacts with other English-speaking professionals, you would be doing him a favor by helping him learn to pronounce thi... |
56,875 | Say you are working in an office where English is not a native language for people but some English terms are used very often (e.g. an IT department). And your boss always pronounces English terms incorrectly.
The question. Is it appropriate to pronounce the terms correctly when speaking to the boss or one should use ... | 2015/10/31 | [
"https://workplace.stackexchange.com/questions/56875",
"https://workplace.stackexchange.com",
"https://workplace.stackexchange.com/users/5415/"
] | First and foremost, **you don't need to correct every mistake**. Focusing on his pronunciation is likely causing you to miss some of the message he is trying to communicate to you.
If your manager interacts with other English-speaking professionals, you would be doing him a favor by helping him learn to pronounce thi... | This answer becomes trivial if you stop thinking of him pronouncing it **wrongly** and instead that he is pronouncing it **in his accent** which doesn't have to be the same as yours.
I have Australian friends who say "dahta" and "dahtabayse" while I say "dayta" and "daytabase". I don't adjust my pronunciation to match... |
56,875 | Say you are working in an office where English is not a native language for people but some English terms are used very often (e.g. an IT department). And your boss always pronounces English terms incorrectly.
The question. Is it appropriate to pronounce the terms correctly when speaking to the boss or one should use ... | 2015/10/31 | [
"https://workplace.stackexchange.com/questions/56875",
"https://workplace.stackexchange.com",
"https://workplace.stackexchange.com/users/5415/"
] | First and foremost, **you don't need to correct every mistake**. Focusing on his pronunciation is likely causing you to miss some of the message he is trying to communicate to you.
If your manager interacts with other English-speaking professionals, you would be doing him a favor by helping him learn to pronounce thi... | I'm going to answer this question as the person who mispronounces words. I'm a native English speaker but have started picking up French late in life. I can follow a conversation and speak short sentences. I slaughter the pronunciation of words; a native or fluent speaker can understand me though.
I personally prefer ... |
56,875 | Say you are working in an office where English is not a native language for people but some English terms are used very often (e.g. an IT department). And your boss always pronounces English terms incorrectly.
The question. Is it appropriate to pronounce the terms correctly when speaking to the boss or one should use ... | 2015/10/31 | [
"https://workplace.stackexchange.com/questions/56875",
"https://workplace.stackexchange.com",
"https://workplace.stackexchange.com/users/5415/"
] | As long as you are not gratuitously using the words, you should always aim at correct pronunciation. Knowingly imitating an incorrect pronunciation is dishonorable and groveling behavior. Correct behavior is to pronounce words correctly and ignore other people who may be pronouncing the word incorrectly.
The only thin... | It's less important how he pronounces it then it is that you understand him. Lots of people have lots of different accents. There is no reason I can think of for a person to mispronounce on purpose.
So I would just pronounce the word/s correctly as I know them. I live in a country where my accent is very different, ov... |
56,875 | Say you are working in an office where English is not a native language for people but some English terms are used very often (e.g. an IT department). And your boss always pronounces English terms incorrectly.
The question. Is it appropriate to pronounce the terms correctly when speaking to the boss or one should use ... | 2015/10/31 | [
"https://workplace.stackexchange.com/questions/56875",
"https://workplace.stackexchange.com",
"https://workplace.stackexchange.com/users/5415/"
] | It's less important how he pronounces it then it is that you understand him. Lots of people have lots of different accents. There is no reason I can think of for a person to mispronounce on purpose.
So I would just pronounce the word/s correctly as I know them. I live in a country where my accent is very different, ov... | I'm going to answer this question as the person who mispronounces words. I'm a native English speaker but have started picking up French late in life. I can follow a conversation and speak short sentences. I slaughter the pronunciation of words; a native or fluent speaker can understand me though.
I personally prefer ... |
56,875 | Say you are working in an office where English is not a native language for people but some English terms are used very often (e.g. an IT department). And your boss always pronounces English terms incorrectly.
The question. Is it appropriate to pronounce the terms correctly when speaking to the boss or one should use ... | 2015/10/31 | [
"https://workplace.stackexchange.com/questions/56875",
"https://workplace.stackexchange.com",
"https://workplace.stackexchange.com/users/5415/"
] | As long as you are not gratuitously using the words, you should always aim at correct pronunciation. Knowingly imitating an incorrect pronunciation is dishonorable and groveling behavior. Correct behavior is to pronounce words correctly and ignore other people who may be pronouncing the word incorrectly.
The only thin... | This answer becomes trivial if you stop thinking of him pronouncing it **wrongly** and instead that he is pronouncing it **in his accent** which doesn't have to be the same as yours.
I have Australian friends who say "dahta" and "dahtabayse" while I say "dayta" and "daytabase". I don't adjust my pronunciation to match... |
56,875 | Say you are working in an office where English is not a native language for people but some English terms are used very often (e.g. an IT department). And your boss always pronounces English terms incorrectly.
The question. Is it appropriate to pronounce the terms correctly when speaking to the boss or one should use ... | 2015/10/31 | [
"https://workplace.stackexchange.com/questions/56875",
"https://workplace.stackexchange.com",
"https://workplace.stackexchange.com/users/5415/"
] | As long as you are not gratuitously using the words, you should always aim at correct pronunciation. Knowingly imitating an incorrect pronunciation is dishonorable and groveling behavior. Correct behavior is to pronounce words correctly and ignore other people who may be pronouncing the word incorrectly.
The only thin... | I'm going to answer this question as the person who mispronounces words. I'm a native English speaker but have started picking up French late in life. I can follow a conversation and speak short sentences. I slaughter the pronunciation of words; a native or fluent speaker can understand me though.
I personally prefer ... |
56,875 | Say you are working in an office where English is not a native language for people but some English terms are used very often (e.g. an IT department). And your boss always pronounces English terms incorrectly.
The question. Is it appropriate to pronounce the terms correctly when speaking to the boss or one should use ... | 2015/10/31 | [
"https://workplace.stackexchange.com/questions/56875",
"https://workplace.stackexchange.com",
"https://workplace.stackexchange.com/users/5415/"
] | This answer becomes trivial if you stop thinking of him pronouncing it **wrongly** and instead that he is pronouncing it **in his accent** which doesn't have to be the same as yours.
I have Australian friends who say "dahta" and "dahtabayse" while I say "dayta" and "daytabase". I don't adjust my pronunciation to match... | I'm going to answer this question as the person who mispronounces words. I'm a native English speaker but have started picking up French late in life. I can follow a conversation and speak short sentences. I slaughter the pronunciation of words; a native or fluent speaker can understand me though.
I personally prefer ... |
16,926,578 | I'm trying to create a chat for a site and I'm wondering if the db solution is the best one in case of a large amount of users.
In case the db is an acceptable solution I would like to know which is the best way to design it:
1. Is one table enough to store all the messages from all the users? Do I have to store each... | 2013/06/04 | [
"https://Stackoverflow.com/questions/16926578",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/2453201/"
] | MySQL is not ment for realtime
------------------------------
MySQL is clearly not the best solution for a chat: You have no reason to work on years of backlog to get the most current messages, nor do you want to fire a query per second for every active user. The overhead of a relational database is not to be ignored.... | use NOSQL as it store data as a file it is good for large database |
16,926,578 | I'm trying to create a chat for a site and I'm wondering if the db solution is the best one in case of a large amount of users.
In case the db is an acceptable solution I would like to know which is the best way to design it:
1. Is one table enough to store all the messages from all the users? Do I have to store each... | 2013/06/04 | [
"https://Stackoverflow.com/questions/16926578",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/2453201/"
] | MySQL is not ment for realtime
------------------------------
MySQL is clearly not the best solution for a chat: You have no reason to work on years of backlog to get the most current messages, nor do you want to fire a query per second for every active user. The overhead of a relational database is not to be ignored.... | Determine what features you want. A few I can think of right off that might make a difference:
* Do you want to store the stream at all? (If not, then your DB needs are minimal.)
* How much of the stream do you want accessible to users? One day? A week? All of it? (You can offload messages periodically to maintain his... |
4,467 | We often hear that in practice, not enough data of sufficient quality, consistency, recency, etc. is available for feeding into mathematical optimization models. Example: my university wanted to plan/optimize their weekly timetable using an integer program, but they did not know the number of rooms (let alone capacitie... | 2020/06/30 | [
"https://or.stackexchange.com/questions/4467",
"https://or.stackexchange.com",
"https://or.stackexchange.com/users/354/"
] | I would call them decision-relevant data, because most optimization problems in practice help people do decisions better, which they already do in a heuristic fashion. This puts the focus on the decision and what is needed to effectively make this decision.
Alternatives would be system-describing data/system-boundary ... | I think, answers provided so far are great. When talking to professionals in the field, I second Nikos and call them "parameters" and cross my fingers they know the difference between a parameter and a variable (which is a bleeding wound between the OR profession in Industrial Engineering and OR profession in Business ... |
4,467 | We often hear that in practice, not enough data of sufficient quality, consistency, recency, etc. is available for feeding into mathematical optimization models. Example: my university wanted to plan/optimize their weekly timetable using an integer program, but they did not know the number of rooms (let alone capacitie... | 2020/06/30 | [
"https://or.stackexchange.com/questions/4467",
"https://or.stackexchange.com",
"https://or.stackexchange.com/users/354/"
] | I would just call it "planning data". I think it might be easier to convince an administrator that "planning data" needs to be recorded/captured than to sell them on "<insert techno-jargon phrase here> data". Administrators grasp what planning is (whether or not they are adept at doing it), and at some visceral level t... | I think, answers provided so far are great. When talking to professionals in the field, I second Nikos and call them "parameters" and cross my fingers they know the difference between a parameter and a variable (which is a bleeding wound between the OR profession in Industrial Engineering and OR profession in Business ... |
4,467 | We often hear that in practice, not enough data of sufficient quality, consistency, recency, etc. is available for feeding into mathematical optimization models. Example: my university wanted to plan/optimize their weekly timetable using an integer program, but they did not know the number of rooms (let alone capacitie... | 2020/06/30 | [
"https://or.stackexchange.com/questions/4467",
"https://or.stackexchange.com",
"https://or.stackexchange.com/users/354/"
] | Adhering to the rules of encapsulation, I would simply call it "parameters". If we're thinking of an optimisation model and, as you said, what changes is the number of things (number of students, number of classrooms, a table with the teachers' schedule, etc.), that's what we call usually parameters in optimisation mod... | I think, answers provided so far are great. When talking to professionals in the field, I second Nikos and call them "parameters" and cross my fingers they know the difference between a parameter and a variable (which is a bleeding wound between the OR profession in Industrial Engineering and OR profession in Business ... |
20,438,072 | I want to takeout the keyboard when the user clicks on the background or any other item on the view.
I found out that the following code will take it off. But where should i add it.
```
[self.view endEditing:YES];
```
All my UI components are created programatically. | 2013/12/07 | [
"https://Stackoverflow.com/questions/20438072",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1377826/"
] | It's super simple, you only need to implement this code in your .m file:
```
-(void)touchesBegan:(NSSet *)touches withEvent:(UIEvent *)event
{
[self.view endEditing:YES];
}
```
This will do. | Use below code
```
UITapGestureRecognizer *recognizer;
recognizer = [[UITapGestureRecognizer alloc] initWithTarget:self action:nil];
recognizer.numberOfTouchesRequired=1;
[self.view addGestureRecognizer:recognizer];
recognizer.delegate = self;
- (BOOL)gestureRecognizerShouldBegin:(UIGestureRecognizer *)gestureRecogn... |
61,077,570 | I have a github account with say a username 'abc'. If I create a repository in it and clone it on my system as
`git clone https://github.com/abc/demo.git` it gets cloned.
If I login into my another github account with username say 'xyz' and create a repository in it and if I try to clone the repository on my same sys... | 2020/04/07 | [
"https://Stackoverflow.com/questions/61077570",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/3588025/"
] | `/xyz/` in the url is not enough to tell which user is cloning. you need to be explicit about it: `xyz@`:
```
$ git clone https://xyz@github.com/xyz/demo.git
``` | There are solutions using ssh.
I faced the same problem and the only solution I found is:
1. to generate an access token with the right 'repo'
2. Use it in the clone url
`git clone https://the_access_token@github.com/xyz/demo.git` |
6,276,346 | I want to print the array index for some purpose. Can anybody tell me about this ? | 2011/06/08 | [
"https://Stackoverflow.com/questions/6276346",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/762267/"
] | Get the first index of an elemnt:
```
$array = array(0 => 'blue', 1 => 'red', 2 => 'green', 3 => 'red');
$key = array_search('green', $array); // $key = 2;
echo $key;
```
For all elemnts
```
foreach($array as $key => $value){
echo "{$key} => {$value}\n";
}
```
will output
```
0 => blue
1 => red
2 => green
3 ... | not sure what you mean with this question but you could try
```
echo "<pre>";
print_r ($arr);
echo "</pre>";
```
that way you'll see your entire array including all the indexes |
6,276,346 | I want to print the array index for some purpose. Can anybody tell me about this ? | 2011/06/08 | [
"https://Stackoverflow.com/questions/6276346",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/762267/"
] | Get the first index of an elemnt:
```
$array = array(0 => 'blue', 1 => 'red', 2 => 'green', 3 => 'red');
$key = array_search('green', $array); // $key = 2;
echo $key;
```
For all elemnts
```
foreach($array as $key => $value){
echo "{$key} => {$value}\n";
}
```
will output
```
0 => blue
1 => red
2 => green
3 ... | if you mean the keys of the array:
```
$array = array(0 => 100, "color" => "red");
print_r(array_keys($array));
//result
Array
(
[0] => 0
[1] => color
)
```
This will provide an array of the keys |
23,411,896 | I would like to put an arrow image (png) centered under my active item menu instead of having my actual blue border-line. I tried to modified my css with no luck, the image doesn't appear. do you know what I doing wrong ?
**My CSS** :
```
#cssmenu ul {
margin: 0;
padding: 0;
font-size: 12pt;
font-... | 2014/05/01 | [
"https://Stackoverflow.com/questions/23411896",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/979974/"
] | The first thing I can see is this line
```
#cssmenu li.active a {
content: url("images/arrowmenunav.png");
}
```
Should be this:
```
#cssmenu li.active a:after {
content: url("images/arrowmenunav.png");
}
```
**I've setup this jsfiddle to show it in a bit more detail** <http://jsfiddle.net/e3WEs/2/>
In t... | Another option if you don't want to use :after. :after is pretty much not supported by old browsers if that concerns you.
<http://jsfiddle.net/f3SQx/>
Mark-up
```
<li><a href="#home">home</a>
<div class="active"></div>
</li>
```
CSS
```
.active {
position:absolute;
width:30px;
height:30px;
top:100%;
margin-l... |
23,411,896 | I would like to put an arrow image (png) centered under my active item menu instead of having my actual blue border-line. I tried to modified my css with no luck, the image doesn't appear. do you know what I doing wrong ?
**My CSS** :
```
#cssmenu ul {
margin: 0;
padding: 0;
font-size: 12pt;
font-... | 2014/05/01 | [
"https://Stackoverflow.com/questions/23411896",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/979974/"
] | The first thing I can see is this line
```
#cssmenu li.active a {
content: url("images/arrowmenunav.png");
}
```
Should be this:
```
#cssmenu li.active a:after {
content: url("images/arrowmenunav.png");
}
```
**I've setup this jsfiddle to show it in a bit more detail** <http://jsfiddle.net/e3WEs/2/>
In t... | >
> Please add **z-index** values to **`#cssmenu li a`**
>
>
> hope this helped you
>
>
> |
38,613,452 | I need to pass both FormData and JSON object in an ajax call, but I get a 400 Bad Request error.
```
[artifact:mvn] org.springframework.web.servlet.mvc.support.DefaultHandlerExceptionResolver - Failed to read HTTP message: org.springframework.http.converter.HttpMessageNotReadableException: Could not read document: Un... | 2016/07/27 | [
"https://Stackoverflow.com/questions/38613452",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1793718/"
] | Java 6 usage is precisely what causes the issue. It seems that one of the required libraries supports Java 7/8 at minimum - there's no workaround, you might have to migrate to a newer Java version. | The error is caused by a dependency which has been compiled with Java 7, so it can't work with Java 6.
Having said that, reading from [Spring Boot's documentation](http://docs.spring.io/spring-boot/docs/current/reference/htmlsingle/#getting-started-system-requirements) about system requirements, it seems that Java 6 i... |
38,613,452 | I need to pass both FormData and JSON object in an ajax call, but I get a 400 Bad Request error.
```
[artifact:mvn] org.springframework.web.servlet.mvc.support.DefaultHandlerExceptionResolver - Failed to read HTTP message: org.springframework.http.converter.HttpMessageNotReadableException: Could not read document: Un... | 2016/07/27 | [
"https://Stackoverflow.com/questions/38613452",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1793718/"
] | Java 6 usage is precisely what causes the issue. It seems that one of the required libraries supports Java 7/8 at minimum - there's no workaround, you might have to migrate to a newer Java version. | The dependency management plugin that Spring Boot's Gradle plugin uses requires Java 7. This means that you'll have to build your application with Java 7 (or later), but you'll still be able to run it using Java 6. |
38,613,452 | I need to pass both FormData and JSON object in an ajax call, but I get a 400 Bad Request error.
```
[artifact:mvn] org.springframework.web.servlet.mvc.support.DefaultHandlerExceptionResolver - Failed to read HTTP message: org.springframework.http.converter.HttpMessageNotReadableException: Could not read document: Un... | 2016/07/27 | [
"https://Stackoverflow.com/questions/38613452",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1793718/"
] | The error is caused by a dependency which has been compiled with Java 7, so it can't work with Java 6.
Having said that, reading from [Spring Boot's documentation](http://docs.spring.io/spring-boot/docs/current/reference/htmlsingle/#getting-started-system-requirements) about system requirements, it seems that Java 6 i... | The dependency management plugin that Spring Boot's Gradle plugin uses requires Java 7. This means that you'll have to build your application with Java 7 (or later), but you'll still be able to run it using Java 6. |
8,756 | I am having problems in accessing the address of a new contract generated within another contract acting as Factory.
My code:
```
contract Object {
string name;
function Object(String _name) {
name = _name
}
}
contract ObjectFactory {
function createObject(string name) returns (address objec... | 2016/09/20 | [
"https://ethereum.stackexchange.com/questions/8756",
"https://ethereum.stackexchange.com",
"https://ethereum.stackexchange.com/users/4366/"
] | Super high-level answer: all nodes, on the road from the changed node to the root, change. | Actually, the merkle tree in ethereum `reorg` the tree while `update` method called. And the subcall of `update` method is `insert` function.
That's to say, when we want to update a tree node's value, a new node will be created and insert to the `appropriate` position with specific key and the old node will be reserve... |
34,484,845 | I have a spinning gear on my website displayed with this code:
```html
<link rel="stylesheet"
href="https://maxcdn.bootstrapcdn.com/font-awesome/4.5.0/css/font-awesome.min.css"/>
<i class = "fa fa-cog fa-5x fa-spin"></i>
```
Personally, I think that the speed of the gear is too fast. Can I modify it with CSS? | 2015/12/27 | [
"https://Stackoverflow.com/questions/34484845",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/5661019/"
] | Short answer
------------
Yes, you can. Replace the `.fa-spin` class on the icon with a new class using your own animation rule:
```css
.slow-spin {
-webkit-animation: fa-spin 6s infinite linear;
animation: fa-spin 6s infinite linear;
}
```
```html
<link rel="stylesheet"
href="https://maxcdn.bootstrapcdn.co... | Similar to the Michael Laszlo's answer. This is what I use to make it faster for fa-refresh as the fa-spin by default is very slow.
```
.fa-spin {
-webkit-animation: fa-spin 0.75s infinite linear !important;
animation: fa-spin 0.75s infinite linear !important;
}
```
I use !important so that I control the specifici... |
34,484,845 | I have a spinning gear on my website displayed with this code:
```html
<link rel="stylesheet"
href="https://maxcdn.bootstrapcdn.com/font-awesome/4.5.0/css/font-awesome.min.css"/>
<i class = "fa fa-cog fa-5x fa-spin"></i>
```
Personally, I think that the speed of the gear is too fast. Can I modify it with CSS? | 2015/12/27 | [
"https://Stackoverflow.com/questions/34484845",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/5661019/"
] | Short answer
------------
Yes, you can. Replace the `.fa-spin` class on the icon with a new class using your own animation rule:
```css
.slow-spin {
-webkit-animation: fa-spin 6s infinite linear;
animation: fa-spin 6s infinite linear;
}
```
```html
<link rel="stylesheet"
href="https://maxcdn.bootstrapcdn.co... | Not necessary to use an own animation or class definition. The speed of any css animation can control by the [animation-duration](https://developer.mozilla.org/en-US/docs/Web/CSS/animation-duration) css property. Simply use:
```
.fa-spin {
animation-duration: 3s; // or something else
}
```
As higher the value the ... |
34,484,845 | I have a spinning gear on my website displayed with this code:
```html
<link rel="stylesheet"
href="https://maxcdn.bootstrapcdn.com/font-awesome/4.5.0/css/font-awesome.min.css"/>
<i class = "fa fa-cog fa-5x fa-spin"></i>
```
Personally, I think that the speed of the gear is too fast. Can I modify it with CSS? | 2015/12/27 | [
"https://Stackoverflow.com/questions/34484845",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/5661019/"
] | Not necessary to use an own animation or class definition. The speed of any css animation can control by the [animation-duration](https://developer.mozilla.org/en-US/docs/Web/CSS/animation-duration) css property. Simply use:
```
.fa-spin {
animation-duration: 3s; // or something else
}
```
As higher the value the ... | Similar to the Michael Laszlo's answer. This is what I use to make it faster for fa-refresh as the fa-spin by default is very slow.
```
.fa-spin {
-webkit-animation: fa-spin 0.75s infinite linear !important;
animation: fa-spin 0.75s infinite linear !important;
}
```
I use !important so that I control the specifici... |
31,048 | How to set the column width in the align environment.
I've got a align environment to demonstrate how to do division by hand so the columns always contain only one number, but the columns are much wider than this.
Following an example only showing the ugly result because of to wide columns:
```
\begin{align}
&1&2... | 2011/10/09 | [
"https://tex.stackexchange.com/questions/31048",
"https://tex.stackexchange.com",
"https://tex.stackexchange.com/users/7875/"
] | You could use `\hphantom` for taking the required space for alignment:
```
\documentclass{article}
\usepackage{mathtools}
\begin{document}
\begin{enumerate}
\item $1 + 1 = 2$
\item $\hphantom{1+1}\mathllap{1} = 2 - 1$
\end{enumerate}
\end{document}
``` | I tried once (and was surprised that it actually work) to use `\item` inside `\intertext` of the nested `align` environment:
```
\begin{enumerate}
\item First point, blah
\begin{align}
a &= b+2 \\ %% not sure about whether those \\ are needed or not
\intertext{\item Second point, blah}
... |
31,048 | How to set the column width in the align environment.
I've got a align environment to demonstrate how to do division by hand so the columns always contain only one number, but the columns are much wider than this.
Following an example only showing the ugly result because of to wide columns:
```
\begin{align}
&1&2... | 2011/10/09 | [
"https://tex.stackexchange.com/questions/31048",
"https://tex.stackexchange.com",
"https://tex.stackexchange.com/users/7875/"
] | ```
\documentclass[leqno]{report}
\usepackage{amsmath}
\begin{document}
\begin{flalign}
1 + 1 &= 2 &\\
1 &= 2 - 1
\end{flalign}
\end{document}
```
 | ```
\documentclass{article}
\usepackage[fleqn]{amsmath}
\begin{document}
\begin{flalign} % Displays all equation #'s in environment.
1 + 1 &= 2 \\
1 &= 2 - 1 &
\end{flalign}
------------------------------
\begin{flalign*}% Add the * if you want no equation #'s displayed.
1 + 1 &= 2 \\
1 &= 2 - 1 &
\end{flalign*}
-----... |
31,048 | How to set the column width in the align environment.
I've got a align environment to demonstrate how to do division by hand so the columns always contain only one number, but the columns are much wider than this.
Following an example only showing the ugly result because of to wide columns:
```
\begin{align}
&1&2... | 2011/10/09 | [
"https://tex.stackexchange.com/questions/31048",
"https://tex.stackexchange.com",
"https://tex.stackexchange.com/users/7875/"
] | ```
\usepackage{array}
\newenvironment{enumalign}
{\par\addvspace{\topsep}\setcounter{enumi}{0}
\noindent$\begin{array}{@{}r@{\hspace{\labelsep}}r@{}>{{}}l@{}}}
{\end{array}$\par\addvspace{\topsep}}
\newcommand{\eitem}{\stepcounter{enumi}\makebox[\labelwidth][r]{\theenumi.}&}
\begin{document}
\begin{enumalign}... | ```
\documentclass{article}
\usepackage[fleqn]{amsmath}
\begin{document}
\begin{flalign} % Displays all equation #'s in environment.
1 + 1 &= 2 \\
1 &= 2 - 1 &
\end{flalign}
------------------------------
\begin{flalign*}% Add the * if you want no equation #'s displayed.
1 + 1 &= 2 \\
1 &= 2 - 1 &
\end{flalign*}
-----... |
31,048 | How to set the column width in the align environment.
I've got a align environment to demonstrate how to do division by hand so the columns always contain only one number, but the columns are much wider than this.
Following an example only showing the ugly result because of to wide columns:
```
\begin{align}
&1&2... | 2011/10/09 | [
"https://tex.stackexchange.com/questions/31048",
"https://tex.stackexchange.com",
"https://tex.stackexchange.com/users/7875/"
] | You could use `\hphantom` for taking the required space for alignment:
```
\documentclass{article}
\usepackage{mathtools}
\begin{document}
\begin{enumerate}
\item $1 + 1 = 2$
\item $\hphantom{1+1}\mathllap{1} = 2 - 1$
\end{enumerate}
\end{document}
``` | ```
\documentclass{article}
\usepackage[fleqn]{amsmath}
\begin{document}
\begin{flalign} % Displays all equation #'s in environment.
1 + 1 &= 2 \\
1 &= 2 - 1 &
\end{flalign}
------------------------------
\begin{flalign*}% Add the * if you want no equation #'s displayed.
1 + 1 &= 2 \\
1 &= 2 - 1 &
\end{flalign*}
-----... |
31,048 | How to set the column width in the align environment.
I've got a align environment to demonstrate how to do division by hand so the columns always contain only one number, but the columns are much wider than this.
Following an example only showing the ugly result because of to wide columns:
```
\begin{align}
&1&2... | 2011/10/09 | [
"https://tex.stackexchange.com/questions/31048",
"https://tex.stackexchange.com",
"https://tex.stackexchange.com/users/7875/"
] | ```
\documentclass[leqno]{report}
\usepackage{amsmath}
\begin{document}
\begin{flalign}
1 + 1 &= 2 &\\
1 &= 2 - 1
\end{flalign}
\end{document}
```
 | I tried once (and was surprised that it actually work) to use `\item` inside `\intertext` of the nested `align` environment:
```
\begin{enumerate}
\item First point, blah
\begin{align}
a &= b+2 \\ %% not sure about whether those \\ are needed or not
\intertext{\item Second point, blah}
... |
31,048 | How to set the column width in the align environment.
I've got a align environment to demonstrate how to do division by hand so the columns always contain only one number, but the columns are much wider than this.
Following an example only showing the ugly result because of to wide columns:
```
\begin{align}
&1&2... | 2011/10/09 | [
"https://tex.stackexchange.com/questions/31048",
"https://tex.stackexchange.com",
"https://tex.stackexchange.com/users/7875/"
] | Note: This is based very heavily on Stefan Kottwitz's answer; I've just used some macros to make it a little bit more flexible.
```
\documentclass{article}
\usepackage{mathtools}
\newcommand{\leftsidelength}{}
\newcommand{\leftside}[1]{\hphantom{\leftsidelength}\mathllap{#1}}
\begin{document}
\begin{enumerate}
\ren... | I tried once (and was surprised that it actually work) to use `\item` inside `\intertext` of the nested `align` environment:
```
\begin{enumerate}
\item First point, blah
\begin{align}
a &= b+2 \\ %% not sure about whether those \\ are needed or not
\intertext{\item Second point, blah}
... |
31,048 | How to set the column width in the align environment.
I've got a align environment to demonstrate how to do division by hand so the columns always contain only one number, but the columns are much wider than this.
Following an example only showing the ugly result because of to wide columns:
```
\begin{align}
&1&2... | 2011/10/09 | [
"https://tex.stackexchange.com/questions/31048",
"https://tex.stackexchange.com",
"https://tex.stackexchange.com/users/7875/"
] | Note: This is based very heavily on Stefan Kottwitz's answer; I've just used some macros to make it a little bit more flexible.
```
\documentclass{article}
\usepackage{mathtools}
\newcommand{\leftsidelength}{}
\newcommand{\leftside}[1]{\hphantom{\leftsidelength}\mathllap{#1}}
\begin{document}
\begin{enumerate}
\ren... | ```
\documentclass{article}
\usepackage[fleqn]{amsmath}
\begin{document}
\begin{flalign} % Displays all equation #'s in environment.
1 + 1 &= 2 \\
1 &= 2 - 1 &
\end{flalign}
------------------------------
\begin{flalign*}% Add the * if you want no equation #'s displayed.
1 + 1 &= 2 \\
1 &= 2 - 1 &
\end{flalign*}
-----... |
31,048 | How to set the column width in the align environment.
I've got a align environment to demonstrate how to do division by hand so the columns always contain only one number, but the columns are much wider than this.
Following an example only showing the ugly result because of to wide columns:
```
\begin{align}
&1&2... | 2011/10/09 | [
"https://tex.stackexchange.com/questions/31048",
"https://tex.stackexchange.com",
"https://tex.stackexchange.com/users/7875/"
] | ```
\documentclass[leqno]{report}
\usepackage{amsmath}
\begin{document}
\begin{flalign}
1 + 1 &= 2 &\\
1 &= 2 - 1
\end{flalign}
\end{document}
```
 | You could use `\hphantom` for taking the required space for alignment:
```
\documentclass{article}
\usepackage{mathtools}
\begin{document}
\begin{enumerate}
\item $1 + 1 = 2$
\item $\hphantom{1+1}\mathllap{1} = 2 - 1$
\end{enumerate}
\end{document}
``` |
31,048 | How to set the column width in the align environment.
I've got a align environment to demonstrate how to do division by hand so the columns always contain only one number, but the columns are much wider than this.
Following an example only showing the ugly result because of to wide columns:
```
\begin{align}
&1&2... | 2011/10/09 | [
"https://tex.stackexchange.com/questions/31048",
"https://tex.stackexchange.com",
"https://tex.stackexchange.com/users/7875/"
] | You could use `\hphantom` for taking the required space for alignment:
```
\documentclass{article}
\usepackage{mathtools}
\begin{document}
\begin{enumerate}
\item $1 + 1 = 2$
\item $\hphantom{1+1}\mathllap{1} = 2 - 1$
\end{enumerate}
\end{document}
``` | Note: This is based very heavily on Stefan Kottwitz's answer; I've just used some macros to make it a little bit more flexible.
```
\documentclass{article}
\usepackage{mathtools}
\newcommand{\leftsidelength}{}
\newcommand{\leftside}[1]{\hphantom{\leftsidelength}\mathllap{#1}}
\begin{document}
\begin{enumerate}
\ren... |
31,048 | How to set the column width in the align environment.
I've got a align environment to demonstrate how to do division by hand so the columns always contain only one number, but the columns are much wider than this.
Following an example only showing the ugly result because of to wide columns:
```
\begin{align}
&1&2... | 2011/10/09 | [
"https://tex.stackexchange.com/questions/31048",
"https://tex.stackexchange.com",
"https://tex.stackexchange.com/users/7875/"
] | ```
\usepackage{array}
\newenvironment{enumalign}
{\par\addvspace{\topsep}\setcounter{enumi}{0}
\noindent$\begin{array}{@{}r@{\hspace{\labelsep}}r@{}>{{}}l@{}}}
{\end{array}$\par\addvspace{\topsep}}
\newcommand{\eitem}{\stepcounter{enumi}\makebox[\labelwidth][r]{\theenumi.}&}
\begin{document}
\begin{enumalign}... | You could use `\hphantom` for taking the required space for alignment:
```
\documentclass{article}
\usepackage{mathtools}
\begin{document}
\begin{enumerate}
\item $1 + 1 = 2$
\item $\hphantom{1+1}\mathllap{1} = 2 - 1$
\end{enumerate}
\end{document}
``` |
554,408 | I have an application that has been getting strange errors when canceling out of a dialog box. The application can't continue if the box is cancelled out of, so it exits, but it is not working for some reason, and thus it keeps running and crashes.
I debugged this problem, and somehow the application runs right past t... | 2009/02/16 | [
"https://Stackoverflow.com/questions/554408",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/26140/"
] | Try `Environment.Exit(exitCode)`. | I have went though this situation in many cases I use Thread.CurrentThread.Abort()
and the process is closed. It seems that Application.Exit isn't hooking up properly with current thread. |
554,408 | I have an application that has been getting strange errors when canceling out of a dialog box. The application can't continue if the box is cancelled out of, so it exits, but it is not working for some reason, and thus it keeps running and crashes.
I debugged this problem, and somehow the application runs right past t... | 2009/02/16 | [
"https://Stackoverflow.com/questions/554408",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/26140/"
] | This is an article which expands on the same train of thought you are going through: <http://www.dev102.com/2008/06/24/how-do-you-exit-your-net-application/>
Basically:
>
> * Environment.Exit - From MSDN: Terminates this process and gives the
> underlying operating system the
> specified exit code. This is the code
... | Also ensure any threads running in your application have the IsBackground property set to true. Non-background threads will easily block the application from exiting. |
554,408 | I have an application that has been getting strange errors when canceling out of a dialog box. The application can't continue if the box is cancelled out of, so it exits, but it is not working for some reason, and thus it keeps running and crashes.
I debugged this problem, and somehow the application runs right past t... | 2009/02/16 | [
"https://Stackoverflow.com/questions/554408",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/26140/"
] | Having had this problem recently (that Application.Exit was failing to correctly terminate message pumps for win-forms with Application.Run(new Form())), I discovered that if you are spawning new threads or starting background workers within the constructor, this will prevent Application.Exit from running.
Move all 'R... | I have went though this situation in many cases I use Thread.CurrentThread.Abort()
and the process is closed. It seems that Application.Exit isn't hooking up properly with current thread. |
554,408 | I have an application that has been getting strange errors when canceling out of a dialog box. The application can't continue if the box is cancelled out of, so it exits, but it is not working for some reason, and thus it keeps running and crashes.
I debugged this problem, and somehow the application runs right past t... | 2009/02/16 | [
"https://Stackoverflow.com/questions/554408",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/26140/"
] | I have went though this situation in many cases I use Thread.CurrentThread.Abort()
and the process is closed. It seems that Application.Exit isn't hooking up properly with current thread. | Is this application run (in the `Main` method) using `Application.Run()`? Otherwise, `Application.Exit()` won't work.
If you wrote your own `Main` method and you want to stop the application, you can only stop by returning from the `Main` method (or killing the process). |
554,408 | I have an application that has been getting strange errors when canceling out of a dialog box. The application can't continue if the box is cancelled out of, so it exits, but it is not working for some reason, and thus it keeps running and crashes.
I debugged this problem, and somehow the application runs right past t... | 2009/02/16 | [
"https://Stackoverflow.com/questions/554408",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/26140/"
] | This is an article which expands on the same train of thought you are going through: <http://www.dev102.com/2008/06/24/how-do-you-exit-your-net-application/>
Basically:
>
> * Environment.Exit - From MSDN: Terminates this process and gives the
> underlying operating system the
> specified exit code. This is the code
... | Try this :
in Program.cs file :
after **Application.Run(new form());**
add **Application.Exit();** |
554,408 | I have an application that has been getting strange errors when canceling out of a dialog box. The application can't continue if the box is cancelled out of, so it exits, but it is not working for some reason, and thus it keeps running and crashes.
I debugged this problem, and somehow the application runs right past t... | 2009/02/16 | [
"https://Stackoverflow.com/questions/554408",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/26140/"
] | I have went though this situation in many cases I use Thread.CurrentThread.Abort()
and the process is closed. It seems that Application.Exit isn't hooking up properly with current thread. | ```
private void frmLogin_FormClosing(object sender, FormClosingEventArgs e)
{
if (e.CloseReason == CloseReason.UserClosing)
{
DialogResult result = MessageBox.Show("Do you really want to exit?", "Dialog Title", MessageBoxButtons.YesNo);
if (result == DialogResult.Yes)
... |
554,408 | I have an application that has been getting strange errors when canceling out of a dialog box. The application can't continue if the box is cancelled out of, so it exits, but it is not working for some reason, and thus it keeps running and crashes.
I debugged this problem, and somehow the application runs right past t... | 2009/02/16 | [
"https://Stackoverflow.com/questions/554408",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/26140/"
] | Having had this problem recently (that Application.Exit was failing to correctly terminate message pumps for win-forms with Application.Run(new Form())), I discovered that if you are spawning new threads or starting background workers within the constructor, this will prevent Application.Exit from running.
Move all 'R... | Is this application run (in the `Main` method) using `Application.Run()`? Otherwise, `Application.Exit()` won't work.
If you wrote your own `Main` method and you want to stop the application, you can only stop by returning from the `Main` method (or killing the process). |
554,408 | I have an application that has been getting strange errors when canceling out of a dialog box. The application can't continue if the box is cancelled out of, so it exits, but it is not working for some reason, and thus it keeps running and crashes.
I debugged this problem, and somehow the application runs right past t... | 2009/02/16 | [
"https://Stackoverflow.com/questions/554408",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/26140/"
] | This is an article which expands on the same train of thought you are going through: <http://www.dev102.com/2008/06/24/how-do-you-exit-your-net-application/>
Basically:
>
> * Environment.Exit - From MSDN: Terminates this process and gives the
> underlying operating system the
> specified exit code. This is the code
... | I have went though this situation in many cases I use Thread.CurrentThread.Abort()
and the process is closed. It seems that Application.Exit isn't hooking up properly with current thread. |
554,408 | I have an application that has been getting strange errors when canceling out of a dialog box. The application can't continue if the box is cancelled out of, so it exits, but it is not working for some reason, and thus it keeps running and crashes.
I debugged this problem, and somehow the application runs right past t... | 2009/02/16 | [
"https://Stackoverflow.com/questions/554408",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/26140/"
] | I have went though this situation in many cases I use Thread.CurrentThread.Abort()
and the process is closed. It seems that Application.Exit isn't hooking up properly with current thread. | Try this :
in Program.cs file :
after **Application.Run(new form());**
add **Application.Exit();** |
554,408 | I have an application that has been getting strange errors when canceling out of a dialog box. The application can't continue if the box is cancelled out of, so it exits, but it is not working for some reason, and thus it keeps running and crashes.
I debugged this problem, and somehow the application runs right past t... | 2009/02/16 | [
"https://Stackoverflow.com/questions/554408",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/26140/"
] | Having had this problem recently (that Application.Exit was failing to correctly terminate message pumps for win-forms with Application.Run(new Form())), I discovered that if you are spawning new threads or starting background workers within the constructor, this will prevent Application.Exit from running.
Move all 'R... | Make sure you have no Console.ReadLine(); in your app and Environment.Exit(1); will work and close your app. |
57,637,466 | Please note: this kind of question has been asked on SO, but I believe mine is different, since the solution alone of using partial `struct X*` types doesn't solve this. I have read the other answers and have found no solution, so please bear with me.
I have the following circular-dependency problem (resulting in a co... | 2019/08/24 | [
"https://Stackoverflow.com/questions/57637466",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/3284878/"
] | Have you tried passing a filtered array to the ForEach. Something like this:
```swift
ForEach(userData.bookList.filter { return !$0.own }) { book in
NavigationLink(destination: BookDetail(book: book)) { BookRow(book: book) }
}
```
**Update**
----------
As it turns out, it is indeed an ugly, ugly bug:
Instead ... | I think we have to wait until SwiftUI List performance improves in subsequent beta releases. I’ve experienced the same lag when lists are filtered from a very large array (500+) down to very small ones. I created a simple test app to time the layout for a simple array with integer IDs and strings with Buttons to simply... |
57,637,466 | Please note: this kind of question has been asked on SO, but I believe mine is different, since the solution alone of using partial `struct X*` types doesn't solve this. I have read the other answers and have found no solution, so please bear with me.
I have the following circular-dependency problem (resulting in a co... | 2019/08/24 | [
"https://Stackoverflow.com/questions/57637466",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/3284878/"
] | Have you tried passing a filtered array to the ForEach. Something like this:
```swift
ForEach(userData.bookList.filter { return !$0.own }) { book in
NavigationLink(destination: BookDetail(book: book)) { BookRow(book: book) }
}
```
**Update**
----------
As it turns out, it is indeed an ugly, ugly bug:
Instead ... | This code will work correctly provided that you initialize your class in the 'SceneDelegate' file as follows:
```
class SceneDelegate: UIResponder, UIWindowSceneDelegate {
var window: UIWindow?
var userData = UserData()
func scene(_ scene: UIScene, willConnectTo session: UISceneSession, options connectionOptions: UI... |
57,637,466 | Please note: this kind of question has been asked on SO, but I believe mine is different, since the solution alone of using partial `struct X*` types doesn't solve this. I have read the other answers and have found no solution, so please bear with me.
I have the following circular-dependency problem (resulting in a co... | 2019/08/24 | [
"https://Stackoverflow.com/questions/57637466",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/3284878/"
] | Have you tried passing a filtered array to the ForEach. Something like this:
```swift
ForEach(userData.bookList.filter { return !$0.own }) { book in
NavigationLink(destination: BookDetail(book: book)) { BookRow(book: book) }
}
```
**Update**
----------
As it turns out, it is indeed an ugly, ugly bug:
Instead ... | Instead of a complicated workaround, just empty the List array and then set the new filters array. It may be necessary to introduce a delay so that emptying the listArray won't be omitted by the followed write.
```
List(listArray){item in
...
}
```
```
self.listArray = []
DispatchQueue.main.asyncAfter(deadline: .n... |
57,637,466 | Please note: this kind of question has been asked on SO, but I believe mine is different, since the solution alone of using partial `struct X*` types doesn't solve this. I have read the other answers and have found no solution, so please bear with me.
I have the following circular-dependency problem (resulting in a co... | 2019/08/24 | [
"https://Stackoverflow.com/questions/57637466",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/3284878/"
] | Have you tried passing a filtered array to the ForEach. Something like this:
```swift
ForEach(userData.bookList.filter { return !$0.own }) { book in
NavigationLink(destination: BookDetail(book: book)) { BookRow(book: book) }
}
```
**Update**
----------
As it turns out, it is indeed an ugly, ugly bug:
Instead ... | Check this article <https://www.hackingwithswift.com/articles/210/how-to-fix-slow-list-updates-in-swiftui>
In short the solution proposed in this article is to add **.id(UUID())** to the list:
```swift
List(items, id: \.self) {
Text("Item \($0)")
}
.id(UUID())
```
"Now, there is a downside to using id() like th... |
57,637,466 | Please note: this kind of question has been asked on SO, but I believe mine is different, since the solution alone of using partial `struct X*` types doesn't solve this. I have read the other answers and have found no solution, so please bear with me.
I have the following circular-dependency problem (resulting in a co... | 2019/08/24 | [
"https://Stackoverflow.com/questions/57637466",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/3284878/"
] | Have you tried passing a filtered array to the ForEach. Something like this:
```swift
ForEach(userData.bookList.filter { return !$0.own }) { book in
NavigationLink(destination: BookDetail(book: book)) { BookRow(book: book) }
}
```
**Update**
----------
As it turns out, it is indeed an ugly, ugly bug:
Instead ... | Looking for how to adapt Seitenwerk's response to my solution, I found a Binding extension that helped me a lot. Here is the code:
```
struct ContactsView: View {
@State var stext : String = ""
@State var users : [MockUser] = []
@State var filtered : [MockUser] = []
var body: some View {
For... |
57,637,466 | Please note: this kind of question has been asked on SO, but I believe mine is different, since the solution alone of using partial `struct X*` types doesn't solve this. I have read the other answers and have found no solution, so please bear with me.
I have the following circular-dependency problem (resulting in a co... | 2019/08/24 | [
"https://Stackoverflow.com/questions/57637466",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/3284878/"
] | I think we have to wait until SwiftUI List performance improves in subsequent beta releases. I’ve experienced the same lag when lists are filtered from a very large array (500+) down to very small ones. I created a simple test app to time the layout for a simple array with integer IDs and strings with Buttons to simply... | This code will work correctly provided that you initialize your class in the 'SceneDelegate' file as follows:
```
class SceneDelegate: UIResponder, UIWindowSceneDelegate {
var window: UIWindow?
var userData = UserData()
func scene(_ scene: UIScene, willConnectTo session: UISceneSession, options connectionOptions: UI... |
57,637,466 | Please note: this kind of question has been asked on SO, but I believe mine is different, since the solution alone of using partial `struct X*` types doesn't solve this. I have read the other answers and have found no solution, so please bear with me.
I have the following circular-dependency problem (resulting in a co... | 2019/08/24 | [
"https://Stackoverflow.com/questions/57637466",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/3284878/"
] | Instead of a complicated workaround, just empty the List array and then set the new filters array. It may be necessary to introduce a delay so that emptying the listArray won't be omitted by the followed write.
```
List(listArray){item in
...
}
```
```
self.listArray = []
DispatchQueue.main.asyncAfter(deadline: .n... | This code will work correctly provided that you initialize your class in the 'SceneDelegate' file as follows:
```
class SceneDelegate: UIResponder, UIWindowSceneDelegate {
var window: UIWindow?
var userData = UserData()
func scene(_ scene: UIScene, willConnectTo session: UISceneSession, options connectionOptions: UI... |
57,637,466 | Please note: this kind of question has been asked on SO, but I believe mine is different, since the solution alone of using partial `struct X*` types doesn't solve this. I have read the other answers and have found no solution, so please bear with me.
I have the following circular-dependency problem (resulting in a co... | 2019/08/24 | [
"https://Stackoverflow.com/questions/57637466",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/3284878/"
] | Check this article <https://www.hackingwithswift.com/articles/210/how-to-fix-slow-list-updates-in-swiftui>
In short the solution proposed in this article is to add **.id(UUID())** to the list:
```swift
List(items, id: \.self) {
Text("Item \($0)")
}
.id(UUID())
```
"Now, there is a downside to using id() like th... | This code will work correctly provided that you initialize your class in the 'SceneDelegate' file as follows:
```
class SceneDelegate: UIResponder, UIWindowSceneDelegate {
var window: UIWindow?
var userData = UserData()
func scene(_ scene: UIScene, willConnectTo session: UISceneSession, options connectionOptions: UI... |
57,637,466 | Please note: this kind of question has been asked on SO, but I believe mine is different, since the solution alone of using partial `struct X*` types doesn't solve this. I have read the other answers and have found no solution, so please bear with me.
I have the following circular-dependency problem (resulting in a co... | 2019/08/24 | [
"https://Stackoverflow.com/questions/57637466",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/3284878/"
] | Looking for how to adapt Seitenwerk's response to my solution, I found a Binding extension that helped me a lot. Here is the code:
```
struct ContactsView: View {
@State var stext : String = ""
@State var users : [MockUser] = []
@State var filtered : [MockUser] = []
var body: some View {
For... | This code will work correctly provided that you initialize your class in the 'SceneDelegate' file as follows:
```
class SceneDelegate: UIResponder, UIWindowSceneDelegate {
var window: UIWindow?
var userData = UserData()
func scene(_ scene: UIScene, willConnectTo session: UISceneSession, options connectionOptions: UI... |
58,206,306 | Suppose I have a local file called "contacts.json" . I want to insert it in react component and create a table . I'll be so glad if anybody can help me .Thanks .
```
{
"contacts": [
{
"id": 1,
"firstName": "hamid",
"lastName": "mohamadi",
"contactType": "Friend",
"birthDate": "2010.10.10",
"phoneNumber... | 2019/10/02 | [
"https://Stackoverflow.com/questions/58206306",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/11749690/"
] | After some digging, I found that the `InputProps` also have the `className` property. The following worked for me:
```
<TextField
{...props}
inputProps={{
readOnly,
}}
InputProps={{
className: (readOnly) ? 'Mui-disabled' : undefined,
}}
/>
```
To see all the properties you can loo... | You need to use classes on TextField
```
<TextField
{...props}
classes={readOnly ? { root: 'Mui-disabled' } : {}}
/>
```
Hope it helps |
58,206,306 | Suppose I have a local file called "contacts.json" . I want to insert it in react component and create a table . I'll be so glad if anybody can help me .Thanks .
```
{
"contacts": [
{
"id": 1,
"firstName": "hamid",
"lastName": "mohamadi",
"contactType": "Friend",
"birthDate": "2010.10.10",
"phoneNumber... | 2019/10/02 | [
"https://Stackoverflow.com/questions/58206306",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/11749690/"
] | When you use the `disabled` property, Material-UI places the `Mui-disabled` class on many different elements. To get the equivalent look, you need to add it to all the same elements.
Below is an example of how to do this. In addition to adding the `Mui-disabled` class, it is also necessary to override the ["focused" s... | You need to use classes on TextField
```
<TextField
{...props}
classes={readOnly ? { root: 'Mui-disabled' } : {}}
/>
```
Hope it helps |
58,206,306 | Suppose I have a local file called "contacts.json" . I want to insert it in react component and create a table . I'll be so glad if anybody can help me .Thanks .
```
{
"contacts": [
{
"id": 1,
"firstName": "hamid",
"lastName": "mohamadi",
"contactType": "Friend",
"birthDate": "2010.10.10",
"phoneNumber... | 2019/10/02 | [
"https://Stackoverflow.com/questions/58206306",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/11749690/"
] | When you use the `disabled` property, Material-UI places the `Mui-disabled` class on many different elements. To get the equivalent look, you need to add it to all the same elements.
Below is an example of how to do this. In addition to adding the `Mui-disabled` class, it is also necessary to override the ["focused" s... | After some digging, I found that the `InputProps` also have the `className` property. The following worked for me:
```
<TextField
{...props}
inputProps={{
readOnly,
}}
InputProps={{
className: (readOnly) ? 'Mui-disabled' : undefined,
}}
/>
```
To see all the properties you can loo... |
20,810,210 | Consider the following class:
```
public class MyClass
{
private MyObject obj;
public MyClass()
{
obj = new MyObject();
}
public void methodCalledByOtherThreads()
{
obj.doStuff();
}
}
```
Since obj was created on one thread and accessed from another, could obj be null wh... | 2013/12/28 | [
"https://Stackoverflow.com/questions/20810210",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/2605245/"
] | For the `methodCalledByOtherThreads` to be called by another thread and cause problems, that thread would have to get a reference to a `MyClass` object whose `obj` field is not initialized, ie. where the constructor has not yet returned.
This would be possible if you leaked the `this` reference from the constructor. F... | This code is fine because the reference to the instance of `MyClass` can't be visible to any other threads before the constructor returns.
Specifically, the [happens-before relation](http://docs.oracle.com/javase/specs/jls/se7/html/jls-17.html#jls-17.4.5) requires that the visible effects of actions occur in the same ... |
20,810,210 | Consider the following class:
```
public class MyClass
{
private MyObject obj;
public MyClass()
{
obj = new MyObject();
}
public void methodCalledByOtherThreads()
{
obj.doStuff();
}
}
```
Since obj was created on one thread and accessed from another, could obj be null wh... | 2013/12/28 | [
"https://Stackoverflow.com/questions/20810210",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/2605245/"
] | For the `methodCalledByOtherThreads` to be called by another thread and cause problems, that thread would have to get a reference to a `MyClass` object whose `obj` field is not initialized, ie. where the constructor has not yet returned.
This would be possible if you leaked the `this` reference from the constructor. F... | The originally picked answer by @Sotirios Delimanolis is wrong. @ZhongYu 's answer is correct.
There is the visibility issue of the concern here. So if MyClass is published unsafely, anything could happen.
Someone in the comment asked for evidence - one can check Listing 3.15 in the book *Java Concurrency in Practice... |
20,810,210 | Consider the following class:
```
public class MyClass
{
private MyObject obj;
public MyClass()
{
obj = new MyObject();
}
public void methodCalledByOtherThreads()
{
obj.doStuff();
}
}
```
Since obj was created on one thread and accessed from another, could obj be null wh... | 2013/12/28 | [
"https://Stackoverflow.com/questions/20810210",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/2605245/"
] | For the `methodCalledByOtherThreads` to be called by another thread and cause problems, that thread would have to get a reference to a `MyClass` object whose `obj` field is not initialized, ie. where the constructor has not yet returned.
This would be possible if you leaked the `this` reference from the constructor. F... | Your other thread **could** see a null object. A volatile object could possibly help, but an explicit lock mechanism (or a Builder) would likely be a better solution.
Have a look at [Java Concurrency in Practice - Sample 14.12](https://stackoverflow.com/questions/10528572/java-concurrency-in-practice-sample-14-12) |
20,810,210 | Consider the following class:
```
public class MyClass
{
private MyObject obj;
public MyClass()
{
obj = new MyObject();
}
public void methodCalledByOtherThreads()
{
obj.doStuff();
}
}
```
Since obj was created on one thread and accessed from another, could obj be null wh... | 2013/12/28 | [
"https://Stackoverflow.com/questions/20810210",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/2605245/"
] | It depends on whether the reference is published "unsafely". A reference is "published" by being written to a shared variable; another thread reads the variable to get the reference. If there is no relationship of `happens-before(write, read)`, the publication is called unsafe. An example of unsafe publication is throu... | This code is fine because the reference to the instance of `MyClass` can't be visible to any other threads before the constructor returns.
Specifically, the [happens-before relation](http://docs.oracle.com/javase/specs/jls/se7/html/jls-17.html#jls-17.4.5) requires that the visible effects of actions occur in the same ... |
20,810,210 | Consider the following class:
```
public class MyClass
{
private MyObject obj;
public MyClass()
{
obj = new MyObject();
}
public void methodCalledByOtherThreads()
{
obj.doStuff();
}
}
```
Since obj was created on one thread and accessed from another, could obj be null wh... | 2013/12/28 | [
"https://Stackoverflow.com/questions/20810210",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/2605245/"
] | It depends on whether the reference is published "unsafely". A reference is "published" by being written to a shared variable; another thread reads the variable to get the reference. If there is no relationship of `happens-before(write, read)`, the publication is called unsafe. An example of unsafe publication is throu... | The originally picked answer by @Sotirios Delimanolis is wrong. @ZhongYu 's answer is correct.
There is the visibility issue of the concern here. So if MyClass is published unsafely, anything could happen.
Someone in the comment asked for evidence - one can check Listing 3.15 in the book *Java Concurrency in Practice... |
20,810,210 | Consider the following class:
```
public class MyClass
{
private MyObject obj;
public MyClass()
{
obj = new MyObject();
}
public void methodCalledByOtherThreads()
{
obj.doStuff();
}
}
```
Since obj was created on one thread and accessed from another, could obj be null wh... | 2013/12/28 | [
"https://Stackoverflow.com/questions/20810210",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/2605245/"
] | This class (if taken as is) is NOT thread safe. In two words: there is reordering of instructions in java ([Instruction reordering & happens-before relationship in java](https://stackoverflow.com/questions/16213443/instruction-reordering-happens-before-relationship-in-java)) and when in your code you're instantiating M... | The originally picked answer by @Sotirios Delimanolis is wrong. @ZhongYu 's answer is correct.
There is the visibility issue of the concern here. So if MyClass is published unsafely, anything could happen.
Someone in the comment asked for evidence - one can check Listing 3.15 in the book *Java Concurrency in Practice... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.