qid int64 1 74.7M | question stringlengths 15 58.3k | date stringlengths 10 10 | metadata list | response_j stringlengths 4 30.2k | response_k stringlengths 11 36.5k |
|---|---|---|---|---|---|
49,102,300 | When I trying to install keras with pip3 this message shows.
```
Requirement already satisfied: keras in /usr/local/lib/python3.5/dist-packages
Requirement already satisfied: pyyaml in /usr/local/lib/python3.5/dist-packages (from keras)
Requirement already satisfied: six>=1.9.0 in ./.local/lib/python3.5/site-packages ... | 2018/03/05 | [
"https://Stackoverflow.com/questions/49102300",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/5213194/"
] | Are you using a virtual environment? If so make sure to activate it.
**EDIT**: To expand on what "virtual environment" means, look [here](https://conda.io/docs/user-guide/install/linux.html) and [here](https://conda.io/docs/_downloads/conda-cheatsheet.pdf) at "Conda." Conda can help you with installations in many way... | What i would suggest is use keras in a separate environment using conda.
Suppose you want to create an env named "myenv"
1.Open Anaconda promt and type the following:
```
conda create --name myenv
```
2.To activate the environment:
```
conda activate myenv
```
3.Now you can install keras and other dependen... |
2,251,752 | Web programmer here - using AJAX (HTML, CSS, JavaScript, AJAX, PHP, MySQL), but for some reason Internet Explorer is acting up (surprise surprise).
AJAX is updating query results on the HTML page, via a PHP script that queries a MySQL Database.
Everything is working fine, except when I use Internet Explorer 8.0 .
Th... | 2010/02/12 | [
"https://Stackoverflow.com/questions/2251752",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/157991/"
] | [Here](http://ajaxian.com/archives/ajax-ie-caching-issue) is an article on the caching issue.
If your request is a GET change it to a POST, this will prevent the results being cached. | GET requests are cached in IE; switch it to a POST request and it won't be cached anymore. |
2,251,752 | Web programmer here - using AJAX (HTML, CSS, JavaScript, AJAX, PHP, MySQL), but for some reason Internet Explorer is acting up (surprise surprise).
AJAX is updating query results on the HTML page, via a PHP script that queries a MySQL Database.
Everything is working fine, except when I use Internet Explorer 8.0 .
Th... | 2010/02/12 | [
"https://Stackoverflow.com/questions/2251752",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/157991/"
] | [Here](http://ajaxian.com/archives/ajax-ie-caching-issue) is an article on the caching issue.
If your request is a GET change it to a POST, this will prevent the results being cached. | Instead of switching to POST, which can be ugly if you're not really using it to update or create content, you should append a random number to the query string, as in `http://domain.com/ajax/some-request?r=123456`. If this number is unique for every request you won't have caching problems. |
2,251,752 | Web programmer here - using AJAX (HTML, CSS, JavaScript, AJAX, PHP, MySQL), but for some reason Internet Explorer is acting up (surprise surprise).
AJAX is updating query results on the HTML page, via a PHP script that queries a MySQL Database.
Everything is working fine, except when I use Internet Explorer 8.0 .
Th... | 2010/02/12 | [
"https://Stackoverflow.com/questions/2251752",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/157991/"
] | [Here](http://ajaxian.com/archives/ajax-ie-caching-issue) is an article on the caching issue.
If your request is a GET change it to a POST, this will prevent the results being cached. | What I have done is, I have kept the "GET" and added new dummy query parameter to the querystring as follows,
```
./BaseServlet?sname=3d_motor&calcdir=20110514&dummyParam=datetime
```
I set *dummyParam* a value of date object in the javascript so that every time the url is generated browser will treat it as a new ur... |
2,251,752 | Web programmer here - using AJAX (HTML, CSS, JavaScript, AJAX, PHP, MySQL), but for some reason Internet Explorer is acting up (surprise surprise).
AJAX is updating query results on the HTML page, via a PHP script that queries a MySQL Database.
Everything is working fine, except when I use Internet Explorer 8.0 .
Th... | 2010/02/12 | [
"https://Stackoverflow.com/questions/2251752",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/157991/"
] | GET requests are cached in IE; switch it to a POST request and it won't be cached anymore. | What I have done is, I have kept the "GET" and added new dummy query parameter to the querystring as follows,
```
./BaseServlet?sname=3d_motor&calcdir=20110514&dummyParam=datetime
```
I set *dummyParam* a value of date object in the javascript so that every time the url is generated browser will treat it as a new ur... |
2,251,752 | Web programmer here - using AJAX (HTML, CSS, JavaScript, AJAX, PHP, MySQL), but for some reason Internet Explorer is acting up (surprise surprise).
AJAX is updating query results on the HTML page, via a PHP script that queries a MySQL Database.
Everything is working fine, except when I use Internet Explorer 8.0 .
Th... | 2010/02/12 | [
"https://Stackoverflow.com/questions/2251752",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/157991/"
] | Instead of switching to POST, which can be ugly if you're not really using it to update or create content, you should append a random number to the query string, as in `http://domain.com/ajax/some-request?r=123456`. If this number is unique for every request you won't have caching problems. | What I have done is, I have kept the "GET" and added new dummy query parameter to the querystring as follows,
```
./BaseServlet?sname=3d_motor&calcdir=20110514&dummyParam=datetime
```
I set *dummyParam* a value of date object in the javascript so that every time the url is generated browser will treat it as a new ur... |
41,741,798 | In Unity, I would like to use the slider in my canvas but only the handle.
A default behaviour is that if the user clicks on a certain point in the slider , the handle will jump right to that point. I would like to disable this behaviour, allowing the user only to drag the handle to move it.
How can this be done?
T... | 2017/01/19 | [
"https://Stackoverflow.com/questions/41741798",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/2871855/"
] | Simply uncheck the *Raycast Target* property of the **Image** component located on the *Background* **GameObject**.
Otherwise you could always override the **Slider** class to fit your need but i guess this would be a bit overkill in your case.
Hope this helps, | Disable interactable checkbox in inspector. This option added with new versions. |
4,325,778 | I have several reports that are from SSAS 2008, but one of them has to drill through to a SQL Server report simply because the data is far to granular for a cube.
Any tips on passing parameters? Of course they are passed in as MDX, and I can't figure out a way to get just the "Key" with the source MDX. Surprisingly I ... | 2010/12/01 | [
"https://Stackoverflow.com/questions/4325778",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/388058/"
] | These are the rules I follow:
1. If in your header file, you only need to use pointers to classes declared in the header file you are including, then I would just use a `class` sentence on the header file (`.h`) and full import on the definition (`.m`) file.
2. If you need to use full definition of some stuff on the h... | Best practices is to put #import statements in .m files. If you need access to a class inside the header file, for a property declaration or a function parameter, use a forward declaration, like this:
```
@class Cocos2DController;
@interface HoppersAppDelegate : NSObject <UIApplicationDelegate> {
Cocos2DController* ... |
4,325,778 | I have several reports that are from SSAS 2008, but one of them has to drill through to a SQL Server report simply because the data is far to granular for a cube.
Any tips on passing parameters? Of course they are passed in as MDX, and I can't figure out a way to get just the "Key" with the source MDX. Surprisingly I ... | 2010/12/01 | [
"https://Stackoverflow.com/questions/4325778",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/388058/"
] | These are the rules I follow:
1. If in your header file, you only need to use pointers to classes declared in the header file you are including, then I would just use a `class` sentence on the header file (`.h`) and full import on the definition (`.m`) file.
2. If you need to use full definition of some stuff on the h... | The #import directive is an improvement over the #include directive in that instead of blindly copying the file in place, it will not include it if it has already been included. Therefore you shouldn't experience any problems with #import-ing the same file multiple times.
As far as best practice goes, IMHO it's best t... |
4,325,778 | I have several reports that are from SSAS 2008, but one of them has to drill through to a SQL Server report simply because the data is far to granular for a cube.
Any tips on passing parameters? Of course they are passed in as MDX, and I can't figure out a way to get just the "Key" with the source MDX. Surprisingly I ... | 2010/12/01 | [
"https://Stackoverflow.com/questions/4325778",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/388058/"
] | Unless it affects the interface definition you should put it in the .m file.
If you just *use* a class, use a forward declaration:
```
@class AClass;
@interface Bob : NSObject {
AClass* a;
}
```
If you *implement* something, then import it:
```
#import "SomeProtocol.h"
@interface Bob : NSObject<SomeProtocol> {... | These are the rules I follow:
1. If in your header file, you only need to use pointers to classes declared in the header file you are including, then I would just use a `class` sentence on the header file (`.h`) and full import on the definition (`.m`) file.
2. If you need to use full definition of some stuff on the h... |
4,325,778 | I have several reports that are from SSAS 2008, but one of them has to drill through to a SQL Server report simply because the data is far to granular for a cube.
Any tips on passing parameters? Of course they are passed in as MDX, and I can't figure out a way to get just the "Key" with the source MDX. Surprisingly I ... | 2010/12/01 | [
"https://Stackoverflow.com/questions/4325778",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/388058/"
] | These are the rules I follow:
1. If in your header file, you only need to use pointers to classes declared in the header file you are including, then I would just use a `class` sentence on the header file (`.h`) and full import on the definition (`.m`) file.
2. If you need to use full definition of some stuff on the h... | I have just one rule: Import at the top of the .h file for the superclass and protocols of any classes you declare in the .h file. This is because any file that imports your .h file also needs the declarations for the superclass and protocols. This is also why the default Xcode template has `#import <UIKit/UIKit.h>` in... |
4,325,778 | I have several reports that are from SSAS 2008, but one of them has to drill through to a SQL Server report simply because the data is far to granular for a cube.
Any tips on passing parameters? Of course they are passed in as MDX, and I can't figure out a way to get just the "Key" with the source MDX. Surprisingly I ... | 2010/12/01 | [
"https://Stackoverflow.com/questions/4325778",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/388058/"
] | The #import directive is an improvement over the #include directive in that instead of blindly copying the file in place, it will not include it if it has already been included. Therefore you shouldn't experience any problems with #import-ing the same file multiple times.
As far as best practice goes, IMHO it's best t... | Best practices is to put #import statements in .m files. If you need access to a class inside the header file, for a property declaration or a function parameter, use a forward declaration, like this:
```
@class Cocos2DController;
@interface HoppersAppDelegate : NSObject <UIApplicationDelegate> {
Cocos2DController* ... |
4,325,778 | I have several reports that are from SSAS 2008, but one of them has to drill through to a SQL Server report simply because the data is far to granular for a cube.
Any tips on passing parameters? Of course they are passed in as MDX, and I can't figure out a way to get just the "Key" with the source MDX. Surprisingly I ... | 2010/12/01 | [
"https://Stackoverflow.com/questions/4325778",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/388058/"
] | Unless it affects the interface definition you should put it in the .m file.
If you just *use* a class, use a forward declaration:
```
@class AClass;
@interface Bob : NSObject {
AClass* a;
}
```
If you *implement* something, then import it:
```
#import "SomeProtocol.h"
@interface Bob : NSObject<SomeProtocol> {... | Best practices is to put #import statements in .m files. If you need access to a class inside the header file, for a property declaration or a function parameter, use a forward declaration, like this:
```
@class Cocos2DController;
@interface HoppersAppDelegate : NSObject <UIApplicationDelegate> {
Cocos2DController* ... |
4,325,778 | I have several reports that are from SSAS 2008, but one of them has to drill through to a SQL Server report simply because the data is far to granular for a cube.
Any tips on passing parameters? Of course they are passed in as MDX, and I can't figure out a way to get just the "Key" with the source MDX. Surprisingly I ... | 2010/12/01 | [
"https://Stackoverflow.com/questions/4325778",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/388058/"
] | I have just one rule: Import at the top of the .h file for the superclass and protocols of any classes you declare in the .h file. This is because any file that imports your .h file also needs the declarations for the superclass and protocols. This is also why the default Xcode template has `#import <UIKit/UIKit.h>` in... | Best practices is to put #import statements in .m files. If you need access to a class inside the header file, for a property declaration or a function parameter, use a forward declaration, like this:
```
@class Cocos2DController;
@interface HoppersAppDelegate : NSObject <UIApplicationDelegate> {
Cocos2DController* ... |
4,325,778 | I have several reports that are from SSAS 2008, but one of them has to drill through to a SQL Server report simply because the data is far to granular for a cube.
Any tips on passing parameters? Of course they are passed in as MDX, and I can't figure out a way to get just the "Key" with the source MDX. Surprisingly I ... | 2010/12/01 | [
"https://Stackoverflow.com/questions/4325778",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/388058/"
] | Unless it affects the interface definition you should put it in the .m file.
If you just *use* a class, use a forward declaration:
```
@class AClass;
@interface Bob : NSObject {
AClass* a;
}
```
If you *implement* something, then import it:
```
#import "SomeProtocol.h"
@interface Bob : NSObject<SomeProtocol> {... | The #import directive is an improvement over the #include directive in that instead of blindly copying the file in place, it will not include it if it has already been included. Therefore you shouldn't experience any problems with #import-ing the same file multiple times.
As far as best practice goes, IMHO it's best t... |
4,325,778 | I have several reports that are from SSAS 2008, but one of them has to drill through to a SQL Server report simply because the data is far to granular for a cube.
Any tips on passing parameters? Of course they are passed in as MDX, and I can't figure out a way to get just the "Key" with the source MDX. Surprisingly I ... | 2010/12/01 | [
"https://Stackoverflow.com/questions/4325778",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/388058/"
] | Unless it affects the interface definition you should put it in the .m file.
If you just *use* a class, use a forward declaration:
```
@class AClass;
@interface Bob : NSObject {
AClass* a;
}
```
If you *implement* something, then import it:
```
#import "SomeProtocol.h"
@interface Bob : NSObject<SomeProtocol> {... | I have just one rule: Import at the top of the .h file for the superclass and protocols of any classes you declare in the .h file. This is because any file that imports your .h file also needs the declarations for the superclass and protocols. This is also why the default Xcode template has `#import <UIKit/UIKit.h>` in... |
15,978,164 | I am trying to get started with the LLVM binding for Haskell. A great place to start is Hello World.
The following is from a blog by the author of the binding.
```
bldGreet :: CodeGenModule (Function (IO ()))
bldGreet = do
puts <- newNamedFunction ExternalLinkage "puts" :: TFunction (Ptr Word8 -> IO Word32)
g... | 2013/04/12 | [
"https://Stackoverflow.com/questions/15978164",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1819861/"
] | The JDBC driver jar (and any jars it depends on) should go in your Oozie sharelib folder on HDFS. I'm running Hortonworks Data Platform 1.2 instead of Cloudera 4.2 so the details may vary, but my JDBC driver is located in `/user/oozie/share/lib/sqoop`. This should allow you to run Sqoop with the JDBC via Oozie.
It is ... | If you are using CDH-5 the JDBC driver jar (and any jars it depends on) should go in '/user/oozie/share/lib/lib\_timestamp/sqoop' folder on HDFS. |
15,978,164 | I am trying to get started with the LLVM binding for Haskell. A great place to start is Hello World.
The following is from a blog by the author of the binding.
```
bldGreet :: CodeGenModule (Function (IO ()))
bldGreet = do
puts <- newNamedFunction ExternalLinkage "puts" :: TFunction (Ptr Word8 -> IO Word32)
g... | 2013/04/12 | [
"https://Stackoverflow.com/questions/15978164",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1819861/"
] | The JDBC driver jar (and any jars it depends on) should go in your Oozie sharelib folder on HDFS. I'm running Hortonworks Data Platform 1.2 instead of Cloudera 4.2 so the details may vary, but my JDBC driver is located in `/user/oozie/share/lib/sqoop`. This should allow you to run Sqoop with the JDBC via Oozie.
It is ... | In CDH5, you should put the jar to '/user/oozie/share/lib/lib\_${timestamp}/sqoop', and after that, you must update the sharelib or restart oozie.
update sharelib:
`oozie admin -oozie http://localhost:11000/oozie -sharelibupdate` |
15,978,164 | I am trying to get started with the LLVM binding for Haskell. A great place to start is Hello World.
The following is from a blog by the author of the binding.
```
bldGreet :: CodeGenModule (Function (IO ()))
bldGreet = do
puts <- newNamedFunction ExternalLinkage "puts" :: TFunction (Ptr Word8 -> IO Word32)
g... | 2013/04/12 | [
"https://Stackoverflow.com/questions/15978164",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1819861/"
] | The JDBC driver jar (and any jars it depends on) should go in your Oozie sharelib folder on HDFS. I'm running Hortonworks Data Platform 1.2 instead of Cloudera 4.2 so the details may vary, but my JDBC driver is located in `/user/oozie/share/lib/sqoop`. This should allow you to run Sqoop with the JDBC via Oozie.
It is ... | I was facing the same issue it was not able to find the `mysql jar`. I am using cloudera 4.4 in this even `oozie admin -oozie http://localhost:11000/oozie -sharelibupdate` command will not work
To resolve the issue I had followed the below steps:
1. create a user in `Hue` with `hdfs` and provide the admin privileges
... |
15,978,164 | I am trying to get started with the LLVM binding for Haskell. A great place to start is Hello World.
The following is from a blog by the author of the binding.
```
bldGreet :: CodeGenModule (Function (IO ()))
bldGreet = do
puts <- newNamedFunction ExternalLinkage "puts" :: TFunction (Ptr Word8 -> IO Word32)
g... | 2013/04/12 | [
"https://Stackoverflow.com/questions/15978164",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1819861/"
] | In CDH5, you should put the jar to '/user/oozie/share/lib/lib\_${timestamp}/sqoop', and after that, you must update the sharelib or restart oozie.
update sharelib:
`oozie admin -oozie http://localhost:11000/oozie -sharelibupdate` | If you are using CDH-5 the JDBC driver jar (and any jars it depends on) should go in '/user/oozie/share/lib/lib\_timestamp/sqoop' folder on HDFS. |
15,978,164 | I am trying to get started with the LLVM binding for Haskell. A great place to start is Hello World.
The following is from a blog by the author of the binding.
```
bldGreet :: CodeGenModule (Function (IO ()))
bldGreet = do
puts <- newNamedFunction ExternalLinkage "puts" :: TFunction (Ptr Word8 -> IO Word32)
g... | 2013/04/12 | [
"https://Stackoverflow.com/questions/15978164",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1819861/"
] | If you are using CDH-5 the JDBC driver jar (and any jars it depends on) should go in '/user/oozie/share/lib/lib\_timestamp/sqoop' folder on HDFS. | I was facing the same issue it was not able to find the `mysql jar`. I am using cloudera 4.4 in this even `oozie admin -oozie http://localhost:11000/oozie -sharelibupdate` command will not work
To resolve the issue I had followed the below steps:
1. create a user in `Hue` with `hdfs` and provide the admin privileges
... |
15,978,164 | I am trying to get started with the LLVM binding for Haskell. A great place to start is Hello World.
The following is from a blog by the author of the binding.
```
bldGreet :: CodeGenModule (Function (IO ()))
bldGreet = do
puts <- newNamedFunction ExternalLinkage "puts" :: TFunction (Ptr Word8 -> IO Word32)
g... | 2013/04/12 | [
"https://Stackoverflow.com/questions/15978164",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1819861/"
] | In CDH5, you should put the jar to '/user/oozie/share/lib/lib\_${timestamp}/sqoop', and after that, you must update the sharelib or restart oozie.
update sharelib:
`oozie admin -oozie http://localhost:11000/oozie -sharelibupdate` | I was facing the same issue it was not able to find the `mysql jar`. I am using cloudera 4.4 in this even `oozie admin -oozie http://localhost:11000/oozie -sharelibupdate` command will not work
To resolve the issue I had followed the below steps:
1. create a user in `Hue` with `hdfs` and provide the admin privileges
... |
170,627 | I would like to see a soft-lock feature for 10k users. This can be considered a scaled-down version of [Content Dispute lock](https://meta.stackexchange.com/q/127557/165773 "discussed in more details here") available to diamond moderators (for the record, "mod lock" lasts for [a week](https://softwareengineering.meta.s... | 2013/03/07 | [
"https://meta.stackexchange.com/questions/170627",
"https://meta.stackexchange.com",
"https://meta.stackexchange.com/users/-1/"
] | >
> Why flag your own question?
>
>
>
To request moderator action.
Anything that you cannot do yourself but moderators can do, is fair game. If you realize you asked your question on the wrong site, for example, you can flag it to request a migration.
Another reason to request moderator attention is if another u... | You might agree with others that your question should be closed, but you can no longer delete it for example. In such a case you can vote to close it.
And if there is anything requiring the attention of a moderator, you can flag to notify them. |
170,627 | I would like to see a soft-lock feature for 10k users. This can be considered a scaled-down version of [Content Dispute lock](https://meta.stackexchange.com/q/127557/165773 "discussed in more details here") available to diamond moderators (for the record, "mod lock" lasts for [a week](https://softwareengineering.meta.s... | 2013/03/07 | [
"https://meta.stackexchange.com/questions/170627",
"https://meta.stackexchange.com",
"https://meta.stackexchange.com/users/-1/"
] | >
> Why flag your own question?
>
>
>
To request moderator action.
Anything that you cannot do yourself but moderators can do, is fair game. If you realize you asked your question on the wrong site, for example, you can flag it to request a migration.
Another reason to request moderator attention is if another u... | For flagging, you may still need to make the mods aware of an issue with the post.
For voting to close, I know for sure that it's possible for someone to want to vote to close their own post. I know, because [I have done it myself](https://stackoverflow.com/q/13872316/237838). I posted that question, then realized it ... |
33,303 | Say we have $n$-gons $P$ and $Q$. Is there any necessary condition for $Q = f(P)$, for some linear transformation $f : \mathbb{R}^2 \to \mathbb{R}^2$?
Sorry if this is too elementary / general. | 2010/07/25 | [
"https://mathoverflow.net/questions/33303",
"https://mathoverflow.net",
"https://mathoverflow.net/users/2503/"
] | Jesse Douglas studied linear transformations of polygons on the complex plane in 1930s. He proved, in particular, that a transformation $z\_i{}'=\sum\_{i=1}^na\_{ij}z\_j$ (all numbers are complex) will transform a polygon $\pi=(z\_1,\cdots,z\_n)$ into a polygon $\pi'=(z\_1{}',\cdots,z\_n{}')$ if, and only if, the matri... | By the way, is there any result on linear transformation of polyhedra in $\mathbb{R}^n$? |
42,218,278 | ```
x = Time.now
y = 1.hours.from_now
z = 1.hours.before_now
```
i'm sorry if this question too stupid. i want to know an effective way to show one hour before and after now in ruby.
thanks for watching and for helping. | 2017/02/14 | [
"https://Stackoverflow.com/questions/42218278",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/-1/"
] | There are no such methods in Ruby. You'll have to do:
```
Time.now + 1*60*60 # 1.hours.from_now -> 1 hour, 60 minutes, 60 seconds
Time.now - 1*60*60 # 1.hours.before_now -> 1 hour, 60 minutes, 60 seconds
```
or you can include `activesupport` in your project. | Also you can write in this manner :
**Current Time:**
x = Time.now `=> 2017-02-14 11:55:17 +0530`
**one hour ago ( one hour before):**
y = x - 1.hour `=> 2017-02-14 10:55:17 +0530`
or
y = **1.hour.ago** `=> 2017-02-14 10:55:17 +0530` `# available in rails v4.2
**one hour later/since ( one hour after ):**
z = x ... |
34,442,666 | I have a generic list of `employees` and `supervisors`
```
List<Employee> employees = new List<Employee>();
List<Supervisor> supervisors = new List<Supervisor>();
```
They are both part of a `employee` class that I have marked as `[Serializable]`
Could I put both of these lists into another list so that it can be ... | 2015/12/23 | [
"https://Stackoverflow.com/questions/34442666",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/4289341/"
] | You can actually serialize two lists to one stream:
```
using (FileStream fs = new FileStream(..., FileMode.OpenOrCreate)) {
BinaryFormatter bf = new BinaryFormatter();
bf.Serialize(fs, employees);
bf.Serialize(fs, supervisors);
}
```
The `BinaryFormatter` prefixes the data block with meta data that also... | You can put this lists in another class container and serialize/deserialize it.
```
[Serializable]
public class Container
{
public List<Employee> employees = new List<Employee>();
public List<Supervisor> supervisors = new List<Supervisor>();
}
``` |
6,276,358 | What is the good mechanism to store information among SQLite database and Shared Preferences?
Why use shared preferences? Why use sqlite? I tried to find the difference between them, and which is the better mechanism for data storing, but I am unable to find the appropriate answer on Google. Please help me with exampl... | 2011/06/08 | [
"https://Stackoverflow.com/questions/6276358",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/787058/"
] | It really depends on the data you want to store.
**SQLite**
Large amounts of same structured data should be stored in a SQLite database as databases are designed for this kind of data. As the data is structured and managed by the database, it can be queried to get a sub set of the data which matches certain criteria... | This question has an accepted answer, but I think there is more to said on the topic - regarding speed.
An application's SharedPreferences and Sqlite DB are both just files, stored in the application's directories on the device's file system. If the amount of data is not too big, the Sqlite option will involve a large... |
6,276,358 | What is the good mechanism to store information among SQLite database and Shared Preferences?
Why use shared preferences? Why use sqlite? I tried to find the difference between them, and which is the better mechanism for data storing, but I am unable to find the appropriate answer on Google. Please help me with exampl... | 2011/06/08 | [
"https://Stackoverflow.com/questions/6276358",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/787058/"
] | It really depends on the data you want to store.
**SQLite**
Large amounts of same structured data should be stored in a SQLite database as databases are designed for this kind of data. As the data is structured and managed by the database, it can be queried to get a sub set of the data which matches certain criteria... | My take is, it is not about speed or size but the kinds of operation you want to do to your data.
If you plan to do **join**, **sort**, **and other DB operations** on your data then go for **Sqlite**. An example is sorting data by date.
If you want to map simple values (like int, boolean, String) then use **Preferen... |
6,276,358 | What is the good mechanism to store information among SQLite database and Shared Preferences?
Why use shared preferences? Why use sqlite? I tried to find the difference between them, and which is the better mechanism for data storing, but I am unable to find the appropriate answer on Google. Please help me with exampl... | 2011/06/08 | [
"https://Stackoverflow.com/questions/6276358",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/787058/"
] | It really depends on the data you want to store.
**SQLite**
Large amounts of same structured data should be stored in a SQLite database as databases are designed for this kind of data. As the data is structured and managed by the database, it can be queried to get a sub set of the data which matches certain criteria... | * For storing huge amount of data, go for SQLite database system. This
will allow the user to search for data as well.
* On the other hand, for storing small amount of data, go for Shared
Preferences. In this case, a huge database system is unnecessary.
This will allow user to simply save data and load them. |
6,276,358 | What is the good mechanism to store information among SQLite database and Shared Preferences?
Why use shared preferences? Why use sqlite? I tried to find the difference between them, and which is the better mechanism for data storing, but I am unable to find the appropriate answer on Google. Please help me with exampl... | 2011/06/08 | [
"https://Stackoverflow.com/questions/6276358",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/787058/"
] | It really depends on the data you want to store.
**SQLite**
Large amounts of same structured data should be stored in a SQLite database as databases are designed for this kind of data. As the data is structured and managed by the database, it can be queried to get a sub set of the data which matches certain criteria... | Forget SQLLite forget SharedPreferences, use Realm. A single solution for all your local storage. You can use plain old Java Objects as RealmObjects and store your data there. You can convert selcted queries into JSON files. No need to parse the entire data base.
Check this link:
<https://realm.io/news/introducing-real... |
6,276,358 | What is the good mechanism to store information among SQLite database and Shared Preferences?
Why use shared preferences? Why use sqlite? I tried to find the difference between them, and which is the better mechanism for data storing, but I am unable to find the appropriate answer on Google. Please help me with exampl... | 2011/06/08 | [
"https://Stackoverflow.com/questions/6276358",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/787058/"
] | This question has an accepted answer, but I think there is more to said on the topic - regarding speed.
An application's SharedPreferences and Sqlite DB are both just files, stored in the application's directories on the device's file system. If the amount of data is not too big, the Sqlite option will involve a large... | My take is, it is not about speed or size but the kinds of operation you want to do to your data.
If you plan to do **join**, **sort**, **and other DB operations** on your data then go for **Sqlite**. An example is sorting data by date.
If you want to map simple values (like int, boolean, String) then use **Preferen... |
6,276,358 | What is the good mechanism to store information among SQLite database and Shared Preferences?
Why use shared preferences? Why use sqlite? I tried to find the difference between them, and which is the better mechanism for data storing, but I am unable to find the appropriate answer on Google. Please help me with exampl... | 2011/06/08 | [
"https://Stackoverflow.com/questions/6276358",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/787058/"
] | This question has an accepted answer, but I think there is more to said on the topic - regarding speed.
An application's SharedPreferences and Sqlite DB are both just files, stored in the application's directories on the device's file system. If the amount of data is not too big, the Sqlite option will involve a large... | * For storing huge amount of data, go for SQLite database system. This
will allow the user to search for data as well.
* On the other hand, for storing small amount of data, go for Shared
Preferences. In this case, a huge database system is unnecessary.
This will allow user to simply save data and load them. |
6,276,358 | What is the good mechanism to store information among SQLite database and Shared Preferences?
Why use shared preferences? Why use sqlite? I tried to find the difference between them, and which is the better mechanism for data storing, but I am unable to find the appropriate answer on Google. Please help me with exampl... | 2011/06/08 | [
"https://Stackoverflow.com/questions/6276358",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/787058/"
] | This question has an accepted answer, but I think there is more to said on the topic - regarding speed.
An application's SharedPreferences and Sqlite DB are both just files, stored in the application's directories on the device's file system. If the amount of data is not too big, the Sqlite option will involve a large... | Forget SQLLite forget SharedPreferences, use Realm. A single solution for all your local storage. You can use plain old Java Objects as RealmObjects and store your data there. You can convert selcted queries into JSON files. No need to parse the entire data base.
Check this link:
<https://realm.io/news/introducing-real... |
6,276,358 | What is the good mechanism to store information among SQLite database and Shared Preferences?
Why use shared preferences? Why use sqlite? I tried to find the difference between them, and which is the better mechanism for data storing, but I am unable to find the appropriate answer on Google. Please help me with exampl... | 2011/06/08 | [
"https://Stackoverflow.com/questions/6276358",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/787058/"
] | My take is, it is not about speed or size but the kinds of operation you want to do to your data.
If you plan to do **join**, **sort**, **and other DB operations** on your data then go for **Sqlite**. An example is sorting data by date.
If you want to map simple values (like int, boolean, String) then use **Preferen... | * For storing huge amount of data, go for SQLite database system. This
will allow the user to search for data as well.
* On the other hand, for storing small amount of data, go for Shared
Preferences. In this case, a huge database system is unnecessary.
This will allow user to simply save data and load them. |
6,276,358 | What is the good mechanism to store information among SQLite database and Shared Preferences?
Why use shared preferences? Why use sqlite? I tried to find the difference between them, and which is the better mechanism for data storing, but I am unable to find the appropriate answer on Google. Please help me with exampl... | 2011/06/08 | [
"https://Stackoverflow.com/questions/6276358",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/787058/"
] | My take is, it is not about speed or size but the kinds of operation you want to do to your data.
If you plan to do **join**, **sort**, **and other DB operations** on your data then go for **Sqlite**. An example is sorting data by date.
If you want to map simple values (like int, boolean, String) then use **Preferen... | Forget SQLLite forget SharedPreferences, use Realm. A single solution for all your local storage. You can use plain old Java Objects as RealmObjects and store your data there. You can convert selcted queries into JSON files. No need to parse the entire data base.
Check this link:
<https://realm.io/news/introducing-real... |
6,276,358 | What is the good mechanism to store information among SQLite database and Shared Preferences?
Why use shared preferences? Why use sqlite? I tried to find the difference between them, and which is the better mechanism for data storing, but I am unable to find the appropriate answer on Google. Please help me with exampl... | 2011/06/08 | [
"https://Stackoverflow.com/questions/6276358",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/787058/"
] | * For storing huge amount of data, go for SQLite database system. This
will allow the user to search for data as well.
* On the other hand, for storing small amount of data, go for Shared
Preferences. In this case, a huge database system is unnecessary.
This will allow user to simply save data and load them. | Forget SQLLite forget SharedPreferences, use Realm. A single solution for all your local storage. You can use plain old Java Objects as RealmObjects and store your data there. You can convert selcted queries into JSON files. No need to parse the entire data base.
Check this link:
<https://realm.io/news/introducing-real... |
161,395 | Hello I'm studying machine learning processes and I'm beside of a misunderstanding..
**Is this right?**
>
> "Minimization is a process that minimize the error rate of Y (output
> of the feature) to be a valid limiter and this is followed by an
> optimization process that acts on the parameters to find the best on... | 2015/07/14 | [
"https://stats.stackexchange.com/questions/161395",
"https://stats.stackexchange.com",
"https://stats.stackexchange.com/users/82276/"
] | This is usually done with maximum likelihood ratio between original model and a model omitting the variance coefficient to be estimate (random intercept/random slope/random co-variance between slope and intercept).
A good example is in these tutorials:
* When model has more than one random coefficient: <http://www.bo... | Asymptotic test are problematic for variance parameters, because parameter space is bounded by zero. Moreover, the hypothesis you are trying to test, can't be true, as the parameter is continuous. Probability of $\sigma^2 = 0$ is exactly 0.
What you can do to make inference on the variance parameters is to switch to a... |
69,731,434 | **in edit\_customer:**
```
<form action="{{ url('customer/profile_update', [ 'id'=> $cust->id ]) }}" method="POST" enctype="multipart/form-data">
@csrf
@method("PUT")
```
**web.php**
//Customer related pages
```
Route::prefix('customer')->middleware(['auth','verified'])->name('customer.')->group(function(){
... | 2021/10/27 | [
"https://Stackoverflow.com/questions/69731434",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/13405269/"
] | you have just missed a closing parenthesis.
```
SELECT UPPER(SUBSTRING(NAME,1,3)) FROM STUDENTS;
```
Also, to get the first 4 letters you should use SUBSTRING(NAME,1,4)
Cheers | both of queries that you used have wrong parenthesis match (every opening parenthesis need closing one). If you want to get first 4 letters you should replace 3 with 4
```
SELECT UCASE(MID(NAME,1,4)) FROM STUDENTS;
SELECT UPPER(SUBSTRING(NAME,1,4)) FROM STUDENTS;
``` |
12,965,588 | I'm using jquery-ui-map 3.0 RC to simplify the process of using json to place markers on a google map using javascript api v3.
When I prototyped using html files it worked fine. Once I started to use embed code within an MVC4 project and debug using iis express I'd get an error in Google Chrome Developer Tools "Uncau... | 2012/10/19 | [
"https://Stackoverflow.com/questions/12965588",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/567606/"
] | You are including gmap3 but making calls to `.gmap(...)`. The examples in the gmap3 documentation use `.gmap3(...)`.
Also, I can find no evidence that you can initialise a map with the standard `google.maps` API, then add markers etc with gmap3.
As far as I can tell, there's no mechanism for mixing the two APIs, at ... | The issue may be that Google maps isn't ready yet. You have used jQuery ready functions, but I suggest you instead use a combination of both.
Please post up a fiddle or example so we can investigate further |
12,965,588 | I'm using jquery-ui-map 3.0 RC to simplify the process of using json to place markers on a google map using javascript api v3.
When I prototyped using html files it worked fine. Once I started to use embed code within an MVC4 project and debug using iis express I'd get an error in Google Chrome Developer Tools "Uncau... | 2012/10/19 | [
"https://Stackoverflow.com/questions/12965588",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/567606/"
] | You are including gmap3 but making calls to `.gmap(...)`. The examples in the gmap3 documentation use `.gmap3(...)`.
Also, I can find no evidence that you can initialise a map with the standard `google.maps` API, then add markers etc with gmap3.
As far as I can tell, there's no mechanism for mixing the two APIs, at ... | I had the same problem and found that it was due to multiple jquery references.
My \_layout.cshtml was loading jquery via the following line in the body section:
@Scripts.Render("~/bundles/jquery")
@RenderSection("scripts", required: false)
It seems that this was effectively overwriting the reference I had in my ... |
21,294,191 | ```
return db.Orders.Where(o => o.Customer == User.Identity.Name);
```
Where does `o` come from? Sometimes I see this form used with other letters like `c`?
Is this exchangeable?
Where does `User.Identity.Name` come from? | 2014/01/22 | [
"https://Stackoverflow.com/questions/21294191",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1893264/"
] | >
> Where does o come from?
>
>
>
`Where` takes a `Func` delegate that takes an instance of whatever collection type you are using. In this case, it would be `Func<Order, bool>`. Your Lambda statement declares an anonymous function that matches the delegate. `o` is simply the `Order` input. You can name it whateve... | This is known as [Lambda Expression](http://msdn.microsoft.com/en-us/library/bb397687.aspx)
>
> By using lambda expressions, you can write local functions that can be passed as arguments or returned as the value of function calls.
>
>
>
In your case, you are using
```
db.Orders.Where(o => o.Customer == User.Ide... |
21,294,191 | ```
return db.Orders.Where(o => o.Customer == User.Identity.Name);
```
Where does `o` come from? Sometimes I see this form used with other letters like `c`?
Is this exchangeable?
Where does `User.Identity.Name` come from? | 2014/01/22 | [
"https://Stackoverflow.com/questions/21294191",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1893264/"
] | The `=>` operator is used to define a *lambda statement* - essentially an inline function. It's the inline equivalent of:
```
public bool Myfunc(Order o)
{
return o.Customer == User.Identity.Name;
}
```
The *type* of `o` is inferred from the parameter type of the `Func` passed into `Where`. In this case, the type... | This is known as [Lambda Expression](http://msdn.microsoft.com/en-us/library/bb397687.aspx)
>
> By using lambda expressions, you can write local functions that can be passed as arguments or returned as the value of function calls.
>
>
>
In your case, you are using
```
db.Orders.Where(o => o.Customer == User.Ide... |
21,294,191 | ```
return db.Orders.Where(o => o.Customer == User.Identity.Name);
```
Where does `o` come from? Sometimes I see this form used with other letters like `c`?
Is this exchangeable?
Where does `User.Identity.Name` come from? | 2014/01/22 | [
"https://Stackoverflow.com/questions/21294191",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1893264/"
] | This is known as [Lambda Expression](http://msdn.microsoft.com/en-us/library/bb397687.aspx)
>
> By using lambda expressions, you can write local functions that can be passed as arguments or returned as the value of function calls.
>
>
>
In your case, you are using
```
db.Orders.Where(o => o.Customer == User.Ide... | All the answers provided are correct. I'll just try to explain you in simple language about the statement:
You are accessing the Order table by writing `db.Orders`
Then you are putting up a condition on the table using `Where`
Inside `Where` you specify the condition. This is done using lambda expression. Lambda expr... |
21,294,191 | ```
return db.Orders.Where(o => o.Customer == User.Identity.Name);
```
Where does `o` come from? Sometimes I see this form used with other letters like `c`?
Is this exchangeable?
Where does `User.Identity.Name` come from? | 2014/01/22 | [
"https://Stackoverflow.com/questions/21294191",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1893264/"
] | >
> Where does o come from?
>
>
>
`Where` takes a `Func` delegate that takes an instance of whatever collection type you are using. In this case, it would be `Func<Order, bool>`. Your Lambda statement declares an anonymous function that matches the delegate. `o` is simply the `Order` input. You can name it whateve... | All the answers provided are correct. I'll just try to explain you in simple language about the statement:
You are accessing the Order table by writing `db.Orders`
Then you are putting up a condition on the table using `Where`
Inside `Where` you specify the condition. This is done using lambda expression. Lambda expr... |
21,294,191 | ```
return db.Orders.Where(o => o.Customer == User.Identity.Name);
```
Where does `o` come from? Sometimes I see this form used with other letters like `c`?
Is this exchangeable?
Where does `User.Identity.Name` come from? | 2014/01/22 | [
"https://Stackoverflow.com/questions/21294191",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1893264/"
] | The `=>` operator is used to define a *lambda statement* - essentially an inline function. It's the inline equivalent of:
```
public bool Myfunc(Order o)
{
return o.Customer == User.Identity.Name;
}
```
The *type* of `o` is inferred from the parameter type of the `Func` passed into `Where`. In this case, the type... | All the answers provided are correct. I'll just try to explain you in simple language about the statement:
You are accessing the Order table by writing `db.Orders`
Then you are putting up a condition on the table using `Where`
Inside `Where` you specify the condition. This is done using lambda expression. Lambda expr... |
7,278,427 | I'm using impromptu
<http://www.shiguenori.com/material/jquery.impromptu/>
to show dialog boxes and collect user's input.
But I can't get the input textbox to focus when it appears.
I've tried giving the input an id and add in impromptu.js
```
$('#impromptu_fname').focus();
```
in several placess.
I also tried... | 2011/09/02 | [
"https://Stackoverflow.com/questions/7278427",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/661424/"
] | You'll have to do it in the `loaded` callback:
```
$.prompt('Your message goes here.', {
// options
loaded: function(){
$('#impromptu_fname').focus();
}
});
``` | Thanks for the tip to use the loaded callback. I had the same problem, however to get the focus on the default button of the initial prompt, here's how I did it:
```
var myPrompt = $.prompt(tourStates);
myPrompt.on('impromptu:loaded', function(e){$('button.jqidefaultbutton[id^="jqi_0"]').focus();});
``` |
43,559,543 | i have lots of adapters and views, viewsmodels and so on. Since its hard to maintain those i would like to use databinding and mvvm for that case. Now i tried to forward the item clicks into the viewmodel. Since its a recycleview i would lovely not loose the functionality to have less memory usage.
Currently i have a... | 2017/04/22 | [
"https://Stackoverflow.com/questions/43559543",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/2032539/"
] | Since you are rendering your React components which depend on the webpack CSS loader in the backend, on your Express server, you need to run your server-side code through webpack, just as you do your client-side code.
In the project I'm currently working on, I have two webpack builds, each with their own config. One p... | Try importing your css like that:
```
import "./text.css";
```
Please share your css as well. |
43,559,543 | i have lots of adapters and views, viewsmodels and so on. Since its hard to maintain those i would like to use databinding and mvvm for that case. Now i tried to forward the item clicks into the viewmodel. Since its a recycleview i would lovely not loose the functionality to have less memory usage.
Currently i have a... | 2017/04/22 | [
"https://Stackoverflow.com/questions/43559543",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/2032539/"
] | If you want to use simple css:
```
import './text.css';
```
But if you want to use CSS Modules, I assume that according to added CSS in your import, check <https://github.com/css-modules/css-modules>.
Also, try to change webpack config:
```
{
test: /\.css$/,
loader: 'style-loader!css-loader!',
},
```
C... | Try importing your css like that:
```
import "./text.css";
```
Please share your css as well. |
43,559,543 | i have lots of adapters and views, viewsmodels and so on. Since its hard to maintain those i would like to use databinding and mvvm for that case. Now i tried to forward the item clicks into the viewmodel. Since its a recycleview i would lovely not loose the functionality to have less memory usage.
Currently i have a... | 2017/04/22 | [
"https://Stackoverflow.com/questions/43559543",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/2032539/"
] | I had to remove from:
```
{
test: /\.css$/,
use: [
{ loader: 'style-loader' },
{ loader: 'css-loader' }
],
include: [
path.resolve(__dirname, "src","client")
],
}
```
to:
```
{
test: /\.css$/,
use: [
{ loader: 'style-loader' },... | Try importing your css like that:
```
import "./text.css";
```
Please share your css as well. |
43,559,543 | i have lots of adapters and views, viewsmodels and so on. Since its hard to maintain those i would like to use databinding and mvvm for that case. Now i tried to forward the item clicks into the viewmodel. Since its a recycleview i would lovely not loose the functionality to have less memory usage.
Currently i have a... | 2017/04/22 | [
"https://Stackoverflow.com/questions/43559543",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/2032539/"
] | To create npm package, you can build like to:
```
module: {
rules: [
{
test: /\.js$/,
include: path.resolve(__dirname, 'src'),
exclude: /(node_modules|bower_components|build)/,
loader: 'babel-loader'
},
{
test: /\.(css|less)$/,
use: ["style-loader",... | Try importing your css like that:
```
import "./text.css";
```
Please share your css as well. |
43,559,543 | i have lots of adapters and views, viewsmodels and so on. Since its hard to maintain those i would like to use databinding and mvvm for that case. Now i tried to forward the item clicks into the viewmodel. Since its a recycleview i would lovely not loose the functionality to have less memory usage.
Currently i have a... | 2017/04/22 | [
"https://Stackoverflow.com/questions/43559543",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/2032539/"
] | I had to remove from:
```
{
test: /\.css$/,
use: [
{ loader: 'style-loader' },
{ loader: 'css-loader' }
],
include: [
path.resolve(__dirname, "src","client")
],
}
```
to:
```
{
test: /\.css$/,
use: [
{ loader: 'style-loader' },... | Since you are rendering your React components which depend on the webpack CSS loader in the backend, on your Express server, you need to run your server-side code through webpack, just as you do your client-side code.
In the project I'm currently working on, I have two webpack builds, each with their own config. One p... |
43,559,543 | i have lots of adapters and views, viewsmodels and so on. Since its hard to maintain those i would like to use databinding and mvvm for that case. Now i tried to forward the item clicks into the viewmodel. Since its a recycleview i would lovely not loose the functionality to have less memory usage.
Currently i have a... | 2017/04/22 | [
"https://Stackoverflow.com/questions/43559543",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/2032539/"
] | To create npm package, you can build like to:
```
module: {
rules: [
{
test: /\.js$/,
include: path.resolve(__dirname, 'src'),
exclude: /(node_modules|bower_components|build)/,
loader: 'babel-loader'
},
{
test: /\.(css|less)$/,
use: ["style-loader",... | Since you are rendering your React components which depend on the webpack CSS loader in the backend, on your Express server, you need to run your server-side code through webpack, just as you do your client-side code.
In the project I'm currently working on, I have two webpack builds, each with their own config. One p... |
43,559,543 | i have lots of adapters and views, viewsmodels and so on. Since its hard to maintain those i would like to use databinding and mvvm for that case. Now i tried to forward the item clicks into the viewmodel. Since its a recycleview i would lovely not loose the functionality to have less memory usage.
Currently i have a... | 2017/04/22 | [
"https://Stackoverflow.com/questions/43559543",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/2032539/"
] | I had to remove from:
```
{
test: /\.css$/,
use: [
{ loader: 'style-loader' },
{ loader: 'css-loader' }
],
include: [
path.resolve(__dirname, "src","client")
],
}
```
to:
```
{
test: /\.css$/,
use: [
{ loader: 'style-loader' },... | If you want to use simple css:
```
import './text.css';
```
But if you want to use CSS Modules, I assume that according to added CSS in your import, check <https://github.com/css-modules/css-modules>.
Also, try to change webpack config:
```
{
test: /\.css$/,
loader: 'style-loader!css-loader!',
},
```
C... |
43,559,543 | i have lots of adapters and views, viewsmodels and so on. Since its hard to maintain those i would like to use databinding and mvvm for that case. Now i tried to forward the item clicks into the viewmodel. Since its a recycleview i would lovely not loose the functionality to have less memory usage.
Currently i have a... | 2017/04/22 | [
"https://Stackoverflow.com/questions/43559543",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/2032539/"
] | To create npm package, you can build like to:
```
module: {
rules: [
{
test: /\.js$/,
include: path.resolve(__dirname, 'src'),
exclude: /(node_modules|bower_components|build)/,
loader: 'babel-loader'
},
{
test: /\.(css|less)$/,
use: ["style-loader",... | If you want to use simple css:
```
import './text.css';
```
But if you want to use CSS Modules, I assume that according to added CSS in your import, check <https://github.com/css-modules/css-modules>.
Also, try to change webpack config:
```
{
test: /\.css$/,
loader: 'style-loader!css-loader!',
},
```
C... |
43,559,543 | i have lots of adapters and views, viewsmodels and so on. Since its hard to maintain those i would like to use databinding and mvvm for that case. Now i tried to forward the item clicks into the viewmodel. Since its a recycleview i would lovely not loose the functionality to have less memory usage.
Currently i have a... | 2017/04/22 | [
"https://Stackoverflow.com/questions/43559543",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/2032539/"
] | I had to remove from:
```
{
test: /\.css$/,
use: [
{ loader: 'style-loader' },
{ loader: 'css-loader' }
],
include: [
path.resolve(__dirname, "src","client")
],
}
```
to:
```
{
test: /\.css$/,
use: [
{ loader: 'style-loader' },... | To create npm package, you can build like to:
```
module: {
rules: [
{
test: /\.js$/,
include: path.resolve(__dirname, 'src'),
exclude: /(node_modules|bower_components|build)/,
loader: 'babel-loader'
},
{
test: /\.(css|less)$/,
use: ["style-loader",... |
43,095,283 | I'm having some issues with a Wicket (8.0.0-M4) NumberTextField in Kotlin (1.1.0).
My stripped-down form looks like this:
```
class Test : AbstractWebPage() {
val housenumberModel: Model<Int> = Model<Int>()
val housenumber = NumberTextField<Int>("housenumberModel", housenumberModel)
val form: Form<Unit>... | 2017/03/29 | [
"https://Stackoverflow.com/questions/43095283",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/875083/"
] | Because of type erasure your NumberTextField cannot detect the generic type parameter of your model. Since your model object is null, it cannot be used to derive the type either.
In this case Wicket assumes a String model object type :/.
Either provide the type to the NumberTextField explicitly, or use a model that k... | There is a way to tell wicket about the type you want, it is by adding the type in the constructor. More [here](https://ci.apache.org/projects/wicket/apidocs/8.x/org/apache/wicket/markup/html/form/NumberTextField.html#NumberTextField-java.lang.String-org.apache.wicket.model.IModel-java.lang.Class-).
In Java it looks l... |
5,501,924 | I'm trying to do something like this:
```
for (std::streampos Position = 0; Position < 123; Position++)
{
// Use Position to access something...
}
```
However, it appears that `std::streampos` does not have `operator++` overloaded.
Trying to use `Position = (Position + 1)` results in the following error:
```
I... | 2011/03/31 | [
"https://Stackoverflow.com/questions/5501924",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/497934/"
] | Try a [`std::streamoff`](http://www.cplusplus.com/reference/iostream/streamoff/), which represents an offset in a stream. It supports both pre- and post increment/decrement operators.
>
> The underlying type is implementation defined, but must be able to be consistently converted to both streamsize and fpos (**thus, ... | Use `+=`:
```
for (std::streampos Position = 0; Position < 123; Position += 1)
```
`+` doesn’t work because `operator +` is actually defined for `streampos` and `steamoff`, not `int`.
This means that two implicit conversions exist that are equally good: either your `1` could be converted to `streamoff` (which is pr... |
5,501,924 | I'm trying to do something like this:
```
for (std::streampos Position = 0; Position < 123; Position++)
{
// Use Position to access something...
}
```
However, it appears that `std::streampos` does not have `operator++` overloaded.
Trying to use `Position = (Position + 1)` results in the following error:
```
I... | 2011/03/31 | [
"https://Stackoverflow.com/questions/5501924",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/497934/"
] | Use `+=`:
```
for (std::streampos Position = 0; Position < 123; Position += 1)
```
`+` doesn’t work because `operator +` is actually defined for `streampos` and `steamoff`, not `int`.
This means that two implicit conversions exist that are equally good: either your `1` could be converted to `streamoff` (which is pr... | I came across this link while looking into how I can subtract from a `std::streampos` object:
<https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=187599>
The suggested solution is using the defined operator overload `operator+()` or `operator-()` which work pretty well for me.
```
Position.operator+(increment_val);
P... |
5,501,924 | I'm trying to do something like this:
```
for (std::streampos Position = 0; Position < 123; Position++)
{
// Use Position to access something...
}
```
However, it appears that `std::streampos` does not have `operator++` overloaded.
Trying to use `Position = (Position + 1)` results in the following error:
```
I... | 2011/03/31 | [
"https://Stackoverflow.com/questions/5501924",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/497934/"
] | Try a [`std::streamoff`](http://www.cplusplus.com/reference/iostream/streamoff/), which represents an offset in a stream. It supports both pre- and post increment/decrement operators.
>
> The underlying type is implementation defined, but must be able to be consistently converted to both streamsize and fpos (**thus, ... | `std::streampos` is not a numeric type, although it supports conversion
to and from numeric types. If you want to do arithmetic on the
position, you need to use `std::streamoff` (and specify the from
argument when calling seek).
Also, don't forget that you can't seek to an arbitrary position in
a file unless it has be... |
5,501,924 | I'm trying to do something like this:
```
for (std::streampos Position = 0; Position < 123; Position++)
{
// Use Position to access something...
}
```
However, it appears that `std::streampos` does not have `operator++` overloaded.
Trying to use `Position = (Position + 1)` results in the following error:
```
I... | 2011/03/31 | [
"https://Stackoverflow.com/questions/5501924",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/497934/"
] | Try a [`std::streamoff`](http://www.cplusplus.com/reference/iostream/streamoff/), which represents an offset in a stream. It supports both pre- and post increment/decrement operators.
>
> The underlying type is implementation defined, but must be able to be consistently converted to both streamsize and fpos (**thus, ... | I came across this link while looking into how I can subtract from a `std::streampos` object:
<https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=187599>
The suggested solution is using the defined operator overload `operator+()` or `operator-()` which work pretty well for me.
```
Position.operator+(increment_val);
P... |
5,501,924 | I'm trying to do something like this:
```
for (std::streampos Position = 0; Position < 123; Position++)
{
// Use Position to access something...
}
```
However, it appears that `std::streampos` does not have `operator++` overloaded.
Trying to use `Position = (Position + 1)` results in the following error:
```
I... | 2011/03/31 | [
"https://Stackoverflow.com/questions/5501924",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/497934/"
] | `std::streampos` is not a numeric type, although it supports conversion
to and from numeric types. If you want to do arithmetic on the
position, you need to use `std::streamoff` (and specify the from
argument when calling seek).
Also, don't forget that you can't seek to an arbitrary position in
a file unless it has be... | I came across this link while looking into how I can subtract from a `std::streampos` object:
<https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=187599>
The suggested solution is using the defined operator overload `operator+()` or `operator-()` which work pretty well for me.
```
Position.operator+(increment_val);
P... |
133,750 | Please, for the two lists
```
L1 = {{a, b}, {c, d}}
L2 = {{{e, f}, {g, h}}, {{i, j}, {k, q}}}
```
The desired result is
```
{{{ae, bf}, {ag, bh}}, {{ci, dj}, {ck, dq}}}
``` | 2016/12/18 | [
"https://mathematica.stackexchange.com/questions/133750",
"https://mathematica.stackexchange.com",
"https://mathematica.stackexchange.com/users/45299/"
] | One way would be
```
l1 = {{a,b},{c,d}};
l2 = {{{e,f},{g,h}},{{i,j},{k,q}}};
Partition[Riffle[l1,l1],2] l2
(* {{{a e, b f},{a g, b h}},{{c i, d j},{c k, d q}}} *)
```
The idea behind this solution is to expand `l1` into the same shape as `l2`
```
Partition[Riffle[l1,l1],2]
(* {{{a,b},{a,b}},{{c,d},{c,d}}} *)
```
... | ```
Flatten[ Flatten[L2, {{1}, {3}}] L1, {{1}, {3}}]
```
or
```
Function[x, # x] /@ #2 & @@@ Thread[{L1, L2}]
```
>
> {{{a e, b f}, {a g, b h}}, {{c i, d j}, {c k, d q}}}
>
>
> |
133,750 | Please, for the two lists
```
L1 = {{a, b}, {c, d}}
L2 = {{{e, f}, {g, h}}, {{i, j}, {k, q}}}
```
The desired result is
```
{{{ae, bf}, {ag, bh}}, {{ci, dj}, {ck, dq}}}
``` | 2016/12/18 | [
"https://mathematica.stackexchange.com/questions/133750",
"https://mathematica.stackexchange.com",
"https://mathematica.stackexchange.com/users/45299/"
] | ```
L1 = {{a, b}, {c, d}}
L2 = {{{e, f}, {g, h}}, {{i, j}, {k, q}}}
Transpose[L1 Transpose[L2, {1, 3, 2}], {1, 3, 2}]
```
>
> {{{a e, b f}, {a g, b h}}, {{c i, d j}, {c k, d q}}}
>
>
> | ```
Flatten[ Flatten[L2, {{1}, {3}}] L1, {{1}, {3}}]
```
or
```
Function[x, # x] /@ #2 & @@@ Thread[{L1, L2}]
```
>
> {{{a e, b f}, {a g, b h}}, {{c i, d j}, {c k, d q}}}
>
>
> |
133,750 | Please, for the two lists
```
L1 = {{a, b}, {c, d}}
L2 = {{{e, f}, {g, h}}, {{i, j}, {k, q}}}
```
The desired result is
```
{{{ae, bf}, {ag, bh}}, {{ci, dj}, {ck, dq}}}
``` | 2016/12/18 | [
"https://mathematica.stackexchange.com/questions/133750",
"https://mathematica.stackexchange.com",
"https://mathematica.stackexchange.com/users/45299/"
] | ```
L1 = {{a, b}, {c, d}};
L2 = {{{e, f}, {g, h}}, {{i, j}, {k, q}}};
Transpose /@ (L1*(Transpose /@ L2))
(* {{{a e, b f}, {a g, b h}}, {{c i, d j}, {c k, d q}}} *)
```
or
```
Thread /@ (L1*(Thread /@ L2))
(* {{{a e, b f}, {a g, b h}}, {{c i, d j}, {c k, d q}}} *)
% == %%
(* True *)
``` | ```
Flatten[ Flatten[L2, {{1}, {3}}] L1, {{1}, {3}}]
```
or
```
Function[x, # x] /@ #2 & @@@ Thread[{L1, L2}]
```
>
> {{{a e, b f}, {a g, b h}}, {{c i, d j}, {c k, d q}}}
>
>
> |
58,116,924 | I have several database objects which need to extract a single record (like TOP 1) from a table, but the priority for which one is chosen depends on a BIT value in a settings table, and that settings table will contain only one row.
I have written a view which will perform the required functionality:
```
CREATE VIEW ... | 2019/09/26 | [
"https://Stackoverflow.com/questions/58116924",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/2882061/"
] | ```
pm.response.json().depositInfoList
```
This will save whole depositInfoList JSON data to the environment variable, and hence when you try to access it, it showed up Object Object.
```
pm.response.json().depositInfoList.depositInfoId
```
This doesn't make sense as `depositInfoList` is an array, you have to prov... | If you want to store the whole object/array in your Environment/Global/Collection variables, you need to stringify the value first:
```
const jsonBody = pm.response.json();
pm.environment.set('depositInfoList', JSON.stringify(jsonBody.depositInfoList)); //will store the whole array as string
pm.environment.set('deposi... |
12,453,994 | So I'm trying to do my programming assignment, here it is:
```
Write a C/C++ program (call it string invert) that takes a
string argument from the command line and outputs the string in reversed order. Here comes
the twist: Each process can output at most one character. If you want to output more than a
single charact... | 2012/09/17 | [
"https://Stackoverflow.com/questions/12453994",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/222676/"
] | Let's say you have the input "abcd", then your program should spawn a process for each character. So the first process would return 'd', the second process 'c' and so on. The assignment is probably a test of how well you understand synchronizing processes. | Every process should jsut print *ONE* character. Example:
```
$yourProgamm sample
```
usually you would loop over the sample string and simply print each character with a call to `cout` or so. However you are supposed to only print one character per process. Meaning you output `e`, everything is fine. But if you run... |
3,537 | While writing RoR code I often need to run drop into a [pry](https://github.com/pry/pry) session or a debugger. So I place my `binding.pry` line in the implementation code and run my spec(s). That works fine if I run the specs in a terminal but from inside Emacs, I get a messy output and it's very hard to use the debug... | 2014/11/14 | [
"https://emacs.stackexchange.com/questions/3537",
"https://emacs.stackexchange.com",
"https://emacs.stackexchange.com/users/94/"
] | `rspec-mode` has recently added a [section in the README](https://github.com/pezra/rspec-mode/#debugging) on this subject. It says:
Install `inf-ruby` and add this to your init file:
```
(add-hook 'after-init-hook 'inf-ruby-switch-setup)
```
When you've hit the breakpoint, hit `C-x C-q` to enable `inf-ruby`. | I find that [pry-remote](https://github.com/Mon-Ouie/pry-remote) is the best way to run pry within Emacs, since then pry gets its own dedicated buffer and can attach to a ruby process from anywhere (included a non-Emacs terminal or things like [pow](http://pow.cx/)). I use something like this:
```
(defun my-run-remote... |
101,558 | I've set up a VMWare instance to run CastIron Integration Appliance. I allocated 2gb of memory to the instance, assuming it would take this as physical memory (my server has 8gb total).
When I view `top` however on the server, the vmware-vmx process has about 100m Resident memory and 1900m Virtual.
Running CastIron i... | 2010/01/11 | [
"https://serverfault.com/questions/101558",
"https://serverfault.com",
"https://serverfault.com/users/19656/"
] | VMware Server has a setting to define if you want all VM memory to fit in physical RAM, or allow some of them to be swapped; it's in the host settings.
If you have more RAM than you're using, you can safely set it to only use RAM; you will then not be able to power on more VMs if there's not enough available physical ... | Unless you're using ESX and making VM resource reservations your VM will not be given any more physical memory than is being **used**, i.e. if you give your VM 4GB but only ever address 1GB then only 1GB of physical memory is taken up.
I'm not sure where the 50% figure comes from but if that VM's vmware-vmx process is... |
101,558 | I've set up a VMWare instance to run CastIron Integration Appliance. I allocated 2gb of memory to the instance, assuming it would take this as physical memory (my server has 8gb total).
When I view `top` however on the server, the vmware-vmx process has about 100m Resident memory and 1900m Virtual.
Running CastIron i... | 2010/01/11 | [
"https://serverfault.com/questions/101558",
"https://serverfault.com",
"https://serverfault.com/users/19656/"
] | Unless you're using ESX and making VM resource reservations your VM will not be given any more physical memory than is being **used**, i.e. if you give your VM 4GB but only ever address 1GB then only 1GB of physical memory is taken up.
I'm not sure where the 50% figure comes from but if that VM's vmware-vmx process is... | Yes this is true. You need to allocate the RAM usage from properties of VM.
Ensure VM is switched off. |
101,558 | I've set up a VMWare instance to run CastIron Integration Appliance. I allocated 2gb of memory to the instance, assuming it would take this as physical memory (my server has 8gb total).
When I view `top` however on the server, the vmware-vmx process has about 100m Resident memory and 1900m Virtual.
Running CastIron i... | 2010/01/11 | [
"https://serverfault.com/questions/101558",
"https://serverfault.com",
"https://serverfault.com/users/19656/"
] | VMware Server has a setting to define if you want all VM memory to fit in physical RAM, or allow some of them to be swapped; it's in the host settings.
If you have more RAM than you're using, you can safely set it to only use RAM; you will then not be able to power on more VMs if there's not enough available physical ... | First, vmware **ALWAYS** creates swap. It's required. If you do not set reservations, ESX host creates a .vswp file equal to the difference between the amount of physical memory assigned to the virtual machine and the reservation it has. By default, memory reservations are set to 0. If you have a virtual machine with 2... |
101,558 | I've set up a VMWare instance to run CastIron Integration Appliance. I allocated 2gb of memory to the instance, assuming it would take this as physical memory (my server has 8gb total).
When I view `top` however on the server, the vmware-vmx process has about 100m Resident memory and 1900m Virtual.
Running CastIron i... | 2010/01/11 | [
"https://serverfault.com/questions/101558",
"https://serverfault.com",
"https://serverfault.com/users/19656/"
] | First, vmware **ALWAYS** creates swap. It's required. If you do not set reservations, ESX host creates a .vswp file equal to the difference between the amount of physical memory assigned to the virtual machine and the reservation it has. By default, memory reservations are set to 0. If you have a virtual machine with 2... | Yes this is true. You need to allocate the RAM usage from properties of VM.
Ensure VM is switched off. |
101,558 | I've set up a VMWare instance to run CastIron Integration Appliance. I allocated 2gb of memory to the instance, assuming it would take this as physical memory (my server has 8gb total).
When I view `top` however on the server, the vmware-vmx process has about 100m Resident memory and 1900m Virtual.
Running CastIron i... | 2010/01/11 | [
"https://serverfault.com/questions/101558",
"https://serverfault.com",
"https://serverfault.com/users/19656/"
] | VMware Server has a setting to define if you want all VM memory to fit in physical RAM, or allow some of them to be swapped; it's in the host settings.
If you have more RAM than you're using, you can safely set it to only use RAM; you will then not be able to power on more VMs if there's not enough available physical ... | Yes this is true. You need to allocate the RAM usage from properties of VM.
Ensure VM is switched off. |
33,708 | I am 31 year old with moderate fitness. I cycle 3 times a week about 40 mins average and my heart rate monitor data shows I average more than many other people on strava. I know beats per minute may be considered as a fitness parameter and was wondering why people like Amanda Coker average out 115bpm after a 300+ km ri... | 2017/03/27 | [
"https://fitness.stackexchange.com/questions/33708",
"https://fitness.stackexchange.com",
"https://fitness.stackexchange.com/users/15392/"
] | Its all about conditioning.
You have not stated for how long have you been cycling and am assuming not very long. The person you mentioned might also have sub 50 resting heart rate while yours would be in 70-90 range. Once you keep performing the same exercise over a period of time, your body/heart becomes very effici... | Many things affect your heart rate. Illness, overtraining, the weather, medication, dehydration, stress...and the list goes on.
Be sure to do tons of aerobic work if you're just starting out and keep your heart rate below 75% of your maximum. You should see your speed increase and your heart rate drop. You might neve... |
4,852,522 | i have been struggling with these problem all today.
i added a draggable object inside a jquery accordion menu.
the problem is it doesnt allow me to drag it outside.
when i try to drag it outside it is resizing the div inside accordion menu and showing scrollbar.
here i made a demo of the problem.
<http://jsbin.com/efo... | 2011/01/31 | [
"https://Stackoverflow.com/questions/4852522",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/401006/"
] | in your `draggable` declaration, add the option `appendTo:'body'`
working example: <http://jsbin.com/efoje4/6>
see [jQuery-Ui: Cannot drag object outside of an accordion](https://stackoverflow.com/questions/1827504/jquery-ui-cannot-drag-object-outside-of-an-accordion) | <http://jsbin.com/efoje4/8/>
You can use appendTo: 'body' which binds to object to the body of the page and not the current container element. |
53,709,133 | I want to find the total number of years(which is simply an integer of four digits) referenced in a document, which is given as a normal string input using python. Can this be done without using Regex? | 2018/12/10 | [
"https://Stackoverflow.com/questions/53709133",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/9641740/"
] | In SQL Server you'd use `DATEDIFF` to find the difference between the birthdate and Jan 1, 2015.
```
SELECT
*
FROM
mytable.device
WHERE
DATEDIFF(YEAR,mytable.birthdate,'1/1/2015') BETWEEN 20 AND 35
``` | Disclaimer: although date arithmetic **is** defined in the SQL standard, only a few DBMS products actually support the ANSI SQL when it comes to date or timestamp arithmetic.
The basic idea is that you need to calculate the difference between the 2015-01-01 and the `birthdate` value in your table and compare that with... |
61,544,258 | I have a struct defined like this:
```
struct IFSFunc {
int a;
bool operator<(const IFSFunc& other) {
return a < other.a;
}
};
```
Since `IFSfunc` is a `struct`, access modifier for the `operator<` should be `public`.
I also have this code:
```
#include <algorithm>
std::vector<std::pair<double... | 2020/05/01 | [
"https://Stackoverflow.com/questions/61544258",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1430705/"
] | You need to define that operator as a const member function.
Also, don't just return true for a comparison. That can result in infinite looping. | I just figure it out. The overloaded function signature was wrong, this is what I need:
```
struct IFSFunc {
int a;
bool operator<(const IFSFunc& other) const {
return a < other.a;
}
};
```
Notice that the `operator<` is now a const function. |
892,805 | I came across the identity
$$\int^x\_0\frac{\ln(p+qt)}{r+st}{\rm d}t=\frac{1}{2s}\left[\ln^2{\left(\frac{q}{s}(r+sx)\right)}-\ln^2{\left(\frac{qr}{s}\right)}+2\mathrm{Li}\_2\left(\frac{qr-ps}{q(r+sx)}\right)-2\mathrm{Li}\_2\left(\frac{qr-ps}{qr}\right)\right]$$
in a book.
Unfortunately, as of now, I am not very ad... | 2014/08/10 | [
"https://math.stackexchange.com/questions/892805",
"https://math.stackexchange.com",
"https://math.stackexchange.com/users/140590/"
] | Among various ways to do it, this one is simple :
 | $\newcommand{\angles}[1]{\left\langle\, #1 \,\right\rangle}
\newcommand{\braces}[1]{\left\lbrace\, #1 \,\right\rbrace}
\newcommand{\bracks}[1]{\left\lbrack\, #1 \,\right\rbrack}
\newcommand{\ceil}[1]{\,\left\lceil\, #1 \,\right\rceil\,}
\newcommand{\dd}{{\rm d}}
\newcommand{\ds}[1]{\displaystyle{#1}}
\newcommand{... |
2,281,756 | I want to prove this:
$\bar{E}'\underline{\subset }E'$.
Now this is how I look at it:
if I have $ x\in \bar{E}'$, then x must be in $\underline{\subset }E'$.
Now the conditions for being a limit point is:
**def limit point:**
A point p is a limit point of set E if every neighborhood of p contains a point q not equ... | 2017/05/15 | [
"https://math.stackexchange.com/questions/2281756",
"https://math.stackexchange.com",
"https://math.stackexchange.com/users/110821/"
] | Suppose $p\in (\overline{E})'$ and let $r\_1>0$. By definition, there exists an element $q\neq p$ in $\overline{E}$ such that $d(p,q)<r\_1$. Since $\overline{E}=E\cup E'$, we have either $q\in E$ or $q\in E'$.
If $q\in E$ we are done as we have found an element of $E$ which is in $B(p;r\_1)$.
Suppose now that $q\in ... | Assume a in (cl A)' and U open nhood a.
Thus some x in U cap cl A with x /= a.
Let V = U - {a} which is open for T1 spaces including metric spaces.
Since x in V, there is some y in V cap A. y /= a.
Hence a in A' and (cl A)' subset A'. |
56,788,471 | While using `Future` I have seen people use
```
Future{
Thread sleep 500
promise success "You've just completed the promise with me in it!"
}
```
Looking at the definition of `Future`, I can see that Future is a trait
But when I make my own trait, Example:
```
trait t{}
def main(args: Array[String])... | 2019/06/27 | [
"https://Stackoverflow.com/questions/56788471",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/7781747/"
] | when you write `Future{ /*your code*/ }` then the `apply` method of the companion object of `Future` is called.
the signature of the `Future`'s apply method is the following
```
def apply[T](body:=>T)
```
You can see that the `apply` method is called when you do `ctrl+click` or `cmd+click` on the `Future` in an IDE... | The syntax for Future you describe comes from the trait companion object.
This object has the following method :
```
def apply[T](body: =>T)(implicit @deprecatedName('execctx) executor: ExecutionContext): Future[T] =
unit.map(_ => body)
```
The accepted argument being a function returning a T, it's perfectly... |
4,143 | We want to limit the permissions for users i.e. not to provide system admin access to all the users. When a non-admin user tries to port the content, we are getting the error at the time of exporting the content: "Failed to resolve mappings in application data SiteEdit" however there is option to skip the error.
Give... | 2014/01/14 | [
"https://tridion.stackexchange.com/questions/4143",
"https://tridion.stackexchange.com",
"https://tridion.stackexchange.com/users/628/"
] | I found the solution to the problem on Tridion forum. [Tridion Article](https://sdltridionworld.com/articles/sdltridion2011/tutorials/using-content-porter-2009-sp1-for-dtap-4.aspx)
Essentially, when you perform import in content porting, the publication metadata and other information is also retrieved and tried to be ... | if you are using a Non-Administrator user to run Content Porter, then you need to look for all the dependencies of the Items that you are accessing.
In order to export/import an Item through Content Porter running using a Non-Administrator user, it is necessary that the Specific Item as well as all the dependencies o... |
4,143 | We want to limit the permissions for users i.e. not to provide system admin access to all the users. When a non-admin user tries to port the content, we are getting the error at the time of exporting the content: "Failed to resolve mappings in application data SiteEdit" however there is option to skip the error.
Give... | 2014/01/14 | [
"https://tridion.stackexchange.com/questions/4143",
"https://tridion.stackexchange.com",
"https://tridion.stackexchange.com/users/628/"
] | if you are using a Non-Administrator user to run Content Porter, then you need to look for all the dependencies of the Items that you are accessing.
In order to export/import an Item through Content Porter running using a Non-Administrator user, it is necessary that the Specific Item as well as all the dependencies o... | Glad to see you have succeeded in identifying the publication metadata as the cause of the problem (although it does look like a different problem, as you started with an export problem) However the more general case is that content porter is telling you "You do not have permission to perform this action", and you don'... |
4,143 | We want to limit the permissions for users i.e. not to provide system admin access to all the users. When a non-admin user tries to port the content, we are getting the error at the time of exporting the content: "Failed to resolve mappings in application data SiteEdit" however there is option to skip the error.
Give... | 2014/01/14 | [
"https://tridion.stackexchange.com/questions/4143",
"https://tridion.stackexchange.com",
"https://tridion.stackexchange.com/users/628/"
] | I found the solution to the problem on Tridion forum. [Tridion Article](https://sdltridionworld.com/articles/sdltridion2011/tutorials/using-content-porter-2009-sp1-for-dtap-4.aspx)
Essentially, when you perform import in content porting, the publication metadata and other information is also retrieved and tried to be ... | Glad to see you have succeeded in identifying the publication metadata as the cause of the problem (although it does look like a different problem, as you started with an export problem) However the more general case is that content porter is telling you "You do not have permission to perform this action", and you don'... |
64,263,173 | Working on a Ruby on Rails project using ERB. I am trying to link a user to their profile page. For example, clicking on the dropdown link and then profile should bring you to site.com/users/1 if you are logged in as User 1.
```
<a class="dropdown-item" href="users/<%= current_user.id %>">Profile</a
```
This works o... | 2020/10/08 | [
"https://Stackoverflow.com/questions/64263173",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/13259707/"
] | You could use the cube root of the absolute value of a normal distribution:
```
# generate noisy data
set.seed(69)
b_x <- 1.3 * (abs(rnorm(2000)))^0.33 + 2
b_y <- 6 * (abs(rnorm(2000)))^0.33 + 20
biased <- data.frame(b_x, b_y)
biased$indicator <- 'biased'
colnames(biased) <- c("x", "y", "indicator")
# put together on... | It seems that you are looking for multivariate normal random numbers as provided by *mvrnorm* in the package *MASS*. You can specify the midpoint of the cloud by the parameter *mu* and the shape of the cloud by the covariance matrix in the parameter *Sigma*. The orientation of the cloud is the direction of the eigenvec... |
64,263,173 | Working on a Ruby on Rails project using ERB. I am trying to link a user to their profile page. For example, clicking on the dropdown link and then profile should bring you to site.com/users/1 if you are logged in as User 1.
```
<a class="dropdown-item" href="users/<%= current_user.id %>">Profile</a
```
This works o... | 2020/10/08 | [
"https://Stackoverflow.com/questions/64263173",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/13259707/"
] | It seems that you are looking for multivariate normal random numbers as provided by *mvrnorm* in the package *MASS*. You can specify the midpoint of the cloud by the parameter *mu* and the shape of the cloud by the covariance matrix in the parameter *Sigma*. The orientation of the cloud is the direction of the eigenvec... | Another way would be to just convolve your uniformly distributed samples with something to smooth out the edges. For example, with a Gaussian like:
```r
n <- 1000
biased <- data.frame(
x=runif(n, 2, 4) + rnorm(n, sd=0.1),
y=runif(n, 20, 30) + rnorm(n, sd=0.5),
indicator='biased')
```
Giving the following plot:... |
64,263,173 | Working on a Ruby on Rails project using ERB. I am trying to link a user to their profile page. For example, clicking on the dropdown link and then profile should bring you to site.com/users/1 if you are logged in as User 1.
```
<a class="dropdown-item" href="users/<%= current_user.id %>">Profile</a
```
This works o... | 2020/10/08 | [
"https://Stackoverflow.com/questions/64263173",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/13259707/"
] | You could use the cube root of the absolute value of a normal distribution:
```
# generate noisy data
set.seed(69)
b_x <- 1.3 * (abs(rnorm(2000)))^0.33 + 2
b_y <- 6 * (abs(rnorm(2000)))^0.33 + 20
biased <- data.frame(b_x, b_y)
biased$indicator <- 'biased'
colnames(biased) <- c("x", "y", "indicator")
# put together on... | Another way would be to just convolve your uniformly distributed samples with something to smooth out the edges. For example, with a Gaussian like:
```r
n <- 1000
biased <- data.frame(
x=runif(n, 2, 4) + rnorm(n, sd=0.1),
y=runif(n, 20, 30) + rnorm(n, sd=0.5),
indicator='biased')
```
Giving the following plot:... |
19,135,121 | I'm using a php script that get arguments from a html page and send them to an expect shell.
When I call this php from CLI it works fine but when i call it from the web page it displays only the first line `spawn ssh user@host`
The code:
```
#!/bin/sh
var=$(expect -c "
spawn ssh user@host
expect \"password:\"
send ... | 2013/10/02 | [
"https://Stackoverflow.com/questions/19135121",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/2131714/"
] | I found a solution for my problem:
First create a new header file called `enums.h` which looks like:
```
#ifndef ENUMS_H
#define ENUMS_H
#include <QtDBus>
#include "enumDBus.h"
enum Color {
RED = 0,
BLUE,
GREEN
};
Q_DECLARE_METATYPE(Color)
#endif /* ENUMS_H */
```
Note following line `#include "enu... | Here is my solution which uses macro and does not have boost dependency.
You need to write below statement in your header file to declare << and >> operators.
For example:
```
DECLARE_ENUM_DATATYPE(QProcess::ProcessState)
```
and in one .cpp file add below statement to define << and >> operators.
```
CREATE_ENU... |
34,186,128 | I am using bootstrap and I have a container with a login form.
However, I want to align this form to the left side of the page. However, using float left makes it look ugly and also makes the form input smaller, as you can see here:
<http://codepen.io/anon/pen/xZGOjR>
```
<div class="container">
<div class="form... | 2015/12/09 | [
"https://Stackoverflow.com/questions/34186128",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1354934/"
] | To do it the bootstrap way. You could add a column width to the form `<div class="form-container text-center col-xs-3">`
Here is your original example tidied up a bit <http://codepen.io/anon/pen/XXbKvN>
Bootstrap uses a 12 column grid system so that everything is nicely laid out on the page. For more info have a loo... | You can use `width: 350px;` to the `.form-container` class.
It can better, if you can upload your design. screenshot. |
128,537 | I have a co-worker who said his 3000 line method is the most optimized possible. How do I react professionally to that?
Should I communicate this to the boss, who does not know anything about programming?
Note that we are a small team of only three programmers that are at the same level and each one has his own piece... | 2019/02/08 | [
"https://workplace.stackexchange.com/questions/128537",
"https://workplace.stackexchange.com",
"https://workplace.stackexchange.com/users/99396/"
] | A long method is definitely a code smell, but it does not conclusively indicate that something is wrong. In fact, I would argue that you shouldn't break a method apart purely on length, that is arbitrary. For example, I've seen some long methods for distinct ETL (Extract/Transform/Load) tasks where the length is really... | Preventing problems is cheaper than waiting for them to happen and then solving them. Your boss likes cheap.
Ask your boss if he expects **your** code to be used for a long time and if changes are likely if customers pay for them.
In the likely event that you get a yes for both then suggest that you would like to ha... |
128,537 | I have a co-worker who said his 3000 line method is the most optimized possible. How do I react professionally to that?
Should I communicate this to the boss, who does not know anything about programming?
Note that we are a small team of only three programmers that are at the same level and each one has his own piece... | 2019/02/08 | [
"https://workplace.stackexchange.com/questions/128537",
"https://workplace.stackexchange.com",
"https://workplace.stackexchange.com/users/99396/"
] | I sense two major flaws here:
* **do you offer a solution to the problem?** Just telling "this code is horrible" won't work. It could be an opinion, it does not bring value to the company; bosses and business want solutions.
* **do you have a reviewing process?** Peer reviews of the code should be done regardless of t... | What is the function trying to do? How complex is that task? What optimisation category did they aim for (speed, accuracy, usability)? Without any of that information it will be hard to make a judgement. You can always take a look at the code. If there are inefficiencies, point them out like 'The code is good! Quickie ... |
128,537 | I have a co-worker who said his 3000 line method is the most optimized possible. How do I react professionally to that?
Should I communicate this to the boss, who does not know anything about programming?
Note that we are a small team of only three programmers that are at the same level and each one has his own piece... | 2019/02/08 | [
"https://workplace.stackexchange.com/questions/128537",
"https://workplace.stackexchange.com",
"https://workplace.stackexchange.com/users/99396/"
] | I'd focus on the maintainability issue.
Depending on circumstances, a 1,000 line function that does one thing and is well-documented can be more readable and maintainable than a 20 line function that defers every decision to a ten calls deep stack of utility functions that each had special cases grafted on over time a... | Apart from the "3000 LOC" there were 3 other phrases in the OP caught my eye:
>
> * Should I communicate this to the boss, who does not know anything about programing?
> * My biggest concern here is that my co-worker might end the relationship with the company at some point and I will have to take care of that piece ... |
128,537 | I have a co-worker who said his 3000 line method is the most optimized possible. How do I react professionally to that?
Should I communicate this to the boss, who does not know anything about programming?
Note that we are a small team of only three programmers that are at the same level and each one has his own piece... | 2019/02/08 | [
"https://workplace.stackexchange.com/questions/128537",
"https://workplace.stackexchange.com",
"https://workplace.stackexchange.com/users/99396/"
] | If you're concerned about it you should actually read the code and offer suggestions (sounds like a great time to push for code review!). It may be 3000 lines out of need. Deciding that just because there are 3000 lines means it's wrong or bad is arbitrary.
[Edited based on updates]
You say that the code's speed is n... | I think the getting hit by a bus example might be the best.
I would go to your boss, and say "I have concerns about the codes maintainability, if the employee gets hit by a bus or otherwise unavailable it will take me ## weeks to figure it out. Are you ok with me being unavailable to work on other project for ## weeks... |
128,537 | I have a co-worker who said his 3000 line method is the most optimized possible. How do I react professionally to that?
Should I communicate this to the boss, who does not know anything about programming?
Note that we are a small team of only three programmers that are at the same level and each one has his own piece... | 2019/02/08 | [
"https://workplace.stackexchange.com/questions/128537",
"https://workplace.stackexchange.com",
"https://workplace.stackexchange.com/users/99396/"
] | I'd focus on the maintainability issue.
Depending on circumstances, a 1,000 line function that does one thing and is well-documented can be more readable and maintainable than a 20 line function that defers every decision to a ten calls deep stack of utility functions that each had special cases grafted on over time a... | >
> How do I react professional to that?
>
>
>
"Great, thanks!"
Now, if you feel the code is sub-optimal, *regardless of the number of lines*, you can test it on the side to see if it meets any performance requirements. This gives you meaningful, actionable information.
If you think the code follows poor practic... |
128,537 | I have a co-worker who said his 3000 line method is the most optimized possible. How do I react professionally to that?
Should I communicate this to the boss, who does not know anything about programming?
Note that we are a small team of only three programmers that are at the same level and each one has his own piece... | 2019/02/08 | [
"https://workplace.stackexchange.com/questions/128537",
"https://workplace.stackexchange.com",
"https://workplace.stackexchange.com/users/99396/"
] | I have worked on legacy code before where the entire website is handled in a single file that is approximately 100,000 lines of code. That's right. Everything about the site is done in a single file, single function. It got to a point where adding or modifying something meant you scrolled all the way to the bottom and ... | Don't worry about it. It's not your problem (right now). It's this guys responsibility to maintain the code, not yours. Don't touch it. If your boss asks you to touch it, whether now or later, tell them why you won't.
If your colleague leaves, you buy a book about refactoring. That's the point where you tell your bos... |
128,537 | I have a co-worker who said his 3000 line method is the most optimized possible. How do I react professionally to that?
Should I communicate this to the boss, who does not know anything about programming?
Note that we are a small team of only three programmers that are at the same level and each one has his own piece... | 2019/02/08 | [
"https://workplace.stackexchange.com/questions/128537",
"https://workplace.stackexchange.com",
"https://workplace.stackexchange.com/users/99396/"
] | Preventing problems is cheaper than waiting for them to happen and then solving them. Your boss likes cheap.
Ask your boss if he expects **your** code to be used for a long time and if changes are likely if customers pay for them.
In the likely event that you get a yes for both then suggest that you would like to ha... | From what you are describing, you have a mountain to climb and a team to drag up it.
I don't think I would specifically talk about the 1k line method, I would start by bringing up best practices with your boss in a 1:1. Ask him if the team has any coding guidelines or best practices that they follow. Assuming the answ... |
128,537 | I have a co-worker who said his 3000 line method is the most optimized possible. How do I react professionally to that?
Should I communicate this to the boss, who does not know anything about programming?
Note that we are a small team of only three programmers that are at the same level and each one has his own piece... | 2019/02/08 | [
"https://workplace.stackexchange.com/questions/128537",
"https://workplace.stackexchange.com",
"https://workplace.stackexchange.com/users/99396/"
] | I'd focus on the maintainability issue.
Depending on circumstances, a 1,000 line function that does one thing and is well-documented can be more readable and maintainable than a 20 line function that defers every decision to a ten calls deep stack of utility functions that each had special cases grafted on over time a... | You've said on one hand that each developer is responsible for their own code, and yet you wish to report one of your colleagues to your manager for not working to your standards.
If the code works as expected, there's nothing that needs to be said about it until there's a time when it's a problem or there's a time wh... |
128,537 | I have a co-worker who said his 3000 line method is the most optimized possible. How do I react professionally to that?
Should I communicate this to the boss, who does not know anything about programming?
Note that we are a small team of only three programmers that are at the same level and each one has his own piece... | 2019/02/08 | [
"https://workplace.stackexchange.com/questions/128537",
"https://workplace.stackexchange.com",
"https://workplace.stackexchange.com/users/99396/"
] | I have worked on legacy code before where the entire website is handled in a single file that is approximately 100,000 lines of code. That's right. Everything about the site is done in a single file, single function. It got to a point where adding or modifying something meant you scrolled all the way to the bottom and ... | >
> How do I react professional to that?
>
>
>
"Great, thanks!"
Now, if you feel the code is sub-optimal, *regardless of the number of lines*, you can test it on the side to see if it meets any performance requirements. This gives you meaningful, actionable information.
If you think the code follows poor practic... |
128,537 | I have a co-worker who said his 3000 line method is the most optimized possible. How do I react professionally to that?
Should I communicate this to the boss, who does not know anything about programming?
Note that we are a small team of only three programmers that are at the same level and each one has his own piece... | 2019/02/08 | [
"https://workplace.stackexchange.com/questions/128537",
"https://workplace.stackexchange.com",
"https://workplace.stackexchange.com/users/99396/"
] | Don't worry about it. It's not your problem (right now). It's this guys responsibility to maintain the code, not yours. Don't touch it. If your boss asks you to touch it, whether now or later, tell them why you won't.
If your colleague leaves, you buy a book about refactoring. That's the point where you tell your bos... | I think the getting hit by a bus example might be the best.
I would go to your boss, and say "I have concerns about the codes maintainability, if the employee gets hit by a bus or otherwise unavailable it will take me ## weeks to figure it out. Are you ok with me being unavailable to work on other project for ## weeks... |
6,047,485 | In EclipseLink, I run into a problem where an element is inserted twice, resulting into a primary key violation. The scenario is as follows:
I have three entities, Element, Restriction and RestrictionElement. The entity RestrictionElement acts as a many-to-many relationship between the two others.
When I create a new R... | 2011/05/18 | [
"https://Stackoverflow.com/questions/6047485",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/530796/"
] | How do your persist RestrictionElement? My guess is when you persist it you get one copy, then a second when you merge the Element with the reference to it.
Try using persist() for new objects, and related the objects after they are managed with the correct managed copy. | Don't forget that once you retrieve an instance of the class using JPA, the instance becomes managed, any changes to it will be automatically merged into the database.
By default, this merge will occur at the moment you query the table. Therefore the following situation can happen:
* query (find by ID)
* update (setN... |
6,047,485 | In EclipseLink, I run into a problem where an element is inserted twice, resulting into a primary key violation. The scenario is as follows:
I have three entities, Element, Restriction and RestrictionElement. The entity RestrictionElement acts as a many-to-many relationship between the two others.
When I create a new R... | 2011/05/18 | [
"https://Stackoverflow.com/questions/6047485",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/530796/"
] | I got a similar issue when I run my program, but the issue is not there under step by step debugging.
I resolved the issue by changing List to Set in the OneToMany relationship. | Don't forget that once you retrieve an instance of the class using JPA, the instance becomes managed, any changes to it will be automatically merged into the database.
By default, this merge will occur at the moment you query the table. Therefore the following situation can happen:
* query (find by ID)
* update (setN... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.