qid int64 1 74.7M | question stringlengths 0 58.3k | date stringlengths 10 10 | metadata list | response_j stringlengths 2 48.3k | response_k stringlengths 2 40.5k |
|---|---|---|---|---|---|
27,599 | I burned a CD on XP using the built-in burning software and I can read the CD on that machine, but when I insert it into my Vista machine, I can't read the files. It shows the correct volume label, and the correct 'free space', but I can't access the actual files.
Am I missing something obvious?
(Both systems are ful... | 2009/08/22 | [
"https://superuser.com/questions/27599",
"https://superuser.com",
"https://superuser.com/users/4123/"
] | If you didn't finalize the disk then it is only readable in the drive that created it. This will make it look like it's an XP to Vista problem if these are the only two computers that you've tried it on. | Try another drive - it's possible (although I would have thought rare these days) for a disc to be written outside the tolerance of a drive. I would expect this to be a drive/disc issue rather than an OS issue. |
2,669,162 | So I have looked at all the suggested ways of importing .dmp files and non of them seem to answer this question: where does the data go once you import it?
Context: I created a user like so:
```
SQL> create user IMPORTER identified by "12345";
SQL> grant connect, unlimited tablespace, resource to IMPORTER;
```
I th... | 2010/04/19 | [
"https://Stackoverflow.com/questions/2669162",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/229250/"
] | In SQL Developer, are you logged in as IMPORTER? The user you're logged in as must have privileges on the IMPORTER schema to see its objects.
Also, make sure that the SYSTEM user has IMP\_FULL\_DATABASE privileges. | It is well possible that 'imp' created the OVIEDOE schema for you, then you need to look there (in SQL Developer open "Other users" node).
And if that is not what you want, try fromuser/touser switches of imp. |
2,669,162 | So I have looked at all the suggested ways of importing .dmp files and non of them seem to answer this question: where does the data go once you import it?
Context: I created a user like so:
```
SQL> create user IMPORTER identified by "12345";
SQL> grant connect, unlimited tablespace, resource to IMPORTER;
```
I th... | 2010/04/19 | [
"https://Stackoverflow.com/questions/2669162",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/229250/"
] | Are you sure that the file actually contains object owned by OVIEDOE ? Normally I'd expect a list of the objects being imported as it processes them.
This result is what I'd expect if I'd done an export for USER1 and then tried to import with FROMUSER=USER\_1 (and yes, I've done plenty of typos in my time).
Try IMP ... | It is well possible that 'imp' created the OVIEDOE schema for you, then you need to look there (in SQL Developer open "Other users" node).
And if that is not what you want, try fromuser/touser switches of imp. |
2,669,162 | So I have looked at all the suggested ways of importing .dmp files and non of them seem to answer this question: where does the data go once you import it?
Context: I created a user like so:
```
SQL> create user IMPORTER identified by "12345";
SQL> grant connect, unlimited tablespace, resource to IMPORTER;
```
I th... | 2010/04/19 | [
"https://Stackoverflow.com/questions/2669162",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/229250/"
] | DCookie: Turns out system did not have IMP\_FULL\_DATABASE privileges, I have granted them.
So I tried to run:
```
C:\oraclexe\app\oracle\product\10.2.0\server\BIN>imp.exe system/password file=C:\exp_schema\database1.dmp show=y full=y
```
the result was:
```
Import: Release 10.2.0.1.0 - Production on Mon Apr 19 18... | It is well possible that 'imp' created the OVIEDOE schema for you, then you need to look there (in SQL Developer open "Other users" node).
And if that is not what you want, try fromuser/touser switches of imp. |
2,669,162 | So I have looked at all the suggested ways of importing .dmp files and non of them seem to answer this question: where does the data go once you import it?
Context: I created a user like so:
```
SQL> create user IMPORTER identified by "12345";
SQL> grant connect, unlimited tablespace, resource to IMPORTER;
```
I th... | 2010/04/19 | [
"https://Stackoverflow.com/questions/2669162",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/229250/"
] | Are you sure that the file actually contains object owned by OVIEDOE ? Normally I'd expect a list of the objects being imported as it processes them.
This result is what I'd expect if I'd done an export for USER1 and then tried to import with FROMUSER=USER\_1 (and yes, I've done plenty of typos in my time).
Try IMP ... | In SQL Developer, are you logged in as IMPORTER? The user you're logged in as must have privileges on the IMPORTER schema to see its objects.
Also, make sure that the SYSTEM user has IMP\_FULL\_DATABASE privileges. |
2,669,162 | So I have looked at all the suggested ways of importing .dmp files and non of them seem to answer this question: where does the data go once you import it?
Context: I created a user like so:
```
SQL> create user IMPORTER identified by "12345";
SQL> grant connect, unlimited tablespace, resource to IMPORTER;
```
I th... | 2010/04/19 | [
"https://Stackoverflow.com/questions/2669162",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/229250/"
] | Are you sure that the file actually contains object owned by OVIEDOE ? Normally I'd expect a list of the objects being imported as it processes them.
This result is what I'd expect if I'd done an export for USER1 and then tried to import with FROMUSER=USER\_1 (and yes, I've done plenty of typos in my time).
Try IMP ... | DCookie: Turns out system did not have IMP\_FULL\_DATABASE privileges, I have granted them.
So I tried to run:
```
C:\oraclexe\app\oracle\product\10.2.0\server\BIN>imp.exe system/password file=C:\exp_schema\database1.dmp show=y full=y
```
the result was:
```
Import: Release 10.2.0.1.0 - Production on Mon Apr 19 18... |
7,195,658 | ```
UIImageView *mooshinLogo = [[UIImageView alloc] initWithImage:[UIImage imageNamed:@"mooshin.png"]];
```
I'm not sure if im instantiating my image correctly because i've been reading that imageNamed will not be emptied from the cache and should only be used for buttons and small icons. What about background images... | 2011/08/25 | [
"https://Stackoverflow.com/questions/7195658",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/295133/"
] | `imageNamed:` method caches images that you load. In case of low memory conditions or memory warning that cache will be emptied.
If you want to show images in gallery it is better to use `imageWithContentsOfFile:` method as it doesn't cache the data.
In case of very big images you should use `CATiledLayer` to display... | No worries! The method `imageNamed` returns an **autoreleased** object, and it will do what you call "be emptied from cache" (i.e. its memory will be released) when it is not needed any more. |
7,195,658 | ```
UIImageView *mooshinLogo = [[UIImageView alloc] initWithImage:[UIImage imageNamed:@"mooshin.png"]];
```
I'm not sure if im instantiating my image correctly because i've been reading that imageNamed will not be emptied from the cache and should only be used for buttons and small icons. What about background images... | 2011/08/25 | [
"https://Stackoverflow.com/questions/7195658",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/295133/"
] | `imageNamed:` method caches images that you load. In case of low memory conditions or memory warning that cache will be emptied.
If you want to show images in gallery it is better to use `imageWithContentsOfFile:` method as it doesn't cache the data.
In case of very big images you should use `CATiledLayer` to display... | [UIImage imageNamed:(NSString \*)imageName] is an autorelease convenience constructor. This means that it's retain count is increased when you initialize it and decreased at the end of the runloop. You could make 100 of them and they'd vanish from memory a few seconds later, unless they're retained by something else. B... |
7,195,658 | ```
UIImageView *mooshinLogo = [[UIImageView alloc] initWithImage:[UIImage imageNamed:@"mooshin.png"]];
```
I'm not sure if im instantiating my image correctly because i've been reading that imageNamed will not be emptied from the cache and should only be used for buttons and small icons. What about background images... | 2011/08/25 | [
"https://Stackoverflow.com/questions/7195658",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/295133/"
] | `imageNamed:` method caches images that you load. In case of low memory conditions or memory warning that cache will be emptied.
If you want to show images in gallery it is better to use `imageWithContentsOfFile:` method as it doesn't cache the data.
In case of very big images you should use `CATiledLayer` to display... | Others above are right about imageNamed keeps a cache of these images. This is especially true when using NIB files. Releasing a Viewcontroller with ImageViews on them doesn't directly release the associated images.
I had an app that had lots of images with lots of pages in a navigation controller. Eventually it would... |
52,189,194 | I have issue with protect worksheet in excel online. I will unlock all of the cells in the worksheet, and lock one range, then protect worksheet, after that nothing is editable in the worksheet, even the cells are unlocked.This issue only happens for excel online version, works fine for installed desktop version. Anyon... | 2018/09/05 | [
"https://Stackoverflow.com/questions/52189194",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/10128286/"
] | This should be an issue of Office-Js API.
We Office-Js API team are looking into this issue.
We are tracking it by internal bug 2542108.
The worksheet will recover to editable state when user refreshes the page. I'm afraid there's no workaround you can do from API side currently. | the issue is fixed now, this should no longer happen. |
42,875,197 | I just found out that you can do this in C++:
```
class Line
{
public:
Line(int x) : _length(x) {}
int GetLength() { return _length; }
private:
int _length;
};
int main()
{
Line* line = new Line(3); // instead of doing this
std::cout << line->GetLength();
std::cout << (new Line(5))->GetLength... | 2017/03/18 | [
"https://Stackoverflow.com/questions/42875197",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/5453788/"
] | The object doesn't get deleted: there is no corresponding call to `delete` for the call to `new` it was allocated with. Do assign it to a pointe then delete that and avoid a memory leak.
Better alternatives:
* just use the stack: `Line(5).GetLength()` will call Line's destructor and free any memory allocated (on the ... | Congratulation on discovering the concept of a "memory leak".
The next step on your adventure is to learn all about [`std::unique_ptr`](http://en.cppreference.com/w/cpp/memory/unique_ptr), [`std::shared_ptr`](http://en.cppreference.com/w/cpp/memory/shared_ptr), [`std::make_unique`](http://en.cppreference.com/w/cpp/mem... |
10,958,278 | I want to get the last modified or created attributes via the `uSNChanged` value in ActiveDirectory using C# ... I was also trying to find the max value of `uSNChanged`, can you help me to find out the solution? Thanks | 2012/06/09 | [
"https://Stackoverflow.com/questions/10958278",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/423936/"
] | There are two ways to retrieve the `uSNChanged` property via .NET:
1. Include a reference to a COM library: "Active DS Type Library", then you need to use the `IADsLargeInterger` to retrieve the value and finally convert it to a `long`. [For example](http://support.microsoft.com/kb/326091):
```
IADsLargeInteger li_ad... | i got the solution guys,we can get a maximum usnchanged value of a domaincontroller through this attribute [HighestCommittedUsn](http://msdn.microsoft.com/en-us/library/system.directoryservices.activedirectory.domaincontroller.highestcommittedusn%28v=vs.90%29.aspx) |
255,810 | I'm currently learning electronics and right now, I'm trying to use a relays... without success. Here is a picture of my circuit:
[](https://i.stack.imgur.com/VLzbL.jpg)
First of all, don't mind the 2 cables on the top right and the relay on the bott... | 2016/09/03 | [
"https://electronics.stackexchange.com/questions/255810",
"https://electronics.stackexchange.com",
"https://electronics.stackexchange.com/users/32476/"
] | Your relay has an 'ultra high sensitive coil' which suggests it is biased with a permanent magnet. If this is the case then you must apply voltage to the coil with the correct polarity, otherwise the coil will cancel out the bias magnet's force instead of adding to it, and the relay won't operate.
If the white stripe... | AM26 is rated for 12V at 50mW
It comes in 3 ranges of sensitivity, this being most sensitive.
If coil Power = 50mW @ 12V then current is 50mW/12 ~ 4mA
This is pretty easy to drive and you might be able to make it click with the 9V battery across the coil with + on pin 1. Although due to hystereis, the guaranteed or... |
255,810 | I'm currently learning electronics and right now, I'm trying to use a relays... without success. Here is a picture of my circuit:
[](https://i.stack.imgur.com/VLzbL.jpg)
First of all, don't mind the 2 cables on the top right and the relay on the bott... | 2016/09/03 | [
"https://electronics.stackexchange.com/questions/255810",
"https://electronics.stackexchange.com",
"https://electronics.stackexchange.com/users/32476/"
] | Your problem is very simple. You are using your breadboard incorrectly. The top pins (pins 1 and 8) are being shorted out by the contact strip. In this case, the breadboard is incompatible with the relay. The spacing between rows of contacts is 0.3 inches, which is a standard DIP IC pin spacing. Your relay, however, ha... | Your relay has an 'ultra high sensitive coil' which suggests it is biased with a permanent magnet. If this is the case then you must apply voltage to the coil with the correct polarity, otherwise the coil will cancel out the bias magnet's force instead of adding to it, and the relay won't operate.
If the white stripe... |
255,810 | I'm currently learning electronics and right now, I'm trying to use a relays... without success. Here is a picture of my circuit:
[](https://i.stack.imgur.com/VLzbL.jpg)
First of all, don't mind the 2 cables on the top right and the relay on the bott... | 2016/09/03 | [
"https://electronics.stackexchange.com/questions/255810",
"https://electronics.stackexchange.com",
"https://electronics.stackexchange.com/users/32476/"
] | Your problem is very simple. You are using your breadboard incorrectly. The top pins (pins 1 and 8) are being shorted out by the contact strip. In this case, the breadboard is incompatible with the relay. The spacing between rows of contacts is 0.3 inches, which is a standard DIP IC pin spacing. Your relay, however, ha... | AM26 is rated for 12V at 50mW
It comes in 3 ranges of sensitivity, this being most sensitive.
If coil Power = 50mW @ 12V then current is 50mW/12 ~ 4mA
This is pretty easy to drive and you might be able to make it click with the 9V battery across the coil with + on pin 1. Although due to hystereis, the guaranteed or... |
29,183,240 | **Edit: I solved this problem:)**
Cause of this error :
1. In the tutorial Implementing GCM Client , there was [link](https://github.com/google/gcm) to download full source code for demo.
2. Downloaded for reference , added google\_play\_service library in build.gradle.
3. Did some recommended changes like SENDER\_ID,... | 2015/03/21 | [
"https://Stackoverflow.com/questions/29183240",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/3952844/"
] | This happens if you use the latest, `7.0.0` version. They sliced up the Google Play Services a bit further than in 6.5, due to how there is an upper limit to method count (65536).
Anyways,
```
compile 'com.google.android.gms:play-services-base:6.5.87'
```
This works with the `GCM` classes the guides mention.
But i... | The google play services you are using is outdated use the following lines in your gradle file and then again sync the project with gradle.
```
dependencies {
compile 'com.google.android.gms:play-services:7.0.0'
}
```
This will surely remove your error. |
29,183,240 | **Edit: I solved this problem:)**
Cause of this error :
1. In the tutorial Implementing GCM Client , there was [link](https://github.com/google/gcm) to download full source code for demo.
2. Downloaded for reference , added google\_play\_service library in build.gradle.
3. Did some recommended changes like SENDER\_ID,... | 2015/03/21 | [
"https://Stackoverflow.com/questions/29183240",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/3952844/"
] | I think your problem is that gradle is not downloading your dependency. I had the same problem but I solved it when I Invalidated cache and restarted android studio. Click on file > invalidate cache/restart | The google play services you are using is outdated use the following lines in your gradle file and then again sync the project with gradle.
```
dependencies {
compile 'com.google.android.gms:play-services:7.0.0'
}
```
This will surely remove your error. |
29,183,240 | **Edit: I solved this problem:)**
Cause of this error :
1. In the tutorial Implementing GCM Client , there was [link](https://github.com/google/gcm) to download full source code for demo.
2. Downloaded for reference , added google\_play\_service library in build.gradle.
3. Did some recommended changes like SENDER\_ID,... | 2015/03/21 | [
"https://Stackoverflow.com/questions/29183240",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/3952844/"
] | This happens if you use the latest, `7.0.0` version. They sliced up the Google Play Services a bit further than in 6.5, due to how there is an upper limit to method count (65536).
Anyways,
```
compile 'com.google.android.gms:play-services-base:6.5.87'
```
This works with the `GCM` classes the guides mention.
But i... | Use this Google Play Services, it's working
```
compile 'com.google.android.gms:play-services:8.1.0'
``` |
29,183,240 | **Edit: I solved this problem:)**
Cause of this error :
1. In the tutorial Implementing GCM Client , there was [link](https://github.com/google/gcm) to download full source code for demo.
2. Downloaded for reference , added google\_play\_service library in build.gradle.
3. Did some recommended changes like SENDER\_ID,... | 2015/03/21 | [
"https://Stackoverflow.com/questions/29183240",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/3952844/"
] | I think your problem is that gradle is not downloading your dependency. I had the same problem but I solved it when I Invalidated cache and restarted android studio. Click on file > invalidate cache/restart | Use this Google Play Services, it's working
```
compile 'com.google.android.gms:play-services:8.1.0'
``` |
64,586,846 | ```
def build_profile(f_name,l_name,**qualification):
profile={}
profile['first']=f_name
profile['last']=l_name
for k,v in qualification.items():
profile[k]=v
return profile
pl=[]
while True:
pl.append(build_profile(input("Enter first name: "),\
input("Enter last name:"),graduation=i... | 2020/10/29 | [
"https://Stackoverflow.com/questions/64586846",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/912233/"
] | You're trying to use a string as an argument *name* which is not possible. It would probably be better to input an actual dictionary than use an \*\* argument:
```py
def build_profile(f_name: str, l_name: str, qualification: dict) -> dict:
return {'first': f_name, 'last': l_name, **qualification}
pl=[]
while Tru... | what you probably want is not to have different keys for different people, but to add one key, for instance "level", for which you can use the different values you ask for (like PHD). So then it looks like this:
```
def build_profile(f_name,l_name,**qualification):
profile={}
profile['first']=f_name
profil... |
306,316 | I am trying to write a C++ program that takes the following inputs from the user to construct rectangles (between 2 and 5): height, width, x-pos, y-pos. All of these rectangles will exist parallel to the x and the y axis, that is all of their edges will have slopes of 0 or infinity.
I've tried to implement what is men... | 2008/11/20 | [
"https://Stackoverflow.com/questions/306316",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/135/"
] | ```
struct Rect
{
Rect(int x1, int x2, int y1, int y2)
: x1(x1), x2(x2), y1(y1), y2(y2)
{
assert(x1 < x2);
assert(y1 < y2);
}
int x1, x2, y1, y2;
};
//some area of the r1 overlaps r2
bool overlap(const Rect &r1, const Rect &r2)
{
return r1.x1 < r2.x2 && r2.x1 < r1.x2 &&
r1.... | I have implemented a C# version, it is easily converted to C++.
```
public bool Intersects ( Rectangle rect )
{
float ulx = Math.Max ( x, rect.x );
float uly = Math.Max ( y, rect.y );
float lrx = Math.Min ( x + width, rect.x + rect.width );
float lry = Math.Min ( y + height, rect.y + rect.height );
return u... |
306,316 | I am trying to write a C++ program that takes the following inputs from the user to construct rectangles (between 2 and 5): height, width, x-pos, y-pos. All of these rectangles will exist parallel to the x and the y axis, that is all of their edges will have slopes of 0 or infinity.
I've tried to implement what is men... | 2008/11/20 | [
"https://Stackoverflow.com/questions/306316",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/135/"
] | ```
struct Rect
{
Rect(int x1, int x2, int y1, int y2)
: x1(x1), x2(x2), y1(y1), y2(y2)
{
assert(x1 < x2);
assert(y1 < y2);
}
int x1, x2, y1, y2;
};
bool
overlap(const Rect &r1, const Rect &r2)
{
// The rectangles don't overlap if
// one rectangle's minimum in some dimensio... | Don't think of coordinates as indicating where pixels are. Think of them as being between the pixels. That way, the area of a 2x2 rectangle should be 4, not 9.
```
bool bOverlap = !((A.Left >= B.Right || B.Left >= A.Right)
&& (A.Bottom >= B.Top || B.Bottom >= A.Top));
``` |
306,316 | I am trying to write a C++ program that takes the following inputs from the user to construct rectangles (between 2 and 5): height, width, x-pos, y-pos. All of these rectangles will exist parallel to the x and the y axis, that is all of their edges will have slopes of 0 or infinity.
I've tried to implement what is men... | 2008/11/20 | [
"https://Stackoverflow.com/questions/306316",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/135/"
] | It is easier to check if a rectangle is completly outside the other, so if it is either
on the left...
```
(r1.x + r1.width < r2.x)
```
or on the right...
```
(r1.x > r2.x + r2.width)
```
or on top...
```
(r1.y + r1.height < r2.y)
```
or on the bottom...
```
(r1.y > r2.y + r2.height)
```
of the second... | ```
struct Rect
{
Rect(int x1, int x2, int y1, int y2)
: x1(x1), x2(x2), y1(y1), y2(y2)
{
assert(x1 < x2);
assert(y1 < y2);
}
int x1, x2, y1, y2;
};
//some area of the r1 overlaps r2
bool overlap(const Rect &r1, const Rect &r2)
{
return r1.x1 < r2.x2 && r2.x1 < r1.x2 &&
r1.... |
306,316 | I am trying to write a C++ program that takes the following inputs from the user to construct rectangles (between 2 and 5): height, width, x-pos, y-pos. All of these rectangles will exist parallel to the x and the y axis, that is all of their edges will have slopes of 0 or infinity.
I've tried to implement what is men... | 2008/11/20 | [
"https://Stackoverflow.com/questions/306316",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/135/"
] | ```
if (RectA.Left < RectB.Right && RectA.Right > RectB.Left &&
RectA.Top > RectB.Bottom && RectA.Bottom < RectB.Top )
```
or, using Cartesian coordinates
(With X1 being left coord, X2 being right coord, **increasing from left to right** and Y1 being Top coord, and Y2 being Bottom coord, **increasing from bot... | It is easier to check if a rectangle is completly outside the other, so if it is either
on the left...
```
(r1.x + r1.width < r2.x)
```
or on the right...
```
(r1.x > r2.x + r2.width)
```
or on top...
```
(r1.y + r1.height < r2.y)
```
or on the bottom...
```
(r1.y > r2.y + r2.height)
```
of the second... |
306,316 | I am trying to write a C++ program that takes the following inputs from the user to construct rectangles (between 2 and 5): height, width, x-pos, y-pos. All of these rectangles will exist parallel to the x and the y axis, that is all of their edges will have slopes of 0 or infinity.
I've tried to implement what is men... | 2008/11/20 | [
"https://Stackoverflow.com/questions/306316",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/135/"
] | This is a very fast way to check with C++ if two rectangles overlap:
```cpp
return std::max(rectA.left, rectB.left) < std::min(rectA.right, rectB.right)
&& std::max(rectA.top, rectB.top) < std::min(rectA.bottom, rectB.bottom);
```
It works by calculating the left and right borders of the intersecting rectangle, ... | A and B be two rectangle. C be their covering rectangle.
```
four points of A be (xAleft,yAtop),(xAleft,yAbottom),(xAright,yAtop),(xAright,yAbottom)
four points of A be (xBleft,yBtop),(xBleft,yBbottom),(xBright,yBtop),(xBright,yBbottom)
A.width = abs(xAleft-xAright);
A.height = abs(yAleft-yAright);
B.width = abs(xBl... |
306,316 | I am trying to write a C++ program that takes the following inputs from the user to construct rectangles (between 2 and 5): height, width, x-pos, y-pos. All of these rectangles will exist parallel to the x and the y axis, that is all of their edges will have slopes of 0 or infinity.
I've tried to implement what is men... | 2008/11/20 | [
"https://Stackoverflow.com/questions/306316",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/135/"
] | Here's how it's done in the Java API:
```
public boolean intersects(Rectangle r) {
int tw = this.width;
int th = this.height;
int rw = r.width;
int rh = r.height;
if (rw <= 0 || rh <= 0 || tw <= 0 || th <= 0) {
return false;
}
int tx = this.x;
int ty = this.y;
int rx = r.x;
... | For those of you who are using center points and half sizes for their rectangle data, instead of the typical x,y,w,h, or x0,y0,x1,x1, here's how you can do it:
```
#include <cmath> // for fabsf(float)
struct Rectangle
{
float centerX, centerY, halfWidth, halfHeight;
};
bool isRectangleOverlapping(const Rectangle... |
306,316 | I am trying to write a C++ program that takes the following inputs from the user to construct rectangles (between 2 and 5): height, width, x-pos, y-pos. All of these rectangles will exist parallel to the x and the y axis, that is all of their edges will have slopes of 0 or infinity.
I've tried to implement what is men... | 2008/11/20 | [
"https://Stackoverflow.com/questions/306316",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/135/"
] | For those of you who are using center points and half sizes for their rectangle data, instead of the typical x,y,w,h, or x0,y0,x1,x1, here's how you can do it:
```
#include <cmath> // for fabsf(float)
struct Rectangle
{
float centerX, centerY, halfWidth, halfHeight;
};
bool isRectangleOverlapping(const Rectangle... | A and B be two rectangle. C be their covering rectangle.
```
four points of A be (xAleft,yAtop),(xAleft,yAbottom),(xAright,yAtop),(xAright,yAbottom)
four points of A be (xBleft,yBtop),(xBleft,yBbottom),(xBright,yBtop),(xBright,yBbottom)
A.width = abs(xAleft-xAright);
A.height = abs(yAleft-yAright);
B.width = abs(xBl... |
306,316 | I am trying to write a C++ program that takes the following inputs from the user to construct rectangles (between 2 and 5): height, width, x-pos, y-pos. All of these rectangles will exist parallel to the x and the y axis, that is all of their edges will have slopes of 0 or infinity.
I've tried to implement what is men... | 2008/11/20 | [
"https://Stackoverflow.com/questions/306316",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/135/"
] | Easiest way is
```
/**
* Check if two rectangles collide
* x_1, y_1, width_1, and height_1 define the boundaries of the first rectangle
* x_2, y_2, width_2, and height_2 define the boundaries of the second rectangle
*/
boolean rectangle_collision(float x_1, float y_1, float width_1, float height_1, float x_2, floa... | ```
bool Square::IsOverlappig(Square &other)
{
bool result1 = other.x >= x && other.y >= y && other.x <= (x + width) && other.y <= (y + height); // other's top left falls within this area
bool result2 = other.x >= x && other.y <= y && other.x <= (x + width) && (other.y + other.height) <= (y + height); // other'... |
306,316 | I am trying to write a C++ program that takes the following inputs from the user to construct rectangles (between 2 and 5): height, width, x-pos, y-pos. All of these rectangles will exist parallel to the x and the y axis, that is all of their edges will have slopes of 0 or infinity.
I've tried to implement what is men... | 2008/11/20 | [
"https://Stackoverflow.com/questions/306316",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/135/"
] | This is a very fast way to check with C++ if two rectangles overlap:
```cpp
return std::max(rectA.left, rectB.left) < std::min(rectA.right, rectB.right)
&& std::max(rectA.top, rectB.top) < std::min(rectA.bottom, rectB.bottom);
```
It works by calculating the left and right borders of the intersecting rectangle, ... | For those of you who are using center points and half sizes for their rectangle data, instead of the typical x,y,w,h, or x0,y0,x1,x1, here's how you can do it:
```
#include <cmath> // for fabsf(float)
struct Rectangle
{
float centerX, centerY, halfWidth, halfHeight;
};
bool isRectangleOverlapping(const Rectangle... |
306,316 | I am trying to write a C++ program that takes the following inputs from the user to construct rectangles (between 2 and 5): height, width, x-pos, y-pos. All of these rectangles will exist parallel to the x and the y axis, that is all of their edges will have slopes of 0 or infinity.
I've tried to implement what is men... | 2008/11/20 | [
"https://Stackoverflow.com/questions/306316",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/135/"
] | In the question, you link to the maths for when rectangles are at arbitrary angles of rotation. If I understand the bit about angles in the question however, I interpret that all rectangles are perpendicular to one another.
A general knowing the area of overlap formula is:
Using the example:
```
1 2 3 4 5... | A and B be two rectangle. C be their covering rectangle.
```
four points of A be (xAleft,yAtop),(xAleft,yAbottom),(xAright,yAtop),(xAright,yAbottom)
four points of A be (xBleft,yBtop),(xBleft,yBbottom),(xBright,yBtop),(xBright,yBbottom)
A.width = abs(xAleft-xAright);
A.height = abs(yAleft-yAright);
B.width = abs(xBl... |
1,719,921 | $$I=\int\_{0}^{\dfrac\pi4}\log(\cos(x))\mathop{\mathrm{d}x}$$ I can solve it if the limit is from $0$ to $\frac\pi2$. How to do it? I have done like this, tried not to use any knowledge of series but just simple integration rules.
$I\_1=\int\_{0}^{\frac{\pi}{4}} \ln(\sin x)+\ln (\cos x) dx \\
=\int\_{0}^{\frac{\pi}{4}}... | 2016/03/30 | [
"https://math.stackexchange.com/questions/1719921",
"https://math.stackexchange.com",
"https://math.stackexchange.com/users/129001/"
] | $$I(t)=\int\_0^{t}\log\big(\cos(x)\big)\,dx$$ is a very difficult integral involving the [polylogarithm function](https://en.wikipedia.org/wiki/Polylogarithm). For $t=\frac \pi 4$, the explicit result is $$I(\frac \pi 4)=\frac{C}{2}-\frac{\pi}{4} \log (2)$$ where appears Catalan number.
As Archis Welankar commented, i... | As shown in [this answer](https://math.stackexchange.com/a/909837),
$$
\int\_0^{\pi/2}\log(1+\cos(x))\,\mathrm{d}x=2\mathrm{G}-\frac\pi2\log(2)
$$
where $\mathrm{G}$ is [Catalan's Constant](http://en.wikipedia.org/wiki/Catalan%27s_constant).
Therefore,
$$
\begin{align}
\int\_0^{\pi/4}\log(\cos(x))\,\mathrm{d}x
&=\frac... |
353,613 | I don't really understand what we are talking about when we say space is homogeneous. What we are measuring? My notion is: it should depend on the entity and with respect to that entity one can decide space is homogeneous or not!
May be I'm asking stupid question, actually the fact is I don't understand the phrase "sp... | 2017/08/25 | [
"https://physics.stackexchange.com/questions/353613",
"https://physics.stackexchange.com",
"https://physics.stackexchange.com/users/166332/"
] | Suppose we measure the density of matter as a function of position. Then we will come up with some function for the density $\rho(r, \theta, \phi)$ where $r$, $\theta$ and $\phi$ are polar coordinates with ourselves at the origin.
* The density is isotropic if it is the same in all directions i.e. it is independent of... | You are correct in the sense that there are physical quantities, observables, like scalar and vector fields that are, in general, varying in space.
However, that's not what the phrase "spacetime is isotropic" is meant to convey. What this means is that, in the absence of anything to break the symmetry, each point in ... |
19,169,211 | I have defined a function where one of the parameters is out. Here, when the function call is made, I pass either a an initialized or an uninitialized argument.
Now, in the case of an initialized argument, how do I make the callee not change the value of the out parameter?
I cant use a ref here because sometimes I do ... | 2013/10/03 | [
"https://Stackoverflow.com/questions/19169211",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/755126/"
] | From [out C# - MSDN](http://msdn.microsoft.com/en-us/library/ee332485.aspx)
Although variables passed as out arguments do not have to be initialized before being passed, the **called method is required to assign a value before the method returns**.
Since a value must be assigned to the parameter with `out`, you can'... | Maybe I get all wrong, but this sounds like you just want to define a method like this
```
void caller(){
int x=5;
int y = doSomething(x);
}
int doSomething(int x){
return x+1;
}
```
or in case you want a null state use:
```
void caller(){
int? x=5;
int y = doSomething(x);
}
int doSomething(int? x){
if (x == nu... |
27,707,901 | So I want to use ajax request and I know how to use it.
But problem that i had that I want to pass parameters to request. So My first page had 4 parameter then I build url like this,
```
var url = "./ControllerServlet?PAGE_ID=BPCLA&ACTION=closeAssessment&SAVE_FLAG=true&closeReason="+closeReasonStr+"&closeCmt="+closeC... | 2014/12/30 | [
"https://Stackoverflow.com/questions/27707901",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/4390665/"
] | You could make an object with the key/value pairs being what you want added to the URL.
```
var closeReason = document.getElementById("SectionClousureReason");
var params = {
PAGE_ID: 'BPCLA',
ACTION: 'closeAssessment',
SAVE_FLAG: 'true',
closeReasonStr: closeReason.options[closeReason.selectedIndex].v... | Build up an object of your parameters and put them in the uri through a loop like this:
```
var values= {
page_id: 'BPCLA',
action: 'test'
},
uri_params = [],
uri = 'http://yoururl.com/file.php?';
for (var param in values) uri_params.push( encodeURIComponent( param ) + '=' + encodeURIComponent( values[ param... |
62,896,600 | In short, the repository is old and huge, say 7GB. For instance, the current branch is `branch01` and the remote is called `origin`. The task is to create a new empty commit on `branch02`. Basically, the empty commit is to trigger the CI(Continuous integration) process when doing the git-push.
However, switching from ... | 2020/07/14 | [
"https://Stackoverflow.com/questions/62896600",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/9091716/"
] | Just to answer the original question, you can do that with a few low-level commands:
```
cmt=$(git commit-tree -m "trigger Jenkins" -p branch02 branch02^{tree}) &&
git update-ref refs/heads/branch02 $cmt
```
That is, you create a new commit object with the same tree object as the original branch and the original bra... | Yes, you can. But note the below steps for creating commits on that branch.
1. `git symbolic-ref HEAD refs/heads/otherbranch` Will checkout without updating the files.
2. Reset your index as per the new branch by `git reset` If you don't do this, you end up committing something based on last checked-out branch
3. Stag... |
35,651,380 | I am trying make a http request to a web service. It returns JSON data. And I am also want to parse this data. I am new at swift I try many ways but get nothing. Here is my service address:
```
http://xxx.xxx.xxx.xxx/mobileservice/login/firmcode/mailaddress/password/ip
```
I am try to call service on this uri templa... | 2016/02/26 | [
"https://Stackoverflow.com/questions/35651380",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/4896705/"
] | <https://github.com/Alamofire/Alamofire>
+
<https://github.com/SwiftyJSON/SwiftyJSON>
EX :
```
Alamofire.request(.GET, "http://xxx.xxx.xxx.xxx/mobileservice/login/firmcode/mailaddress/password/ip", parameters: nil)
.responseJSON { response in
print(response.request) // original URL request
... | You can use a third party framework like Alamofire, as Benobab says. It's also quite easy to use `NSURLSession` and an `NSURLSessionTask` to do this. `NSURLSession` has a method `sharedSession` that gives you a session that's already configured. Then you want to create an `NSURLSessionDataTask`. Take a look at the Xcod... |
35,651,380 | I am trying make a http request to a web service. It returns JSON data. And I am also want to parse this data. I am new at swift I try many ways but get nothing. Here is my service address:
```
http://xxx.xxx.xxx.xxx/mobileservice/login/firmcode/mailaddress/password/ip
```
I am try to call service on this uri templa... | 2016/02/26 | [
"https://Stackoverflow.com/questions/35651380",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/4896705/"
] | A nice way for sending http request is alamofire. Although you can also send http without external library. Look at this code
```
func sendHttpRequests(data : Dictionary<String, AnyObject>)
{
let url = NSURL ( string : "http://xxx.xxx.xxx.xxx/mobileservice/login/firmcode/mailaddress/password/ip")!
let request:NS... | <https://github.com/Alamofire/Alamofire>
+
<https://github.com/SwiftyJSON/SwiftyJSON>
EX :
```
Alamofire.request(.GET, "http://xxx.xxx.xxx.xxx/mobileservice/login/firmcode/mailaddress/password/ip", parameters: nil)
.responseJSON { response in
print(response.request) // original URL request
... |
35,651,380 | I am trying make a http request to a web service. It returns JSON data. And I am also want to parse this data. I am new at swift I try many ways but get nothing. Here is my service address:
```
http://xxx.xxx.xxx.xxx/mobileservice/login/firmcode/mailaddress/password/ip
```
I am try to call service on this uri templa... | 2016/02/26 | [
"https://Stackoverflow.com/questions/35651380",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/4896705/"
] | A nice way for sending http request is alamofire. Although you can also send http without external library. Look at this code
```
func sendHttpRequests(data : Dictionary<String, AnyObject>)
{
let url = NSURL ( string : "http://xxx.xxx.xxx.xxx/mobileservice/login/firmcode/mailaddress/password/ip")!
let request:NS... | You can use a third party framework like Alamofire, as Benobab says. It's also quite easy to use `NSURLSession` and an `NSURLSessionTask` to do this. `NSURLSession` has a method `sharedSession` that gives you a session that's already configured. Then you want to create an `NSURLSessionDataTask`. Take a look at the Xcod... |
19,691,953 | I am using Haskell and have declared a `Vector` as
```
data Vector = Vector [Double]
```
Now, I want to declare the `dot` product of two vectors as
```
dot :: Vector -> Vector -> Double
dot a b = sum $ a * b -- I already wrote Vector as an instance of Num for *.
```
But, the problem is, I receive the error
```
C... | 2013/10/30 | [
"https://Stackoverflow.com/questions/19691953",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/904316/"
] | So I've noticed you're not using standard vectors. I'd suggest switching to them, but if you really don't want to,
```
toList :: Vector -> [Double]
toList (Vector a) = a
```
and use
```
dot a b = sum . toList $ a * b
```
If you switch to standard vectors you have 3 choices
1. Turn your `Vector` to a list,
```... | You are using sum from Prelude with type:
`sum :: Num a => [a] -> a`
sum for vectors is defined in Data.Vector (usually imported qualified)
edit: I missed the fact that you are using your own datatype, not the one from Data.Vector |
19,691,953 | I am using Haskell and have declared a `Vector` as
```
data Vector = Vector [Double]
```
Now, I want to declare the `dot` product of two vectors as
```
dot :: Vector -> Vector -> Double
dot a b = sum $ a * b -- I already wrote Vector as an instance of Num for *.
```
But, the problem is, I receive the error
```
C... | 2013/10/30 | [
"https://Stackoverflow.com/questions/19691953",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/904316/"
] | You are using sum from Prelude with type:
`sum :: Num a => [a] -> a`
sum for vectors is defined in Data.Vector (usually imported qualified)
edit: I missed the fact that you are using your own datatype, not the one from Data.Vector | To a create a dot function you could do
```
data Vector = Vector [Double]
dot :: Vector -> Vector -> Double
dot (Vector a) (Vector b) = sum $ zipWith (*) a b
```
This way 'a' and 'b' are now the [Double] inside of the Vector and not the Vector its self.
Step-by-step:
```
dot (Vector [1,2]) (Vector [3,4]) = sum $ ... |
19,691,953 | I am using Haskell and have declared a `Vector` as
```
data Vector = Vector [Double]
```
Now, I want to declare the `dot` product of two vectors as
```
dot :: Vector -> Vector -> Double
dot a b = sum $ a * b -- I already wrote Vector as an instance of Num for *.
```
But, the problem is, I receive the error
```
C... | 2013/10/30 | [
"https://Stackoverflow.com/questions/19691953",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/904316/"
] | So I've noticed you're not using standard vectors. I'd suggest switching to them, but if you really don't want to,
```
toList :: Vector -> [Double]
toList (Vector a) = a
```
and use
```
dot a b = sum . toList $ a * b
```
If you switch to standard vectors you have 3 choices
1. Turn your `Vector` to a list,
```... | Since you aren't using `Data.Vector` vectors, you can't actually make `sum` work directly on your data type, since it's type is
```
sum :: Num a => [a] -> a
```
and you're giving it `Vector [Double]` instead of a `Num a => [a]`. You'll have to extract list inside the vector first:
```
toList :: Vector -> [Double]
t... |
19,691,953 | I am using Haskell and have declared a `Vector` as
```
data Vector = Vector [Double]
```
Now, I want to declare the `dot` product of two vectors as
```
dot :: Vector -> Vector -> Double
dot a b = sum $ a * b -- I already wrote Vector as an instance of Num for *.
```
But, the problem is, I receive the error
```
C... | 2013/10/30 | [
"https://Stackoverflow.com/questions/19691953",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/904316/"
] | So I've noticed you're not using standard vectors. I'd suggest switching to them, but if you really don't want to,
```
toList :: Vector -> [Double]
toList (Vector a) = a
```
and use
```
dot a b = sum . toList $ a * b
```
If you switch to standard vectors you have 3 choices
1. Turn your `Vector` to a list,
```... | Generally, yes. Oftentimes this is desirable since it allows you to prune away functions that you don't want people to have access to. For instance, giving a user `[Double]` lets them compute the length and examine it as a linked-list, while `newtype Vector = Vector [Double]` would let you expose `vectorLength` if and ... |
19,691,953 | I am using Haskell and have declared a `Vector` as
```
data Vector = Vector [Double]
```
Now, I want to declare the `dot` product of two vectors as
```
dot :: Vector -> Vector -> Double
dot a b = sum $ a * b -- I already wrote Vector as an instance of Num for *.
```
But, the problem is, I receive the error
```
C... | 2013/10/30 | [
"https://Stackoverflow.com/questions/19691953",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/904316/"
] | So I've noticed you're not using standard vectors. I'd suggest switching to them, but if you really don't want to,
```
toList :: Vector -> [Double]
toList (Vector a) = a
```
and use
```
dot a b = sum . toList $ a * b
```
If you switch to standard vectors you have 3 choices
1. Turn your `Vector` to a list,
```... | To a create a dot function you could do
```
data Vector = Vector [Double]
dot :: Vector -> Vector -> Double
dot (Vector a) (Vector b) = sum $ zipWith (*) a b
```
This way 'a' and 'b' are now the [Double] inside of the Vector and not the Vector its self.
Step-by-step:
```
dot (Vector [1,2]) (Vector [3,4]) = sum $ ... |
19,691,953 | I am using Haskell and have declared a `Vector` as
```
data Vector = Vector [Double]
```
Now, I want to declare the `dot` product of two vectors as
```
dot :: Vector -> Vector -> Double
dot a b = sum $ a * b -- I already wrote Vector as an instance of Num for *.
```
But, the problem is, I receive the error
```
C... | 2013/10/30 | [
"https://Stackoverflow.com/questions/19691953",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/904316/"
] | Since you aren't using `Data.Vector` vectors, you can't actually make `sum` work directly on your data type, since it's type is
```
sum :: Num a => [a] -> a
```
and you're giving it `Vector [Double]` instead of a `Num a => [a]`. You'll have to extract list inside the vector first:
```
toList :: Vector -> [Double]
t... | To a create a dot function you could do
```
data Vector = Vector [Double]
dot :: Vector -> Vector -> Double
dot (Vector a) (Vector b) = sum $ zipWith (*) a b
```
This way 'a' and 'b' are now the [Double] inside of the Vector and not the Vector its self.
Step-by-step:
```
dot (Vector [1,2]) (Vector [3,4]) = sum $ ... |
19,691,953 | I am using Haskell and have declared a `Vector` as
```
data Vector = Vector [Double]
```
Now, I want to declare the `dot` product of two vectors as
```
dot :: Vector -> Vector -> Double
dot a b = sum $ a * b -- I already wrote Vector as an instance of Num for *.
```
But, the problem is, I receive the error
```
C... | 2013/10/30 | [
"https://Stackoverflow.com/questions/19691953",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/904316/"
] | Generally, yes. Oftentimes this is desirable since it allows you to prune away functions that you don't want people to have access to. For instance, giving a user `[Double]` lets them compute the length and examine it as a linked-list, while `newtype Vector = Vector [Double]` would let you expose `vectorLength` if and ... | To a create a dot function you could do
```
data Vector = Vector [Double]
dot :: Vector -> Vector -> Double
dot (Vector a) (Vector b) = sum $ zipWith (*) a b
```
This way 'a' and 'b' are now the [Double] inside of the Vector and not the Vector its self.
Step-by-step:
```
dot (Vector [1,2]) (Vector [3,4]) = sum $ ... |
60,226 | I am really stumped at the moment about how to solve a particular problem. I have many time series like this:
[](https://i.stack.imgur.com/xTjYc.png)
This represents the number of hours a person spends on a website each day throughout the year. Any d... | 2019/09/15 | [
"https://datascience.stackexchange.com/questions/60226",
"https://datascience.stackexchange.com",
"https://datascience.stackexchange.com/users/-1/"
] | To construct sentence embeddings Spacy just averages the word embeddings. I do not have access to Spacy right now, else would have give a demonstration but you can try:
```
spacy_nlp('hello I').vector == (spacy_nlp('hello').vector + spacy_nlp('I').vector) / 2
```
If this also gives `False`, it will be because the fl... | The answer is: **average embeddings of the parsed tokens**.
Mind that the tokenizer may be customized/different from what you expect.
Here you find a full example
```
import spacy
import numpy as np
nlp = spacy.load("en_core_web_md")
txt= 'ChatGPT could automatically compose comments submitted in regulatory processe... |
65,897,926 | FAILURE: Build failed with an exception.
* What went wrong:
Execution failed for task ':app:mergeReleaseResources'.
>
> Multiple task action failures occurred:
> A failure occurred while executing com.android.build.gradle.internal.tasks.Workers$ActionFacade
> > Android resource compilation failed
> AAPT: D:\Flutter ... | 2021/01/26 | [
"https://Stackoverflow.com/questions/65897926",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/12025401/"
] | Problem Is With APP ICON .
>
> MAKE APP ICON .PNG FORMAT
>
>
> | **The Error is solved**
**If this type of error occurs it means that your flutter app icon is not png format. So, first, make your app icon in png extension and then again add in your flutter project. This error will be solved.** |
18,806,021 | H,
Here is my code that is giving error object is undeclared first use this function although every thing is alright, why is this happening so? that class is not visible to main function and its giving errors.
```
#include <iostream.h>
#include <stdio.h>
#include <conio.h>
using namespace std;
class time
{
in... | 2013/09/14 | [
"https://Stackoverflow.com/questions/18806021",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/2477039/"
] | show the exact error.
```
time(int h,int m,int s):hrs(h),mins(m),secs(s){}
```
That's an **initializer list**.
```
// could it be replaced by this:
time(int m, int s, int h) { min= m; sec = s; hour = h; }
```
No, because you changed the argument order.
But `time(int h,int m,int s):hrs(h),mins(m),secs(s){}` is ... | As for your second question -
```
time(int h,int m,int s):hrs(h),mins(m),secs(s){}
```
This line uses **MIL** - [Member initialization list](https://stackoverflow.com/questions/7665021/c-member-initialization-list), as for use/not use - [Why should I prefer to use member initialization list?](https://stackoverflow.c... |
18,806,021 | H,
Here is my code that is giving error object is undeclared first use this function although every thing is alright, why is this happening so? that class is not visible to main function and its giving errors.
```
#include <iostream.h>
#include <stdio.h>
#include <conio.h>
using namespace std;
class time
{
in... | 2013/09/14 | [
"https://Stackoverflow.com/questions/18806021",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/2477039/"
] | show the exact error.
```
time(int h,int m,int s):hrs(h),mins(m),secs(s){}
```
That's an **initializer list**.
```
// could it be replaced by this:
time(int m, int s, int h) { min= m; sec = s; hour = h; }
```
No, because you changed the argument order.
But `time(int h,int m,int s):hrs(h),mins(m),secs(s){}` is ... | Your code will not print correct output if you want t3 to really have the sum of t1,t2. If the code is actually what is required, then it is fine.
But, if add really needs to add, then don't create another local variable t4 in the function. Rather modify the member variables like this:
```
void add(Time t1, Time t2)... |
18,806,021 | H,
Here is my code that is giving error object is undeclared first use this function although every thing is alright, why is this happening so? that class is not visible to main function and its giving errors.
```
#include <iostream.h>
#include <stdio.h>
#include <conio.h>
using namespace std;
class time
{
in... | 2013/09/14 | [
"https://Stackoverflow.com/questions/18806021",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/2477039/"
] | Your choice of the class name is a bit unfortunate, since there is already a function named [`std::time`](http://en.cppreference.com/w/cpp/chrono/c/time) in the standard library, so just choose a different name or consider using namespaces.
Concerning the second question:
This way of initializing the member variables... | As for your second question -
```
time(int h,int m,int s):hrs(h),mins(m),secs(s){}
```
This line uses **MIL** - [Member initialization list](https://stackoverflow.com/questions/7665021/c-member-initialization-list), as for use/not use - [Why should I prefer to use member initialization list?](https://stackoverflow.c... |
18,806,021 | H,
Here is my code that is giving error object is undeclared first use this function although every thing is alright, why is this happening so? that class is not visible to main function and its giving errors.
```
#include <iostream.h>
#include <stdio.h>
#include <conio.h>
using namespace std;
class time
{
in... | 2013/09/14 | [
"https://Stackoverflow.com/questions/18806021",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/2477039/"
] | Your choice of the class name is a bit unfortunate, since there is already a function named [`std::time`](http://en.cppreference.com/w/cpp/chrono/c/time) in the standard library, so just choose a different name or consider using namespaces.
Concerning the second question:
This way of initializing the member variables... | Your code will not print correct output if you want t3 to really have the sum of t1,t2. If the code is actually what is required, then it is fine.
But, if add really needs to add, then don't create another local variable t4 in the function. Rather modify the member variables like this:
```
void add(Time t1, Time t2)... |
55,399,918 | I want to promt for a string variable (name of item) and then promt for a double variable (cost). I want this to be done 5 times so each time it loops the vales are stored as a different pair of variable.
need to have user input an item and then its price so i can calc a bill.
not sure if I can crate a loop for this ... | 2019/03/28 | [
"https://Stackoverflow.com/questions/55399918",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/11272126/"
] | Here is a solution with `arrays` and a `for` loop.
You can try it in [CPP Shell](http://cpp.sh/).
```
#include <iostream>
#include <string>
using namespace std;
int main()
{
string Item[5];
double Price[5] ;
for(int i = 0; i < 5; i++)
{
cout<<"Please enter item"<<endl;
cin>> Item... | Your code doesn't compile for many reasons!
Of course you can use a loop for your purpose. Consider the following code, which is not really good, but does the job:
```
#include <string>
#include <iostream>
using namespace std;
int main()
{
int i = 1;
string Item[5];
double Price[5];
while (i<6)... |
6,650,879 | I was wondering if there was a parameter in SQL for all (not \*!) For example, I'm writing a search table now, and if the user does not input something in the text box, it would mean to ignore that specific parameter and display ALL of them for that field. I understand you could make separate OLEDB or SQL commands for ... | 2011/07/11 | [
"https://Stackoverflow.com/questions/6650879",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/831600/"
] | you probably need a variation on JNK's answer as I think your user input is probably coming through as empty string rather than `NULL` eg
```
WHERE (Vendorname = @Vendorname OR @Vendorname = '')
AND (CustomerName = @Customername OR @Customername = '')
```
This may of course vary from field to field. | ```
da.SelectCommand = new OleDbCommand("SELECT * FROM TestQuery WHERE (@VendorName is null or VendorName = @VendorName) AND (@CustomerName is null or CustomerName = @CustomerName)", cs);
da.SelectCommand.Parameters.Add("@VendorName", OleDbType.VarChar).Value = string.isNullOrEmpty(combo_VendorView.Text) ? null : combo... |
6,650,879 | I was wondering if there was a parameter in SQL for all (not \*!) For example, I'm writing a search table now, and if the user does not input something in the text box, it would mean to ignore that specific parameter and display ALL of them for that field. I understand you could make separate OLEDB or SQL commands for ... | 2011/07/11 | [
"https://Stackoverflow.com/questions/6650879",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/831600/"
] | Is it possible @CustomerName is not equal to NULL but to "" (an empty string)? | If the combo box is not selected, why bother with the parameter in your SQL statement's where clause at all? You already have the logic on the Vendor combo box. |
6,650,879 | I was wondering if there was a parameter in SQL for all (not \*!) For example, I'm writing a search table now, and if the user does not input something in the text box, it would mean to ignore that specific parameter and display ALL of them for that field. I understand you could make separate OLEDB or SQL commands for ... | 2011/07/11 | [
"https://Stackoverflow.com/questions/6650879",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/831600/"
] | ```
combo_CustomerView.Text.ToString() // is converting null to ''
```
so use:
```
da.SelectCommand = new OleDbCommand("SELECT * FROM TestQuery WHERE CustomerName = @CustomerName OR @CustomerName = ''", cs);
``` | I don't do much with .NET, but I assume that `combo_CustomerView.Text.ToString()` returns the string "Null" or the empty string ("") when the combo box is empty. What you really want to do there is assign the `NULL` literal. In pseudocode:
```
If combo_box is empty then
...Parameters.Add().Value = Null
Else
..... |
6,650,879 | I was wondering if there was a parameter in SQL for all (not \*!) For example, I'm writing a search table now, and if the user does not input something in the text box, it would mean to ignore that specific parameter and display ALL of them for that field. I understand you could make separate OLEDB or SQL commands for ... | 2011/07/11 | [
"https://Stackoverflow.com/questions/6650879",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/831600/"
] | ```
combo_CustomerView.Text.ToString() // is converting null to ''
```
so use:
```
da.SelectCommand = new OleDbCommand("SELECT * FROM TestQuery WHERE CustomerName = @CustomerName OR @CustomerName = ''", cs);
``` | The problem is that you're never setting `@CustomerName` to null. In your code, if the user selects the empty entry in the `ComboBox`, the `@CustomerName` parameter will have an empty string as its value.
You need something like this:
```
if(string.IsNullOrEmpty(combo_CustomerView.Text))
{
da.SelectCommand.Parame... |
6,650,879 | I was wondering if there was a parameter in SQL for all (not \*!) For example, I'm writing a search table now, and if the user does not input something in the text box, it would mean to ignore that specific parameter and display ALL of them for that field. I understand you could make separate OLEDB or SQL commands for ... | 2011/07/11 | [
"https://Stackoverflow.com/questions/6650879",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/831600/"
] | you probably need a variation on JNK's answer as I think your user input is probably coming through as empty string rather than `NULL` eg
```
WHERE (Vendorname = @Vendorname OR @Vendorname = '')
AND (CustomerName = @Customername OR @Customername = '')
```
This may of course vary from field to field. | The problem is that you're never setting `@CustomerName` to null. In your code, if the user selects the empty entry in the `ComboBox`, the `@CustomerName` parameter will have an empty string as its value.
You need something like this:
```
if(string.IsNullOrEmpty(combo_CustomerView.Text))
{
da.SelectCommand.Parame... |
6,650,879 | I was wondering if there was a parameter in SQL for all (not \*!) For example, I'm writing a search table now, and if the user does not input something in the text box, it would mean to ignore that specific parameter and display ALL of them for that field. I understand you could make separate OLEDB or SQL commands for ... | 2011/07/11 | [
"https://Stackoverflow.com/questions/6650879",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/831600/"
] | ```
combo_CustomerView.Text.ToString() // is converting null to ''
```
so use:
```
da.SelectCommand = new OleDbCommand("SELECT * FROM TestQuery WHERE CustomerName = @CustomerName OR @CustomerName = ''", cs);
``` | Generic code
```
where (col1=@param1 or @param1 is null) and (col2=@param2 or @param2 is null) and...
``` |
6,650,879 | I was wondering if there was a parameter in SQL for all (not \*!) For example, I'm writing a search table now, and if the user does not input something in the text box, it would mean to ignore that specific parameter and display ALL of them for that field. I understand you could make separate OLEDB or SQL commands for ... | 2011/07/11 | [
"https://Stackoverflow.com/questions/6650879",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/831600/"
] | You can use the `COALESCE` operator in this example. If your parameter was passed in as null, or you put in logic to convert an empty string to null, you could essentially do this:
```
SELECT *
FROM TestQuery
WHERE
VendorName = COALESCE(@VendorName,VendorName)
AND CustomerName = COALESCE(@CustomerName, Customer... | ```
da.SelectCommand = new OleDbCommand("SELECT * FROM TestQuery WHERE (@VendorName is null or VendorName = @VendorName) AND (@CustomerName is null or CustomerName = @CustomerName)", cs);
da.SelectCommand.Parameters.Add("@VendorName", OleDbType.VarChar).Value = string.isNullOrEmpty(combo_VendorView.Text) ? null : combo... |
6,650,879 | I was wondering if there was a parameter in SQL for all (not \*!) For example, I'm writing a search table now, and if the user does not input something in the text box, it would mean to ignore that specific parameter and display ALL of them for that field. I understand you could make separate OLEDB or SQL commands for ... | 2011/07/11 | [
"https://Stackoverflow.com/questions/6650879",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/831600/"
] | you probably need a variation on JNK's answer as I think your user input is probably coming through as empty string rather than `NULL` eg
```
WHERE (Vendorname = @Vendorname OR @Vendorname = '')
AND (CustomerName = @Customername OR @Customername = '')
```
This may of course vary from field to field. | Generic code
```
where (col1=@param1 or @param1 is null) and (col2=@param2 or @param2 is null) and...
``` |
6,650,879 | I was wondering if there was a parameter in SQL for all (not \*!) For example, I'm writing a search table now, and if the user does not input something in the text box, it would mean to ignore that specific parameter and display ALL of them for that field. I understand you could make separate OLEDB or SQL commands for ... | 2011/07/11 | [
"https://Stackoverflow.com/questions/6650879",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/831600/"
] | Use explicit `NULL` evaluation like below:
```
WHERE (Vendorname = @Vendorname OR @Vendorname IS NULL)
AND (CustomerName = @Customername OR @Customername IS NULL)
``` | If the combo box is not selected, why bother with the parameter in your SQL statement's where clause at all? You already have the logic on the Vendor combo box. |
6,650,879 | I was wondering if there was a parameter in SQL for all (not \*!) For example, I'm writing a search table now, and if the user does not input something in the text box, it would mean to ignore that specific parameter and display ALL of them for that field. I understand you could make separate OLEDB or SQL commands for ... | 2011/07/11 | [
"https://Stackoverflow.com/questions/6650879",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/831600/"
] | You can use the `COALESCE` operator in this example. If your parameter was passed in as null, or you put in logic to convert an empty string to null, you could essentially do this:
```
SELECT *
FROM TestQuery
WHERE
VendorName = COALESCE(@VendorName,VendorName)
AND CustomerName = COALESCE(@CustomerName, Customer... | If the combo box is not selected, why bother with the parameter in your SQL statement's where clause at all? You already have the logic on the Vendor combo box. |
17,924,087 | I've provided metadata by defining a Model (so far only one Entity/Model):
```
function init(store){
addSerieType(store);
}
function addSerieType(store){
store.addEntityType({
shortName: "Serie",
namespace: "xxx",
defaultResourceName: "Serien",
/... | 2013/07/29 | [
"https://Stackoverflow.com/questions/17924087",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/2630177/"
] | **Frame Animation in Cocos2dX**
```
CCAnimation *animation = CCAnimation::create();
// load image file from local file system to CCSpriteFrame,
then add into CCAnimation
for (int i = 1; i < 15; i++)
{
char szImageFileName[128] = {0};
sprintf(szImageFileName, "Images/grossini_dance_%02d.png", i);
animatio... | U can Do like this...........
```
//"horse.png" through which batch node crate
CCSpriteBatchNode* spritebatch = CCSpriteBatchNode::create("horse.png");
CCSpriteFrameCache* cache = CCSpriteFrameCache::sharedSpriteFrameCache();
cache->addSpriteFramesWithFile("horse.plist");
// "hero" is CCSprite and "h... |
17,924,087 | I've provided metadata by defining a Model (so far only one Entity/Model):
```
function init(store){
addSerieType(store);
}
function addSerieType(store){
store.addEntityType({
shortName: "Serie",
namespace: "xxx",
defaultResourceName: "Serien",
/... | 2013/07/29 | [
"https://Stackoverflow.com/questions/17924087",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/2630177/"
] | The below code will move your sprite once:
```
CCSprite *sprite=CCSprite::create("image.png");
CCMoveTo *moveSprite=CCMoveTo::create(0.5, ccp(200, 400));
sprite->runAction(moveSprite);
```
The below line will scale your sprite:
```
sprite->setScale(1.2);
```
The below code will rotate your sprite:
```
CCRotateBy... | So there are basically two types of animations you could run on your image (or `ccsprite`).
1: Translations:- `CCmoveBy`,`CCmoveTo`,`CCrotateBy` etc.
2: Frame Animations.
There usage is as follows...
```
CCSprite *sprite=CCSprite::create("image.png");
CCMoveTo *moveSprite=CCMoveTo::create(0.5, ccp(200, 400));
spri... |
17,924,087 | I've provided metadata by defining a Model (so far only one Entity/Model):
```
function init(store){
addSerieType(store);
}
function addSerieType(store){
store.addEntityType({
shortName: "Serie",
namespace: "xxx",
defaultResourceName: "Serien",
/... | 2013/07/29 | [
"https://Stackoverflow.com/questions/17924087",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/2630177/"
] | The below code will move your sprite once:
```
CCSprite *sprite=CCSprite::create("image.png");
CCMoveTo *moveSprite=CCMoveTo::create(0.5, ccp(200, 400));
sprite->runAction(moveSprite);
```
The below line will scale your sprite:
```
sprite->setScale(1.2);
```
The below code will rotate your sprite:
```
CCRotateBy... | You can use simple animation and some complex animation by using cocos2dx. some third party tools are available for making sprite frame and you can run animation on these frames by using code of cocos2dx.
```
CCSpriteBatchNode* spritebatch = CCSpriteBatchNode::create("horse.png");
CCSpriteFrameCache* cache = CCSpriteF... |
17,924,087 | I've provided metadata by defining a Model (so far only one Entity/Model):
```
function init(store){
addSerieType(store);
}
function addSerieType(store){
store.addEntityType({
shortName: "Serie",
namespace: "xxx",
defaultResourceName: "Serien",
/... | 2013/07/29 | [
"https://Stackoverflow.com/questions/17924087",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/2630177/"
] | You can use simple animation and some complex animation by using cocos2dx. some third party tools are available for making sprite frame and you can run animation on these frames by using code of cocos2dx.
```
CCSpriteBatchNode* spritebatch = CCSpriteBatchNode::create("horse.png");
CCSpriteFrameCache* cache = CCSpriteF... | At first you need a software to make a plist file.when you got plist file you can use this code to make a Animation.
```
CCSprite *pBody = CCSprite::createWithSpriteFrameName("enemy1_m_1.png");
CC_BREAK_IF(!pBody);
CCSpriteFrameCache* pAttac_FrameCache = CCSpriteFrameCache::sharedSpriteFrameCache();
pAttac_FrameCache... |
17,924,087 | I've provided metadata by defining a Model (so far only one Entity/Model):
```
function init(store){
addSerieType(store);
}
function addSerieType(store){
store.addEntityType({
shortName: "Serie",
namespace: "xxx",
defaultResourceName: "Serien",
/... | 2013/07/29 | [
"https://Stackoverflow.com/questions/17924087",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/2630177/"
] | The below code will move your sprite once:
```
CCSprite *sprite=CCSprite::create("image.png");
CCMoveTo *moveSprite=CCMoveTo::create(0.5, ccp(200, 400));
sprite->runAction(moveSprite);
```
The below line will scale your sprite:
```
sprite->setScale(1.2);
```
The below code will rotate your sprite:
```
CCRotateBy... | U can Do like this...........
```
//"horse.png" through which batch node crate
CCSpriteBatchNode* spritebatch = CCSpriteBatchNode::create("horse.png");
CCSpriteFrameCache* cache = CCSpriteFrameCache::sharedSpriteFrameCache();
cache->addSpriteFramesWithFile("horse.plist");
// "hero" is CCSprite and "h... |
17,924,087 | I've provided metadata by defining a Model (so far only one Entity/Model):
```
function init(store){
addSerieType(store);
}
function addSerieType(store){
store.addEntityType({
shortName: "Serie",
namespace: "xxx",
defaultResourceName: "Serien",
/... | 2013/07/29 | [
"https://Stackoverflow.com/questions/17924087",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/2630177/"
] | **Frame Animation in Cocos2dX**
```
CCAnimation *animation = CCAnimation::create();
// load image file from local file system to CCSpriteFrame,
then add into CCAnimation
for (int i = 1; i < 15; i++)
{
char szImageFileName[128] = {0};
sprintf(szImageFileName, "Images/grossini_dance_%02d.png", i);
animatio... | So there are basically two types of animations you could run on your image (or `ccsprite`).
1: Translations:- `CCmoveBy`,`CCmoveTo`,`CCrotateBy` etc.
2: Frame Animations.
There usage is as follows...
```
CCSprite *sprite=CCSprite::create("image.png");
CCMoveTo *moveSprite=CCMoveTo::create(0.5, ccp(200, 400));
spri... |
17,924,087 | I've provided metadata by defining a Model (so far only one Entity/Model):
```
function init(store){
addSerieType(store);
}
function addSerieType(store){
store.addEntityType({
shortName: "Serie",
namespace: "xxx",
defaultResourceName: "Serien",
/... | 2013/07/29 | [
"https://Stackoverflow.com/questions/17924087",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/2630177/"
] | **Frame Animation in Cocos2dX**
```
CCAnimation *animation = CCAnimation::create();
// load image file from local file system to CCSpriteFrame,
then add into CCAnimation
for (int i = 1; i < 15; i++)
{
char szImageFileName[128] = {0};
sprintf(szImageFileName, "Images/grossini_dance_%02d.png", i);
animatio... | You can use LevelHelper and SpriteHelper . Coding Part is not required for animations . |
17,924,087 | I've provided metadata by defining a Model (so far only one Entity/Model):
```
function init(store){
addSerieType(store);
}
function addSerieType(store){
store.addEntityType({
shortName: "Serie",
namespace: "xxx",
defaultResourceName: "Serien",
/... | 2013/07/29 | [
"https://Stackoverflow.com/questions/17924087",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/2630177/"
] | So there are basically two types of animations you could run on your image (or `ccsprite`).
1: Translations:- `CCmoveBy`,`CCmoveTo`,`CCrotateBy` etc.
2: Frame Animations.
There usage is as follows...
```
CCSprite *sprite=CCSprite::create("image.png");
CCMoveTo *moveSprite=CCMoveTo::create(0.5, ccp(200, 400));
spri... | Your best friend is the test application. Compile it and run it, find something similar to what you want to do and check the code for it. You can find the source in cocos2d-x/tests/cpp-tests/Classes/ ([link to github](https://github.com/cocos2d/cocos2d-x/tree/v3/tests/cpp-tests/Classes))
If you need examples about ani... |
17,924,087 | I've provided metadata by defining a Model (so far only one Entity/Model):
```
function init(store){
addSerieType(store);
}
function addSerieType(store){
store.addEntityType({
shortName: "Serie",
namespace: "xxx",
defaultResourceName: "Serien",
/... | 2013/07/29 | [
"https://Stackoverflow.com/questions/17924087",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/2630177/"
] | The below code will move your sprite once:
```
CCSprite *sprite=CCSprite::create("image.png");
CCMoveTo *moveSprite=CCMoveTo::create(0.5, ccp(200, 400));
sprite->runAction(moveSprite);
```
The below line will scale your sprite:
```
sprite->setScale(1.2);
```
The below code will rotate your sprite:
```
CCRotateBy... | At first you need a software to make a plist file.when you got plist file you can use this code to make a Animation.
```
CCSprite *pBody = CCSprite::createWithSpriteFrameName("enemy1_m_1.png");
CC_BREAK_IF(!pBody);
CCSpriteFrameCache* pAttac_FrameCache = CCSpriteFrameCache::sharedSpriteFrameCache();
pAttac_FrameCache... |
17,924,087 | I've provided metadata by defining a Model (so far only one Entity/Model):
```
function init(store){
addSerieType(store);
}
function addSerieType(store){
store.addEntityType({
shortName: "Serie",
namespace: "xxx",
defaultResourceName: "Serien",
/... | 2013/07/29 | [
"https://Stackoverflow.com/questions/17924087",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/2630177/"
] | The below code will move your sprite once:
```
CCSprite *sprite=CCSprite::create("image.png");
CCMoveTo *moveSprite=CCMoveTo::create(0.5, ccp(200, 400));
sprite->runAction(moveSprite);
```
The below line will scale your sprite:
```
sprite->setScale(1.2);
```
The below code will rotate your sprite:
```
CCRotateBy... | According to what I've been through when I started learning Cocos2dx, there are two ways to mess around with CCSprite:
1. Update Timer + Instant Action Per Update Call (ScheduleUpdate + CCActionInstant);
2. Action In Finite Time (CCActionInterval)
For 1, the template code should like this:
```
CCDirector::sharedDir... |
47,928,608 | I am trying to parse the first page of google search results. Specifically, the Title and the small Summary that is provided. Here is what I have so far:
```
from urllib.request import urlretrieve
import urllib.parse
from urllib.parse import urlencode, urlparse, parse_qs
import webbrowser
from bs4 import BeautifulSoup... | 2017/12/21 | [
"https://Stackoverflow.com/questions/47928608",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/9119847/"
] | Your url doesn't work for me. But with `https://google.com/search?q=` I get results.
```
import urllib
from bs4 import BeautifulSoup
import requests
import webbrowser
text = 'hello world'
text = urllib.parse.quote_plus(text)
url = 'https://google.com/search?q=' + text
response = requests.get(url)
#with open('outpu... | 1. *Default Google search address start* doesn't contain `#` symbol. Instead, it should have `?` and `/search` [pathname](https://url.spec.whatwg.org/#example-5434421b):
```none
---> https://google.com/#q=
---> https://www.google.com/search?q=cake
```
2. Make sure you're passing [`user-agent`](https://developer.mozi... |
44,759,371 | I want to create android app about an article that contains 30 chapters so i am to make 30 buttons every button will contain different text stories so please tell me how can i show these 30 buttons in list view instead of showing in normal linear layout of vertical orientation please help me out? | 2017/06/26 | [
"https://Stackoverflow.com/questions/44759371",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/8139887/"
] | You need to run
```
php artisan migrate:rollback
```
if that also fails just go in and drop all the tables which you may have to do as it seems your migration table is messed up or your roles table when you ran a previous rollback did not drop the table.
or you can use `migrate:reset` command will roll back all of... | remove the table from the database ( I did it manually the first time I had this issue)
and make this change in the create\_users\_table migration as such
```
$table->string('email', 60)->unique();
```
and this worked for me..
Hope this helps you as well |
44,759,371 | I want to create android app about an article that contains 30 chapters so i am to make 30 buttons every button will contain different text stories so please tell me how can i show these 30 buttons in list view instead of showing in normal linear layout of vertical orientation please help me out? | 2017/06/26 | [
"https://Stackoverflow.com/questions/44759371",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/8139887/"
] | You've got a number of problems. Your main problem is that you aren't adding a column to a table. Your script is instead trying to create a new table, as seen in this line:
```
Schema::create('roles', function (Blueprint $table) {
```
You said you are trying to add a column to the users table, but you aren't even wo... | You need to run
```
php artisan migrate:rollback
```
if that also fails just go in and drop all the tables which you may have to do as it seems your migration table is messed up or your roles table when you ran a previous rollback did not drop the table.
or you can use `migrate:reset` command will roll back all of... |
44,759,371 | I want to create android app about an article that contains 30 chapters so i am to make 30 buttons every button will contain different text stories so please tell me how can i show these 30 buttons in list view instead of showing in normal linear layout of vertical orientation please help me out? | 2017/06/26 | [
"https://Stackoverflow.com/questions/44759371",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/8139887/"
] | You need to run
```
php artisan migrate:rollback
```
if that also fails just go in and drop all the tables which you may have to do as it seems your migration table is messed up or your roles table when you ran a previous rollback did not drop the table.
or you can use `migrate:reset` command will roll back all of... | I had the same issue and I tried something like this and it works perfect for me. My Laravel version is 5.5.
```
public function up()
{
Schema::connection('mysql2')->create('images', function (Blueprint $table) {
$table->increments('id');
$table->string('name');
... |
44,759,371 | I want to create android app about an article that contains 30 chapters so i am to make 30 buttons every button will contain different text stories so please tell me how can i show these 30 buttons in list view instead of showing in normal linear layout of vertical orientation please help me out? | 2017/06/26 | [
"https://Stackoverflow.com/questions/44759371",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/8139887/"
] | You've got a number of problems. Your main problem is that you aren't adding a column to a table. Your script is instead trying to create a new table, as seen in this line:
```
Schema::create('roles', function (Blueprint $table) {
```
You said you are trying to add a column to the users table, but you aren't even wo... | remove the table from the database ( I did it manually the first time I had this issue)
and make this change in the create\_users\_table migration as such
```
$table->string('email', 60)->unique();
```
and this worked for me..
Hope this helps you as well |
44,759,371 | I want to create android app about an article that contains 30 chapters so i am to make 30 buttons every button will contain different text stories so please tell me how can i show these 30 buttons in list view instead of showing in normal linear layout of vertical orientation please help me out? | 2017/06/26 | [
"https://Stackoverflow.com/questions/44759371",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/8139887/"
] | I had the same issue and I tried something like this and it works perfect for me. My Laravel version is 5.5.
```
public function up()
{
Schema::connection('mysql2')->create('images', function (Blueprint $table) {
$table->increments('id');
$table->string('name');
... | remove the table from the database ( I did it manually the first time I had this issue)
and make this change in the create\_users\_table migration as such
```
$table->string('email', 60)->unique();
```
and this worked for me..
Hope this helps you as well |
44,759,371 | I want to create android app about an article that contains 30 chapters so i am to make 30 buttons every button will contain different text stories so please tell me how can i show these 30 buttons in list view instead of showing in normal linear layout of vertical orientation please help me out? | 2017/06/26 | [
"https://Stackoverflow.com/questions/44759371",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/8139887/"
] | You've got a number of problems. Your main problem is that you aren't adding a column to a table. Your script is instead trying to create a new table, as seen in this line:
```
Schema::create('roles', function (Blueprint $table) {
```
You said you are trying to add a column to the users table, but you aren't even wo... | I had the same issue and I tried something like this and it works perfect for me. My Laravel version is 5.5.
```
public function up()
{
Schema::connection('mysql2')->create('images', function (Blueprint $table) {
$table->increments('id');
$table->string('name');
... |
20,930,930 | I have a simple two column table where the left shows line numbers and the right shows code. I want the left-side to be the smallest size without clipping, and the right side to fill the remaining area (the whole table should be a 100% width).
```
<table>
<tr>
<td><pre>line numbers</pre></td>
<td><pre>code... | 2014/01/05 | [
"https://Stackoverflow.com/questions/20930930",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/229686/"
] | Just set the second `td` in every row to be `width: 100%;` ... Table cells can't break to a new row if their width exceeds the container, so it will just force everything to fit as closely to your styles as it can. So, setting a 100% width on one column, and no setting on the other will make the cells in that column as... | Another way to do it:
```
td:nth-child(2) { width: 100%; }
```
JSFiddle: <http://jsfiddle.net/SabdielRivera/n84xf/5/> |
20,930,930 | I have a simple two column table where the left shows line numbers and the right shows code. I want the left-side to be the smallest size without clipping, and the right side to fill the remaining area (the whole table should be a 100% width).
```
<table>
<tr>
<td><pre>line numbers</pre></td>
<td><pre>code... | 2014/01/05 | [
"https://Stackoverflow.com/questions/20930930",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/229686/"
] | Just set the second `td` in every row to be `width: 100%;` ... Table cells can't break to a new row if their width exceeds the container, so it will just force everything to fit as closely to your styles as it can. So, setting a 100% width on one column, and no setting on the other will make the cells in that column as... | You can set the `td` twidth to be `width:100%` to achieve what you need. Here's a [fiddle](http://jsfiddle.net/aL8qL/1/) |
20,930,930 | I have a simple two column table where the left shows line numbers and the right shows code. I want the left-side to be the smallest size without clipping, and the right side to fill the remaining area (the whole table should be a 100% width).
```
<table>
<tr>
<td><pre>line numbers</pre></td>
<td><pre>code... | 2014/01/05 | [
"https://Stackoverflow.com/questions/20930930",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/229686/"
] | Just set the second `td` in every row to be `width: 100%;` ... Table cells can't break to a new row if their width exceeds the container, so it will just force everything to fit as closely to your styles as it can. So, setting a 100% width on one column, and no setting on the other will make the cells in that column as... | Another solution is:
```
td:first-child { width: 1% }
```
It won't crop your content, but will makes first column as small as possible |
20,930,930 | I have a simple two column table where the left shows line numbers and the right shows code. I want the left-side to be the smallest size without clipping, and the right side to fill the remaining area (the whole table should be a 100% width).
```
<table>
<tr>
<td><pre>line numbers</pre></td>
<td><pre>code... | 2014/01/05 | [
"https://Stackoverflow.com/questions/20930930",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/229686/"
] | Another way to do it:
```
td:nth-child(2) { width: 100%; }
```
JSFiddle: <http://jsfiddle.net/SabdielRivera/n84xf/5/> | You can set the `td` twidth to be `width:100%` to achieve what you need. Here's a [fiddle](http://jsfiddle.net/aL8qL/1/) |
20,930,930 | I have a simple two column table where the left shows line numbers and the right shows code. I want the left-side to be the smallest size without clipping, and the right side to fill the remaining area (the whole table should be a 100% width).
```
<table>
<tr>
<td><pre>line numbers</pre></td>
<td><pre>code... | 2014/01/05 | [
"https://Stackoverflow.com/questions/20930930",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/229686/"
] | Another solution is:
```
td:first-child { width: 1% }
```
It won't crop your content, but will makes first column as small as possible | You can set the `td` twidth to be `width:100%` to achieve what you need. Here's a [fiddle](http://jsfiddle.net/aL8qL/1/) |
66,872,138 | I have an `Android` application with a video player with `DRM`. When I try to take a screenshot after the video player in my app is opened I see the message: `"Can't take screenshot due to security policy"`. It is okay, but I want to customize this message or, in the best way, have a callback when the user tries to mak... | 2021/03/30 | [
"https://Stackoverflow.com/questions/66872138",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/5658185/"
] | As this message came from OS, unfortunately you can not edit it. Also you can not have an event which triggers after this toast. | check this [link](https://github.com/rbague/ScreenshotCallback)
>
> OR
>
>
>
1. Gradle dependency Add it in your project-level build.gradle at the end of repositories:
allprojects {
repositories {
...
maven { url 'https://jitpack.io' }
}
}
Add the dependency in yout app-level build.gradle:
```
implementation'c... |
24,138,027 | I want to remove frequent patterns from an arraylist. I tried this using hashset but output appears the same.This is the sample set of my arraylist which is residing on a file mytext.txt...How to remove the repeated sequences either before adding into file or after adding into file?
This is the content of my newlist..... | 2014/06/10 | [
"https://Stackoverflow.com/questions/24138027",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/3392249/"
] | Because `font-family: sans-serif;` is set, each browser set's their own standard font. This can ofcourse differ between different browsers.
In chrome, you can set the default fonts at chrome://settings/, under advanced settings.
In safari it is less easy, but I could find [this post](https://apple.stackexchange.com/q... | Every browser makes it able to chose the fonts you want to be displayed
In chrome you have to go to the settings and click 'Show advanced settings' or something like that to find content display adjustments menu |
24,138,027 | I want to remove frequent patterns from an arraylist. I tried this using hashset but output appears the same.This is the sample set of my arraylist which is residing on a file mytext.txt...How to remove the repeated sequences either before adding into file or after adding into file?
This is the content of my newlist..... | 2014/06/10 | [
"https://Stackoverflow.com/questions/24138027",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/3392249/"
] | Because `font-family: sans-serif;` is set, each browser set's their own standard font. This can ofcourse differ between different browsers.
In chrome, you can set the default fonts at chrome://settings/, under advanced settings.
In safari it is less easy, but I could find [this post](https://apple.stackexchange.com/q... | Fonts compatibility should be differs from various browsers. The way to fix the issue is by using the google fonts or call the font extensions supported for various browsers.
```
@font-face {
font-family: 'MyWebFont';
src: url('myfont.woff') format('woff'), /* Chrome 6+, Firefox 3.6+, IE 9+, Safari 5.1+ */
url('myf... |
2,878 | The code that I'm analyzing calls fork and I was wondering if there was a way to trace the child process that is created. I've looked in *The IDAPro Book* and there's nothing on the topic (if there is I can't find it). Perhaps it's not possible with IDAPro. Also if it's helpful I'm debugging an elf executable remotely ... | 2013/09/21 | [
"https://reverseengineering.stackexchange.com/questions/2878",
"https://reverseengineering.stackexchange.com",
"https://reverseengineering.stackexchange.com/users/-1/"
] | This isn't IDA problem, per se. It's more to do with the debugger you're using. I assume you're using remote GDB through IDA. The debugger will attach itself to a specific process, and that process only. Fortunately, GDB has an option to follow child processes, using the debugging option:
`set follow-fork-mode child` ... | IDA does not support multi-process debugging at the moment (as of 2013). To debug the new process, you'll need to either detach from the current one, or use a new instance of IDA. |
3,417,129 | I'm trying to solve my homework, but I don't know if I'm on the right way.
I have
$$\frac{(n+1)^n(n+1)}{2(2n+1)n^n}$$
and I want to cancel $(n+1)^n$ with $n^n$.
So I have a sequence of series and try to check the convergence with Ratio Test.
$$\lim\_{n\to \infty}\frac{(n+1)^{n+2}}{n^n(2n+1)(2n+2)} $$ | 2019/10/31 | [
"https://math.stackexchange.com/questions/3417129",
"https://math.stackexchange.com",
"https://math.stackexchange.com/users/720749/"
] | Always try with trivial cases at first, notably for $n=1$ we have
$$(n+1)^n=n^n+(n+1) \implies 2=1+2$$
---
**Edit**
Since the original problem seems related to the ratio test for convergence, we have that
$$\frac{(n+1)^n(n+1)}{2(2n+1)n^n}=\frac{(n+1)^n}{n^n}\frac{n+1}{4n+2}=\left(1+\frac1n\right)^n\frac{n+1}{4n+2}$... | Maybe you need to use the binomial theorem?
$$(n+1)^n=\sum\_{j=0}^n \binom{n}{j}n^j1^{n-j}=\sum\_{j=0}^n \binom{n}{j}n^j. $$ |
41,145 | I am wondering if it's possible to have works from Photoshop or Illustrator made from online tutorials, into your portfolio? If some work's design can be changed a bit, can it be counted like mine? | 2014/10/21 | [
"https://graphicdesign.stackexchange.com/questions/41145",
"https://graphicdesign.stackexchange.com",
"https://graphicdesign.stackexchange.com/users/32505/"
] | Disclaimer: I'm not a lawyer, so I can't take responsbility, yadda yadda yadda.
No. 'Changing' a work 'a bit to make it mine' is a so-called derivative work, for which the original author explicitly owns the copyright.
Besides, taking someone else's work, changing it a bit, and presenting it as completely your own, ... | My suggestion would be to do the tutorial using the files and steps they give you, then use the techniques you've learned to create something that is your own. It will show much better in your portfolio and it might not be as easy to recognize as a tutorial.
Most of the creative people who are going to review your por... |
41,145 | I am wondering if it's possible to have works from Photoshop or Illustrator made from online tutorials, into your portfolio? If some work's design can be changed a bit, can it be counted like mine? | 2014/10/21 | [
"https://graphicdesign.stackexchange.com/questions/41145",
"https://graphicdesign.stackexchange.com",
"https://graphicdesign.stackexchange.com/users/32505/"
] | Disclaimer: I'm not a lawyer, so I can't take responsbility, yadda yadda yadda.
No. 'Changing' a work 'a bit to make it mine' is a so-called derivative work, for which the original author explicitly owns the copyright.
Besides, taking someone else's work, changing it a bit, and presenting it as completely your own, ... | I think following the tutorials is good for practice, but either start off with something unique or make the result unique in some way to set it apart, as GoofyMonkey says.
But rather than hiding the fact that your works are tutorial-based, which could be considered deceit and grounds for disqualification (from jobs, ... |
41,145 | I am wondering if it's possible to have works from Photoshop or Illustrator made from online tutorials, into your portfolio? If some work's design can be changed a bit, can it be counted like mine? | 2014/10/21 | [
"https://graphicdesign.stackexchange.com/questions/41145",
"https://graphicdesign.stackexchange.com",
"https://graphicdesign.stackexchange.com/users/32505/"
] | You can put tutorial work in your portfolio provided you explain that it is tutorial work. Alas, I don't know if that would gain you much in an interview. The fact that you can finish a tutorial doesn't necessarily translate into design and problem solving skills which is what the person looking at your portfolio wants... | My suggestion would be to do the tutorial using the files and steps they give you, then use the techniques you've learned to create something that is your own. It will show much better in your portfolio and it might not be as easy to recognize as a tutorial.
Most of the creative people who are going to review your por... |
41,145 | I am wondering if it's possible to have works from Photoshop or Illustrator made from online tutorials, into your portfolio? If some work's design can be changed a bit, can it be counted like mine? | 2014/10/21 | [
"https://graphicdesign.stackexchange.com/questions/41145",
"https://graphicdesign.stackexchange.com",
"https://graphicdesign.stackexchange.com/users/32505/"
] | You can put tutorial work in your portfolio provided you explain that it is tutorial work. Alas, I don't know if that would gain you much in an interview. The fact that you can finish a tutorial doesn't necessarily translate into design and problem solving skills which is what the person looking at your portfolio wants... | I think following the tutorials is good for practice, but either start off with something unique or make the result unique in some way to set it apart, as GoofyMonkey says.
But rather than hiding the fact that your works are tutorial-based, which could be considered deceit and grounds for disqualification (from jobs, ... |
41,145 | I am wondering if it's possible to have works from Photoshop or Illustrator made from online tutorials, into your portfolio? If some work's design can be changed a bit, can it be counted like mine? | 2014/10/21 | [
"https://graphicdesign.stackexchange.com/questions/41145",
"https://graphicdesign.stackexchange.com",
"https://graphicdesign.stackexchange.com/users/32505/"
] | My suggestion would be to do the tutorial using the files and steps they give you, then use the techniques you've learned to create something that is your own. It will show much better in your portfolio and it might not be as easy to recognize as a tutorial.
Most of the creative people who are going to review your por... | I think following the tutorials is good for practice, but either start off with something unique or make the result unique in some way to set it apart, as GoofyMonkey says.
But rather than hiding the fact that your works are tutorial-based, which could be considered deceit and grounds for disqualification (from jobs, ... |
16,596,988 | I'm trying to insert demo records from some simple form using active records and codeigniter
```
function create_httpPost()
{
$data = array(
'title' => $this->input->post('title'),
'content' => $this->input->post('content')
);
$this->newsModel->createData($data); //error occures here
$this->in... | 2013/05/16 | [
"https://Stackoverflow.com/questions/16596988",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1765862/"
] | According to the CodeIgniter documentation, model class names must begin by an upper case letter with the rest of the name being lower case.
See: <http://ellislab.com/codeigniter/user-guide/general/models.html>
In the section titled **Anatomy of a Model:**
>
> Class names must have the first letter capitalized with... | Try this:
```
function create_httpPost()
{
$this->load->model('newsModel'); // you need to load model
$this->newsModel->createData(array(
'title' => $this->input->post('title', TRUE),
'content' => $this->input->post('content', TRUE)
));
$this->index();
}
``` |
16,596,988 | I'm trying to insert demo records from some simple form using active records and codeigniter
```
function create_httpPost()
{
$data = array(
'title' => $this->input->post('title'),
'content' => $this->input->post('content')
);
$this->newsModel->createData($data); //error occures here
$this->in... | 2013/05/16 | [
"https://Stackoverflow.com/questions/16596988",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1765862/"
] | According to the CodeIgniter documentation, model class names must begin by an upper case letter with the rest of the name being lower case.
See: <http://ellislab.com/codeigniter/user-guide/general/models.html>
In the section titled **Anatomy of a Model:**
>
> Class names must have the first letter capitalized with... | This is very comman problem with CI2.
this function must be inside one of ur models right ?
if so, please note that `u can't reference model from inside other model` ! for some reason. u need to let controller handle that |
16,596,988 | I'm trying to insert demo records from some simple form using active records and codeigniter
```
function create_httpPost()
{
$data = array(
'title' => $this->input->post('title'),
'content' => $this->input->post('content')
);
$this->newsModel->createData($data); //error occures here
$this->in... | 2013/05/16 | [
"https://Stackoverflow.com/questions/16596988",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1765862/"
] | Try this:
```
function create_httpPost()
{
$this->load->model('newsModel'); // you need to load model
$this->newsModel->createData(array(
'title' => $this->input->post('title', TRUE),
'content' => $this->input->post('content', TRUE)
));
$this->index();
}
``` | This is very comman problem with CI2.
this function must be inside one of ur models right ?
if so, please note that `u can't reference model from inside other model` ! for some reason. u need to let controller handle that |
673,166 | We know we can add two angular velocity vectors to get a total angular velocity. Whereas I more of less understand the basic principle and the mathematical formulation, I have problems in visualizing this addition. Example picture (from my old Resnick and Haliday book) is attached. However, once the base rotated with $... | 2021/10/23 | [
"https://physics.stackexchange.com/questions/673166",
"https://physics.stackexchange.com",
"https://physics.stackexchange.com/users/114954/"
] | [](https://i.stack.imgur.com/EAhzK.jpg)
I see it like this:
you obtain the angular velocity components from the
rotation matrix
the disk is rotating with the angle $~\varphi\_z~$ about the z-axes the rotation matrix is:
$$\mathbf R\_d= \left[ \begin... | I think the problem is notational and/or a bad diagram. In this case, $\omega\_1$ is the *relative* rotation of the wheel to the disk, and $\omega\_2$ the absolute rotation of the disk.
Rotation Vectors
----------------
I propose to think of it this way. Use the $\boldsymbol{\omega}$ symbols for absolute rotation vec... |
673,166 | We know we can add two angular velocity vectors to get a total angular velocity. Whereas I more of less understand the basic principle and the mathematical formulation, I have problems in visualizing this addition. Example picture (from my old Resnick and Haliday book) is attached. However, once the base rotated with $... | 2021/10/23 | [
"https://physics.stackexchange.com/questions/673166",
"https://physics.stackexchange.com",
"https://physics.stackexchange.com/users/114954/"
] | $\newcommand{\bl}[1]{\boldsymbol{#1}}
\newcommand{\e}{\bl=}
\newcommand{\p}{\bl+}
\newcommand{\m}{\bl-}
\newcommand{\gr}{\bl>}
\newcommand{\les}{\bl<}
\newcommand{\greq}{\bl\ge}
\newcommand{\leseq}{\bl\le}
\newcommand{\plr}[1]{\left(#1\right)}
\newcommand{\blr}[1]{\left[#1\right]}
\newcommand{\lara}[1]{\langle#1\rangl... | I think the problem is notational and/or a bad diagram. In this case, $\omega\_1$ is the *relative* rotation of the wheel to the disk, and $\omega\_2$ the absolute rotation of the disk.
Rotation Vectors
----------------
I propose to think of it this way. Use the $\boldsymbol{\omega}$ symbols for absolute rotation vec... |
9,571,231 | I know how to use preg\_match and preg\_match\_all to find the actual matches of regex patterns in a given string, but the function that I am writing not only needs the text of the matches, but to be able to traverse the string AROUND the matches...
Therefore, I need to know the position of the match in the string, ba... | 2012/03/05 | [
"https://Stackoverflow.com/questions/9571231",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/54408/"
] | You can use the flag [`PREG_OFFSET_CAPTURE`](http://php.net/manual/en/function.preg-match.php) for that:
```
preg_match('/bar/', 'Foobar', $matches, PREG_OFFSET_CAPTURE);
var_export($matches);
```
Result is:
```
array (
0 =>
array (
0 => 'bar',
1 => 3, // <-- the string offset of the match
),
)
... | preg\_match has an optional flag, `PREG_OFFSET_CAPTURE`, that records the string position of the match's occurence in the original 'haystack'. See the 'flags' section: <http://php.net/preg_match> |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.