qid
int64
1
74.7M
question
stringlengths
15
58.3k
date
stringlengths
10
10
metadata
list
response_j
stringlengths
4
30.2k
response_k
stringlengths
11
36.5k
14,741,715
``` c=["pink", "purple", "black", "yellow", "purple", "indego", "white", "peach"] import random import collections def apply(T): i = random.randint(0, 7) return c[i] for x in range(1, 50): for ch in map(apply, c): print(ch) ``` I'm trying to figure out how to count the occurrences of each of the n...
2013/02/07
[ "https://Stackoverflow.com/questions/14741715", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2048983/" ]
First off, your `apply` function ignores its argument, which is never a good sign for something you're giving to `map`. I'm going to assume you were trying to generate a list of random colors, called `colors`, and then count that; you could equally well replace that by a generator. Filter, reduce, etc are functional p...
I think this will be the simplest solution. It does not use filters or so, but it seems quite smart solution ``` counts = [(colors.count(x), x) for x in set(colors)] ``` You can also make a dict, not list of tuples... depending on python interpreter version you use.
14,741,715
``` c=["pink", "purple", "black", "yellow", "purple", "indego", "white", "peach"] import random import collections def apply(T): i = random.randint(0, 7) return c[i] for x in range(1, 50): for ch in map(apply, c): print(ch) ``` I'm trying to figure out how to count the occurrences of each of the n...
2013/02/07
[ "https://Stackoverflow.com/questions/14741715", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2048983/" ]
First off, your `apply` function ignores its argument, which is never a good sign for something you're giving to `map`. I'm going to assume you were trying to generate a list of random colors, called `colors`, and then count that; you could equally well replace that by a generator. Filter, reduce, etc are functional p...
@Dougal Below works fine to count the list using reduce and lambda: ``` c = ["pink", "purple", "black", "yellow", "purple", "indego", "white", "peach", "test"] print reduce(lambda x, y: x + 1, c, 0) ``` Notice that last parameter to reduce() which is 0.
14,741,715
``` c=["pink", "purple", "black", "yellow", "purple", "indego", "white", "peach"] import random import collections def apply(T): i = random.randint(0, 7) return c[i] for x in range(1, 50): for ch in map(apply, c): print(ch) ``` I'm trying to figure out how to count the occurrences of each of the n...
2013/02/07
[ "https://Stackoverflow.com/questions/14741715", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2048983/" ]
@Dougal Below works fine to count the list using reduce and lambda: ``` c = ["pink", "purple", "black", "yellow", "purple", "indego", "white", "peach", "test"] print reduce(lambda x, y: x + 1, c, 0) ``` Notice that last parameter to reduce() which is 0.
I think this will be the simplest solution. It does not use filters or so, but it seems quite smart solution ``` counts = [(colors.count(x), x) for x in set(colors)] ``` You can also make a dict, not list of tuples... depending on python interpreter version you use.
43,691,711
I am working on an issue where i need to Declare a two - dimensional array named multiplicationTable that contains 4 elements by 4 elements.Initialize it in a nested loop to contain elements that equal to the value that is the product of the two index values for each element. In a second nested loop, display the values...
2017/04/29
[ "https://Stackoverflow.com/questions/43691711", "https://Stackoverflow.com", "https://Stackoverflow.com/users/3128212/" ]
Unfortunately in pycharm you have to set `CUDA_HOME` and `LD_LIBRARY_PATH` inside the IDE. To do that go to the Run menu->edit configurations then choose your project. Then you click on the Environment Variables and add an entry for `CUDA_HOME` and `LD_LIBRARY_PATH`. When you have done that you can run directly from in...
I've read this other Stackoverflow post: [Pycharm environment different than command line](https://stackoverflow.com/questions/19715724/pycharm-environment-different-than-command-line), and it seems that the problem is that openning PyCharm in the normal way won't preserve the bash environment. The solution is to open ...
43,691,711
I am working on an issue where i need to Declare a two - dimensional array named multiplicationTable that contains 4 elements by 4 elements.Initialize it in a nested loop to contain elements that equal to the value that is the product of the two index values for each element. In a second nested loop, display the values...
2017/04/29
[ "https://Stackoverflow.com/questions/43691711", "https://Stackoverflow.com", "https://Stackoverflow.com/users/3128212/" ]
Unfortunately in pycharm you have to set `CUDA_HOME` and `LD_LIBRARY_PATH` inside the IDE. To do that go to the Run menu->edit configurations then choose your project. Then you click on the Environment Variables and add an entry for `CUDA_HOME` and `LD_LIBRARY_PATH`. When you have done that you can run directly from in...
I have searched a lot, but I didn't find the right solution for this question anywhere. I found the solution with my friends and I would like to share with you also. If your Tensorflow works in terminal properly but doesn't work in Pycharm you have two solutions: 1- Open Pycharm from Terminal. For me: ``` pycharm-co...
5,545,182
I have a bit of a problem in regards to getting my program to work. I have created a hashmap that has a setting and the hashmap can hold 4 key/value pairs. Now each key (0,1,2,3) is attached to a String 'value' that represents a colour ("white", "red"... etc). Now I am using random to give me a random number from 0 t...
2011/04/04
[ "https://Stackoverflow.com/questions/5545182", "https://Stackoverflow.com", "https://Stackoverflow.com/users/691939/" ]
It seems to me this is begging for an array Color[4] indexed from 0 to 3 - rather than changing your random int to a String or Integer key and doing a Hash lookup. --- Totally fake class that shows how to use an array with your random ``` public class foo { private Color[] colors = { Color.red, Color.green, Colo...
For anyone interested in how I solved this (thanks to the help of other on here and tutorials on google): ``` // fields private Color1[] colors = { Color1.red, Color1.green, Color1.blue, Color1.yellow }; private int a2; private String getRandomColor; //constructor calling methods to generate a ran...
5,545,182
I have a bit of a problem in regards to getting my program to work. I have created a hashmap that has a setting and the hashmap can hold 4 key/value pairs. Now each key (0,1,2,3) is attached to a String 'value' that represents a colour ("white", "red"... etc). Now I am using random to give me a random number from 0 t...
2011/04/04
[ "https://Stackoverflow.com/questions/5545182", "https://Stackoverflow.com", "https://Stackoverflow.com/users/691939/" ]
Use an array instead: ``` String[] colors = new String[]{"white", "red"... etc}; int random = random.nextInt(colors.length); String randomColor = colors[random]; ``` **Edit:**Substitute String for your Color class (or primitive) if you want to.
For anyone interested in how I solved this (thanks to the help of other on here and tutorials on google): ``` // fields private Color1[] colors = { Color1.red, Color1.green, Color1.blue, Color1.yellow }; private int a2; private String getRandomColor; //constructor calling methods to generate a ran...
5,545,182
I have a bit of a problem in regards to getting my program to work. I have created a hashmap that has a setting and the hashmap can hold 4 key/value pairs. Now each key (0,1,2,3) is attached to a String 'value' that represents a colour ("white", "red"... etc). Now I am using random to give me a random number from 0 t...
2011/04/04
[ "https://Stackoverflow.com/questions/5545182", "https://Stackoverflow.com", "https://Stackoverflow.com/users/691939/" ]
You need a method that converts the String into a actual color. I would use something like this: ``` public static Color stringToColor(final String value) { if (value == null) { return Color.black; } try { // get color by hex or octal value return Color.decode(value); } catch (NumberF...
For anyone interested in how I solved this (thanks to the help of other on here and tutorials on google): ``` // fields private Color1[] colors = { Color1.red, Color1.green, Color1.blue, Color1.yellow }; private int a2; private String getRandomColor; //constructor calling methods to generate a ran...
10,602,490
I'm trying to get a batch file to open tor, but i have the browser bundle and its not technically software, so I don't know how to launch it with a batch file. Any suggestions?
2012/05/15
[ "https://Stackoverflow.com/questions/10602490", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1396154/" ]
I put a shortcut to Tor on my desktop, and ran it. Create a shortcut to Tor, and within a batch file, enter this: start "" "C:\Users\%USERNAME%\Desktop\SHORTCUT.lnk" "site1" "site2" " Just replace SHORTCUTNAME with the name of the shortcut, and site1 and site2 with the sites you want.
You can use the PUSHD command to enter in the browser folder and then the START command to execute the program. I hope that I have helped.
10,602,490
I'm trying to get a batch file to open tor, but i have the browser bundle and its not technically software, so I don't know how to launch it with a batch file. Any suggestions?
2012/05/15
[ "https://Stackoverflow.com/questions/10602490", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1396154/" ]
I put a shortcut to Tor on my desktop, and ran it. Create a shortcut to Tor, and within a batch file, enter this: start "" "C:\Users\%USERNAME%\Desktop\SHORTCUT.lnk" "site1" "site2" " Just replace SHORTCUTNAME with the name of the shortcut, and site1 and site2 with the sites you want.
Well I know how to run the internet command in a batch file, but don't know how to run a customised selection. Try downloading firefox(web browser)(it's great) and then downloading the add on Fox tab. It lets you select a website from your own pre made bundle when you open a new tab. Sorry for not being able to answe...
10,602,490
I'm trying to get a batch file to open tor, but i have the browser bundle and its not technically software, so I don't know how to launch it with a batch file. Any suggestions?
2012/05/15
[ "https://Stackoverflow.com/questions/10602490", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1396154/" ]
I put a shortcut to Tor on my desktop, and ran it. Create a shortcut to Tor, and within a batch file, enter this: start "" "C:\Users\%USERNAME%\Desktop\SHORTCUT.lnk" "site1" "site2" " Just replace SHORTCUTNAME with the name of the shortcut, and site1 and site2 with the sites you want.
Inside the unzipped bundle is "App/tor" -- that is the tor binary. However, it would be more helpful to know why you want to launch tor separately.
39,543,290
When an image object is created, can know when is fully loaded using the "complete" property, or the "onload" method, then, this image has processed ( resizing for example ) using some time, that can be some seconds in big files. How to know when browser finish to **process** an image **after loading it**? EDIT: In...
2016/09/17
[ "https://Stackoverflow.com/questions/39543290", "https://Stackoverflow.com", "https://Stackoverflow.com/users/5930315/" ]
Here is one way. CanvasContext2D `drawImage` method is synchronous. Before being able to use this method, the browser has to completely render the image. So you can use it as a waiting method in your `waitBIGimage` method. ```js var BIGimage; putBIGimage(); function putBIGimage() { BIGimage = document.createEl...
There is no reliable way to know - your browser can continue to execute arbitrary javascript or perform built in functions (i.e., resizing of the browser window) which can directly or indirectly affect the image and cause it to be either redrawn, or appear to not finish drawing for a while. You can hook in to particul...
45,178
I have a few CD's that I ripped a while ago that are in my iTunes library, that have an explicit label. They play fine on my local computer. The problem is, these ripped CDs are not marked as explicit in my iTunes library, so due to a bug in iTunes Match, when I play these songs on other devices, they play the clean ...
2012/03/22
[ "https://apple.stackexchange.com/questions/45178", "https://apple.stackexchange.com", "https://apple.stackexchange.com/users/181/" ]
[Subler](https://bitbucket.org/galad87/subler) ============================================== ...allows to edit (almost?) any metadata to a song manually. You can use this tool add the explicit label to a song. I've successfully tested version 0.14 in Lion. ![enter image description here](https://i.stack.imgur.com/n...
I sent an email to iTunes store support. This is what they said: > > I understand that iTunes Match is providing the clean versions of certain explicit songs. I imagine that you are eager to enjoy the original content. I am happy to look into this for you. > > > This is a known issue that Apple's engineers are curr...
651,772
I want to redirect users, after HTTPS login, to the HTTP pages on the site. Using HTTPS for the whole site is not going to happen. What I have so far is the following: 1. User posts the login form to the secure site * The secure server validates the credentials * The secure server sends a 302 redirect to the clien...
2009/03/16
[ "https://Stackoverflow.com/questions/651772", "https://Stackoverflow.com", "https://Stackoverflow.com/users/7867/" ]
> > I am considering black-listing IE6 so that only it gets the slow meta refresh and everyone else gets the fast 302. > > > I would do something like that. Also include a plain HTML link in the body for accessibility. Note that some other browsers do give a similar warning about leaving an HTTPS site, but in the...
I don't think there's any other way. That error message is for the user's benefit, and is present in IE 7 and Firefox 3 now as well. The only way that I know of to prevent it is to add your site as trusted within the browser. **Update:** Oh, so it's not the mixed content error. I know which one you mean, though I stil...
651,772
I want to redirect users, after HTTPS login, to the HTTP pages on the site. Using HTTPS for the whole site is not going to happen. What I have so far is the following: 1. User posts the login form to the secure site * The secure server validates the credentials * The secure server sends a 302 redirect to the clien...
2009/03/16
[ "https://Stackoverflow.com/questions/651772", "https://Stackoverflow.com", "https://Stackoverflow.com/users/7867/" ]
Reviving an old topic , but to make it compelete posting the following so other devs can have a choice of implementation One way of moving bettween https to http without a warning message is to use client redirect using javascript. Steps 1. User enters login details on a https form and click on login button 2. login...
I don't think there's any other way. That error message is for the user's benefit, and is present in IE 7 and Firefox 3 now as well. The only way that I know of to prevent it is to add your site as trusted within the browser. **Update:** Oh, so it's not the mixed content error. I know which one you mean, though I stil...
9,281,871
I am trying to write C++ programs and integrate it with MATLAB using mex interface. I wrote mex -setup command on MATLAB and this was the result Select a compiler: [0] None I have Visual Studio 2010 installed on a Windows 7 64 bit PC with MATLAB R2009b installed (64bit). I read somewhere visual studio 2010 should h...
2012/02/14
[ "https://Stackoverflow.com/questions/9281871", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1019083/" ]
Could it be related to the fact that cl.exe is not in your %PATH ? Try fixing your PATH using the Options Panel on "My Computer" and try again
You need to install both Visual Studio 2008 and the corresponding Windows SDK: <http://www.mathworks.co.uk/support/compilers/R2009b/win64.html> Visual Studio 2010 isn't supported by R2009b. R2010a is the first that supports VS 2010.
9,281,871
I am trying to write C++ programs and integrate it with MATLAB using mex interface. I wrote mex -setup command on MATLAB and this was the result Select a compiler: [0] None I have Visual Studio 2010 installed on a Windows 7 64 bit PC with MATLAB R2009b installed (64bit). I read somewhere visual studio 2010 should h...
2012/02/14
[ "https://Stackoverflow.com/questions/9281871", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1019083/" ]
Could it be related to the fact that cl.exe is not in your %PATH ? Try fixing your PATH using the Options Panel on "My Computer" and try again
You are asking how to compile the mex-file directly on the Matlab's command line. An alternative would be to compile the mex-file from Visual Studio. You might be interested in the following procedure [Compiling mex files with Visual Studio](http://www.orangeowlsolutions.com/?s=mex) which has been tested with Visual...
9,281,871
I am trying to write C++ programs and integrate it with MATLAB using mex interface. I wrote mex -setup command on MATLAB and this was the result Select a compiler: [0] None I have Visual Studio 2010 installed on a Windows 7 64 bit PC with MATLAB R2009b installed (64bit). I read somewhere visual studio 2010 should h...
2012/02/14
[ "https://Stackoverflow.com/questions/9281871", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1019083/" ]
You need to install both Visual Studio 2008 and the corresponding Windows SDK: <http://www.mathworks.co.uk/support/compilers/R2009b/win64.html> Visual Studio 2010 isn't supported by R2009b. R2010a is the first that supports VS 2010.
You are asking how to compile the mex-file directly on the Matlab's command line. An alternative would be to compile the mex-file from Visual Studio. You might be interested in the following procedure [Compiling mex files with Visual Studio](http://www.orangeowlsolutions.com/?s=mex) which has been tested with Visual...
58,763,355
I tried to trim in an object inside objects but it's not working. anyone give the example code trim in an object inside the object. **Example** ``` const data = {tgg:" egg ",ggg:{dfgf:" tyt "}, ff:[{tyuyy:" sd f "}]} ``` how to trim this object in all scenario **Excepted Output** ``` {tgg:"egg",ggg:{dfgf:"tyt...
2019/11/08
[ "https://Stackoverflow.com/questions/58763355", "https://Stackoverflow.com", "https://Stackoverflow.com/users/9614586/" ]
You could loop through the [entries](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/entries) of object. If the current value is an object, recursively call the function on the value. If the current value is a string, trim it. This will work for any level of nesting. ```js const...
```js const data = { tgg: " egg ", ggg: { dfgf: " tyt " }, ff: [{ tyuyy: " sdf " }] }; const _data = JSON.stringify(data).replace(/"\s+|\s+"/g, '"'); console.log(JSON.parse(_data)); ```
25,715,895
Please let me know what is the authentication method we should use when working with OneDrive REST APIs. Is it AZURE AD using the URL <https://login.windows.net/common/oauth2/authorize>? Or the <https://login.live.com/oauth20_authorize.srf>? I'm trying to make a simple call to the new OneDrive REST API (I'm using Azu...
2014/09/08
[ "https://Stackoverflow.com/questions/25715895", "https://Stackoverflow.com", "https://Stackoverflow.com/users/3863167/" ]
IF you refer the public free version of OneDrive, then you should take a look at [OneDrives API Documentation](http://msdn.microsoft.com/en-us/library/dn659750.aspx). Which uses [Live SDK](http://msdn.microsoft.com/en-us/library/dn631819.aspx). If you are using the OneDrive for Business, then you should [use the Share...
Check out the [new][1] v1.0 O365 APIs that describe the OneDrive Business and other O365 service APIs, including authentication.
46,257,264
The default bootstrap carousel controls (left and right arrows) have links that span 100% of the height of the image in the carousel. I apologize as this may be a silly question, but how do you change this so that the links are only over the width and height of the arrows themselves? You can see an example of what I m...
2017/09/16
[ "https://Stackoverflow.com/questions/46257264", "https://Stackoverflow.com", "https://Stackoverflow.com/users/8228666/" ]
add a class with 'carousel-control' and then add the following CSS. or you can directly add this CSS to your code ``` #carousel-example-generic a.carousel-control { height: 26%; top: 33%; width: 86px; background: black; //add your own CSS as you need } ```
add in both `.carousel-control.left` and `.carousel-control.right`, ``` //change the margin to make the width and height more longer or shorter margin: 100px 0; //change the radius to make the point of the squared-hover looks rounded border-radius: 60px; ```
46,257,264
The default bootstrap carousel controls (left and right arrows) have links that span 100% of the height of the image in the carousel. I apologize as this may be a silly question, but how do you change this so that the links are only over the width and height of the arrows themselves? You can see an example of what I m...
2017/09/16
[ "https://Stackoverflow.com/questions/46257264", "https://Stackoverflow.com", "https://Stackoverflow.com/users/8228666/" ]
add in both `.carousel-control.left` and `.carousel-control.right`, ``` //change the margin to make the width and height more longer or shorter margin: 100px 0; //change the radius to make the point of the squared-hover looks rounded border-radius: 60px; ```
**add max-height & margin-top css values** ``` <a style=" max-height:21%; margin-top:21%; " ..... ``` to visually see the changes ( make `aria-hidden="false"` in first `<span>` & add `background-color:blue;` in `<a>` ) // note i tried this in bootstrap 4 not sure about 3
46,257,264
The default bootstrap carousel controls (left and right arrows) have links that span 100% of the height of the image in the carousel. I apologize as this may be a silly question, but how do you change this so that the links are only over the width and height of the arrows themselves? You can see an example of what I m...
2017/09/16
[ "https://Stackoverflow.com/questions/46257264", "https://Stackoverflow.com", "https://Stackoverflow.com/users/8228666/" ]
I ended up here after doing a Google search, figured out on my own, so I'm adding my solution for Bootstrap 4.x so others can find this easy solution. Since the icons are SVGs, adjusting BOTH the height and width will change the size of the icons. I had assumed they would change size if I increased the width, but that'...
add in both `.carousel-control.left` and `.carousel-control.right`, ``` //change the margin to make the width and height more longer or shorter margin: 100px 0; //change the radius to make the point of the squared-hover looks rounded border-radius: 60px; ```
46,257,264
The default bootstrap carousel controls (left and right arrows) have links that span 100% of the height of the image in the carousel. I apologize as this may be a silly question, but how do you change this so that the links are only over the width and height of the arrows themselves? You can see an example of what I m...
2017/09/16
[ "https://Stackoverflow.com/questions/46257264", "https://Stackoverflow.com", "https://Stackoverflow.com/users/8228666/" ]
add a class with 'carousel-control' and then add the following CSS. or you can directly add this CSS to your code ``` #carousel-example-generic a.carousel-control { height: 26%; top: 33%; width: 86px; background: black; //add your own CSS as you need } ```
**add max-height & margin-top css values** ``` <a style=" max-height:21%; margin-top:21%; " ..... ``` to visually see the changes ( make `aria-hidden="false"` in first `<span>` & add `background-color:blue;` in `<a>` ) // note i tried this in bootstrap 4 not sure about 3
46,257,264
The default bootstrap carousel controls (left and right arrows) have links that span 100% of the height of the image in the carousel. I apologize as this may be a silly question, but how do you change this so that the links are only over the width and height of the arrows themselves? You can see an example of what I m...
2017/09/16
[ "https://Stackoverflow.com/questions/46257264", "https://Stackoverflow.com", "https://Stackoverflow.com/users/8228666/" ]
I ended up here after doing a Google search, figured out on my own, so I'm adding my solution for Bootstrap 4.x so others can find this easy solution. Since the icons are SVGs, adjusting BOTH the height and width will change the size of the icons. I had assumed they would change size if I increased the width, but that'...
add a class with 'carousel-control' and then add the following CSS. or you can directly add this CSS to your code ``` #carousel-example-generic a.carousel-control { height: 26%; top: 33%; width: 86px; background: black; //add your own CSS as you need } ```
46,257,264
The default bootstrap carousel controls (left and right arrows) have links that span 100% of the height of the image in the carousel. I apologize as this may be a silly question, but how do you change this so that the links are only over the width and height of the arrows themselves? You can see an example of what I m...
2017/09/16
[ "https://Stackoverflow.com/questions/46257264", "https://Stackoverflow.com", "https://Stackoverflow.com/users/8228666/" ]
I ended up here after doing a Google search, figured out on my own, so I'm adding my solution for Bootstrap 4.x so others can find this easy solution. Since the icons are SVGs, adjusting BOTH the height and width will change the size of the icons. I had assumed they would change size if I increased the width, but that'...
**add max-height & margin-top css values** ``` <a style=" max-height:21%; margin-top:21%; " ..... ``` to visually see the changes ( make `aria-hidden="false"` in first `<span>` & add `background-color:blue;` in `<a>` ) // note i tried this in bootstrap 4 not sure about 3
46,289,043
I am working in a chat application for Android and I am using RecyclerView for listing the messages. I have written the adapter, but I am having a problem with detecting when an element(TextView in this case) inside the layout is clicked. This is my adapter: ``` public class ChatRoomThreadAdapter extends RecyclerVi...
2017/09/18
[ "https://Stackoverflow.com/questions/46289043", "https://Stackoverflow.com", "https://Stackoverflow.com/users/3774526/" ]
Make sure you have both `focusableInTouchMode` & `focusable` disabled on the button. The first click will get the focus and the second click executes the onClickListener. .
After scroll, recycler view items are not clickable and the issue is still open <https://issuetracker.google.com/issues/66996774> Found a way to force click if the scroll state is still SCROLL\_STATE\_SETTLING ``` import android.content.Context import android.util.AttributeSet import android.view.MotionEvent import a...
46,289,043
I am working in a chat application for Android and I am using RecyclerView for listing the messages. I have written the adapter, but I am having a problem with detecting when an element(TextView in this case) inside the layout is clicked. This is my adapter: ``` public class ChatRoomThreadAdapter extends RecyclerVi...
2017/09/18
[ "https://Stackoverflow.com/questions/46289043", "https://Stackoverflow.com", "https://Stackoverflow.com/users/3774526/" ]
Make sure you have both `focusableInTouchMode` & `focusable` disabled on the button. The first click will get the focus and the second click executes the onClickListener. .
The following class will fix this issue : ``` class WrapperRecyclerView(context: Context, attributeSet: AttributeSet?, defStyle: Int) : RecyclerView(context, attributeSet, defStyle) { constructor(context: Context) : this(context, null, 0) constructor(context: Context, attributeSet: AttributeSet) : this(conte...
46,289,043
I am working in a chat application for Android and I am using RecyclerView for listing the messages. I have written the adapter, but I am having a problem with detecting when an element(TextView in this case) inside the layout is clicked. This is my adapter: ``` public class ChatRoomThreadAdapter extends RecyclerVi...
2017/09/18
[ "https://Stackoverflow.com/questions/46289043", "https://Stackoverflow.com", "https://Stackoverflow.com/users/3774526/" ]
Make sure you have both `focusableInTouchMode` & `focusable` disabled on the button. The first click will get the focus and the second click executes the onClickListener. .
For me focusableInTouchMode & focusable doesn't work. Add this line to RecyclerView : ``` android:nestedScrollingEnabled="false" ``` Enjoy¡
46,289,043
I am working in a chat application for Android and I am using RecyclerView for listing the messages. I have written the adapter, but I am having a problem with detecting when an element(TextView in this case) inside the layout is clicked. This is my adapter: ``` public class ChatRoomThreadAdapter extends RecyclerVi...
2017/09/18
[ "https://Stackoverflow.com/questions/46289043", "https://Stackoverflow.com", "https://Stackoverflow.com/users/3774526/" ]
Make sure you have both `focusableInTouchMode` & `focusable` disabled on the button. The first click will get the focus and the second click executes the onClickListener. .
A tip for those trying to debug this kind of scrolling state problem in recycler view. Create your own `MyRecyclerView` extending `RecyclerView`, and override `fun onInterceptTouchEvent` there just to add logging: ``` override fun onInterceptTouchEvent(event: MotionEvent?): Boolean { Log.d(TAG, "MyRecyclerView int...
46,289,043
I am working in a chat application for Android and I am using RecyclerView for listing the messages. I have written the adapter, but I am having a problem with detecting when an element(TextView in this case) inside the layout is clicked. This is my adapter: ``` public class ChatRoomThreadAdapter extends RecyclerVi...
2017/09/18
[ "https://Stackoverflow.com/questions/46289043", "https://Stackoverflow.com", "https://Stackoverflow.com/users/3774526/" ]
After scroll, recycler view items are not clickable and the issue is still open <https://issuetracker.google.com/issues/66996774> Found a way to force click if the scroll state is still SCROLL\_STATE\_SETTLING ``` import android.content.Context import android.util.AttributeSet import android.view.MotionEvent import a...
The following class will fix this issue : ``` class WrapperRecyclerView(context: Context, attributeSet: AttributeSet?, defStyle: Int) : RecyclerView(context, attributeSet, defStyle) { constructor(context: Context) : this(context, null, 0) constructor(context: Context, attributeSet: AttributeSet) : this(conte...
46,289,043
I am working in a chat application for Android and I am using RecyclerView for listing the messages. I have written the adapter, but I am having a problem with detecting when an element(TextView in this case) inside the layout is clicked. This is my adapter: ``` public class ChatRoomThreadAdapter extends RecyclerVi...
2017/09/18
[ "https://Stackoverflow.com/questions/46289043", "https://Stackoverflow.com", "https://Stackoverflow.com/users/3774526/" ]
After scroll, recycler view items are not clickable and the issue is still open <https://issuetracker.google.com/issues/66996774> Found a way to force click if the scroll state is still SCROLL\_STATE\_SETTLING ``` import android.content.Context import android.util.AttributeSet import android.view.MotionEvent import a...
For me focusableInTouchMode & focusable doesn't work. Add this line to RecyclerView : ``` android:nestedScrollingEnabled="false" ``` Enjoy¡
46,289,043
I am working in a chat application for Android and I am using RecyclerView for listing the messages. I have written the adapter, but I am having a problem with detecting when an element(TextView in this case) inside the layout is clicked. This is my adapter: ``` public class ChatRoomThreadAdapter extends RecyclerVi...
2017/09/18
[ "https://Stackoverflow.com/questions/46289043", "https://Stackoverflow.com", "https://Stackoverflow.com/users/3774526/" ]
After scroll, recycler view items are not clickable and the issue is still open <https://issuetracker.google.com/issues/66996774> Found a way to force click if the scroll state is still SCROLL\_STATE\_SETTLING ``` import android.content.Context import android.util.AttributeSet import android.view.MotionEvent import a...
A tip for those trying to debug this kind of scrolling state problem in recycler view. Create your own `MyRecyclerView` extending `RecyclerView`, and override `fun onInterceptTouchEvent` there just to add logging: ``` override fun onInterceptTouchEvent(event: MotionEvent?): Boolean { Log.d(TAG, "MyRecyclerView int...
18,008,252
I am new to CSS and website design. See the menu on the left on this page: When you hover over a menu element the background around the text becomes white but I would like the entire row and a little bit over and under the text to become white too, similar to the top menus. Here's the code I have: ``` .child-sidebar-m...
2013/08/02
[ "https://Stackoverflow.com/questions/18008252", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2287673/" ]
Have you tried calling the alert after setting focus? Also try setting document.activeElement to document.getElementById('glCode\_'+i) ?
I'm not sure if this is the case for you, but I had this exact same problem. My issue was that for some crazy reason I had this in my CSS ``` -webkit-user-select: none; ``` ...which allowed me to click on the text input, but it would not allow me to type.
6,850,263
I have a listBox labeled `placementTwoListBox` where I have data loaded into it. The placementTwoListBox looks like this: `placementTwoListBox`: ---------------------- ``` U3 IC-00276G 236.135 198.644 90 U12 IC-00270G 250.610 201.594 0 J1 INT-00112G 269.665 179.894 180 J2 INT-00...
2011/07/27
[ "https://Stackoverflow.com/questions/6850263", "https://Stackoverflow.com", "https://Stackoverflow.com/users/864197/" ]
Use getline and then parse each line seprately: ``` #include <iostream> #include <sstream> #include <string> int main() { std::string line; while(std::getline(std::cin, line)) { std::stringstream linestream(line); int a; int b; int c; if (linestream >> a >> b >> c...
The simplest solution I can think of is to read the file line-by-line with `std::getline`, then store each line in turn in an `std::istringstream`, then do `>> a >> b >> c` on that and check the return value.
6,850,263
I have a listBox labeled `placementTwoListBox` where I have data loaded into it. The placementTwoListBox looks like this: `placementTwoListBox`: ---------------------- ``` U3 IC-00276G 236.135 198.644 90 U12 IC-00270G 250.610 201.594 0 J1 INT-00112G 269.665 179.894 180 J2 INT-00...
2011/07/27
[ "https://Stackoverflow.com/questions/6850263", "https://Stackoverflow.com", "https://Stackoverflow.com/users/864197/" ]
Use getline and then parse each line seprately: ``` #include <iostream> #include <sstream> #include <string> int main() { std::string line; while(std::getline(std::cin, line)) { std::stringstream linestream(line); int a; int b; int c; if (linestream >> a >> b >> c...
``` std::string line; while(std::getline(inputFile, line)) { std::stringstream ss(line); if ( ss >> a >> b >> c) { // line has three numbers. Work with this! } else { // line does not have three numbers. Ignore this case! } } ```
1,188,220
I want to check if parameter `$PGkey` is equal to a key with the same name inside a hash table. Further, I want to do it in a format as close to this as possible: ``` while(<PARAdef>) { my($PGkey, $PGval) = split /\s+=\s+/; if($PGkey == $hash{$PGkey}) { print PARAnew "$PGkey = $hash{$PGkey}->[$id]\n"; ...
2009/07/27
[ "https://Stackoverflow.com/questions/1188220", "https://Stackoverflow.com", "https://Stackoverflow.com/users/135671/" ]
The way to check for hash key existence is: ``` exists $hash{$key} ```
Using the [conditional operator](http://perldoc.perl.org/perlop.html#Conditional-Operator) lets you factor out the common code in that if/else statement: ``` while ( <PARAdef> ) { chomp; my ($PGkey, $PGval) = split /\s+=\s+/; print "$PGkey = ", $PGval eq $hash{$PGkey}[$id] ? $hash{$PGkey}[$id] : $P...
29,621,230
I am using kaltura java API in my project. I want to list down all deleted videos. So I am using following filter: ``` KalturaMediaEntryFilter entryFilter = new KalturaMediaEntryFilter(); entryFilter.statusEqual = KalturaEntryStatus.DELETED; ``` Now i want to list all videos with status READY and DELETED I know ther...
2015/04/14
[ "https://Stackoverflow.com/questions/29621230", "https://Stackoverflow.com", "https://Stackoverflow.com/users/3300140/" ]
Use: entryFilter.statusIn = "2,3"; See the reference of the Kaltura entry status enum: <http://www.kaltura.com/api_v3/testmeDoc/?object=KalturaEntryStatus>
I also found the way to achieve this: ``` mediaFilter.statusIn = "" + KalturaEntryStatus.READY.hashCode + "," + KalturaEntryStatus.DELETED.hashCode; ```
5,902,079
I have been put in charge of updating a service that reads a text file and creates pdf files from sections of the text file and emails out the pdfs. I recently made some changes to the service and used the .Net 4.0 Framework. When updating on the server, the 4.0 Framework was installed before I could move my files and ...
2011/05/05
[ "https://Stackoverflow.com/questions/5902079", "https://Stackoverflow.com", "https://Stackoverflow.com/users/484452/" ]
You're trying to use the Console class in a service, which doesn't have a console window associated with it. You should use some alternate form of logging that doesn't assume there's a console window. log4net, as one example, allows you to configure multiple "appenders", such as a console, file, and event log appender,...
It looks like there error is happening before your try catch. Given that you should see the specific message output by your logging (I assume it goes to the Event Log). I don't see a message that looks like what is in your log. You might want to have an app domain exception handler to catch any exceptions and log them.
5,902,079
I have been put in charge of updating a service that reads a text file and creates pdf files from sections of the text file and emails out the pdfs. I recently made some changes to the service and used the .Net 4.0 Framework. When updating on the server, the 4.0 Framework was installed before I could move my files and ...
2011/05/05
[ "https://Stackoverflow.com/questions/5902079", "https://Stackoverflow.com", "https://Stackoverflow.com/users/484452/" ]
You're trying to use the Console class in a service, which doesn't have a console window associated with it. You should use some alternate form of logging that doesn't assume there's a console window. log4net, as one example, allows you to configure multiple "appenders", such as a console, file, and event log appender,...
Also you should ensure your m\_log routine has proper error handling as that could be the culprit as well.
4,599,951
Hello I created a menu from a table. I added to the table employee the user none to make it the default value in the option menu. The problem is that I dont know how to add the none user as the default value in the option menu. Here is what I have: ``` $query = "SELECT UserName FROM employee where Classification_Class...
2011/01/05
[ "https://Stackoverflow.com/questions/4599951", "https://Stackoverflow.com", "https://Stackoverflow.com/users/558904/" ]
one way is you can create one form with three buttons. if you are using form\_tag, you can create three buttons by doing submit\_tag three times. for the submit\_tags use the same :name parameter but different values. When handling the form submit check for which button they clicked and then reroute to appropriate acti...
Having the same question, I've tried to use form\_for and it seems to work. I just added a submit button for additional actions. ``` = form_for @request do |f| = render 'shared/error_messages', object: f.object = f.label :status = f.text_field :status ...some more fields = f.submit "Save changes", class: ...
12,822,975
> > **Possible Duplicate:** > > [Members vs method arguments access in C++](https://stackoverflow.com/questions/885136/members-vs-method-arguments-access-in-c) > > > I have a class that has some members, like `x`, `y`, `width` and `height`. In its constructor, I wouldn't do this: ``` A::A(int x, int y, int wi...
2012/10/10
[ "https://Stackoverflow.com/questions/12822975", "https://Stackoverflow.com", "https://Stackoverflow.com/users/924313/" ]
You can use initialization lists just fine with the same names: ``` A::A(int x, int y, int width, int height) : x(x), y(y), width(width), height(height) { } ``` An alternative is to use different names, if you don't want to have the same names. Some Hungarian-notation variation comes to mind (I might...
Although you can avoid the problem by using the constructor's initialization list, I suggest following a convention for naming data members, for instance, a trailing `_`, or a leading `m_`. Otherwise you are very likely to have name clashes, specially if you have members with names such as `x` and `y`. ``` class A { ...
12,822,975
> > **Possible Duplicate:** > > [Members vs method arguments access in C++](https://stackoverflow.com/questions/885136/members-vs-method-arguments-access-in-c) > > > I have a class that has some members, like `x`, `y`, `width` and `height`. In its constructor, I wouldn't do this: ``` A::A(int x, int y, int wi...
2012/10/10
[ "https://Stackoverflow.com/questions/12822975", "https://Stackoverflow.com", "https://Stackoverflow.com/users/924313/" ]
You can use initialization lists just fine with the same names: ``` A::A(int x, int y, int width, int height) : x(x), y(y), width(width), height(height) { } ``` An alternative is to use different names, if you don't want to have the same names. Some Hungarian-notation variation comes to mind (I might...
If you must use assignments in the constructor (as opposed to using a list of initializers, which is preferred) the specific pattern to address this issue is to use `this` pointer, as follows: ``` this->a = a; ```
12,822,975
> > **Possible Duplicate:** > > [Members vs method arguments access in C++](https://stackoverflow.com/questions/885136/members-vs-method-arguments-access-in-c) > > > I have a class that has some members, like `x`, `y`, `width` and `height`. In its constructor, I wouldn't do this: ``` A::A(int x, int y, int wi...
2012/10/10
[ "https://Stackoverflow.com/questions/12822975", "https://Stackoverflow.com", "https://Stackoverflow.com/users/924313/" ]
You can use initialization lists just fine with the same names: ``` A::A(int x, int y, int width, int height) : x(x), y(y), width(width), height(height) { } ``` An alternative is to use different names, if you don't want to have the same names. Some Hungarian-notation variation comes to mind (I might...
You can just change the names of the constructor arguments. When you write ``` A::A(int x, int y, int width, int height) { x = x; y = y; width = width; height = height; } ``` then you're assigning the **arguments of the constructor to themselves**, leaving the actual **instance variables uninitialize...
12,822,975
> > **Possible Duplicate:** > > [Members vs method arguments access in C++](https://stackoverflow.com/questions/885136/members-vs-method-arguments-access-in-c) > > > I have a class that has some members, like `x`, `y`, `width` and `height`. In its constructor, I wouldn't do this: ``` A::A(int x, int y, int wi...
2012/10/10
[ "https://Stackoverflow.com/questions/12822975", "https://Stackoverflow.com", "https://Stackoverflow.com/users/924313/" ]
You can use initialization lists just fine with the same names: ``` A::A(int x, int y, int width, int height) : x(x), y(y), width(width), height(height) { } ``` An alternative is to use different names, if you don't want to have the same names. Some Hungarian-notation variation comes to mind (I might...
If at all possible, it's better to set data members via the initializer list, in which case there's no problem with arguments that shadow member names. Another alternative is to use `this->foo = foo;` in the body of the constructor. A similar problem exists for setters, but now you can't use the initializer list soluti...
12,822,975
> > **Possible Duplicate:** > > [Members vs method arguments access in C++](https://stackoverflow.com/questions/885136/members-vs-method-arguments-access-in-c) > > > I have a class that has some members, like `x`, `y`, `width` and `height`. In its constructor, I wouldn't do this: ``` A::A(int x, int y, int wi...
2012/10/10
[ "https://Stackoverflow.com/questions/12822975", "https://Stackoverflow.com", "https://Stackoverflow.com/users/924313/" ]
If you must use assignments in the constructor (as opposed to using a list of initializers, which is preferred) the specific pattern to address this issue is to use `this` pointer, as follows: ``` this->a = a; ```
Although you can avoid the problem by using the constructor's initialization list, I suggest following a convention for naming data members, for instance, a trailing `_`, or a leading `m_`. Otherwise you are very likely to have name clashes, specially if you have members with names such as `x` and `y`. ``` class A { ...
12,822,975
> > **Possible Duplicate:** > > [Members vs method arguments access in C++](https://stackoverflow.com/questions/885136/members-vs-method-arguments-access-in-c) > > > I have a class that has some members, like `x`, `y`, `width` and `height`. In its constructor, I wouldn't do this: ``` A::A(int x, int y, int wi...
2012/10/10
[ "https://Stackoverflow.com/questions/12822975", "https://Stackoverflow.com", "https://Stackoverflow.com/users/924313/" ]
Although you can avoid the problem by using the constructor's initialization list, I suggest following a convention for naming data members, for instance, a trailing `_`, or a leading `m_`. Otherwise you are very likely to have name clashes, specially if you have members with names such as `x` and `y`. ``` class A { ...
You can just change the names of the constructor arguments. When you write ``` A::A(int x, int y, int width, int height) { x = x; y = y; width = width; height = height; } ``` then you're assigning the **arguments of the constructor to themselves**, leaving the actual **instance variables uninitialize...
12,822,975
> > **Possible Duplicate:** > > [Members vs method arguments access in C++](https://stackoverflow.com/questions/885136/members-vs-method-arguments-access-in-c) > > > I have a class that has some members, like `x`, `y`, `width` and `height`. In its constructor, I wouldn't do this: ``` A::A(int x, int y, int wi...
2012/10/10
[ "https://Stackoverflow.com/questions/12822975", "https://Stackoverflow.com", "https://Stackoverflow.com/users/924313/" ]
If you must use assignments in the constructor (as opposed to using a list of initializers, which is preferred) the specific pattern to address this issue is to use `this` pointer, as follows: ``` this->a = a; ```
You can just change the names of the constructor arguments. When you write ``` A::A(int x, int y, int width, int height) { x = x; y = y; width = width; height = height; } ``` then you're assigning the **arguments of the constructor to themselves**, leaving the actual **instance variables uninitialize...
12,822,975
> > **Possible Duplicate:** > > [Members vs method arguments access in C++](https://stackoverflow.com/questions/885136/members-vs-method-arguments-access-in-c) > > > I have a class that has some members, like `x`, `y`, `width` and `height`. In its constructor, I wouldn't do this: ``` A::A(int x, int y, int wi...
2012/10/10
[ "https://Stackoverflow.com/questions/12822975", "https://Stackoverflow.com", "https://Stackoverflow.com/users/924313/" ]
If you must use assignments in the constructor (as opposed to using a list of initializers, which is preferred) the specific pattern to address this issue is to use `this` pointer, as follows: ``` this->a = a; ```
If at all possible, it's better to set data members via the initializer list, in which case there's no problem with arguments that shadow member names. Another alternative is to use `this->foo = foo;` in the body of the constructor. A similar problem exists for setters, but now you can't use the initializer list soluti...
12,822,975
> > **Possible Duplicate:** > > [Members vs method arguments access in C++](https://stackoverflow.com/questions/885136/members-vs-method-arguments-access-in-c) > > > I have a class that has some members, like `x`, `y`, `width` and `height`. In its constructor, I wouldn't do this: ``` A::A(int x, int y, int wi...
2012/10/10
[ "https://Stackoverflow.com/questions/12822975", "https://Stackoverflow.com", "https://Stackoverflow.com/users/924313/" ]
If at all possible, it's better to set data members via the initializer list, in which case there's no problem with arguments that shadow member names. Another alternative is to use `this->foo = foo;` in the body of the constructor. A similar problem exists for setters, but now you can't use the initializer list soluti...
You can just change the names of the constructor arguments. When you write ``` A::A(int x, int y, int width, int height) { x = x; y = y; width = width; height = height; } ``` then you're assigning the **arguments of the constructor to themselves**, leaving the actual **instance variables uninitialize...
35,334,576
I have two `p` tag and one (`id=floating`) is having css property `{float: right}`. This affects the other `p` tag (`id=toCenter`) which have the style `{text-align: center}`. ie. text alignment is only applicable to remaining area. Even though this output is understandable, What should I do to have the `'toCenter'`...
2016/02/11
[ "https://Stackoverflow.com/questions/35334576", "https://Stackoverflow.com", "https://Stackoverflow.com/users/5083859/" ]
for all that maybe struggle with the same topic, after a lot of fetching through websites and reading, i found a solution and will make a conclusion for all that are interested. > > AJP-Connector: > ============== > > > AJP - connector of tomcat 7 does not! support websocket but it also > does not give any logs o...
add / to the end of the wss in your proxy setting ``` ProxyPass /myapp/chat/ wss://x:443/myapp/chat/ ProxyPassReverse /myapp/chat/ wss://x:443/myapp/chat/ ```
12,016,529
I set ./git/config file like this. ``` [remote "origin"] url = https://github.com/haradashinya/dotfiles.git ``` It's pushed my github's repository but it asks for my username and password. So, I set my url to ssh style, like this: ``` url = git@github.com:haradashinya/dotfiles.git ``` But it outputs an error ...
2012/08/18
[ "https://Stackoverflow.com/questions/12016529", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1113655/" ]
Even if you have defined ssh keys, you need to be sure HOME is defined (which isn't the case on Windows for instance, unless you are using a DOS session from git-cmd.bat shipped with msysgit): see "[Trying to “install” github, `.ssh` dir not there](https://stackoverflow.com/questions/8514097/trying-to-install-github-ss...
You need to add your SSH key to your github account here: <https://github.com/settings/ssh> If you haven't generated an SSH key, or you don't know how to generate an SSH key, or you don't understand how to add it to your github account, github provides detailed instructions here: <https://help.github.com/articles/gene...
12,016,529
I set ./git/config file like this. ``` [remote "origin"] url = https://github.com/haradashinya/dotfiles.git ``` It's pushed my github's repository but it asks for my username and password. So, I set my url to ssh style, like this: ``` url = git@github.com:haradashinya/dotfiles.git ``` But it outputs an error ...
2012/08/18
[ "https://Stackoverflow.com/questions/12016529", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1113655/" ]
I've followed with <https://help.github.com/articles/error-permission-denied-publickey> instructions. And I resolved my problem by ssh-add 'my-id-rsa-path' command. `ssh-add ~/.ssh/id_rsa; ssh -vT git@github.com #-> success!` Thanks for help!
You need to add your SSH key to your github account here: <https://github.com/settings/ssh> If you haven't generated an SSH key, or you don't know how to generate an SSH key, or you don't understand how to add it to your github account, github provides detailed instructions here: <https://help.github.com/articles/gene...
45,451
Hi all, if this is a duplicate, I sincerely apologize. I wasn't able to find it when I searched, but that doesn't mean much. There have been several occasions ([this one for example](https://stackoverflow.com/questions/2555255/how-can-i-protect-this-code-from-sql-injection-a-bit-confused)) on SO where I have had a rou...
2010/04/04
[ "https://meta.stackexchange.com/questions/45451", "https://meta.stackexchange.com", "https://meta.stackexchange.com/users/135856/" ]
Most of the time, if I don't have a concrete, specific answer, then I simply don't answer *or* comment - somebody else will take care of that. But if the question itself is vague, or it doesn't seem that anybody else is willing to answer, then I generally use the following three-pronged approach: 1. State your assumpt...
I tend to do the same thing - add a comment at most - or not reply at all when I'm not sure. On the other hand, it could be that what little you know already helps the asker enough to get the problem sorted. In exotic cases that are not likely to get answered anyway in the next few minutes, it may well be worth answe...
45,451
Hi all, if this is a duplicate, I sincerely apologize. I wasn't able to find it when I searched, but that doesn't mean much. There have been several occasions ([this one for example](https://stackoverflow.com/questions/2555255/how-can-i-protect-this-code-from-sql-injection-a-bit-confused)) on SO where I have had a rou...
2010/04/04
[ "https://meta.stackexchange.com/questions/45451", "https://meta.stackexchange.com", "https://meta.stackexchange.com/users/135856/" ]
Most of the time, if I don't have a concrete, specific answer, then I simply don't answer *or* comment - somebody else will take care of that. But if the question itself is vague, or it doesn't seem that anybody else is willing to answer, then I generally use the following three-pronged approach: 1. State your assumpt...
I guess I'm a lot less worried about getting downvoted than I am about someone not getting any discussion. I'll post an answer I'm less than certain about, and just state that. I'm ok with being wrong these days. If I have the time/ability to look it up to become more certain, then I will. Otherwise I can just edit/del...
45,451
Hi all, if this is a duplicate, I sincerely apologize. I wasn't able to find it when I searched, but that doesn't mean much. There have been several occasions ([this one for example](https://stackoverflow.com/questions/2555255/how-can-i-protect-this-code-from-sql-injection-a-bit-confused)) on SO where I have had a rou...
2010/04/04
[ "https://meta.stackexchange.com/questions/45451", "https://meta.stackexchange.com", "https://meta.stackexchange.com/users/135856/" ]
I guess I'm a lot less worried about getting downvoted than I am about someone not getting any discussion. I'll post an answer I'm less than certain about, and just state that. I'm ok with being wrong these days. If I have the time/ability to look it up to become more certain, then I will. Otherwise I can just edit/del...
I tend to do the same thing - add a comment at most - or not reply at all when I'm not sure. On the other hand, it could be that what little you know already helps the asker enough to get the problem sorted. In exotic cases that are not likely to get answered anyway in the next few minutes, it may well be worth answe...
27,851,099
The below query is taking so long to run that eventually it just times out. I looked at the EXPLAIN plan and it seems that it's not using the indices of one of my tables so I assume that has something to do with it though I'm not sure why that's happening. Here's the query: ``` SELECT documentID , coID , sui...
2015/01/08
[ "https://Stackoverflow.com/questions/27851099", "https://Stackoverflow.com", "https://Stackoverflow.com/users/973731/" ]
I suggest using the `IN` operator for filtering as follows: ``` FOR document IN documents FILTER document.tokens IN @myArrayList RETURN document ``` This will only return a document if the `tokens` attribute is an array and contains any of the values contained in the `@myArrayList` bind parameter.
I have found an answer to my question on the ArangoDB Google Group. I am linking to it as it was very difficult for me to locate a solution: h[ttps://groups.google.com/forum/#!newtopic/arangodb/arangodb/fen4Nr7N4Uo](https://groups.google.com/forum/#!newtopic/arangodb/arangodb/fen4Nr7N4Uo) I have adapted the code there...
27,851,099
The below query is taking so long to run that eventually it just times out. I looked at the EXPLAIN plan and it seems that it's not using the indices of one of my tables so I assume that has something to do with it though I'm not sure why that's happening. Here's the query: ``` SELECT documentID , coID , sui...
2015/01/08
[ "https://Stackoverflow.com/questions/27851099", "https://Stackoverflow.com", "https://Stackoverflow.com/users/973731/" ]
I have found an answer to my question on the ArangoDB Google Group. I am linking to it as it was very difficult for me to locate a solution: h[ttps://groups.google.com/forum/#!newtopic/arangodb/arangodb/fen4Nr7N4Uo](https://groups.google.com/forum/#!newtopic/arangodb/arangodb/fen4Nr7N4Uo) I have adapted the code there...
If you want to find documents, which at least contain all specified colors, in any order, you can use a query like this: ``` LET lenArrayList = LENGTH(@myArrayList) FOR doc IN documents FILTER HAS(doc, "tokens") // avoid bad calls to INTERSECTION() FILTER LENGTH(INTERSECTION(@myArrayList, doc.tokens)) == lenA...
27,851,099
The below query is taking so long to run that eventually it just times out. I looked at the EXPLAIN plan and it seems that it's not using the indices of one of my tables so I assume that has something to do with it though I'm not sure why that's happening. Here's the query: ``` SELECT documentID , coID , sui...
2015/01/08
[ "https://Stackoverflow.com/questions/27851099", "https://Stackoverflow.com", "https://Stackoverflow.com/users/973731/" ]
I suggest using the `IN` operator for filtering as follows: ``` FOR document IN documents FILTER document.tokens IN @myArrayList RETURN document ``` This will only return a document if the `tokens` attribute is an array and contains any of the values contained in the `@myArrayList` bind parameter.
If you want to find documents, which at least contain all specified colors, in any order, you can use a query like this: ``` LET lenArrayList = LENGTH(@myArrayList) FOR doc IN documents FILTER HAS(doc, "tokens") // avoid bad calls to INTERSECTION() FILTER LENGTH(INTERSECTION(@myArrayList, doc.tokens)) == lenA...
10,861,425
I'm using PHP SDK for Facebook in CI and all works well except in the facebook login. I set the redirect\_url to 'http://mysite.com/index.php' so that facebook will redirect back to the home page after login. The problem is that when redirecting, facebook adds a query string like so: <http://mysite.com/index.php?status...
2012/06/02
[ "https://Stackoverflow.com/questions/10861425", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1432243/" ]
**The Myth:** `inline` is just a suggestion which a compiler may or may not abide to. A good compiler will anyways do what needs to be done. **The Truth:** `inline` usually indicates to the implementation that inline substitution of the function body at the point of call is to be preferred to the usual function...
It's at the discretion of the compiler. But some cases just can't be inlined, like: * Recursive functions * Functions whose address is referenced somewhere * Virtual functions (there are some exceptions thought)
10,861,425
I'm using PHP SDK for Facebook in CI and all works well except in the facebook login. I set the redirect\_url to 'http://mysite.com/index.php' so that facebook will redirect back to the home page after login. The problem is that when redirecting, facebook adds a query string like so: <http://mysite.com/index.php?status...
2012/06/02
[ "https://Stackoverflow.com/questions/10861425", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1432243/" ]
**The Myth:** `inline` is just a suggestion which a compiler may or may not abide to. A good compiler will anyways do what needs to be done. **The Truth:** `inline` usually indicates to the implementation that inline substitution of the function body at the point of call is to be preferred to the usual function...
That depends on the compiler optimization. Different compilers have different rules to make the code more efficient. But if you declare a function as inline, the compiler tends to respect your decision as long as none of it's rules says different. Remember that the compiler can change completely the execution path of...
7,554,837
I'm using a boolean mode full-text search: ``` SELECT *, match(Tournament.Name) against ('query' in boolean mode) as score FROM `tournaments` AS `Tournament` WHERE 1 =1 ORDER BY `score` desc LIMIT 20 ``` What I wanted to do was to change the `where` clause to contain something like `score > 0.5`, but this threw an e...
2011/09/26
[ "https://Stackoverflow.com/questions/7554837", "https://Stackoverflow.com", "https://Stackoverflow.com/users/50151/" ]
Rick James [answered](http://forums.mysql.com/read.php?20,436927,437075) this over at the MySQL dev forums. He wrote: > > "score" is derived, so it cannot be in WHERE. Use HAVING instead of > WHERE in this situation > > > ``` SELECT ... AS score FROM ... WHERE ... HAVING score > 0.5 ORDER BY score DESC ```
I suggest you have a look at the basic mysql [functions](http://dev.mysql.com/doc/refman/5.0/en/string-functions.html), to extract substrings from strings and convert them into a number. You can use them in you were clause and compare the result to 0.5
49,265,031
I have an BufferedinputStream that contains the byte[] representation of a file file and before that it contains the name of file ("FileName.fileExtension") I'd like to read the first line and then read the byte representation of the file so I can Convert It to the it's extension I tried this but it didn't work and be...
2018/03/13
[ "https://Stackoverflow.com/questions/49265031", "https://Stackoverflow.com", "https://Stackoverflow.com/users/7940682/" ]
``` i, j = np.triu_indices(len(df), 1) pd.Series( df.values[i, j], df.index[i] + df.index[j] ).sort_values(ascending=False) EF 9 CF 9 CE 8 DF 6 BC 3 DE 2 AE 2 CD 1 BF 1 BE 1 BD 1 AD 1 AB 1 AF 0 AC 0 dtype: object ``` --- **Setup** ``` txt = """\ A B C D E F...
You can loop through row and columns using `combinations` from `itertools` and add to the list. ``` from itertools import combinations explode_list = [] _ = [explode_list.append([r + c, df.loc[r][c]]) for r, c in combinations(df.columns, 2)] ``` **Output** ``` [['AB', 1], ['AC', 0], ... ] ```
37,435,584
After uploading the excel file on `file uploader` control in sapui5, excel file is converted in to JSON using following code. ``` handleExcelUpload : function(e) { this._import(e.getParameter("files") && e.getParameter("files")[0]); }, _import : function(file) { if (file && window.FileReader) { ...
2016/05/25
[ "https://Stackoverflow.com/questions/37435584", "https://Stackoverflow.com", "https://Stackoverflow.com/users/6011619/" ]
Yes I got answer.. I found `readAsArrayBuffer` method in Javascript which is compatible for all latest browser even in `IE11` Here is my working code. XML code: ``` <FileUploader id="fileUploader" name="myFileUpload" class="sapUiSmallMarginEnd" uploadUrl="upload/" width="400px" ...
Try this, without external library: /\*In the function "Press" \*/ ``` var file = oFileUploader.getFocusDomRef().files[0]; if (file && window.FileReader) { var reader = new FileReader(); var that = this; reader.onload = function(e) { ...
37,435,584
After uploading the excel file on `file uploader` control in sapui5, excel file is converted in to JSON using following code. ``` handleExcelUpload : function(e) { this._import(e.getParameter("files") && e.getParameter("files")[0]); }, _import : function(file) { if (file && window.FileReader) { ...
2016/05/25
[ "https://Stackoverflow.com/questions/37435584", "https://Stackoverflow.com", "https://Stackoverflow.com/users/6011619/" ]
Yes I got answer.. I found `readAsArrayBuffer` method in Javascript which is compatible for all latest browser even in `IE11` Here is my working code. XML code: ``` <FileUploader id="fileUploader" name="myFileUpload" class="sapUiSmallMarginEnd" uploadUrl="upload/" width="400px" ...
Check the code in my gist [Upload\_CSV.js](https://gist.github.com/elsheikh21/0c559c6e2fcd8b8981ad1f2a48b49d6e) Place this in the controller to parse the file using JS client side ``` var fU = this.getView().byId("idfileUploader"); var domRef = fU.getFocusDomRef(); var file = domRef.files[0]; var read...
46,884,693
I have a popup page in my application which includes some checkboxes, and I also have a ContentPage in my MainPage which contains some stacklayouts, I want to bind the IsVisible Property of my stacklayout to the IsChecked property of my checkbox (which is in another page), but i don't know how to do it, can anybody ple...
2017/10/23
[ "https://Stackoverflow.com/questions/46884693", "https://Stackoverflow.com", "https://Stackoverflow.com/users/8133327/" ]
``` <StackLayout Orientation="Horizontal" Spacing="60"> <local:Checkbox x:Name="va1Checkbox" Text="VA1"/> <local:Checkbox x:Name="va2Checkbox" Text="VA2"/> </StackLayout> ``` I believe your popup represents some kind of settings based on which you control your `StackLayout` in Main Page. If thi...
I don't know very well XAML and MVVM, but I think you can pass MainPage's ViewModel to Popup... if you change MainPage's ViewModel properties in Popup I think these changes will reflect also to MainPage's binded controls. If you are not using MVVM (you should...), I think you have to pass a reference to properties use...
72,484,320
After many days of trying to find a guide that would show me all of these things in one example I finally gave up and made something that works via brute force, but I know that this is the wrong way to do it. I don't know exactly why it's wrong but it cant be as complicated as I have made it out to be here. These are m...
2022/06/03
[ "https://Stackoverflow.com/questions/72484320", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1284415/" ]
If you are creating react app with the help of **react-redux** library, there are built-in hooks for, 1. Get the data from the redux state - **useSelector()** 2. And dispatch actions to update the redux state - **useDispatch()** *Usage of useSelector() :-* So, you don't need to use following code to map redux state ...
Your existing flow is currently as follows. Submit form -> setResponse -> re-render -> read response -> set errors. A couple things to note. 1. You should not be using a client side validation tool (ReactHookForm) for server side validation/errors 2. Do not setError within the render method of the component 3. The as...
72,484,320
After many days of trying to find a guide that would show me all of these things in one example I finally gave up and made something that works via brute force, but I know that this is the wrong way to do it. I don't know exactly why it's wrong but it cant be as complicated as I have made it out to be here. These are m...
2022/06/03
[ "https://Stackoverflow.com/questions/72484320", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1284415/" ]
If you are creating react app with the help of **react-redux** library, there are built-in hooks for, 1. Get the data from the redux state - **useSelector()** 2. And dispatch actions to update the redux state - **useDispatch()** *Usage of useSelector() :-* So, you don't need to use following code to map redux state ...
I took all the advice from the people who commented here and created the following which is much nicer (but could probably still be optimized a bit) ``` import React, { useState } from 'react'; import { useForm } from "react-hook-form"; import { ErrorMessage } from '@hookform/error-message'; import { useSelector, useD...
38,164,274
Let's consider this code: ``` std::map< int, char > charMap; for( auto& i : charMap ) { charMap[ i.first + 1 ] = charMap[ i.first ]; charMap.erase( i.first ); } ``` Let's say that the map has some values with randomed keys. I am trying to shift the keys by 1. This won't work because the loop goes on forever....
2016/07/02
[ "https://Stackoverflow.com/questions/38164274", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2121418/" ]
In C++17, you can use node extraction and splicing (see P0083R3): ``` std::map<int, char> tmpMap; for (auto it = charMap.begin(); it != charMap.end(); ) { auto nh = charMap.extract(it++); // node handle ++nh.key(); tmpMap.insert(tmpMap.end(), std::move(nh)); } tmpMap.swap(charMap); ``` The loop extra...
You cannot use this kind of range iteration for two fundamental reasons: The first reason is that a fundamental property of a map is that iterating over the map iterates in key order. You are iterating over the map. So, if the first key in the map is key 0, you will copy the value to key 1. Then, you iterate to the n...
38,164,274
Let's consider this code: ``` std::map< int, char > charMap; for( auto& i : charMap ) { charMap[ i.first + 1 ] = charMap[ i.first ]; charMap.erase( i.first ); } ``` Let's say that the map has some values with randomed keys. I am trying to shift the keys by 1. This won't work because the loop goes on forever....
2016/07/02
[ "https://Stackoverflow.com/questions/38164274", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2121418/" ]
### Ad hoc solution using the known impact on order You could simply opt for a backward iteration, starting from the last element: ``` for( auto pi = charMap.end(); pi-- != charMap.begin(); pi=charMap.erase( pi )) charMap[ pi->first + 1 ] = charMap[ pi->first ]; ``` **[Online demo](http://ideone.com/Mm10LW)** ...
You cannot use this kind of range iteration for two fundamental reasons: The first reason is that a fundamental property of a map is that iterating over the map iterates in key order. You are iterating over the map. So, if the first key in the map is key 0, you will copy the value to key 1. Then, you iterate to the n...
38,164,274
Let's consider this code: ``` std::map< int, char > charMap; for( auto& i : charMap ) { charMap[ i.first + 1 ] = charMap[ i.first ]; charMap.erase( i.first ); } ``` Let's say that the map has some values with randomed keys. I am trying to shift the keys by 1. This won't work because the loop goes on forever....
2016/07/02
[ "https://Stackoverflow.com/questions/38164274", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2121418/" ]
In C++17, you can use node extraction and splicing (see P0083R3): ``` std::map<int, char> tmpMap; for (auto it = charMap.begin(); it != charMap.end(); ) { auto nh = charMap.extract(it++); // node handle ++nh.key(); tmpMap.insert(tmpMap.end(), std::move(nh)); } tmpMap.swap(charMap); ``` The loop extra...
### Ad hoc solution using the known impact on order You could simply opt for a backward iteration, starting from the last element: ``` for( auto pi = charMap.end(); pi-- != charMap.begin(); pi=charMap.erase( pi )) charMap[ pi->first + 1 ] = charMap[ pi->first ]; ``` **[Online demo](http://ideone.com/Mm10LW)** ...
55,436,654
I have an interactive report with many columns. One of these columns is employee review. In review the values can be good, bad or not applicable. This column has a link to a form which allows employers to change the review from not applicable to either good or bad. Another column is employees. This employees column has...
2019/03/30
[ "https://Stackoverflow.com/questions/55436654", "https://Stackoverflow.com", "https://Stackoverflow.com/users/11263472/" ]
I've been meaning to write a blog post detailing a simple example, but it belongs in your SQL. ``` select case when col = 'reason to display' then apex_page.get_url(...) end as my_col ``` And define column to not [escape special characters](http://www.grassroots-oracle.com/2017/01/escape-special-characters-apex-de...
If I am understanding it correctly, you want to create a link in emp\_Review column. When Emp\_review column having value 'Not Applicable' then display link and open a form otherwise link should be disabled. You can achieve this in your Interactive Report SQL query only. You can write below code, assuming the form pag...
17,539,972
I want the value of the id which is in url in html paragraph tag. How I do this **jquery** ``` function get_Table_List(id) { $.ajax({ type: "GET", url: "one.html?outlet="+id, }); ``` **html** ``` <div class="outletTitle" style="text-align:center;">Selected outlet:<p id="prev...
2013/07/09
[ "https://Stackoverflow.com/questions/17539972", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2518671/" ]
Based on my understanding, using `.text()` you change the text value. ``` function get_Table_List(id) { $.ajax({ type: "GET", url: "one.html?outlet="+id, }); $('#preview').text(id); // where changes takes place } ``` **Result:** ``` Selected outlet:<p id="preview">id</p> ``` Or if y...
``` <script type="text/javascript"> $(document).ready(function(){ var $temp = $('p').html(); alert($temp); }); </script> ``` [Demo](http://www.mkyong.com/wp-content/uploads/jQuery/jQuery-get-tag-value.html)
17,539,972
I want the value of the id which is in url in html paragraph tag. How I do this **jquery** ``` function get_Table_List(id) { $.ajax({ type: "GET", url: "one.html?outlet="+id, }); ``` **html** ``` <div class="outletTitle" style="text-align:center;">Selected outlet:<p id="prev...
2013/07/09
[ "https://Stackoverflow.com/questions/17539972", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2518671/" ]
Based on my understanding, using `.text()` you change the text value. ``` function get_Table_List(id) { $.ajax({ type: "GET", url: "one.html?outlet="+id, }); $('#preview').text(id); // where changes takes place } ``` **Result:** ``` Selected outlet:<p id="preview">id</p> ``` Or if y...
`var x = $('outletTitle p').attr('id')` should do then do what ever you want to do with the variable
17,539,972
I want the value of the id which is in url in html paragraph tag. How I do this **jquery** ``` function get_Table_List(id) { $.ajax({ type: "GET", url: "one.html?outlet="+id, }); ``` **html** ``` <div class="outletTitle" style="text-align:center;">Selected outlet:<p id="prev...
2013/07/09
[ "https://Stackoverflow.com/questions/17539972", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2518671/" ]
Based on my understanding, using `.text()` you change the text value. ``` function get_Table_List(id) { $.ajax({ type: "GET", url: "one.html?outlet="+id, }); $('#preview').text(id); // where changes takes place } ``` **Result:** ``` Selected outlet:<p id="preview">id</p> ``` Or if y...
I don't understand your question clearly. Did you mean when someone requests `one.html?outlet=123`, you want that page `one.html` shows the outlet id in your `<p id="preview"></p>` tag? If this is the case, I think you have to parse `document.location.href`.
38,433,344
the part of the html is: ```html <p class="more"> <span>S</span><br /> <input type="radio" name="rt0" value="0/0/S" onclick='showEI(this,"0", "0", "","S")'/> ¥1140<br /> <span class="seatNum">>9</span> </p> ``` --- then i got the xpath of `¥1140`: ``` price = etree_html.find('.//*[@id="result_table...
2016/07/18
[ "https://Stackoverflow.com/questions/38433344", "https://Stackoverflow.com", "https://Stackoverflow.com/users/6339005/" ]
Follow these steps- 1.Select button 2.Change its type to custom in **Attributes inspector** 3.Change its title from **Plain** to **Attributed** 4.Change the part of title which you want to be set bold [![enter image description here](https://i.stack.imgur.com/xMlTP.png)](https://i.stack.imgur.com/xMlTP.png)
A solution would be to have a `UIView` with two different `UILabel` as subviews ( your "Log in with" label and your "Facebook" label ). Then, above this `UIView` you could have a `UIButton` with a white background and an alpha equal to 0.01 so the button would be touchable but invisible. This `UIButton` would be the ...
38,433,344
the part of the html is: ```html <p class="more"> <span>S</span><br /> <input type="radio" name="rt0" value="0/0/S" onclick='showEI(this,"0", "0", "","S")'/> ¥1140<br /> <span class="seatNum">>9</span> </p> ``` --- then i got the xpath of `¥1140`: ``` price = etree_html.find('.//*[@id="result_table...
2016/07/18
[ "https://Stackoverflow.com/questions/38433344", "https://Stackoverflow.com", "https://Stackoverflow.com/users/6339005/" ]
Follow these steps- 1.Select button 2.Change its type to custom in **Attributes inspector** 3.Change its title from **Plain** to **Attributed** 4.Change the part of title which you want to be set bold [![enter image description here](https://i.stack.imgur.com/xMlTP.png)](https://i.stack.imgur.com/xMlTP.png)
``` NSMutableAttributedString *titleText = [[NSMutableAttributedString alloc] initWithString:@"Login with Facebook"]; [yourbutton.titleLabel setFont:[UIFont boldSystemFontOfSize:14]]; // Set the font to bold from the beginning of the string to the "," [titleText addAttributes:[NSDictionary dictionaryWithObject:[UIFont...
3,929,188
Lets say I have this folder on my server called books. Inside I have and index.php with this links: books/book1.php books/book2.php I then decide to create a subdirectory called "scifi", for a better sorting of the books. So the books are no in: books/scifi/book1.php books/scifi/book2.php The links have changed and...
2010/10/14
[ "https://Stackoverflow.com/questions/3929188", "https://Stackoverflow.com", "https://Stackoverflow.com/users/463065/" ]
``` $sampleLink = "books/book1.php"; $temp = explode("/",$sampleLink); //["books","book1.php"] $temp[0] .= "/scifi"; //["books/scifi","book1.php"] $sampleLink = implode("/",$temp); //"books/scifi/book1.php" ```
Just to clarify Steve´s answer: ``` <?php $sampleLink = '<a href="/book1.php">Book...</a>'; $temp = explode("/",$sampleLink); //["books","book1.php"] $temp[0] .= "/email/books/scifi"; //["books/scifi","book1.php"] $sampleLink = implode("/",$temp); //"books/scifi/book1.php" echo $sampleLink; ?> ``` It was reall...
46,115,626
I have downloaded the new Xcode 9 build from the Apple website <https://developer.apple.com/xcode/> However, I am getting the following error when extracting the file [![enter image description here](https://i.stack.imgur.com/GzjPJ.png)](https://i.stack.imgur.com/GzjPJ.png) Is this a known issue with the downloadab...
2017/09/08
[ "https://Stackoverflow.com/questions/46115626", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1695685/" ]
It looks like the software I was using to unzip <https://theunarchiver.com/> didn't support `xip` format fully. Switching to the native `osx` unzip solved the issue
I was having older version of MacOS then required for given Xcode's xip file. Thats why it was giving me above error. Once I Updated my MacOS to required version. The same xip started working fine.
46,115,626
I have downloaded the new Xcode 9 build from the Apple website <https://developer.apple.com/xcode/> However, I am getting the following error when extracting the file [![enter image description here](https://i.stack.imgur.com/GzjPJ.png)](https://i.stack.imgur.com/GzjPJ.png) Is this a known issue with the downloadab...
2017/09/08
[ "https://Stackoverflow.com/questions/46115626", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1695685/" ]
It looks like the software I was using to unzip <https://theunarchiver.com/> didn't support `xip` format fully. Switching to the native `osx` unzip solved the issue
During Swift 5 I want to install the old Xcode and i am DONE with just some step <https://stackoverflow.com/a/61096470/6881070> ``` https://stackoverflow.com/a/61096470/6881070 ```
46,115,626
I have downloaded the new Xcode 9 build from the Apple website <https://developer.apple.com/xcode/> However, I am getting the following error when extracting the file [![enter image description here](https://i.stack.imgur.com/GzjPJ.png)](https://i.stack.imgur.com/GzjPJ.png) Is this a known issue with the downloadab...
2017/09/08
[ "https://Stackoverflow.com/questions/46115626", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1695685/" ]
It looks like the software I was using to unzip <https://theunarchiver.com/> didn't support `xip` format fully. Switching to the native `osx` unzip solved the issue
I tried using `unzip`, Unarchiver, and other tools, but ultimately the only tool which was even able to open the file was [Pacifist](https://www.charlessoft.com/). However, Pacifist was really slow so I just ended up downloading Xcode from the App Store.
45,049,172
I am getting the solution is as follows ``` class StringCheck { public static void main (String[] args) { String str="Hello world I am here"; String r; System.out.println(str); r = str.replaceAll(" ",""); System.out.println(r); } } OUTPUT: HelloworldIamher...
2017/07/12
[ "https://Stackoverflow.com/questions/45049172", "https://Stackoverflow.com", "https://Stackoverflow.com/users/8125854/" ]
What I understood from your question is you don't want to use `str.replaceAll()` function. So possible alternative is following. Please refer more details [Removing whitespace from strings in Java](https://stackoverflow.com/q/5455794/3213745) ``` import java.util.*; public class StringCheck { public static void m...
Well as you do not want to keep the value just loop and print ``` String str="Hello world I am here"; for (char c : str.toCharArray()) { if (c != ' ') System.out.print(c); } ``` **output** HelloworldIamhere Of course if you wanted to keep this new String then use a StringBuilder an...
45,049,172
I am getting the solution is as follows ``` class StringCheck { public static void main (String[] args) { String str="Hello world I am here"; String r; System.out.println(str); r = str.replaceAll(" ",""); System.out.println(r); } } OUTPUT: HelloworldIamher...
2017/07/12
[ "https://Stackoverflow.com/questions/45049172", "https://Stackoverflow.com", "https://Stackoverflow.com/users/8125854/" ]
Well as you do not want to keep the value just loop and print ``` String str="Hello world I am here"; for (char c : str.toCharArray()) { if (c != ' ') System.out.print(c); } ``` **output** HelloworldIamhere Of course if you wanted to keep this new String then use a StringBuilder an...
``` String s = "Hello world I am here"; StringBuilder sb = new StringBuilder(); for (char c : s.toCharArray()) { if (c != ' ') { sb.append(c); } } System.out.println(sb.toString()); ```
45,049,172
I am getting the solution is as follows ``` class StringCheck { public static void main (String[] args) { String str="Hello world I am here"; String r; System.out.println(str); r = str.replaceAll(" ",""); System.out.println(r); } } OUTPUT: HelloworldIamher...
2017/07/12
[ "https://Stackoverflow.com/questions/45049172", "https://Stackoverflow.com", "https://Stackoverflow.com/users/8125854/" ]
What I understood from your question is you don't want to use `str.replaceAll()` function. So possible alternative is following. Please refer more details [Removing whitespace from strings in Java](https://stackoverflow.com/q/5455794/3213745) ``` import java.util.*; public class StringCheck { public static void m...
Iterate each char in `str`. =========================== If it is not equal ' ', append it to your result string `r`. But why would you want to do it without using library functions?
45,049,172
I am getting the solution is as follows ``` class StringCheck { public static void main (String[] args) { String str="Hello world I am here"; String r; System.out.println(str); r = str.replaceAll(" ",""); System.out.println(r); } } OUTPUT: HelloworldIamher...
2017/07/12
[ "https://Stackoverflow.com/questions/45049172", "https://Stackoverflow.com", "https://Stackoverflow.com/users/8125854/" ]
Iterate each char in `str`. =========================== If it is not equal ' ', append it to your result string `r`. But why would you want to do it without using library functions?
``` String s = "Hello world I am here"; StringBuilder sb = new StringBuilder(); for (char c : s.toCharArray()) { if (c != ' ') { sb.append(c); } } System.out.println(sb.toString()); ```
45,049,172
I am getting the solution is as follows ``` class StringCheck { public static void main (String[] args) { String str="Hello world I am here"; String r; System.out.println(str); r = str.replaceAll(" ",""); System.out.println(r); } } OUTPUT: HelloworldIamher...
2017/07/12
[ "https://Stackoverflow.com/questions/45049172", "https://Stackoverflow.com", "https://Stackoverflow.com/users/8125854/" ]
What I understood from your question is you don't want to use `str.replaceAll()` function. So possible alternative is following. Please refer more details [Removing whitespace from strings in Java](https://stackoverflow.com/q/5455794/3213745) ``` import java.util.*; public class StringCheck { public static void m...
``` String s = "Hello world I am here"; StringBuilder sb = new StringBuilder(); for (char c : s.toCharArray()) { if (c != ' ') { sb.append(c); } } System.out.println(sb.toString()); ```
45,049,172
I am getting the solution is as follows ``` class StringCheck { public static void main (String[] args) { String str="Hello world I am here"; String r; System.out.println(str); r = str.replaceAll(" ",""); System.out.println(r); } } OUTPUT: HelloworldIamher...
2017/07/12
[ "https://Stackoverflow.com/questions/45049172", "https://Stackoverflow.com", "https://Stackoverflow.com/users/8125854/" ]
What I understood from your question is you don't want to use `str.replaceAll()` function. So possible alternative is following. Please refer more details [Removing whitespace from strings in Java](https://stackoverflow.com/q/5455794/3213745) ``` import java.util.*; public class StringCheck { public static void m...
``` public class Removespaces { public static void main(String[] args) { Scanner sc = new Scanner(System.in); String s = sc.nextLine(); char[] ch = s.toCharArray(); String s1 = ""; for(int i=0;i<ch.length;i++){ if(s.charAt(i)==' ') { continue; }e...
45,049,172
I am getting the solution is as follows ``` class StringCheck { public static void main (String[] args) { String str="Hello world I am here"; String r; System.out.println(str); r = str.replaceAll(" ",""); System.out.println(r); } } OUTPUT: HelloworldIamher...
2017/07/12
[ "https://Stackoverflow.com/questions/45049172", "https://Stackoverflow.com", "https://Stackoverflow.com/users/8125854/" ]
What I understood from your question is you don't want to use `str.replaceAll()` function. So possible alternative is following. Please refer more details [Removing whitespace from strings in Java](https://stackoverflow.com/q/5455794/3213745) ``` import java.util.*; public class StringCheck { public static void m...
Hey I have solution for that question you can have this way. I didn’t use in-build function public class RemoveSpace { ``` public static void main(String[] args) { String str="Abd is a good guy"; char[] a=str.toCharArray(); System.out.println(a); int size=a.length; for(int i=0; i<size;i++) {...
45,049,172
I am getting the solution is as follows ``` class StringCheck { public static void main (String[] args) { String str="Hello world I am here"; String r; System.out.println(str); r = str.replaceAll(" ",""); System.out.println(r); } } OUTPUT: HelloworldIamher...
2017/07/12
[ "https://Stackoverflow.com/questions/45049172", "https://Stackoverflow.com", "https://Stackoverflow.com/users/8125854/" ]
``` public class Removespaces { public static void main(String[] args) { Scanner sc = new Scanner(System.in); String s = sc.nextLine(); char[] ch = s.toCharArray(); String s1 = ""; for(int i=0;i<ch.length;i++){ if(s.charAt(i)==' ') { continue; }e...
``` String s = "Hello world I am here"; StringBuilder sb = new StringBuilder(); for (char c : s.toCharArray()) { if (c != ' ') { sb.append(c); } } System.out.println(sb.toString()); ```
45,049,172
I am getting the solution is as follows ``` class StringCheck { public static void main (String[] args) { String str="Hello world I am here"; String r; System.out.println(str); r = str.replaceAll(" ",""); System.out.println(r); } } OUTPUT: HelloworldIamher...
2017/07/12
[ "https://Stackoverflow.com/questions/45049172", "https://Stackoverflow.com", "https://Stackoverflow.com/users/8125854/" ]
Hey I have solution for that question you can have this way. I didn’t use in-build function public class RemoveSpace { ``` public static void main(String[] args) { String str="Abd is a good guy"; char[] a=str.toCharArray(); System.out.println(a); int size=a.length; for(int i=0; i<size;i++) {...
``` String s = "Hello world I am here"; StringBuilder sb = new StringBuilder(); for (char c : s.toCharArray()) { if (c != ' ') { sb.append(c); } } System.out.println(sb.toString()); ```
59,633,645
I have a SQL statement set as a string. Whenever I execute the call in my application locally I am getting an error where it seems the SQL is not being built out properly and not delimited by comma between two different columns. I am wondering why this is happening. There is an Iif statement with an expression in betwe...
2020/01/07
[ "https://Stackoverflow.com/questions/59633645", "https://Stackoverflow.com", "https://Stackoverflow.com/users/3375417/" ]
You have to return a `Future` as yours is an async function ``` Future<String> getName() async { final prefs = await SharedPreferences.getInstance(); return prefs.getString('name'); } ```
Okay, I now figured out what I was missing: **my function is async!** And as it turns out, **async function in Dart have a return type of `Future`.**
60,271,510
in sql query this commando do exactly i wanted: ``` SELECT v.id, ( SELECT sv.status_id FROM status_viagem sv WHERE sv.viagem_id = v.id ORDER BY sv.created_at DESC LIMIT 1 ) AS status_id FROM viagens v ``` Here is the sql results: [![enter image description here](https://...
2020/02/17
[ "https://Stackoverflow.com/questions/60271510", "https://Stackoverflow.com", "https://Stackoverflow.com/users/4055693/" ]
There are many ways to query in laravel. I have created a [test project](https://bitbucket.org/BagusTesa/sto-answers/src/4358ed4a9b884afdd8da503af70e97cdb39dc79b/?at=answer%2F60271510) for you to try. The gist are: 1. Eloquent ORM =============== Eloquent ORM is Laravel's magic which have [some limitations in eager l...
I am not sure what viagens and viagem represent, but I think one of the relationships has to be belongsToMany() and the other hasMany(). then after you set relationships correctly, you can use Eloquent like this : ``` $status_id = Viagem::with('status')->orderBy('created_at', 'desc')->first()->pluck('status_id'); ``...
60,271,510
in sql query this commando do exactly i wanted: ``` SELECT v.id, ( SELECT sv.status_id FROM status_viagem sv WHERE sv.viagem_id = v.id ORDER BY sv.created_at DESC LIMIT 1 ) AS status_id FROM viagens v ``` Here is the sql results: [![enter image description here](https://...
2020/02/17
[ "https://Stackoverflow.com/questions/60271510", "https://Stackoverflow.com", "https://Stackoverflow.com/users/4055693/" ]
There are many ways to query in laravel. I have created a [test project](https://bitbucket.org/BagusTesa/sto-answers/src/4358ed4a9b884afdd8da503af70e97cdb39dc79b/?at=answer%2F60271510) for you to try. The gist are: 1. Eloquent ORM =============== Eloquent ORM is Laravel's magic which have [some limitations in eager l...
Try this. ``` $status_id = Viagem::join('status','viagem.id','status_viagem.viagem_id') ->select('viagem.id','status_viagem.status_id') ->get(); ```
4,218,687
I have a relative positioned div with many absolute positioned img in it: ``` <div class="container"> <img /> <img /> </div> .container{ position: relative; border: 4px solid #ccc; } .container img { position: absolute; } ``` What am I trying to achieve? I'm using a [jquery image fader plugin]...
2010/11/18
[ "https://Stackoverflow.com/questions/4218687", "https://Stackoverflow.com", "https://Stackoverflow.com/users/400861/" ]
Absolutely positioned elements are taken out of normal flow and are not used to compute the height of other elements. You have to set the height explicitly. Ideally by knowing the size of the images in advance and setting it in your stylesheet, or alternatively by measuring it with JavaScript. Another option would be...
The absolutely positioned imgs aren't conisdered part of the div for rendering purposes due to the absolute positioning. Consider using relative positioning or fixed min-height on the img or div.
46,741
Matthew 10:22 (DRB): > > And you shall be hated by all men for my name's sake: but **he** that shall persevere unto the end, he shall be saved. > > > Matthew 10:22 (KJV): > > 22. And ye shall be hated of all {cf15I men} for my name's sake: but **he** that endureth to the end shall be saved. > > > To whom do...
2020/04/04
[ "https://hermeneutics.stackexchange.com/questions/46741", "https://hermeneutics.stackexchange.com", "https://hermeneutics.stackexchange.com/users/33285/" ]
Matt 10:22 has a very Koine Greek construction that uses a stand alone article (ὁ = ho) as an indefinite pronoun. Thus, a better translation is given by several modern versions such as: * NIV: You will be hated by everyone because of me, but **the one** who stands firm to the end will be saved. * ESV: and you will be ...
The Christian disciple of Jesus in every age. "You" here seems indeed to be directed to those in His direct hearing, but He seems to intend to include not only Christians persecuted in that first generation, but all Christians. Consider Matthew 24 for example: > > Matthew 24:3-13 (DRB) And when he was sitting on mo...
459,991
At work we have a large website - I "own" three directories. I am wondering if I can have only two sites in the site manager in Filezilla, but after supplying a password, it asks which remote directory I wish to go to, versus having to navigate down from the root, or have 6 identical sites (dev and live) in the manager...
2012/08/09
[ "https://superuser.com/questions/459991", "https://superuser.com", "https://superuser.com/users/137341/" ]
In trying, and failing, to find a way to cause such a prompt I kept overlooking that you already have this available. Just create your two sites, and then after connecting enter the desired directory into the "Remote site:" field that appears above the directory tree/file listing. It's functionally identical to the pr...
Create a `symlink` like ``` ln -s /path/to/real/directory /where/to/make/link ```
459,991
At work we have a large website - I "own" three directories. I am wondering if I can have only two sites in the site manager in Filezilla, but after supplying a password, it asks which remote directory I wish to go to, versus having to navigate down from the root, or have 6 identical sites (dev and live) in the manager...
2012/08/09
[ "https://superuser.com/questions/459991", "https://superuser.com", "https://superuser.com/users/137341/" ]
In trying, and failing, to find a way to cause such a prompt I kept overlooking that you already have this available. Just create your two sites, and then after connecting enter the desired directory into the "Remote site:" field that appears above the directory tree/file listing. It's functionally identical to the pr...
I find that using the FileZilla Site Manager I like to set "Default remote directory" under the advanced settings. You can add all the different permutations of directories on the server as separate sites. ![FileZilla Site Manager Default remote directory](https://i.stack.imgur.com/BSC6z.png) Your six sites need not ...
12,091,767
For example, on my Xperia mini phone, * [Build.MODEL](http://developer.android.com/reference/android/os/Build.html#MODEL) returns **'st15i'** * [Build.MANUFACTURER](http://developer.android.com/reference/android/os/Build.html#MANUFACTURER) returns **'Sony Ericsson'** but I want to get **'Sony Ericsson xperia mini'** ...
2012/08/23
[ "https://Stackoverflow.com/questions/12091767", "https://Stackoverflow.com", "https://Stackoverflow.com/users/848655/" ]
For that particular phone (and perhaps for many others SonyEricsson phones) you can get the real device name only by reading system property you have mentioned: `ro.semc.product.model` Since `android.os.SystemProperties` class is hidden from public API you will need to use a reflection (or exec `getprop ro.semc.produc...
ST15I *is* the model code for the XPeria mini. So maybe you shoud use `Build.DEVICE`, ord build a correspondance base for the various codes to their names.
33,202,966
This is a simplified version of a problem I am having. I'm trying to create an an array of ProduceItem inside of class database. I have outlined the warnings and problems I've encountered in my attempts. Thank you for your help in advance. ``` import javax.swing.*; import java.awt.*; public class Test{ public stat...
2015/10/18
[ "https://Stackoverflow.com/questions/33202966", "https://Stackoverflow.com", "https://Stackoverflow.com/users/5460495/" ]
When you redirect the output of `ls` to the file `c`, it's a chicken and egg problem: If `c` would not be created upfront, that would mean the shell would need to store the output in a buffer and (in the end) write that buffer to the file. Since this is not the best approach in many cases (because of memory managemen...
The file is created (or truncated) so the output of `ls` can be redirected to it. Hence, `ls` sees the file.
33,202,966
This is a simplified version of a problem I am having. I'm trying to create an an array of ProduceItem inside of class database. I have outlined the warnings and problems I've encountered in my attempts. Thank you for your help in advance. ``` import javax.swing.*; import java.awt.*; public class Test{ public stat...
2015/10/18
[ "https://Stackoverflow.com/questions/33202966", "https://Stackoverflow.com", "https://Stackoverflow.com/users/5460495/" ]
The redirection of standard output for the command ``` ls > c ``` Creates the file handle for `c` before the command `ls` executes. The `touch b` (and visibility of `b` are a red-herring). For example, ``` mkdir t ; cd t ; ls > a ; cat a ``` Will display `a` (**because** the `>` creates the `a` before `ls` is [`e...
The file is created (or truncated) so the output of `ls` can be redirected to it. Hence, `ls` sees the file.