qid
int64
1
74.6M
question
stringlengths
45
24.2k
date
stringlengths
10
10
metadata
stringlengths
101
178
response_j
stringlengths
32
23.2k
response_k
stringlengths
21
13.2k
51,610,180
I am trying to create a transition using react and css. I want to add a class to the `span` to create the animation - See example below. Does anyone know if the issue is with the css or my javascript. ```js class App extends React.Component { state = { class: null }; componentDidMount() { this.setState...
2018/07/31
['https://Stackoverflow.com/questions/51610180', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/4756106/']
You could use a different approach and append `active` class with `setTimeout` method. ```js class App extends React.Component { state = { class: null }; componentDidMount() { setTimeout(() => this.refs.progressBar.classList.add("active"), 100) } render() { return ( <div className = "pro...
You can use `requestAnimationFrame()` to trigger the transition on mount. I'd presume that doing this is more robust than relying on a `setTimeout()`. ``` componentDidMount() { requestAnimationFrame(() => { this.setState({ class: "active" }); }); } ``` Source: <https://www.plurals...
49,276,120
I want to open Google Street View Android directly from my app. Can anyone help me in doing this? I have successfully opened the Maps app with Streeview thanks to SO but that's not what I am looking for. I actually want to open Streetview camera directly from my app so I can take a panoramic photo. My actual task is...
2018/03/14
['https://Stackoverflow.com/questions/49276120', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/6492719/']
u are using python 3.6 . so pip3 install numpy should be used, make a try .
You need to make sure all the dependent libraries AND the Python file containing your function are all in one zip file in order for it to detect the correct dependencies. So essentially, you will need to have Numpy, Panda and your own files all in one zip file before you upload it. Also make sure that your code is ref...
49,276,120
I want to open Google Street View Android directly from my app. Can anyone help me in doing this? I have successfully opened the Maps app with Streeview thanks to SO but that's not what I am looking for. I actually want to open Streetview camera directly from my app so I can take a panoramic photo. My actual task is...
2018/03/14
['https://Stackoverflow.com/questions/49276120', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/6492719/']
u are using python 3.6 . so pip3 install numpy should be used, make a try .
So like Wai kin chung said, you need to use pip3 to install the libraries. so to figure out which python version is default you can type: ``` which python ``` or ``` python -v ``` So in order to install with python3 you need to type: ``` python3 -m pip install sklearn, pandas, numpy --user ``` Once that is ...
49,276,120
I want to open Google Street View Android directly from my app. Can anyone help me in doing this? I have successfully opened the Maps app with Streeview thanks to SO but that's not what I am looking for. I actually want to open Streetview camera directly from my app so I can take a panoramic photo. My actual task is...
2018/03/14
['https://Stackoverflow.com/questions/49276120', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/6492719/']
u are using python 3.6 . so pip3 install numpy should be used, make a try .
If you're running this on Windows (like I was), you'll run into an issue with the libraries being compiled on an incompatible OS. You can use an Amazon Linux EC2 instance, or a Cloud9 development instance to build your virtualenv as detailed above. Or, you could just download the pre-compiled wheel files as discussed...
49,276,120
I want to open Google Street View Android directly from my app. Can anyone help me in doing this? I have successfully opened the Maps app with Streeview thanks to SO but that's not what I am looking for. I actually want to open Streetview camera directly from my app so I can take a panoramic photo. My actual task is...
2018/03/14
['https://Stackoverflow.com/questions/49276120', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/6492719/']
u are using python 3.6 . so pip3 install numpy should be used, make a try .
Was having a similar problem on Ubuntu 18.04. Solved the issue by using `python3.7` and `pip3.7`. Its important to use `pip3.7` when installing the packages, like `pip3.7 install numpy` or `pip3.7 install numpy --user` To install `python3.7` and `pip3.7` on Ubuntu you can use `deadsnakes/ppa` ``` sudo add-apt-repos...
37,541,683
Well, OpenCv comes with its function findCheckerboardCorners() in C++ which goes like ``` bool findChessboardCorners(InputArray image, Size patternSize, OutputArray corners, int flags=CALIB_CB_ADAPTIVE_THRESH+CALIB_CB_NORMALIZE_IMAGE ) ``` After using this function for a while, one thing that i understood was that...
2016/05/31
['https://Stackoverflow.com/questions/37541683', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/4633925/']
Short answer: you cannot. The OpenCV checkerboard detection code assumes that the pattern is uniform (all squares have the same size) and therefore, in order to uniquely locate its position in the image, the following two conditions must be true: 1. The pattern is entirely visible. 2. The pattern has a known numbers ...
The doc for [`findChessboardCorners`](http://docs.opencv.org/3.0.0/d9/d0c/group__calib3d.html#ga93efa9b0aa890de240ca32b11253dd4a) says that > > `patternSize` – Number of inner corners per a chessboard row and > column > > > So `patternSize` is not the size of the chessboard inside the image but the number of inn...
1,427,602
Can we show an image in its original size in MATLAB? Right now when we are showing, it is exactly fitted to the image window size. However, I want to show the image in its original size. When the image is of larger size, a scroll bar should appear in the image window. This would allow the user to view the image in its...
2009/09/15
['https://Stackoverflow.com/questions/1427602', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/-1/']
try: figure,imshow(your\_image), axis image This changes the image axis to the original size
There are 3 things to take care of in order to display image in its original size (1:1): * The figure size and units. * The axes size and units. * The axes data aspect ratio. Once all of that are set according to the image size even using MATLAB's `image()` function one could generate 1:1 display of an image. Here i...
1,427,602
Can we show an image in its original size in MATLAB? Right now when we are showing, it is exactly fitted to the image window size. However, I want to show the image in its original size. When the image is of larger size, a scroll bar should appear in the image window. This would allow the user to view the image in its...
2009/09/15
['https://Stackoverflow.com/questions/1427602', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/-1/']
I believe what you're looking for is the [IMTOOL](http://www.mathworks.com/access/helpdesk/help/toolbox/images/imtool.html) utility (which is a part of the [Image Processing Toolbox](http://www.mathworks.com/products/image/)). It's a MATLAB GUI that allows you to view images in their original size (100% magnification) ...
There are 3 things to take care of in order to display image in its original size (1:1): * The figure size and units. * The axes size and units. * The axes data aspect ratio. Once all of that are set according to the image size even using MATLAB's `image()` function one could generate 1:1 display of an image. Here i...
1,427,602
Can we show an image in its original size in MATLAB? Right now when we are showing, it is exactly fitted to the image window size. However, I want to show the image in its original size. When the image is of larger size, a scroll bar should appear in the image window. This would allow the user to view the image in its...
2009/09/15
['https://Stackoverflow.com/questions/1427602', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/-1/']
I believe what you're looking for is the [IMTOOL](http://www.mathworks.com/access/helpdesk/help/toolbox/images/imtool.html) utility (which is a part of the [Image Processing Toolbox](http://www.mathworks.com/products/image/)). It's a MATLAB GUI that allows you to view images in their original size (100% magnification) ...
Funny, nobody here has mentioned [`truesize`](https://www.mathworks.com/help/images/ref/truesize.html) yet: > > `truesize(fig)` adjusts the display size such that each image pixel covers one screen pixel. If you do not specify a figure, `truesize` adjusts the display size of the current figure. > > >
1,427,602
Can we show an image in its original size in MATLAB? Right now when we are showing, it is exactly fitted to the image window size. However, I want to show the image in its original size. When the image is of larger size, a scroll bar should appear in the image window. This would allow the user to view the image in its...
2009/09/15
['https://Stackoverflow.com/questions/1427602', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/-1/']
Matlab slider has a problem that it fires callback only on MouseUp and not on MouseMove, so pure matlab implementation would always feels strange. Better way - go for Java in Matlab. So you do not have to re-implement whole scroll logics. You can put Java Swing GUI component inside Matlab window, it is not difficult a...
There are 3 things to take care of in order to display image in its original size (1:1): * The figure size and units. * The axes size and units. * The axes data aspect ratio. Once all of that are set according to the image size even using MATLAB's `image()` function one could generate 1:1 display of an image. Here i...
1,427,602
Can we show an image in its original size in MATLAB? Right now when we are showing, it is exactly fitted to the image window size. However, I want to show the image in its original size. When the image is of larger size, a scroll bar should appear in the image window. This would allow the user to view the image in its...
2009/09/15
['https://Stackoverflow.com/questions/1427602', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/-1/']
Matlab slider has a problem that it fires callback only on MouseUp and not on MouseMove, so pure matlab implementation would always feels strange. Better way - go for Java in Matlab. So you do not have to re-implement whole scroll logics. You can put Java Swing GUI component inside Matlab window, it is not difficult a...
This code from MATLAB's Answers forum creates a window where the image is shown at native resolution (100%), and also gives a "navigation" window showing where your viewed section of the image (in the main window) fits into the whole image. ``` % Create a scroll panel with a Magnification Box and an Overview tool. hFi...
1,427,602
Can we show an image in its original size in MATLAB? Right now when we are showing, it is exactly fitted to the image window size. However, I want to show the image in its original size. When the image is of larger size, a scroll bar should appear in the image window. This would allow the user to view the image in its...
2009/09/15
['https://Stackoverflow.com/questions/1427602', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/-1/']
This code from MATLAB's Answers forum creates a window where the image is shown at native resolution (100%), and also gives a "navigation" window showing where your viewed section of the image (in the main window) fits into the whole image. ``` % Create a scroll panel with a Magnification Box and an Overview tool. hFi...
There are 3 things to take care of in order to display image in its original size (1:1): * The figure size and units. * The axes size and units. * The axes data aspect ratio. Once all of that are set according to the image size even using MATLAB's `image()` function one could generate 1:1 display of an image. Here i...
1,427,602
Can we show an image in its original size in MATLAB? Right now when we are showing, it is exactly fitted to the image window size. However, I want to show the image in its original size. When the image is of larger size, a scroll bar should appear in the image window. This would allow the user to view the image in its...
2009/09/15
['https://Stackoverflow.com/questions/1427602', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/-1/']
Matlab slider has a problem that it fires callback only on MouseUp and not on MouseMove, so pure matlab implementation would always feels strange. Better way - go for Java in Matlab. So you do not have to re-implement whole scroll logics. You can put Java Swing GUI component inside Matlab window, it is not difficult a...
try: figure,imshow(your\_image), axis image This changes the image axis to the original size
1,427,602
Can we show an image in its original size in MATLAB? Right now when we are showing, it is exactly fitted to the image window size. However, I want to show the image in its original size. When the image is of larger size, a scroll bar should appear in the image window. This would allow the user to view the image in its...
2009/09/15
['https://Stackoverflow.com/questions/1427602', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/-1/']
I believe what you're looking for is the [IMTOOL](http://www.mathworks.com/access/helpdesk/help/toolbox/images/imtool.html) utility (which is a part of the [Image Processing Toolbox](http://www.mathworks.com/products/image/)). It's a MATLAB GUI that allows you to view images in their original size (100% magnification) ...
try: figure,imshow(your\_image), axis image This changes the image axis to the original size
1,427,602
Can we show an image in its original size in MATLAB? Right now when we are showing, it is exactly fitted to the image window size. However, I want to show the image in its original size. When the image is of larger size, a scroll bar should appear in the image window. This would allow the user to view the image in its...
2009/09/15
['https://Stackoverflow.com/questions/1427602', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/-1/']
Matlab slider has a problem that it fires callback only on MouseUp and not on MouseMove, so pure matlab implementation would always feels strange. Better way - go for Java in Matlab. So you do not have to re-implement whole scroll logics. You can put Java Swing GUI component inside Matlab window, it is not difficult a...
Funny, nobody here has mentioned [`truesize`](https://www.mathworks.com/help/images/ref/truesize.html) yet: > > `truesize(fig)` adjusts the display size such that each image pixel covers one screen pixel. If you do not specify a figure, `truesize` adjusts the display size of the current figure. > > >
1,427,602
Can we show an image in its original size in MATLAB? Right now when we are showing, it is exactly fitted to the image window size. However, I want to show the image in its original size. When the image is of larger size, a scroll bar should appear in the image window. This would allow the user to view the image in its...
2009/09/15
['https://Stackoverflow.com/questions/1427602', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/-1/']
I believe what you're looking for is the [IMTOOL](http://www.mathworks.com/access/helpdesk/help/toolbox/images/imtool.html) utility (which is a part of the [Image Processing Toolbox](http://www.mathworks.com/products/image/)). It's a MATLAB GUI that allows you to view images in their original size (100% magnification) ...
This code from MATLAB's Answers forum creates a window where the image is shown at native resolution (100%), and also gives a "navigation" window showing where your viewed section of the image (in the main window) fits into the whole image. ``` % Create a scroll panel with a Magnification Box and an Overview tool. hFi...
17,735,526
I'm playing around with some code in a Kobold2D example project (Orthogonal Tile based Game) and I've noticed: ``` @interface TileMapLayer : CCLayer //Map { float tileMapHeightInPixels; //depricated@interface TileMapLayer() } @end ``` in the TileMapLayer.h file, and: ``` @interface TileMapLayer() @property (s...
2013/07/18
['https://Stackoverflow.com/questions/17735526', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/-1/']
What you put in a header and implementation file is entirely up to you. They all get concatenated by the preprocessor before compilation anyway. It's convention to put external interfaces that other compilation units might want to use into header files. The person who wrote your example code intends to keep all of thos...
Things defined in .h can be used by any .m files as long as the .m includes the .h. But things defined in .m can only be used in current .m file.
17,735,526
I'm playing around with some code in a Kobold2D example project (Orthogonal Tile based Game) and I've noticed: ``` @interface TileMapLayer : CCLayer //Map { float tileMapHeightInPixels; //depricated@interface TileMapLayer() } @end ``` in the TileMapLayer.h file, and: ``` @interface TileMapLayer() @property (s...
2013/07/18
['https://Stackoverflow.com/questions/17735526', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/-1/']
First notice that `.m` are Objective-C files (which can have both Objective-C and C) and `.c` are plain C files which can only contain C code. Both employ the `.h` extension for the header. Regarding Objective-C, the `.m` file does `@interface TileMapLayer()` to declare a class *extension*. A class *extension* can add...
Things defined in .h can be used by any .m files as long as the .m includes the .h. But things defined in .m can only be used in current .m file.
28,699
The description in the book describes touching the right hand in front of the left foot while the right leg goes up, then says to repeat it with the left hand going down, and that you've completed one rep when you've done that. Then, it says to switch legs. So, when doing ladders (1 rep, then 2 reps, then 3 reps, etc),...
2016/01/19
['https://fitness.stackexchange.com/questions/28699', 'https://fitness.stackexchange.com', 'https://fitness.stackexchange.com/users/8039/']
Do not regret this break from your weightlifting and take the opportunity to become an even better weightlifter. The trainers I have had, most often has used about half of the workout for yoga exercises to improve flexibility, range, mobility and core strength. Exercises like over-the-head-squats demands extremely hig...
Training is in essence applying force to a resistance. How that resistance looks like is just limited to your imagination. * The World is your gym (phrase stolen from Ross Enamait) go out and train outside in fresh air, you can do pull-ups, chin-ups, dips on trees or monkey bars on playgrounds, using heavy stones, bar...
28,699
The description in the book describes touching the right hand in front of the left foot while the right leg goes up, then says to repeat it with the left hand going down, and that you've completed one rep when you've done that. Then, it says to switch legs. So, when doing ladders (1 rep, then 2 reps, then 3 reps, etc),...
2016/01/19
['https://fitness.stackexchange.com/questions/28699', 'https://fitness.stackexchange.com', 'https://fitness.stackexchange.com/users/8039/']
Do not regret this break from your weightlifting and take the opportunity to become an even better weightlifter. The trainers I have had, most often has used about half of the workout for yoga exercises to improve flexibility, range, mobility and core strength. Exercises like over-the-head-squats demands extremely hig...
If you consider yourself handy then you could consider building some weightlifting equipment yourself. It is cheap and surprisingly simple. Although I do recommend that you do buy the barbell since making one out of wood or other common materials would be considerably weaker or larger if you try to maintain the same s...
28,699
The description in the book describes touching the right hand in front of the left foot while the right leg goes up, then says to repeat it with the left hand going down, and that you've completed one rep when you've done that. Then, it says to switch legs. So, when doing ladders (1 rep, then 2 reps, then 3 reps, etc),...
2016/01/19
['https://fitness.stackexchange.com/questions/28699', 'https://fitness.stackexchange.com', 'https://fitness.stackexchange.com/users/8039/']
Training is in essence applying force to a resistance. How that resistance looks like is just limited to your imagination. * The World is your gym (phrase stolen from Ross Enamait) go out and train outside in fresh air, you can do pull-ups, chin-ups, dips on trees or monkey bars on playgrounds, using heavy stones, bar...
Lifting>family but really, you might be able to find a place to do chinups in a park or on a tree or something, it's one of the best exercises to do. Maybe you can buy a metal bar from a hardware store and make a chinup station yourself. Dips are also great. Other than that you can start a running routine.
28,699
The description in the book describes touching the right hand in front of the left foot while the right leg goes up, then says to repeat it with the left hand going down, and that you've completed one rep when you've done that. Then, it says to switch legs. So, when doing ladders (1 rep, then 2 reps, then 3 reps, etc),...
2016/01/19
['https://fitness.stackexchange.com/questions/28699', 'https://fitness.stackexchange.com', 'https://fitness.stackexchange.com/users/8039/']
If you consider yourself handy then you could consider building some weightlifting equipment yourself. It is cheap and surprisingly simple. Although I do recommend that you do buy the barbell since making one out of wood or other common materials would be considerably weaker or larger if you try to maintain the same s...
Get a pullup/chinup bar. You can get one for about $20. Buy a couple of parallel bars where you can do dips. If you have a couple of sturdy chairs, they will do. Pullups, chinups, dips, pushups, planks, bodyweight squats are all great exercises that could make up for a very decent routine.
28,699
The description in the book describes touching the right hand in front of the left foot while the right leg goes up, then says to repeat it with the left hand going down, and that you've completed one rep when you've done that. Then, it says to switch legs. So, when doing ladders (1 rep, then 2 reps, then 3 reps, etc),...
2016/01/19
['https://fitness.stackexchange.com/questions/28699', 'https://fitness.stackexchange.com', 'https://fitness.stackexchange.com/users/8039/']
If you consider yourself handy then you could consider building some weightlifting equipment yourself. It is cheap and surprisingly simple. Although I do recommend that you do buy the barbell since making one out of wood or other common materials would be considerably weaker or larger if you try to maintain the same s...
[Gymnastic Strength Training](https://www.gymnasticbodies.com/) is a perfect option for you in my opinion. It is very well designed program with tons of progressions and requires almost negligible equipment.
28,699
The description in the book describes touching the right hand in front of the left foot while the right leg goes up, then says to repeat it with the left hand going down, and that you've completed one rep when you've done that. Then, it says to switch legs. So, when doing ladders (1 rep, then 2 reps, then 3 reps, etc),...
2016/01/19
['https://fitness.stackexchange.com/questions/28699', 'https://fitness.stackexchange.com', 'https://fitness.stackexchange.com/users/8039/']
Do not regret this break from your weightlifting and take the opportunity to become an even better weightlifter. The trainers I have had, most often has used about half of the workout for yoga exercises to improve flexibility, range, mobility and core strength. Exercises like over-the-head-squats demands extremely hig...
Get a pullup/chinup bar. You can get one for about $20. Buy a couple of parallel bars where you can do dips. If you have a couple of sturdy chairs, they will do. Pullups, chinups, dips, pushups, planks, bodyweight squats are all great exercises that could make up for a very decent routine.
28,699
The description in the book describes touching the right hand in front of the left foot while the right leg goes up, then says to repeat it with the left hand going down, and that you've completed one rep when you've done that. Then, it says to switch legs. So, when doing ladders (1 rep, then 2 reps, then 3 reps, etc),...
2016/01/19
['https://fitness.stackexchange.com/questions/28699', 'https://fitness.stackexchange.com', 'https://fitness.stackexchange.com/users/8039/']
Do not regret this break from your weightlifting and take the opportunity to become an even better weightlifter. The trainers I have had, most often has used about half of the workout for yoga exercises to improve flexibility, range, mobility and core strength. Exercises like over-the-head-squats demands extremely hig...
Lifting>family but really, you might be able to find a place to do chinups in a park or on a tree or something, it's one of the best exercises to do. Maybe you can buy a metal bar from a hardware store and make a chinup station yourself. Dips are also great. Other than that you can start a running routine.
28,699
The description in the book describes touching the right hand in front of the left foot while the right leg goes up, then says to repeat it with the left hand going down, and that you've completed one rep when you've done that. Then, it says to switch legs. So, when doing ladders (1 rep, then 2 reps, then 3 reps, etc),...
2016/01/19
['https://fitness.stackexchange.com/questions/28699', 'https://fitness.stackexchange.com', 'https://fitness.stackexchange.com/users/8039/']
Get a pullup/chinup bar. You can get one for about $20. Buy a couple of parallel bars where you can do dips. If you have a couple of sturdy chairs, they will do. Pullups, chinups, dips, pushups, planks, bodyweight squats are all great exercises that could make up for a very decent routine.
Lifting>family but really, you might be able to find a place to do chinups in a park or on a tree or something, it's one of the best exercises to do. Maybe you can buy a metal bar from a hardware store and make a chinup station yourself. Dips are also great. Other than that you can start a running routine.
28,699
The description in the book describes touching the right hand in front of the left foot while the right leg goes up, then says to repeat it with the left hand going down, and that you've completed one rep when you've done that. Then, it says to switch legs. So, when doing ladders (1 rep, then 2 reps, then 3 reps, etc),...
2016/01/19
['https://fitness.stackexchange.com/questions/28699', 'https://fitness.stackexchange.com', 'https://fitness.stackexchange.com/users/8039/']
If you consider yourself handy then you could consider building some weightlifting equipment yourself. It is cheap and surprisingly simple. Although I do recommend that you do buy the barbell since making one out of wood or other common materials would be considerably weaker or larger if you try to maintain the same s...
Training is in essence applying force to a resistance. How that resistance looks like is just limited to your imagination. * The World is your gym (phrase stolen from Ross Enamait) go out and train outside in fresh air, you can do pull-ups, chin-ups, dips on trees or monkey bars on playgrounds, using heavy stones, bar...
28,699
The description in the book describes touching the right hand in front of the left foot while the right leg goes up, then says to repeat it with the left hand going down, and that you've completed one rep when you've done that. Then, it says to switch legs. So, when doing ladders (1 rep, then 2 reps, then 3 reps, etc),...
2016/01/19
['https://fitness.stackexchange.com/questions/28699', 'https://fitness.stackexchange.com', 'https://fitness.stackexchange.com/users/8039/']
[Gymnastic Strength Training](https://www.gymnasticbodies.com/) is a perfect option for you in my opinion. It is very well designed program with tons of progressions and requires almost negligible equipment.
Lifting>family but really, you might be able to find a place to do chinups in a park or on a tree or something, it's one of the best exercises to do. Maybe you can buy a metal bar from a hardware store and make a chinup station yourself. Dips are also great. Other than that you can start a running routine.
25,834,234
I have a `p:datagrid` that contain some offers inside the `p:datagrid` there is a `p:commandLink` that will pass offer and redirect to onther page this is my xhtml ``` <p:dataGrid lazy="true" var="offer" paginatorPosition="bottom" value="#{listCategoriesBean.OfferByCategory()}" columns="1" rows="5" pagina...
2014/09/14
['https://Stackoverflow.com/questions/25834234', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/3982495/']
(Copied from Answer, so (c) @naifsami) I Solved the problem by workarround idea by using p:remotecommand outside the table and call the remotecommand from inside the table ``` <p:remoteCommand name="remoteCommandFunctionName" action="#{listCategoriesBean.ToMore()}" /> <p:dataGrid lazy="true" var="offer" paginat...
You should get the desired result by navigating through the outcome attribute. ```html <p:commandLink styleClass="clickAll" action="more.xhtml?faces-redirect=true"> <f:setPropertyActionListener value="#{offer}" target="#{listCategoriesBean.offer}" /> <i class="fa fa-plus"></i> </p:commandLink> ```
68,377,604
Im just beginner in Swift Development. I don't know how to remove the .isSelected when the user choose the other button
2021/07/14
['https://Stackoverflow.com/questions/68377604', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/15285622/']
Looking at the pattern that you tried, you could match using a capture group for the part after the first curly. ``` \{(\{.*?}}) ``` And replace with ``` {&#8203;$1 ``` See a [regex demo](https://regex101.com/r/XJ9wdP/1) and a [Java demo](https://ideone.com/tdRXau) Example code ``` String regex = "\\{(\\{.*?\\}...
``` Pattern CURLY_BRACKETS_PLACEHOLDER = Pattern.compile("\\{\\{(.*?)\\}\\}"); Matcher m = CURLY_BRACKETS_PLACEHOLDER.matcher(htmlString); while(m.find()) { String script = m.group(1); String scriptWithPlaceholder = "{{"+script+"}}"; String replacementToken = "{"+ ZERO_WIDTH_SPACE_CHARACTER +"{"...
181,623
Does the first syllable rhyme with “glow” or with “how”? It is no use appealing to the Hindi for “Little Frog” or anything else, since Kipling confessed to making it up of whole cloth, as I discovered after asking a local Hindi speaker who drew a total blank. The question comes down to what sound Kipling meant to sugge...
2014/07/01
['https://english.stackexchange.com/questions/181623', 'https://english.stackexchange.com', 'https://english.stackexchange.com/users/76878/']
It actually appears that the way it is pronounced may be different. The Name [Mowgli](http://en.m.wikipedia.org/wiki/Mowgli#The_Name_Mowgli): > > In the stories, the name Mowgli is said to mean "frog". Kipling made up the name, and it "does not mean 'frog' in any language other than the language of the forest." > >...
Andrew Leach left a comment linking to a [Kipling Society web page](http://www.kiplingsociety.co.uk/rg_junglebook_names.htm) that says > > *This list of names, their meanings, and pronunciation, was provided by Rudyard Kipling as an Author's Note for the definitive Sussex Edition of his works (Vol. X11, pages 471-8)....
41,160,023
I don't get it why is this not working properly: [Fiddle](https://jsfiddle.net/ze5tsgy9/1/) I just want to show the tax amount but it gets `false` results. ``` // calculate brutto and tax $(document).on('keyup paste', '#netto', function() { var brutto = $("#brutto").val(); var netto = $("#netto").val(); ...
2016/12/15
['https://Stackoverflow.com/questions/41160023', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/2502731/']
Please try following code : ``` // calculate brutto and tax $(document).on('keyup paste', '#netto', function () { var brutto = $("#brutto").val(); var netto = $("#netto").val(); $("#brutto").val(netto * 1.19); var brutto1 = $("#brutto").val(); $("#tax").val(brutto1 - netto); ``` }); In yo...
You need to validate the value of `brutto` element is a number before performing operation. the `+` operator is use to convert input to a number. ``` $(document).on('keyup paste', '#netto', function() { var brutto = +$("#brutto").val() || 1; var netto = +$("#netto").val() || 1; brutto = netto * 1.19; ...
41,160,023
I don't get it why is this not working properly: [Fiddle](https://jsfiddle.net/ze5tsgy9/1/) I just want to show the tax amount but it gets `false` results. ``` // calculate brutto and tax $(document).on('keyup paste', '#netto', function() { var brutto = $("#brutto").val(); var netto = $("#netto").val(); ...
2016/12/15
['https://Stackoverflow.com/questions/41160023', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/2502731/']
The problem is that you get the brutto value before filling it, the solution is to get `var brutto` after you calculate `$("#brutto").val(netto * 1.19)`: ```js // calculate brutto and tax $(document).on('keyup paste', '#netto', function() { var netto = +$("#netto").val(); $("#brutto").val(netto * 1.19); va...
You need to validate the value of `brutto` element is a number before performing operation. the `+` operator is use to convert input to a number. ``` $(document).on('keyup paste', '#netto', function() { var brutto = +$("#brutto").val() || 1; var netto = +$("#netto").val() || 1; brutto = netto * 1.19; ...
41,160,023
I don't get it why is this not working properly: [Fiddle](https://jsfiddle.net/ze5tsgy9/1/) I just want to show the tax amount but it gets `false` results. ``` // calculate brutto and tax $(document).on('keyup paste', '#netto', function() { var brutto = $("#brutto").val(); var netto = $("#netto").val(); ...
2016/12/15
['https://Stackoverflow.com/questions/41160023', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/2502731/']
Please try following code : ``` // calculate brutto and tax $(document).on('keyup paste', '#netto', function () { var brutto = $("#brutto").val(); var netto = $("#netto").val(); $("#brutto").val(netto * 1.19); var brutto1 = $("#brutto").val(); $("#tax").val(brutto1 - netto); ``` }); In yo...
Parse you strings to int, change the event to a input type event: ``` $(document).on('input', '#netto', function () { var brutto = parseInt($("#brutto").val()); var netto = parseInt($("#netto").val()); $("#brutto").val(netto * 1.19); $("#tax").val((netto * 1.19) - netto ); }); ``` better if you go with a...
41,160,023
I don't get it why is this not working properly: [Fiddle](https://jsfiddle.net/ze5tsgy9/1/) I just want to show the tax amount but it gets `false` results. ``` // calculate brutto and tax $(document).on('keyup paste', '#netto', function() { var brutto = $("#brutto").val(); var netto = $("#netto").val(); ...
2016/12/15
['https://Stackoverflow.com/questions/41160023', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/2502731/']
The problem is that you get the brutto value before filling it, the solution is to get `var brutto` after you calculate `$("#brutto").val(netto * 1.19)`: ```js // calculate brutto and tax $(document).on('keyup paste', '#netto', function() { var netto = +$("#netto").val(); $("#brutto").val(netto * 1.19); va...
Parse you strings to int, change the event to a input type event: ``` $(document).on('input', '#netto', function () { var brutto = parseInt($("#brutto").val()); var netto = parseInt($("#netto").val()); $("#brutto").val(netto * 1.19); $("#tax").val((netto * 1.19) - netto ); }); ``` better if you go with a...
41,160,023
I don't get it why is this not working properly: [Fiddle](https://jsfiddle.net/ze5tsgy9/1/) I just want to show the tax amount but it gets `false` results. ``` // calculate brutto and tax $(document).on('keyup paste', '#netto', function() { var brutto = $("#brutto").val(); var netto = $("#netto").val(); ...
2016/12/15
['https://Stackoverflow.com/questions/41160023', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/2502731/']
The problem is that you get the brutto value before filling it, the solution is to get `var brutto` after you calculate `$("#brutto").val(netto * 1.19)`: ```js // calculate brutto and tax $(document).on('keyup paste', '#netto', function() { var netto = +$("#netto").val(); $("#brutto").val(netto * 1.19); va...
Please try following code : ``` // calculate brutto and tax $(document).on('keyup paste', '#netto', function () { var brutto = $("#brutto").val(); var netto = $("#netto").val(); $("#brutto").val(netto * 1.19); var brutto1 = $("#brutto").val(); $("#tax").val(brutto1 - netto); ``` }); In yo...
53,911,308
In order to release my App in the Play Store, I had to change the `TargetSdkVersion` from `23` to `26`. Before I changed it, the App worked perfectly! Now the App crashes on start. I figured out, that the problem was at these two lines: ``` prefs = getSharedPreferences("de.bs.quicknoteblock.Notes", Context.MODE_WORLD_...
2018/12/24
['https://Stackoverflow.com/questions/53911308', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/10828450/']
`Context.MODE_WORLD_WRITEABLE` is deprecated, replace it with `Context.MODE_PRIVATE`
hi I think your problem is the SharedPreferences code please test this way > > (maybe should change Context.MODE\_WORLD\_WRITEABLE to > Context.MODE\_PRIVATE is work ! ) > > > first please download this source code and add your project , [download](http://ufile.io/hapau) so after add you can use SharedPrefere...
66,720,402
I'm trying to retrieve the most recent article on a blog. My current code below does not output anything. ``` {% for article in blogs['myblog'].articles.last %} {{ article.title }} {% endfor %} ```
2021/03/20
['https://Stackoverflow.com/questions/66720402', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/13262682/']
You don't need a loop in order to access the last item. ``` {% assign article = blogs['myblog'].articles.last %} ``` This will set `article` to the last item. You can then use it as expected. ``` {{ article.title }} ``` Docs: <https://shopify.dev/docs/themes/liquid/reference/filters/array-filters#last>
It can be done like this using [forloop.last](https://shopify.dev/docs/themes/liquid/reference/objects/for-loops#forloop-last): ``` {% for article in blogs['myblog'].articles %} {% if forloop.last == true %} {{ article.title }} {% endif %} {% endfor %} ``` This assumes that `blogs` is a variable. Ot...
47,354,108
Could you please advise how ``` sudo su - userb ``` translates into ansible ? More specifically, I would like to login to linux server X as `usera` then become `userb` (with the command above), and then execute all the tasks defined in the playbook as `userb` The following are configuration options in `ansible.cf...
2017/11/17
['https://Stackoverflow.com/questions/47354108', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/4035529/']
I do not believe this is possible without adding some extra state and interfaces to your BlockingQueue. Proof goes something like this. You want to wait until the reading thread is blocked on `pop`. But there is no way to distinguish between that and the thread being about to execute the `pop`. This remains true no ma...
You can use a `std::condition_variable` to accomplish this. The help page of cppreference.com actually shows a very nice cosumer-producer example which should be exactly what you are looking for: <http://en.cppreference.com/w/cpp/thread/condition_variable> EDIT: Actually the german version of cppreference.com has an e...
47,354,108
Could you please advise how ``` sudo su - userb ``` translates into ansible ? More specifically, I would like to login to linux server X as `usera` then become `userb` (with the command above), and then execute all the tasks defined in the playbook as `userb` The following are configuration options in `ansible.cf...
2017/11/17
['https://Stackoverflow.com/questions/47354108', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/4035529/']
``` template<class T> struct async_queue { T pop() { auto l = lock(); ++wait_count; cv.wait( l, [&]{ return !data.empty(); } ); --wait_count; auto r = std::move(data.front()); data.pop_front(); return r; } void push(T in) { { auto l = lock(); data.push_back( std::move(i...
You can use a `std::condition_variable` to accomplish this. The help page of cppreference.com actually shows a very nice cosumer-producer example which should be exactly what you are looking for: <http://en.cppreference.com/w/cpp/thread/condition_variable> EDIT: Actually the german version of cppreference.com has an e...
51,161,348
I am in the process of translating some MATLAB code into Python. There is one line that is giving me a bit of trouble: ``` [q,f_dummy,exitflag, output] = quadprog(H,f,-A,zeros(p*N,1),E,qm,[],[],q0,options); ``` I looked up the documentation in MATLAB to find that the quadprog function is used for optimization (parti...
2018/07/03
['https://Stackoverflow.com/questions/51161348', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/9645799/']
There is a library called [CVXOPT](https://scaron.info/blog/quadratic-programming-in-python.html) that has quadratic programming in it. ``` def quadprog_solve_qp(P, q, G=None, h=None, A=None, b=None): qp_G = .5 * (P + P.T) # make sure P is symmetric qp_a = -q if A is not None: qp_C = -numpy.vstac...
[OSQP](https://osqp.org) is a specialized free QP solver based on ADMM. I have adapted the [OSQP documentation demo](http://osqp.org/docs/examples/demo.html) and the OSQP call in the [qpsolvers repository](https://github.com/stephane-caron/qpsolvers/blob/master/qpsolvers/osqp_.py) for your problem. Note that matrices...
51,161,348
I am in the process of translating some MATLAB code into Python. There is one line that is giving me a bit of trouble: ``` [q,f_dummy,exitflag, output] = quadprog(H,f,-A,zeros(p*N,1),E,qm,[],[],q0,options); ``` I looked up the documentation in MATLAB to find that the quadprog function is used for optimization (parti...
2018/07/03
['https://Stackoverflow.com/questions/51161348', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/9645799/']
There is a library called [CVXOPT](https://scaron.info/blog/quadratic-programming-in-python.html) that has quadratic programming in it. ``` def quadprog_solve_qp(P, q, G=None, h=None, A=None, b=None): qp_G = .5 * (P + P.T) # make sure P is symmetric qp_a = -q if A is not None: qp_C = -numpy.vstac...
I will start by mentioning that *quadratic programming* problems are a subset of *convex optimization* problems which are a subset of *optimization* problems. There are multiple python packages which solve quadratic programming problems, notably 1. [cvxopt](https://cvxopt.org/userguide/coneprog.html#quadratic-program...
51,161,348
I am in the process of translating some MATLAB code into Python. There is one line that is giving me a bit of trouble: ``` [q,f_dummy,exitflag, output] = quadprog(H,f,-A,zeros(p*N,1),E,qm,[],[],q0,options); ``` I looked up the documentation in MATLAB to find that the quadprog function is used for optimization (parti...
2018/07/03
['https://Stackoverflow.com/questions/51161348', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/9645799/']
There is a library called [CVXOPT](https://scaron.info/blog/quadratic-programming-in-python.html) that has quadratic programming in it. ``` def quadprog_solve_qp(P, q, G=None, h=None, A=None, b=None): qp_G = .5 * (P + P.T) # make sure P is symmetric qp_a = -q if A is not None: qp_C = -numpy.vstac...
You could use the [`solve_qp`](https://scaron.info/doc/qpsolvers/quadratic-programming.html#qpsolvers.solve_qp) function from [qpsolvers](https://github.com/stephane-caron/qpsolvers). It can be installed, along with a starter kit of open source solvers, by `pip install qpsolvers[open_source_solvers]`. Then you can repl...
51,161,348
I am in the process of translating some MATLAB code into Python. There is one line that is giving me a bit of trouble: ``` [q,f_dummy,exitflag, output] = quadprog(H,f,-A,zeros(p*N,1),E,qm,[],[],q0,options); ``` I looked up the documentation in MATLAB to find that the quadprog function is used for optimization (parti...
2018/07/03
['https://Stackoverflow.com/questions/51161348', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/9645799/']
[OSQP](https://osqp.org) is a specialized free QP solver based on ADMM. I have adapted the [OSQP documentation demo](http://osqp.org/docs/examples/demo.html) and the OSQP call in the [qpsolvers repository](https://github.com/stephane-caron/qpsolvers/blob/master/qpsolvers/osqp_.py) for your problem. Note that matrices...
You could use the [`solve_qp`](https://scaron.info/doc/qpsolvers/quadratic-programming.html#qpsolvers.solve_qp) function from [qpsolvers](https://github.com/stephane-caron/qpsolvers). It can be installed, along with a starter kit of open source solvers, by `pip install qpsolvers[open_source_solvers]`. Then you can repl...
51,161,348
I am in the process of translating some MATLAB code into Python. There is one line that is giving me a bit of trouble: ``` [q,f_dummy,exitflag, output] = quadprog(H,f,-A,zeros(p*N,1),E,qm,[],[],q0,options); ``` I looked up the documentation in MATLAB to find that the quadprog function is used for optimization (parti...
2018/07/03
['https://Stackoverflow.com/questions/51161348', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/9645799/']
I will start by mentioning that *quadratic programming* problems are a subset of *convex optimization* problems which are a subset of *optimization* problems. There are multiple python packages which solve quadratic programming problems, notably 1. [cvxopt](https://cvxopt.org/userguide/coneprog.html#quadratic-program...
You could use the [`solve_qp`](https://scaron.info/doc/qpsolvers/quadratic-programming.html#qpsolvers.solve_qp) function from [qpsolvers](https://github.com/stephane-caron/qpsolvers). It can be installed, along with a starter kit of open source solvers, by `pip install qpsolvers[open_source_solvers]`. Then you can repl...
3,554,426
I've started using [Code Contracts](http://msdn.microsoft.com/en-us/devlabs/dd491992.aspx) in all new code I'm writing, such as in a framework library I'm building to help bootstrap [IoC](http://en.wikipedia.org/wiki/Inversion_of_control), [O/RM](http://en.wikipedia.org/wiki/Object-relational_mapping), etc., in an ASP....
2010/08/24
['https://Stackoverflow.com/questions/3554426', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/61818/']
If you attach a handler to the MouseLeftButtonDown event on the ListView it will only fire when areas outside of a ListViewItem are clicked. Any clicks inside the items will be handled by the items themselves to drive the ListView's selection behavior. You can make changes to the clickable areas by adjusting the Backg...
`ListBoxItem` control handles clicks on ListBox. You should either: * use `PreviewMouseDown` event on ListBox * Add event handler in code via `myListBox.AddHandler` method See **[How to Attach to MouseDown Event on ListBox](http://www.wpfnewbie.com/2010/07/22/how-to-attach-to-mousedown-event-on-listbox/)** for explan...
3,554,426
I've started using [Code Contracts](http://msdn.microsoft.com/en-us/devlabs/dd491992.aspx) in all new code I'm writing, such as in a framework library I'm building to help bootstrap [IoC](http://en.wikipedia.org/wiki/Inversion_of_control), [O/RM](http://en.wikipedia.org/wiki/Object-relational_mapping), etc., in an ASP....
2010/08/24
['https://Stackoverflow.com/questions/3554426', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/61818/']
If you attach a handler to the MouseLeftButtonDown event on the ListView it will only fire when areas outside of a ListViewItem are clicked. Any clicks inside the items will be handled by the items themselves to drive the ListView's selection behavior. You can make changes to the clickable areas by adjusting the Backg...
I found if I had previously single clicked on an item in the listview (and thereby selecting it), then next double clicked on the empty space in the listview the undesired result of having the previously selected item being actioned as if it had been double clicked on (rather then the empty space). To get around this I...
55,584,078
I would like to report progress from a long running PLINQ query. I can't really find any native LINQ method that allows me to do this (as was [implemented](https://learn.microsoft.com/en-us/dotnet/standard/parallel-programming/how-to-cancel-a-plinq-query) for [cancellation](https://learn.microsoft.com/en-us/dotnet/api...
2019/04/09
['https://Stackoverflow.com/questions/55584078', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/7371817/']
This answer might not be as elegant, but it gets the job done. When using PLINQ, there are multiple threads processing your collection, so using those threads to **report** progress results in multiple (and out-of-order) progress reports like 0% 1% 5% 4% 3% etc... Instead, we can use those multiple threads to **updat...
This extension can be positioned either at the start or at the end of the LINQ query. If positioned at the start will start reporting progress immediately, but will erroneously report 100% before the job is done. If positioned at the end will report accurately the end of the query, but will delay reporting progress unt...
39,831,170
I'm using C# and windows forms, i have a group box with 20 labels in it (10 in the top row and 10 in the bottom row). I want to set Text property of these labels based on their location coordinates in the group box. Y co-ordinate of all labels in same row remains same and only X co-ordinate changes. ``` Example locat...
2016/10/03
['https://Stackoverflow.com/questions/39831170', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/6691757/']
This sounds like a good candidate for a User Control to me. Design a user control with the groupbox and labels. Expose the operations you need externally. Possibly a good moment to set naming conventions to something more meaningful to you. Another way could be to generate the labels from code instead of design time...
I guess can try a foreach to GroupBox.Controls,and you can check their names inside this foreach too. example: ``` foreach(Label lbl in groupBox1.Controls { if (lbl.Name.Contains("[int_a]_[int_b]")) { lbl.Text = "Label Text"; } } ``` I guess this gives you a base to what you're needing
957,172
Can someone please help me out with a query? In Microsoft SQL Server, I have the following query, which executes fine: ``` SELECT * FROM ControlPoint INNER JOIN Project ON ControlPoint.ProjectID = Project.ProjectID INNER JOIN Site ON Site.SiteID = Project.SiteID WHERE Project.ProjectName LIKE '%Flood%' ``` My proble...
2009/06/05
['https://Stackoverflow.com/questions/957172', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/98094/']
Access uses different wildcard patterns. In your case, it will be - LIKE '?Flood?' (replace question mark with asterisk). I don't know formatting codes to apply here so that it shows it correctly. See the link for details - <http://www.techonthenet.com/access/queries/like.php>
Use this sintax in access never fails (this is an example) select \* from customer, adress where customer.id = adress.customerId
957,172
Can someone please help me out with a query? In Microsoft SQL Server, I have the following query, which executes fine: ``` SELECT * FROM ControlPoint INNER JOIN Project ON ControlPoint.ProjectID = Project.ProjectID INNER JOIN Site ON Site.SiteID = Project.SiteID WHERE Project.ProjectName LIKE '%Flood%' ``` My proble...
2009/06/05
['https://Stackoverflow.com/questions/957172', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/98094/']
You will need some parentheses in addition to changing the wild cards: ``` SELECT * FROM (ControlPoint INNER JOIN Project ON ControlPoint.ProjectID = Project.ProjectID) INNER JOIN Site ON Site.SiteID = Project.SiteID WHERE Project.ProjectName LIKE '*Flood*' ``` Note that the asterisk is used in the Access query wind...
Use this sintax in access never fails (this is an example) select \* from customer, adress where customer.id = adress.customerId
957,172
Can someone please help me out with a query? In Microsoft SQL Server, I have the following query, which executes fine: ``` SELECT * FROM ControlPoint INNER JOIN Project ON ControlPoint.ProjectID = Project.ProjectID INNER JOIN Site ON Site.SiteID = Project.SiteID WHERE Project.ProjectName LIKE '%Flood%' ``` My proble...
2009/06/05
['https://Stackoverflow.com/questions/957172', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/98094/']
The syntax error is caused because access uses " instead of ' as the string delimiter. As previously mentioned you will also need to change the % wildcards to \*
Use this sintax in access never fails (this is an example) select \* from customer, adress where customer.id = adress.customerId
957,172
Can someone please help me out with a query? In Microsoft SQL Server, I have the following query, which executes fine: ``` SELECT * FROM ControlPoint INNER JOIN Project ON ControlPoint.ProjectID = Project.ProjectID INNER JOIN Site ON Site.SiteID = Project.SiteID WHERE Project.ProjectName LIKE '%Flood%' ``` My proble...
2009/06/05
['https://Stackoverflow.com/questions/957172', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/98094/']
You will need some parentheses in addition to changing the wild cards: ``` SELECT * FROM (ControlPoint INNER JOIN Project ON ControlPoint.ProjectID = Project.ProjectID) INNER JOIN Site ON Site.SiteID = Project.SiteID WHERE Project.ProjectName LIKE '*Flood*' ``` Note that the asterisk is used in the Access query wind...
Access uses different wildcard patterns. In your case, it will be - LIKE '?Flood?' (replace question mark with asterisk). I don't know formatting codes to apply here so that it shows it correctly. See the link for details - <http://www.techonthenet.com/access/queries/like.php>
957,172
Can someone please help me out with a query? In Microsoft SQL Server, I have the following query, which executes fine: ``` SELECT * FROM ControlPoint INNER JOIN Project ON ControlPoint.ProjectID = Project.ProjectID INNER JOIN Site ON Site.SiteID = Project.SiteID WHERE Project.ProjectName LIKE '%Flood%' ``` My proble...
2009/06/05
['https://Stackoverflow.com/questions/957172', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/98094/']
You will need some parentheses in addition to changing the wild cards: ``` SELECT * FROM (ControlPoint INNER JOIN Project ON ControlPoint.ProjectID = Project.ProjectID) INNER JOIN Site ON Site.SiteID = Project.SiteID WHERE Project.ProjectName LIKE '*Flood*' ``` Note that the asterisk is used in the Access query wind...
The syntax error is caused because access uses " instead of ' as the string delimiter. As previously mentioned you will also need to change the % wildcards to \*
32,011,014
Consider the following macro: ``` #define FOO(a,b) (--a)* 8 + (--b); ``` Now ``` int graph[8][8] = { 0 }; int *graph_p = &(graph[0][0]); int *p = graph_p + FOO(2, 3); ``` Why do I get the error: > > IntelliSense: expression must be a modifiable lvalue > > >
2015/08/14
['https://Stackoverflow.com/questions/32011014', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/5211135/']
It's because you are passing an *integer constant* to function-like macro `FOO(a, b)`, that applies pre-increment `--` operator to its arguments. The result of this macro expansion looks as: ``` int *p = graph_p + (--2)* 8 + (--3);; ``` which is illegal in C, as operator requires a *modifiable lvalue* as its operan...
The line ``` int *p = graph_p + FOO(2, 3); ``` will be replaced at compile time by the defined macro as ``` int *p = graph_p + (--2)* 8 + (--3);; ``` the operand of prefix `--` must be an lvalue. `2` and `3` are integer constants and it can't be an operand of prefix `--` operator.
32,011,014
Consider the following macro: ``` #define FOO(a,b) (--a)* 8 + (--b); ``` Now ``` int graph[8][8] = { 0 }; int *graph_p = &(graph[0][0]); int *p = graph_p + FOO(2, 3); ``` Why do I get the error: > > IntelliSense: expression must be a modifiable lvalue > > >
2015/08/14
['https://Stackoverflow.com/questions/32011014', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/5211135/']
The line ``` int *p = graph_p + FOO(2, 3); ``` will be replaced at compile time by the defined macro as ``` int *p = graph_p + (--2)* 8 + (--3);; ``` the operand of prefix `--` must be an lvalue. `2` and `3` are integer constants and it can't be an operand of prefix `--` operator.
`FOO(2,3)` translates to `(--2)* 8 + (--3)` You can only increment/decrement an lvalue, not a number.
32,011,014
Consider the following macro: ``` #define FOO(a,b) (--a)* 8 + (--b); ``` Now ``` int graph[8][8] = { 0 }; int *graph_p = &(graph[0][0]); int *p = graph_p + FOO(2, 3); ``` Why do I get the error: > > IntelliSense: expression must be a modifiable lvalue > > >
2015/08/14
['https://Stackoverflow.com/questions/32011014', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/5211135/']
The line ``` int *p = graph_p + FOO(2, 3); ``` will be replaced at compile time by the defined macro as ``` int *p = graph_p + (--2)* 8 + (--3);; ``` the operand of prefix `--` must be an lvalue. `2` and `3` are integer constants and it can't be an operand of prefix `--` operator.
Try this: ``` Int * p=(int * )(graph-p+FOO(2,3)); ```
32,011,014
Consider the following macro: ``` #define FOO(a,b) (--a)* 8 + (--b); ``` Now ``` int graph[8][8] = { 0 }; int *graph_p = &(graph[0][0]); int *p = graph_p + FOO(2, 3); ``` Why do I get the error: > > IntelliSense: expression must be a modifiable lvalue > > >
2015/08/14
['https://Stackoverflow.com/questions/32011014', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/5211135/']
It's because you are passing an *integer constant* to function-like macro `FOO(a, b)`, that applies pre-increment `--` operator to its arguments. The result of this macro expansion looks as: ``` int *p = graph_p + (--2)* 8 + (--3);; ``` which is illegal in C, as operator requires a *modifiable lvalue* as its operan...
`FOO(2,3)` translates to `(--2)* 8 + (--3)` You can only increment/decrement an lvalue, not a number.
32,011,014
Consider the following macro: ``` #define FOO(a,b) (--a)* 8 + (--b); ``` Now ``` int graph[8][8] = { 0 }; int *graph_p = &(graph[0][0]); int *p = graph_p + FOO(2, 3); ``` Why do I get the error: > > IntelliSense: expression must be a modifiable lvalue > > >
2015/08/14
['https://Stackoverflow.com/questions/32011014', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/5211135/']
It's because you are passing an *integer constant* to function-like macro `FOO(a, b)`, that applies pre-increment `--` operator to its arguments. The result of this macro expansion looks as: ``` int *p = graph_p + (--2)* 8 + (--3);; ``` which is illegal in C, as operator requires a *modifiable lvalue* as its operan...
Try this: ``` Int * p=(int * )(graph-p+FOO(2,3)); ```
51,500,657
Is it possible to get substring from right hand hand(Reverse) direction using `substring()` in JAVA. Example. Suppose `String S="abcdef"`, Can I get Substring "fedc" using `S.substring(S.length()-1,3)` ? If it is not correct, please suggest me how to get Substring from right hand end(Reverse direction)??
2018/07/24
['https://Stackoverflow.com/questions/51500657', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/10128375/']
You could reverse the string and use `substring`. Unfortunately `String` does not have that, but `StringBuilder` has it e.g. ``` new StringBuilder("abcdef").reverse().toString().substring(0,4); ```
You can reverse the string and find the substring ``` // reverse String s = "abcdef"; StringBuilder builder = new StringBuilder(s); String substring = builder.reverse().substring(0,3); ```
51,500,657
Is it possible to get substring from right hand hand(Reverse) direction using `substring()` in JAVA. Example. Suppose `String S="abcdef"`, Can I get Substring "fedc" using `S.substring(S.length()-1,3)` ? If it is not correct, please suggest me how to get Substring from right hand end(Reverse direction)??
2018/07/24
['https://Stackoverflow.com/questions/51500657', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/10128375/']
You could reverse the string and use `substring`. Unfortunately `String` does not have that, but `StringBuilder` has it e.g. ``` new StringBuilder("abcdef").reverse().toString().substring(0,4); ```
Java doesn't support extension methods like C# does, so I would build a function for this. This way you can control how much of the reverse substring you want with a parameter. ``` public class StackOverflow { public static void main(String[] args) { String data = "abcdef"; for (int i = 0; i < data...
39,452,720
I created a vagrant box using `vagrant package` , uploaded it and released it. Then I did `vagrant init <username>/<box>` which created a Vagrantfile. I even appended the box version to the Vagrantfile. Next I did `vagrant up --provider virtualbox`. This tries to get the box locally and then when it can't find it...
2016/09/12
['https://Stackoverflow.com/questions/39452720', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/5955578/']
What I figured was that due to some reason vagrant had got corrupted. So doing a fresh install of vagrant did the trick.
Upgrading vagrant version through installing `.deb` version worked for me (download through vagrant website: <https://www.vagrantup.com/downloads> - choose tab "Debian" and install the package)
39,452,720
I created a vagrant box using `vagrant package` , uploaded it and released it. Then I did `vagrant init <username>/<box>` which created a Vagrantfile. I even appended the box version to the Vagrantfile. Next I did `vagrant up --provider virtualbox`. This tries to get the box locally and then when it can't find it...
2016/09/12
['https://Stackoverflow.com/questions/39452720', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/5955578/']
What I figured was that due to some reason vagrant had got corrupted. So doing a fresh install of vagrant did the trick.
I suffered for 2 hours but I don't want anyone to suffer ;) 1 - **access the terminal (sudo) and, remove vagrant files** $ rm -rf /opt/vagrant $ rm -f /usr/bin/vagrant 2 - **then install it again as it has probably been corrupted.** $ curl -O <https://releases.hashicorp.com/vagrant/2.2.9/vagrant_2.2.9_x86_64.deb> ...
39,452,720
I created a vagrant box using `vagrant package` , uploaded it and released it. Then I did `vagrant init <username>/<box>` which created a Vagrantfile. I even appended the box version to the Vagrantfile. Next I did `vagrant up --provider virtualbox`. This tries to get the box locally and then when it can't find it...
2016/09/12
['https://Stackoverflow.com/questions/39452720', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/5955578/']
Make sure you have virtualbox installed if you are using ubuntu. `sudo apt install virtualbox-qt`
Upgrading vagrant version through installing `.deb` version worked for me (download through vagrant website: <https://www.vagrantup.com/downloads> - choose tab "Debian" and install the package)
39,452,720
I created a vagrant box using `vagrant package` , uploaded it and released it. Then I did `vagrant init <username>/<box>` which created a Vagrantfile. I even appended the box version to the Vagrantfile. Next I did `vagrant up --provider virtualbox`. This tries to get the box locally and then when it can't find it...
2016/09/12
['https://Stackoverflow.com/questions/39452720', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/5955578/']
Make sure you have virtualbox installed if you are using ubuntu. `sudo apt install virtualbox-qt`
I suffered for 2 hours but I don't want anyone to suffer ;) 1 - **access the terminal (sudo) and, remove vagrant files** $ rm -rf /opt/vagrant $ rm -f /usr/bin/vagrant 2 - **then install it again as it has probably been corrupted.** $ curl -O <https://releases.hashicorp.com/vagrant/2.2.9/vagrant_2.2.9_x86_64.deb> ...
39,452,720
I created a vagrant box using `vagrant package` , uploaded it and released it. Then I did `vagrant init <username>/<box>` which created a Vagrantfile. I even appended the box version to the Vagrantfile. Next I did `vagrant up --provider virtualbox`. This tries to get the box locally and then when it can't find it...
2016/09/12
['https://Stackoverflow.com/questions/39452720', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/5955578/']
Upgrading vagrant version through installing `.deb` version worked for me (download through vagrant website: <https://www.vagrantup.com/downloads> - choose tab "Debian" and install the package)
I suffered for 2 hours but I don't want anyone to suffer ;) 1 - **access the terminal (sudo) and, remove vagrant files** $ rm -rf /opt/vagrant $ rm -f /usr/bin/vagrant 2 - **then install it again as it has probably been corrupted.** $ curl -O <https://releases.hashicorp.com/vagrant/2.2.9/vagrant_2.2.9_x86_64.deb> ...
5,043
I started wondering about this when I realized most websites I visit have white backgrounds, and I know that the screen is usually responsible for most of the battery usage. Since I can't change the background in those sites, I might at least switch my wallpaper to a black one. Most (all?) phones need back-lighting to...
2011/01/21
['https://android.stackexchange.com/questions/5043', 'https://android.stackexchange.com', 'https://android.stackexchange.com/users/1926/']
On OLED, AMOLED and Super AMOLED screens: [Yes](http://techlogg.com/2010/12/ips-vs-amoled-vs-slcd-smartphone-displays-explained/1877) LCD screens: [No](http://techlogg.com/2010/05/black-vs-white-screen-power-consumption-24-more-monitors-tested/17)
This depends on the screen technology. For instance, (it was said that) Android 2.3 Gingerbread has dark theme since Google's latest flagship device Nexus S uses (Super) AMOLED display which consumes less energy when displaying dark color since AMOLED produces its own light and darker color emits less photons. Contra...
5,043
I started wondering about this when I realized most websites I visit have white backgrounds, and I know that the screen is usually responsible for most of the battery usage. Since I can't change the background in those sites, I might at least switch my wallpaper to a black one. Most (all?) phones need back-lighting to...
2011/01/21
['https://android.stackexchange.com/questions/5043', 'https://android.stackexchange.com', 'https://android.stackexchange.com/users/1926/']
This depends on the screen technology. For instance, (it was said that) Android 2.3 Gingerbread has dark theme since Google's latest flagship device Nexus S uses (Super) AMOLED display which consumes less energy when displaying dark color since AMOLED produces its own light and darker color emits less photons. Contra...
If your screen has an older standard lcd then this doesn't help at all. The backlight is still shining behind all those darkened pixels. You just can't see it. If you have oled, amoled, super amoled, LED lcd, or I think even plasma then it does help to darken the screen because the light is generated specifically wher...
5,043
I started wondering about this when I realized most websites I visit have white backgrounds, and I know that the screen is usually responsible for most of the battery usage. Since I can't change the background in those sites, I might at least switch my wallpaper to a black one. Most (all?) phones need back-lighting to...
2011/01/21
['https://android.stackexchange.com/questions/5043', 'https://android.stackexchange.com', 'https://android.stackexchange.com/users/1926/']
On OLED, AMOLED and Super AMOLED screens: [Yes](http://techlogg.com/2010/12/ips-vs-amoled-vs-slcd-smartphone-displays-explained/1877) LCD screens: [No](http://techlogg.com/2010/05/black-vs-white-screen-power-consumption-24-more-monitors-tested/17)
If your screen has an older standard lcd then this doesn't help at all. The backlight is still shining behind all those darkened pixels. You just can't see it. If you have oled, amoled, super amoled, LED lcd, or I think even plasma then it does help to darken the screen because the light is generated specifically wher...
5,043
I started wondering about this when I realized most websites I visit have white backgrounds, and I know that the screen is usually responsible for most of the battery usage. Since I can't change the background in those sites, I might at least switch my wallpaper to a black one. Most (all?) phones need back-lighting to...
2011/01/21
['https://android.stackexchange.com/questions/5043', 'https://android.stackexchange.com', 'https://android.stackexchange.com/users/1926/']
On OLED, AMOLED and Super AMOLED screens: [Yes](http://techlogg.com/2010/12/ips-vs-amoled-vs-slcd-smartphone-displays-explained/1877) LCD screens: [No](http://techlogg.com/2010/05/black-vs-white-screen-power-consumption-24-more-monitors-tested/17)
Hey, I just ran a load of test to figure this out. They are vaguely scientific tests! I figured out that I was saving 20% battery by switching to dark wallpaper and dark themed apps. Have a look through my write up, you should be able to work out the saving on your phone: <http://blog.stevemould.com/phone-battery-save...
5,043
I started wondering about this when I realized most websites I visit have white backgrounds, and I know that the screen is usually responsible for most of the battery usage. Since I can't change the background in those sites, I might at least switch my wallpaper to a black one. Most (all?) phones need back-lighting to...
2011/01/21
['https://android.stackexchange.com/questions/5043', 'https://android.stackexchange.com', 'https://android.stackexchange.com/users/1926/']
Hey, I just ran a load of test to figure this out. They are vaguely scientific tests! I figured out that I was saving 20% battery by switching to dark wallpaper and dark themed apps. Have a look through my write up, you should be able to work out the saving on your phone: <http://blog.stevemould.com/phone-battery-save...
If your screen has an older standard lcd then this doesn't help at all. The backlight is still shining behind all those darkened pixels. You just can't see it. If you have oled, amoled, super amoled, LED lcd, or I think even plasma then it does help to darken the screen because the light is generated specifically wher...
3,475,856
$\int\_{x^2+y^2+z^2\le 2(x+y+z)}(x^2+y^2+z^2)\sin z dxdydz$ Can you give me a hint how to start?
2019/12/14
['https://math.stackexchange.com/questions/3475856', 'https://math.stackexchange.com', 'https://math.stackexchange.com/users/653945/']
Let us restate, also introducing notations, so that there is nothing more to prove at the end. > > Given is a triangle $\Delta ABC$. We consider intermediate points $A',A''\in BC$, $B',B''\in CA$, $C',C''\in AB$, so that > $$ > \frac{A'C}{BC} = > \frac{B'A}{CA} = > \frac{C'B}{AB} = > \frac 13= > \frac{BA''}{BC} = > ...
Two things : 1) About the equality of the lengths you are asking for, see the recent question [Proof that each of the three cevians is divided in the ratio $1:3:3$](https://math.stackexchange.com/q/3350495) (with, among the answers, one of mine). 2) About the proportion ($1/7$) of areas : Let $A,a$ be the resp. area...
23,575
Back in the 90's I remember watching a late-night movie on one of the networks. The story took place in an arid, post-apocaliptic future. The plot revolved around a little girl who befriended a cyborg killing machine. The cyborg killing machine spent the movie blasting apart a gang of evil cyborgs to protect her, and ...
2012/09/18
['https://scifi.stackexchange.com/questions/23575', 'https://scifi.stackexchange.com', 'https://scifi.stackexchange.com/users/8590/']
Is it by any chance [Screamers](http://www.imdb.com/title/tt0114367/)? The main character is a human soldier (or mercenary, can't remember exactly). He travels trough an arid, desolated post-apocalyptic planet and saves a little girl from cyborg killing machines, and she follows him 'till the end of the movie, when he...
I think it might be the film [Cyborg](http://www.imdb.com/title/tt0097138/). > > Gibson Rickenbacker is a hired fighter living in a plague-ravaged apocalyptic America where a plague has infested most of the United States and the rest of the world. In New York City, Gibson encounters a woman named Pearl Prophet. Pearl...
23,575
Back in the 90's I remember watching a late-night movie on one of the networks. The story took place in an arid, post-apocaliptic future. The plot revolved around a little girl who befriended a cyborg killing machine. The cyborg killing machine spent the movie blasting apart a gang of evil cyborgs to protect her, and ...
2012/09/18
['https://scifi.stackexchange.com/questions/23575', 'https://scifi.stackexchange.com', 'https://scifi.stackexchange.com/users/8590/']
S. Albano, in case you haven't already found the movie, the one you're looking for is [Knights (1993)](http://www.imdb.com/title/tt0107333/ "Knights (1993)") From [Wikipedia](https://en.wikipedia.org/wiki/Knights_(film)): > > The cyborg Gabriel was created to destroy all other cyborgs. He later rescues Nea by killin...
Is it by any chance [Screamers](http://www.imdb.com/title/tt0114367/)? The main character is a human soldier (or mercenary, can't remember exactly). He travels trough an arid, desolated post-apocalyptic planet and saves a little girl from cyborg killing machines, and she follows him 'till the end of the movie, when he...
23,575
Back in the 90's I remember watching a late-night movie on one of the networks. The story took place in an arid, post-apocaliptic future. The plot revolved around a little girl who befriended a cyborg killing machine. The cyborg killing machine spent the movie blasting apart a gang of evil cyborgs to protect her, and ...
2012/09/18
['https://scifi.stackexchange.com/questions/23575', 'https://scifi.stackexchange.com', 'https://scifi.stackexchange.com/users/8590/']
S. Albano, in case you haven't already found the movie, the one you're looking for is [Knights (1993)](http://www.imdb.com/title/tt0107333/ "Knights (1993)") From [Wikipedia](https://en.wikipedia.org/wiki/Knights_(film)): > > The cyborg Gabriel was created to destroy all other cyborgs. He later rescues Nea by killin...
I think it might be the film [Cyborg](http://www.imdb.com/title/tt0097138/). > > Gibson Rickenbacker is a hired fighter living in a plague-ravaged apocalyptic America where a plague has infested most of the United States and the rest of the world. In New York City, Gibson encounters a woman named Pearl Prophet. Pearl...
10,908,070
I have a dataset with minute by minute GPS coordinates recorded by a persons cellphone. I.e. the dataset has 1440 rows with LON/LAT values. Based on the data I would like a point estimate (lon/lat value) of where the participants home is. Let's assume that home is the single location where they spend most of their time...
2012/06/06
['https://Stackoverflow.com/questions/10908070', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/318752/']
There are "time spent" functions in the `trip` package (I'm the author). You can create objects from the track data that understand the underlying track process over time, and simply process the points assuming straight line segments between fixes. If "home" is where the largest value pixel is, i.e. when you break up a...
How about using the location that minimises the sum squared distance to all the events? This might be close to the supremum of any kernel smoothing if my brain is working right. If your data comprises two clusters (home and work) then I think the location will be in the biggest cluster rather than between them. Its no...
10,908,070
I have a dataset with minute by minute GPS coordinates recorded by a persons cellphone. I.e. the dataset has 1440 rows with LON/LAT values. Based on the data I would like a point estimate (lon/lat value) of where the participants home is. Let's assume that home is the single location where they spend most of their time...
2012/06/06
['https://Stackoverflow.com/questions/10908070', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/318752/']
There are "time spent" functions in the `trip` package (I'm the author). You can create objects from the track data that understand the underlying track process over time, and simply process the points assuming straight line segments between fixes. If "home" is where the largest value pixel is, i.e. when you break up a...
In response to spacedman - I am pretty sure least squares won't work. Least squares is best known for bowing to the demands of outliers, without much weighting to things that are "nearby". This is the opposite of what is desired. The bisquare estimator would probably work better, in my opinion - but I have never used ...
10,908,070
I have a dataset with minute by minute GPS coordinates recorded by a persons cellphone. I.e. the dataset has 1440 rows with LON/LAT values. Based on the data I would like a point estimate (lon/lat value) of where the participants home is. Let's assume that home is the single location where they spend most of their time...
2012/06/06
['https://Stackoverflow.com/questions/10908070', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/318752/']
How about using the location that minimises the sum squared distance to all the events? This might be close to the supremum of any kernel smoothing if my brain is working right. If your data comprises two clusters (home and work) then I think the location will be in the biggest cluster rather than between them. Its no...
In response to spacedman - I am pretty sure least squares won't work. Least squares is best known for bowing to the demands of outliers, without much weighting to things that are "nearby". This is the opposite of what is desired. The bisquare estimator would probably work better, in my opinion - but I have never used ...
13,075
I played a game today where I feel that I had a nice positional advantage (the computer supports my opinion) but I only managed to draw it in the end. This is the position that I consider to be critical: ``` [fen "2bq1r2/1r1np1kp/pp4p1/2pP1pP1/2P1NQ2/3B3P/PP3P2/R3R1K1 w - - 0 1"] ``` I am playing White. Here Black p...
2015/12/13
['https://chess.stackexchange.com/questions/13075', 'https://chess.stackexchange.com', 'https://chess.stackexchange.com/users/8751/']
Black is very weak on the black squares, on the e file, his e pawn is very weak and his knight and bishop are short of good squares because of his cramped position. You should try and get your knight to f4 and double your rooks on the e file. I would start with Nc3. This also helps against Black's obvious plan to unde...
You should try for a breakthrough on the h file. You will eventually play h5, but you might want to move your king to g2 and double rooks on the file before you push the pawn. Your pieces have better lateral mobility than Black's, which is why you should be thinking of moving your rooks to one end of the board, and fin...
13,075
I played a game today where I feel that I had a nice positional advantage (the computer supports my opinion) but I only managed to draw it in the end. This is the position that I consider to be critical: ``` [fen "2bq1r2/1r1np1kp/pp4p1/2pP1pP1/2P1NQ2/3B3P/PP3P2/R3R1K1 w - - 0 1"] ``` I am playing White. Here Black p...
2015/12/13
['https://chess.stackexchange.com/questions/13075', 'https://chess.stackexchange.com', 'https://chess.stackexchange.com/users/8751/']
Black is very weak on the black squares, on the e file, his e pawn is very weak and his knight and bishop are short of good squares because of his cramped position. You should try and get your knight to f4 and double your rooks on the e file. I would start with Nc3. This also helps against Black's obvious plan to unde...
As stated, White is clearly better here, but it's hard to say if White can force a win in the long run against best play. I like the idea with Nc3 in Brian Towers response a lot, but I'm not sure the idea outlined in that answer is enough to win by itself. I think that you should combine different ideas. As suggested,...
13,075
I played a game today where I feel that I had a nice positional advantage (the computer supports my opinion) but I only managed to draw it in the end. This is the position that I consider to be critical: ``` [fen "2bq1r2/1r1np1kp/pp4p1/2pP1pP1/2P1NQ2/3B3P/PP3P2/R3R1K1 w - - 0 1"] ``` I am playing White. Here Black p...
2015/12/13
['https://chess.stackexchange.com/questions/13075', 'https://chess.stackexchange.com', 'https://chess.stackexchange.com/users/8751/']
As stated, White is clearly better here, but it's hard to say if White can force a win in the long run against best play. I like the idea with Nc3 in Brian Towers response a lot, but I'm not sure the idea outlined in that answer is enough to win by itself. I think that you should combine different ideas. As suggested,...
You should try for a breakthrough on the h file. You will eventually play h5, but you might want to move your king to g2 and double rooks on the file before you push the pawn. Your pieces have better lateral mobility than Black's, which is why you should be thinking of moving your rooks to one end of the board, and fin...
7,486,389
Is there any way to call one class's ArrayList onto another class? In class A ArrayList is there, I need to use that ArrayList in class B, Class A is having `AsyncTask` in that I have the Arraylist so I need that in side AsynTask's Arraylist in another class. In class A: ``` public Class A{ public class HomeTask e...
2011/09/20
['https://Stackoverflow.com/questions/7486389', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/954839/']
If you set the language in a view, the error messages will be printed in the selected language: ``` from django.utils.translation import activate activate('de') ```
if you use \_ in your form messages the message will be displayed in the right lang! but if you want to check which lang is running in the template you can use: ``` {% if LANGUAGE_CODE != "ch" %} {% endif %} ``` for more info about using \_ in your form, check this out: <https://docs.djangoproject.com/en/1.3/ref/fo...
7,486,389
Is there any way to call one class's ArrayList onto another class? In class A ArrayList is there, I need to use that ArrayList in class B, Class A is having `AsyncTask` in that I have the Arraylist so I need that in side AsynTask's Arraylist in another class. In class A: ``` public Class A{ public class HomeTask e...
2011/09/20
['https://Stackoverflow.com/questions/7486389', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/954839/']
**Some quick explanation first:** Your form field errors come from ``` raise forms.ValidationError(_("My Error Message")) ``` In Django (possibly in other places also), it is common to see this: ``` from django.utils.translation import ugettext_lazy as _ ``` This turns the `_` into a `ugettext_lazy`, i.e. the co...
if you use \_ in your form messages the message will be displayed in the right lang! but if you want to check which lang is running in the template you can use: ``` {% if LANGUAGE_CODE != "ch" %} {% endif %} ``` for more info about using \_ in your form, check this out: <https://docs.djangoproject.com/en/1.3/ref/fo...
5,081,853
A client has asked me to connect to their SVN server to upload (sync) my file changes rather than use FTP. I simply want to connect to the SVN server. Every tutorial I read has something to do with installing SVN server on my local machine - I don't want to install a server, I want to connect to one, pull down the fil...
2011/02/22
['https://Stackoverflow.com/questions/5081853', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/628815/']
Basically you need to install subversion first: ``` sudo apt-get install subversion ``` Then you need to checkout the SVN repository, add your files and commit; that looks similar to this: ``` svn co http://some.url/to/the/repository cd repository-folder cp ../files/from/otherfolder . svn add the/new/files svn comm...
I'd suggest reading through <http://svnbook.red-bean.com/nightly/en/svn.tour.importing.html> and the next 4-5 pages of that chapter/section to get a good primer on using SVN as a client. You want to check out a working copy to your local machine: `svn checkout <http://host.example.com/svn/repo/trunk> my-working-copy`...
5,873,516
I don't get it. I usually install third party software into */usr/local* so libraries are installed into /usr/local/lib and never had problems linking to these libraries. But now it suddenly no longer works: ``` $ gcc -lkaytils -o test test.c /usr/bin/ld.gold.real: error: cannot find -lkaytils /usr/bin/ld.gold.real: /...
2011/05/03
['https://Stackoverflow.com/questions/5873516', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/274473/']
gcc -print-search-dirs will tell you what path the compiler checks. /usr/local/lib is simply not among them, so your compile time linker (in this case the new gold ld from binutils) doesn't find the library while the dynamic one (ld-linux.so which reads the cache written by ldconfig) does. Presumably the builds you've ...
This is probably an issue of environment variables - you have something set that's including /usr/local/include but not /usr/local/lib From the GCC mapage on environment variables ``` CPATH specifies a list of directories to be searched as if speci‐ fied with -I, but after any paths given with -I option...
55,464,578
Consider the following code: ``` struct A { virtual A& operator+=(const A& other) noexcept = 0; }; void foo_inner(int *p) noexcept { *p += *p; } void foo_virtual_inner(A *p) noexcept { *p += *p; } void foo(int *p) noexcept { return foo_inner(p); } struct Aint : public A { int i; A& operator+=(const ...
2019/04/01
['https://Stackoverflow.com/questions/55464578', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/1593077/']
GCC guesses that Aint \*p points to instance of Aint \*p (but does not think this is guaranteed to happen) and therefore it devirtualises speculatively the call to operator+= and the typeinfo checking is an inlined copy of it. -fno-devirtualize-speculatively leads to same code as Clang and MSVC produces. ``` _Z11foo_...
Following @JanHubicka's answer, I've filed a bug against GCC: <https://gcc.gnu.org/bugzilla/show_bug.cgi?id=89924> and it's being worked on (!).
55,464,578
Consider the following code: ``` struct A { virtual A& operator+=(const A& other) noexcept = 0; }; void foo_inner(int *p) noexcept { *p += *p; } void foo_virtual_inner(A *p) noexcept { *p += *p; } void foo(int *p) noexcept { return foo_inner(p); } struct Aint : public A { int i; A& operator+=(const ...
2019/04/01
['https://Stackoverflow.com/questions/55464578', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/1593077/']
GCC guesses that Aint \*p points to instance of Aint \*p (but does not think this is guaranteed to happen) and therefore it devirtualises speculatively the call to operator+= and the typeinfo checking is an inlined copy of it. -fno-devirtualize-speculatively leads to same code as Clang and MSVC produces. ``` _Z11foo_...
The compiler can't assume that an Aint\* actually points to an Aint object until it sees some operation that would have undefined semantics otherwise, like referring to one of its non-static members. Otherwise it could be the result of reinterpret\_cast from some other pointer type waiting to be reinterpret\_casted bac...
55,464,578
Consider the following code: ``` struct A { virtual A& operator+=(const A& other) noexcept = 0; }; void foo_inner(int *p) noexcept { *p += *p; } void foo_virtual_inner(A *p) noexcept { *p += *p; } void foo(int *p) noexcept { return foo_inner(p); } struct Aint : public A { int i; A& operator+=(const ...
2019/04/01
['https://Stackoverflow.com/questions/55464578', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/1593077/']
Following @JanHubicka's answer, I've filed a bug against GCC: <https://gcc.gnu.org/bugzilla/show_bug.cgi?id=89924> and it's being worked on (!).
The compiler can't assume that an Aint\* actually points to an Aint object until it sees some operation that would have undefined semantics otherwise, like referring to one of its non-static members. Otherwise it could be the result of reinterpret\_cast from some other pointer type waiting to be reinterpret\_casted bac...
53,561,760
I feel dumb as it seems so easy. But I am stuck with this one: I built a scraper which gets me the titles of jobs. Works great but it includes the h1 tags. E.g. it saves the title of a job as: "<*h1>Marketing Manager<*/h1>" I do not know why he does not just take the value within the h1 tag. But secondly, I just tr...
2018/11/30
['https://Stackoverflow.com/questions/53561760', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/10075876/']
This gives you a bunch of elements: ``` job_title = html_doc.search('.job-detail-desc h1') ``` This gives you the text of the first one: ``` job_title = html_doc.at('.job-detail-desc h1').text ```
For HTML, a rule of thumb is that documents have `html` and `body` tags, and fragments usually do not. Try to use the `DocumentFragment` class because the text is not a valid HTML or XML document. ``` html_doc = Nokogiri::HTML::DocumentFragment.parse(html_file) ```
53,561,760
I feel dumb as it seems so easy. But I am stuck with this one: I built a scraper which gets me the titles of jobs. Works great but it includes the h1 tags. E.g. it saves the title of a job as: "<*h1>Marketing Manager<*/h1>" I do not know why he does not just take the value within the h1 tag. But secondly, I just tr...
2018/11/30
['https://Stackoverflow.com/questions/53561760', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/10075876/']
The issue you're having is that `job_title` is not a simple string; it's a set of node object(s) that match the search. When you print it with `puts`, Ruby is calling `#to_s` on the node set and outputting the "HTML source" of all the nodes. What you need to do is to isolate the node you want an then extract its text ...
For HTML, a rule of thumb is that documents have `html` and `body` tags, and fragments usually do not. Try to use the `DocumentFragment` class because the text is not a valid HTML or XML document. ``` html_doc = Nokogiri::HTML::DocumentFragment.parse(html_file) ```
46,169,229
I've seen a lot of nice solutions here about how to work with ArrayList and HashMaps, but the point is I still can't solve my problem. So, the idea is there are few people that drink beer, wine and cola. So, it looks like that (for example): ``` Steve wine Steve cola Ben cola Frank wine Ben cola Ben cola Frank wine...
2017/09/12
['https://Stackoverflow.com/questions/46169229', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/8258820/']
Key should be unique in hash map or Dictionary (C#). This case while inserting key itself need to combine name and drink. Giving the solution in C# here. Hope it helps. ``` public class Person { public string Name { get; set; } public string Drink { get; set; } } class Program { static void Main(string[] ...
First I would recommend you to take care of your namings. What is really the key in your case is an order not a person (since Steve cola and Steve wine is different you shouldn't name it as person). After that: containsKey will use the hashcode method which will be inherited from the Object class if you don't override...
46,169,229
I've seen a lot of nice solutions here about how to work with ArrayList and HashMaps, but the point is I still can't solve my problem. So, the idea is there are few people that drink beer, wine and cola. So, it looks like that (for example): ``` Steve wine Steve cola Ben cola Frank wine Ben cola Ben cola Frank wine...
2017/09/12
['https://Stackoverflow.com/questions/46169229', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/8258820/']
You are making a mistake by storing `Person` Object as a Key. You must store the person name, a String as Key and it will work fine. ``` Map<String, Integer> map = new HashMap<>(); for (Person p : persons) { if (map.containsKey(p.getName())) { map.put(p.getName(), map.get(p)+1); ...
You have to override equals and hashCode method in Person class. Below is the sample code: ``` class Person { private String name; private String drink; public Person(String name, String drink) { super(); this.name = name; this.drink = drink; } @Override public int hashCode() { return t...
46,169,229
I've seen a lot of nice solutions here about how to work with ArrayList and HashMaps, but the point is I still can't solve my problem. So, the idea is there are few people that drink beer, wine and cola. So, it looks like that (for example): ``` Steve wine Steve cola Ben cola Frank wine Ben cola Ben cola Frank wine...
2017/09/12
['https://Stackoverflow.com/questions/46169229', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/8258820/']
Overwrite hashcode and equals method in your Person class
You are making a mistake by storing `Person` Object as a Key. You must store the person name, a String as Key and it will work fine. ``` Map<String, Integer> map = new HashMap<>(); for (Person p : persons) { if (map.containsKey(p.getName())) { map.put(p.getName(), map.get(p)+1); ...
46,169,229
I've seen a lot of nice solutions here about how to work with ArrayList and HashMaps, but the point is I still can't solve my problem. So, the idea is there are few people that drink beer, wine and cola. So, it looks like that (for example): ``` Steve wine Steve cola Ben cola Frank wine Ben cola Ben cola Frank wine...
2017/09/12
['https://Stackoverflow.com/questions/46169229', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/8258820/']
If you can use Java 8 streams here is one clever solution : ``` List<Person> people = Arrays.asList(new Person("Steve", "wine"), new Person("Steve", "cola"), new Person("Ben", "cola"), new Person("Ben", "cola"), new Person("Steve", "wine"), new Person("Steve", "wine")); Map<Person, Lo...
Overwrite hashcode and equals method in your Person class
46,169,229
I've seen a lot of nice solutions here about how to work with ArrayList and HashMaps, but the point is I still can't solve my problem. So, the idea is there are few people that drink beer, wine and cola. So, it looks like that (for example): ``` Steve wine Steve cola Ben cola Frank wine Ben cola Ben cola Frank wine...
2017/09/12
['https://Stackoverflow.com/questions/46169229', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/8258820/']
Overwrite hashcode and equals method in your Person class
You have to override equals and hashCode method in Person class. Below is the sample code: ``` class Person { private String name; private String drink; public Person(String name, String drink) { super(); this.name = name; this.drink = drink; } @Override public int hashCode() { return t...
46,169,229
I've seen a lot of nice solutions here about how to work with ArrayList and HashMaps, but the point is I still can't solve my problem. So, the idea is there are few people that drink beer, wine and cola. So, it looks like that (for example): ``` Steve wine Steve cola Ben cola Frank wine Ben cola Ben cola Frank wine...
2017/09/12
['https://Stackoverflow.com/questions/46169229', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/8258820/']
Overwrite hashcode and equals method in your Person class
Key should be unique in hash map or Dictionary (C#). This case while inserting key itself need to combine name and drink. Giving the solution in C# here. Hope it helps. ``` public class Person { public string Name { get; set; } public string Drink { get; set; } } class Program { static void Main(string[] ...
46,169,229
I've seen a lot of nice solutions here about how to work with ArrayList and HashMaps, but the point is I still can't solve my problem. So, the idea is there are few people that drink beer, wine and cola. So, it looks like that (for example): ``` Steve wine Steve cola Ben cola Frank wine Ben cola Ben cola Frank wine...
2017/09/12
['https://Stackoverflow.com/questions/46169229', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/8258820/']
If you can use Java 8 streams here is one clever solution : ``` List<Person> people = Arrays.asList(new Person("Steve", "wine"), new Person("Steve", "cola"), new Person("Ben", "cola"), new Person("Ben", "cola"), new Person("Steve", "wine"), new Person("Steve", "wine")); Map<Person, Lo...
First I would recommend you to take care of your namings. What is really the key in your case is an order not a person (since Steve cola and Steve wine is different you shouldn't name it as person). After that: containsKey will use the hashcode method which will be inherited from the Object class if you don't override...
46,169,229
I've seen a lot of nice solutions here about how to work with ArrayList and HashMaps, but the point is I still can't solve my problem. So, the idea is there are few people that drink beer, wine and cola. So, it looks like that (for example): ``` Steve wine Steve cola Ben cola Frank wine Ben cola Ben cola Frank wine...
2017/09/12
['https://Stackoverflow.com/questions/46169229', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/8258820/']
You are making a mistake by storing `Person` Object as a Key. You must store the person name, a String as Key and it will work fine. ``` Map<String, Integer> map = new HashMap<>(); for (Person p : persons) { if (map.containsKey(p.getName())) { map.put(p.getName(), map.get(p)+1); ...
Overriding **equals** and **hascode** method in your **Person** class is the solution for your problem. assuming you have Person class with parameter **name** and **drink** , then you could use some IDE like eclipse to generate hashcode and equals method for you see below code: ``` public class Person { privat...
46,169,229
I've seen a lot of nice solutions here about how to work with ArrayList and HashMaps, but the point is I still can't solve my problem. So, the idea is there are few people that drink beer, wine and cola. So, it looks like that (for example): ``` Steve wine Steve cola Ben cola Frank wine Ben cola Ben cola Frank wine...
2017/09/12
['https://Stackoverflow.com/questions/46169229', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/8258820/']
You have to override equals and hashCode method in Person class. Below is the sample code: ``` class Person { private String name; private String drink; public Person(String name, String drink) { super(); this.name = name; this.drink = drink; } @Override public int hashCode() { return t...
First I would recommend you to take care of your namings. What is really the key in your case is an order not a person (since Steve cola and Steve wine is different you shouldn't name it as person). After that: containsKey will use the hashcode method which will be inherited from the Object class if you don't override...
46,169,229
I've seen a lot of nice solutions here about how to work with ArrayList and HashMaps, but the point is I still can't solve my problem. So, the idea is there are few people that drink beer, wine and cola. So, it looks like that (for example): ``` Steve wine Steve cola Ben cola Frank wine Ben cola Ben cola Frank wine...
2017/09/12
['https://Stackoverflow.com/questions/46169229', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/8258820/']
Overwrite hashcode and equals method in your Person class
``` int count = Collections.frequency("your collection", "Your Value"); ``` I meant to say like that: ``` ArrayList<String> list = new ArrayList<>(); list.add("Steve wine"); list.add("Steve cola"); list.add("Ben cola"); list.add("Frank wine"); list.add("Ben cola"); list.add("Ben cola"); list.add("Frank wine"); Sys...