qid
int64
1
74.7M
question
stringlengths
0
58.3k
date
stringlengths
10
10
metadata
list
response_j
stringlengths
2
48.3k
response_k
stringlengths
2
40.5k
54,155
A long-time client has asked us to help screen their work machines for pornography. They're worried about liability if sensitive materials were found. Their main concerns (for obvious reasons) are video, audio, and image files. If possible, they'd also like to scan text-based documents for inappropriate content. They h...
2011/03/03
[ "https://softwareengineering.stackexchange.com/questions/54155", "https://softwareengineering.stackexchange.com", "https://softwareengineering.stackexchange.com/users/17429/" ]
You can do this with 90% [Headology](http://wiki.lspace.org/mediawiki/index.php/Headology), 10% software. Firstly, quietly scan employees computers, build a database of files and sizes for each employee. Then leak a memo that all PC's will be scanned for questionable content, i.e. The bosses have a [Shazam](http://it...
I just wanted to comment, but only have 1 rep, so I can't. In the case of Gravatar, you could add a function to filter out from a list of clean sites in internet cache locations. I.E. Gravatar and other sites you don't want false positives from. You could also filter out things like the desktop wallpaper. If they are ...
54,155
A long-time client has asked us to help screen their work machines for pornography. They're worried about liability if sensitive materials were found. Their main concerns (for obvious reasons) are video, audio, and image files. If possible, they'd also like to scan text-based documents for inappropriate content. They h...
2011/03/03
[ "https://softwareengineering.stackexchange.com/questions/54155", "https://softwareengineering.stackexchange.com", "https://softwareengineering.stackexchange.com/users/17429/" ]
> > * Is this ethical? > > > Depends on the implementation and reasonable expectations of the employees. For example, if your software scans any machine *connected to* the network, then there's an additional requirement that infra needs to prevent unauthorized machines from plugging in. (Maybe that should be obvio...
Image and content analysis to determine the differences between a tasteful photograph of a person, a swimsuit photograph, a nude photograph, depictions of pornography... as far as I know is nowhere near sophisticated enough to do in software alone. Fortunately crowdsourcing should be useful here, as @ammoQ suggested i...
54,155
A long-time client has asked us to help screen their work machines for pornography. They're worried about liability if sensitive materials were found. Their main concerns (for obvious reasons) are video, audio, and image files. If possible, they'd also like to scan text-based documents for inappropriate content. They h...
2011/03/03
[ "https://softwareengineering.stackexchange.com/questions/54155", "https://softwareengineering.stackexchange.com", "https://softwareengineering.stackexchange.com/users/17429/" ]
About legal aspects, in France: The boss owns the computers and the internet connection: He can do whatever pleases him. BUT, employee privacy cannot be violated. If a directory on the computer is labelled PERSONAL, the boss is not allowed to scan it. The only way to bypass that is to get elements of evidence that e...
Everyone's computer operating system was probably installed from a disk image. 1. start with the disk image and get a list of files you probably don't need to scan. 2. get a list of all the other files on each PC. 3. pull the actual files from 10-20 random machines and use as a test bed 4. search for items in a profa...
61,041,421
I need to split the String by `numbers` and `.` symbol. My String is ``` "Nagapur82. Nanavade83. Nandur84. Nandurkichi Wadi85." ``` and I want Array of like ``` [ "Nagapur", "Nanavade", "Nandur", "Nandurkichi Wadi"] ```
2020/04/05
[ "https://Stackoverflow.com/questions/61041421", "https://Stackoverflow.com", "https://Stackoverflow.com/users/12134603/" ]
Instead of getting `HttpContext`, get `IHtttpContextAccessor` service from DI container (it does not make any sense to pass the `HttpContext` from the startup class): ``` services.AddHttpContextAccessor(); services.AddTransient<RequestInfo>(sp => { var context = sp.GetService<IHttpContextAccessor>(); return ne...
I've got this working by following [Microsoft Docs - use HttpContext from custom components](https://learn.microsoft.com/en-us/aspnet/core/fundamentals/http-context?view=aspnetcore-3.1) to inject directly without creating the instance in ConfigureServices. > > The dependency injection container supplies the IHttpCont...
61,041,421
I need to split the String by `numbers` and `.` symbol. My String is ``` "Nagapur82. Nanavade83. Nandur84. Nandurkichi Wadi85." ``` and I want Array of like ``` [ "Nagapur", "Nanavade", "Nandur", "Nandurkichi Wadi"] ```
2020/04/05
[ "https://Stackoverflow.com/questions/61041421", "https://Stackoverflow.com", "https://Stackoverflow.com/users/12134603/" ]
Instead of getting `HttpContext`, get `IHtttpContextAccessor` service from DI container (it does not make any sense to pass the `HttpContext` from the startup class): ``` services.AddHttpContextAccessor(); services.AddTransient<RequestInfo>(sp => { var context = sp.GetService<IHttpContextAccessor>(); return ne...
You just need to register all the dependencies before they are needed as shown below: ``` services.AddHttpContextAccessor(); services.AddTransient<RequestInfo>(); ``` Inside the `RequestInfo` class you can ask for `IHttpContextAccessor` ``` public class RequestInfo { private readonly IHttpContextAccessor _httpC...
41,926
After reviewing several texts about the second law of thermodynamics and the concept of entropy, from a systemic point of view, it seems to me that entropy is only a circular reasoning concept. Thermodynamics raised from the study of gases, and gases can't exemplify all types of particles behavior. Gas particles only ...
2017/04/09
[ "https://philosophy.stackexchange.com/questions/41926", "https://philosophy.stackexchange.com", "https://philosophy.stackexchange.com/users/23407/" ]
The 2nd law of thermodynamics is an assertion. It is a statement that someone made that they believe to be true. It is also an assertion that is backed by an enormous body of evidence so vast that the prevailing belief is that no counter example exists. We have never observed a closed system in which entropy does not i...
Thanks for your answers, I think I have the answer. The problem was trying to find a relation of proportionality between entropy and any of the presented features. But I realize now that entropy sustains the 2nd law, and viceversa. In simple words, there is some physically measurable quantity (entropy) that always inc...
20,763,508
What are the best methods to `vertically-align` something relative to it's elements dimensions. As of right now, I'm only aware of `vertical-align:middle;` working well inside of a `<tr>`. Are there any other methodologies that I'm overlooking that can work to procedurally accomplish this goal?
2013/12/24
[ "https://Stackoverflow.com/questions/20763508", "https://Stackoverflow.com", "https://Stackoverflow.com/users/3117081/" ]
Here are 3 very good techniques for vertically centering a child within a container - even when you don't know the height of the child element. The first 2 come from [this CSS-tricks article](http://css-tricks.com/centering-in-the-unknown/) **Markup (for all methods):** ``` <div class="block"> <div class="ce...
A great place for you to start is this [article](http://css-tricks.com/what-is-vertical-align/) by CSS Tricks. It goes over every value that `vertical-align` can have and the different uses of each in a clear concise way. Here are the options: ``` vertical-align: baseline /* keyword values */ vertical-align: sub...
20,763,508
What are the best methods to `vertically-align` something relative to it's elements dimensions. As of right now, I'm only aware of `vertical-align:middle;` working well inside of a `<tr>`. Are there any other methodologies that I'm overlooking that can work to procedurally accomplish this goal?
2013/12/24
[ "https://Stackoverflow.com/questions/20763508", "https://Stackoverflow.com", "https://Stackoverflow.com/users/3117081/" ]
Here are 3 very good techniques for vertically centering a child within a container - even when you don't know the height of the child element. The first 2 come from [this CSS-tricks article](http://css-tricks.com/centering-in-the-unknown/) **Markup (for all methods):** ``` <div class="block"> <div class="ce...
with table you can use ``` <table> <tr> <td valign="middle"></td> </tr> </table> ``` or css ``` td{ vertical-align:middle; } ``` If you want css vertical align is middle for div use display: table-cell; and display: table; ``` #abc{ font:Verdana, Geneva, sans-serif; font-size:18px; ...
20,763,508
What are the best methods to `vertically-align` something relative to it's elements dimensions. As of right now, I'm only aware of `vertical-align:middle;` working well inside of a `<tr>`. Are there any other methodologies that I'm overlooking that can work to procedurally accomplish this goal?
2013/12/24
[ "https://Stackoverflow.com/questions/20763508", "https://Stackoverflow.com", "https://Stackoverflow.com/users/3117081/" ]
Here are 3 very good techniques for vertically centering a child within a container - even when you don't know the height of the child element. The first 2 come from [this CSS-tricks article](http://css-tricks.com/centering-in-the-unknown/) **Markup (for all methods):** ``` <div class="block"> <div class="ce...
This might be a surprise to you, but `vertical-align` has been such a confusing thing that you might get tangled in it even for smallest of `divs` Here are some awesome resources to understand it : * [**Understanding vertical-align, or "How (Not) To Vertically Center Content**](http://phrogz.net/CSS/vertical-align/in...
20,763,508
What are the best methods to `vertically-align` something relative to it's elements dimensions. As of right now, I'm only aware of `vertical-align:middle;` working well inside of a `<tr>`. Are there any other methodologies that I'm overlooking that can work to procedurally accomplish this goal?
2013/12/24
[ "https://Stackoverflow.com/questions/20763508", "https://Stackoverflow.com", "https://Stackoverflow.com/users/3117081/" ]
Here are 3 very good techniques for vertically centering a child within a container - even when you don't know the height of the child element. The first 2 come from [this CSS-tricks article](http://css-tricks.com/centering-in-the-unknown/) **Markup (for all methods):** ``` <div class="block"> <div class="ce...
My favorite for modal centering is to use a combination of `position` and `translate`, as described here: <http://css-tricks.com/centering-percentage-widthheight-elements/> In summary: ``` .center { width: 50%; /* or whatever you want your width to be; defaults to 100% */ height: 50%; /* or whatever you want ...
24,939,678
Hi I have a dynamically generated list of items generated by php mysql. Below a content section there is a link basically "Load Related" link in this case the content is a bunch of thumbnails. I dont want to load the thumbs with the list when the page loads, instead I want to load them with Ajax using JQuery. The co...
2014/07/24
[ "https://Stackoverflow.com/questions/24939678", "https://Stackoverflow.com", "https://Stackoverflow.com/users/544774/" ]
Can you start from this? ``` $( 'a.related' ).bind( 'click', function( e ) { var url = $( this ).attr( 'href' ); var id = $( this ).attr( 'data-id' ); $( 'div#pimgs' + id ).load( url ); e.preventDefault(); } ); ``` In your dynamically generated `<a>`, put the numbers into `data-id` attribute ([ref]...
[**demo**](http://jsfiddle.net/p4q6c/1/) Don't use duplicate ID's. ``` $('a[class^="related"]').bind('click', function(e) { e.preventDefault(); var id = $(this).attr('class').split(' ').filter(function(v) { return v.indexOf('related') > -1; })[0]; var url = $(this).attr('href'); ...
5,399,821
I am a self-taught java programmer, so i don't know the proper way to do a great deal of things. I have written a few simple games (such as Asteroids, Snake, ect.) so i know how to do the basics. Now i am working on a more complicated game, a role-playing game with zombies. I started writing it without putting much th...
2011/03/23
[ "https://Stackoverflow.com/questions/5399821", "https://Stackoverflow.com", "https://Stackoverflow.com/users/672229/" ]
There is a reason frequent use of static fields is frowned upon, and that reason is that static fields are less flexible than non-static ones, because there can only be one copy of a static field, but a non-static field can hold a different value for each object instance. By using static fields, you are restricting yo...
There isn't a one answer that can be given. In general, "lots of global variables" is an anti-pattern - whoever doesn't need to know locations of everything shouldnt be able to - that way that part of your code can't screw it up. So take it case by case. You need a way to know locations of all objects? Have a class ca...
5,399,821
I am a self-taught java programmer, so i don't know the proper way to do a great deal of things. I have written a few simple games (such as Asteroids, Snake, ect.) so i know how to do the basics. Now i am working on a more complicated game, a role-playing game with zombies. I started writing it without putting much th...
2011/03/23
[ "https://Stackoverflow.com/questions/5399821", "https://Stackoverflow.com", "https://Stackoverflow.com/users/672229/" ]
There is a reason frequent use of static fields is frowned upon, and that reason is that static fields are less flexible than non-static ones, because there can only be one copy of a static field, but a non-static field can hold a different value for each object instance. By using static fields, you are restricting yo...
Honestly, I would do a thorough check of the class structure to see if there was a better design than making everything global. Using paradigms like [MVC](http://jordanhall.co.uk/programming/simple-explanation-of-model-view-controller-mvc-2206990/) can really simplify your code organization. I don't know what your spec...
48,084,971
I'm new to python, so bear with me on this one. I want to make a script that searches within all excel files in a specific folder, to see if they contain an '@' sign. If it finds a match it should write to a log.txt files with the name of the excel file. I don't have the name of the excel files in advance. So far I'm ...
2018/01/03
[ "https://Stackoverflow.com/questions/48084971", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1495850/" ]
You should read through [Pandas - Working with Text Data](https://pandas.pydata.org/pandas-docs/stable/text.html#testing-for-strings-that-match-or-contain-a-pattern) specifically the section on strings that match or contain a pattern. Unfortunately you cannot search a DataFrame with the string methods common to core P...
This an answer without using pandas ``` import logging LOG_FILENAME = r'file_output_location_path\log.txt' logging.basicConfig(filename=LOG_FILENAME, level=logging.WARNING, format='%(asctime)s %(message)s' ) source_folder = r'excel_file_folder_path' def co...
11,528,017
I am looking at using <http://code.google.com/p/libphonenumber/> for a well-established project. Today the project does not use Google's libraries for JavaScript, favoring jQuery, jQueryUI, requirejs, and so on. libphonenumber looks awesome ... except that the javascript version (svn co <http://libphonenumber.googleco...
2012/07/17
[ "https://Stackoverflow.com/questions/11528017", "https://Stackoverflow.com", "https://Stackoverflow.com/users/618148/" ]
You can also use my lib. <https://github.com/Gilshallem/phoneparser> Its only got one method but you can do a lot with it ``` parsePhone("12025550104"); result: { countryCode:1, areaCode:202, number:5550104, countryISOCode:"US" } ```
Here are two implementations of Google libphonenumber in JavaScript that have zero dependencies and are implemented in a single file. I've used Nathan Hammond's version without issue but it is not on NPM. Rui Marinho's version is on NPM. * <https://github.com/nathanhammond/libphonenumber> * <https://github.com/ruimari...
11,528,017
I am looking at using <http://code.google.com/p/libphonenumber/> for a well-established project. Today the project does not use Google's libraries for JavaScript, favoring jQuery, jQueryUI, requirejs, and so on. libphonenumber looks awesome ... except that the javascript version (svn co <http://libphonenumber.googleco...
2012/07/17
[ "https://Stackoverflow.com/questions/11528017", "https://Stackoverflow.com", "https://Stackoverflow.com/users/618148/" ]
You can also use my lib. <https://github.com/Gilshallem/phoneparser> Its only got one method but you can do a lot with it ``` parsePhone("12025550104"); result: { countryCode:1, areaCode:202, number:5550104, countryISOCode:"US" } ```
I just spent 2 days figuring this out. For now, anyway, you can download a minified version of libphonenumber-js from [here](https://cdnjs.cloudflare.com/ajax/libs/libphonenumber-js/1.4.2/libphonenumber-js.min.js) drop it in place, with the usual ``` <script type="text/javascript" language="javascript" src="/static/...
11,528,017
I am looking at using <http://code.google.com/p/libphonenumber/> for a well-established project. Today the project does not use Google's libraries for JavaScript, favoring jQuery, jQueryUI, requirejs, and so on. libphonenumber looks awesome ... except that the javascript version (svn co <http://libphonenumber.googleco...
2012/07/17
[ "https://Stackoverflow.com/questions/11528017", "https://Stackoverflow.com", "https://Stackoverflow.com/users/618148/" ]
I've got a [custom build](https://github.com/jackocnr/intl-tel-input/blob/master/build/js/utils.js) (currently 220KB) that I use for my [International Telephone Input](https://github.com/jackocnr/intl-tel-input) plugin, with plenty of helper functions exposed. Read [the source](https://github.com/jackocnr/intl-tel-inpu...
Here are two implementations of Google libphonenumber in JavaScript that have zero dependencies and are implemented in a single file. I've used Nathan Hammond's version without issue but it is not on NPM. Rui Marinho's version is on NPM. * <https://github.com/nathanhammond/libphonenumber> * <https://github.com/ruimari...
11,528,017
I am looking at using <http://code.google.com/p/libphonenumber/> for a well-established project. Today the project does not use Google's libraries for JavaScript, favoring jQuery, jQueryUI, requirejs, and so on. libphonenumber looks awesome ... except that the javascript version (svn co <http://libphonenumber.googleco...
2012/07/17
[ "https://Stackoverflow.com/questions/11528017", "https://Stackoverflow.com", "https://Stackoverflow.com/users/618148/" ]
I've got a [custom build](https://github.com/jackocnr/intl-tel-input/blob/master/build/js/utils.js) (currently 220KB) that I use for my [International Telephone Input](https://github.com/jackocnr/intl-tel-input) plugin, with plenty of helper functions exposed. Read [the source](https://github.com/jackocnr/intl-tel-inpu...
I just spent 2 days figuring this out. For now, anyway, you can download a minified version of libphonenumber-js from [here](https://cdnjs.cloudflare.com/ajax/libs/libphonenumber-js/1.4.2/libphonenumber-js.min.js) drop it in place, with the usual ``` <script type="text/javascript" language="javascript" src="/static/...
11,528,017
I am looking at using <http://code.google.com/p/libphonenumber/> for a well-established project. Today the project does not use Google's libraries for JavaScript, favoring jQuery, jQueryUI, requirejs, and so on. libphonenumber looks awesome ... except that the javascript version (svn co <http://libphonenumber.googleco...
2012/07/17
[ "https://Stackoverflow.com/questions/11528017", "https://Stackoverflow.com", "https://Stackoverflow.com/users/618148/" ]
Here are two implementations of Google libphonenumber in JavaScript that have zero dependencies and are implemented in a single file. I've used Nathan Hammond's version without issue but it is not on NPM. Rui Marinho's version is on NPM. * <https://github.com/nathanhammond/libphonenumber> * <https://github.com/ruimari...
I just spent 2 days figuring this out. For now, anyway, you can download a minified version of libphonenumber-js from [here](https://cdnjs.cloudflare.com/ajax/libs/libphonenumber-js/1.4.2/libphonenumber-js.min.js) drop it in place, with the usual ``` <script type="text/javascript" language="javascript" src="/static/...
51,667,393
I am using excel to input data for my test automation scripts and I am able read data from excel when i know the exact row and the column to read. The challenge which I am facing is when I have merged cells in the sheet. E.g. [Test data excel sample](https://i.stack.imgur.com/f1lDh.png) Here ScriptName and Iteration a...
2018/08/03
[ "https://Stackoverflow.com/questions/51667393", "https://Stackoverflow.com", "https://Stackoverflow.com/users/4466798/" ]
The below code will determine the number of merged cells in a column - colName, with begining row as startingRow ``` public int getNumOfMergedRows(String colName, int startingRow) { int rowsMerged = 0, col = 0; XSSFRow mergedRow = null; XSSFCell mergedCell = null; try { col = getExcelColNum(col...
I have a sample code which takes the fiel as input.It will count the values in 3rd column for all values and stores it in a map. It does so by counting the blank values in excel file and reset the counter at each valid value ``` import java.io.File; import java.io.FileInputStream; import java.io.FileNotFoundException;...
10,629,803
Currently I'm using an ArrayList to store a list of elements, whereby I will need to insert new elements at specific positions. There is a need for me to enter elements at a position larger than the current size. For e.g: ``` ArrayList<String> arr = new ArrayList<String>(); arr.add(3,"hi"); ``` Now I already know th...
2012/05/17
[ "https://Stackoverflow.com/questions/10629803", "https://Stackoverflow.com", "https://Stackoverflow.com/users/822377/" ]
Your requirements are contradictory: > > ... I will need to insert new elements at specific positions. > > > There is a need for me to enter elements at a position larger than the current size. > > > These imply that positions are stable; i.e. that an element at a given position remains at that position. > > ...
even you can use TreeMap for maintaining order of keys.
10,629,803
Currently I'm using an ArrayList to store a list of elements, whereby I will need to insert new elements at specific positions. There is a need for me to enter elements at a position larger than the current size. For e.g: ``` ArrayList<String> arr = new ArrayList<String>(); arr.add(3,"hi"); ``` Now I already know th...
2012/05/17
[ "https://Stackoverflow.com/questions/10629803", "https://Stackoverflow.com", "https://Stackoverflow.com/users/822377/" ]
even you can use TreeMap for maintaining order of keys.
Use Vector class to solve this issue. Vector vector = new Vector(); **vector.setSize(100);** vector.set(98, "a"); When "setSize" is set to 100 then all 100 elements gets initialized with null values.
10,629,803
Currently I'm using an ArrayList to store a list of elements, whereby I will need to insert new elements at specific positions. There is a need for me to enter elements at a position larger than the current size. For e.g: ``` ArrayList<String> arr = new ArrayList<String>(); arr.add(3,"hi"); ``` Now I already know th...
2012/05/17
[ "https://Stackoverflow.com/questions/10629803", "https://Stackoverflow.com", "https://Stackoverflow.com/users/822377/" ]
even you can use TreeMap for maintaining order of keys.
For those who are still dealing with this, you may do it like this. ``` Object[] array= new Object[10]; array[0]="1"; array[3]= "3"; array[2]="2"; array[7]="7"; List<Object> list= Arrays.asList(array); ``` But the thing is you need to identify the total size first, this should be just a comment but I do not have mu...
10,629,803
Currently I'm using an ArrayList to store a list of elements, whereby I will need to insert new elements at specific positions. There is a need for me to enter elements at a position larger than the current size. For e.g: ``` ArrayList<String> arr = new ArrayList<String>(); arr.add(3,"hi"); ``` Now I already know th...
2012/05/17
[ "https://Stackoverflow.com/questions/10629803", "https://Stackoverflow.com", "https://Stackoverflow.com/users/822377/" ]
Your requirements are contradictory: > > ... I will need to insert new elements at specific positions. > > > There is a need for me to enter elements at a position larger than the current size. > > > These imply that positions are stable; i.e. that an element at a given position remains at that position. > > ...
First and foremost, I would say use `Map` instead of List. I guess your problem can be solved in better way if you use `Map`. But in any case if you really want to do this with `Arraylist` ``` ArrayList<String> a = new ArrayList<String>(); //Create empty list a.addAll(Arrays.asList( new String[100])); ...
10,629,803
Currently I'm using an ArrayList to store a list of elements, whereby I will need to insert new elements at specific positions. There is a need for me to enter elements at a position larger than the current size. For e.g: ``` ArrayList<String> arr = new ArrayList<String>(); arr.add(3,"hi"); ``` Now I already know th...
2012/05/17
[ "https://Stackoverflow.com/questions/10629803", "https://Stackoverflow.com", "https://Stackoverflow.com/users/822377/" ]
First and foremost, I would say use `Map` instead of List. I guess your problem can be solved in better way if you use `Map`. But in any case if you really want to do this with `Arraylist` ``` ArrayList<String> a = new ArrayList<String>(); //Create empty list a.addAll(Arrays.asList( new String[100])); ...
Use Vector class to solve this issue. Vector vector = new Vector(); **vector.setSize(100);** vector.set(98, "a"); When "setSize" is set to 100 then all 100 elements gets initialized with null values.
10,629,803
Currently I'm using an ArrayList to store a list of elements, whereby I will need to insert new elements at specific positions. There is a need for me to enter elements at a position larger than the current size. For e.g: ``` ArrayList<String> arr = new ArrayList<String>(); arr.add(3,"hi"); ``` Now I already know th...
2012/05/17
[ "https://Stackoverflow.com/questions/10629803", "https://Stackoverflow.com", "https://Stackoverflow.com/users/822377/" ]
First and foremost, I would say use `Map` instead of List. I guess your problem can be solved in better way if you use `Map`. But in any case if you really want to do this with `Arraylist` ``` ArrayList<String> a = new ArrayList<String>(); //Create empty list a.addAll(Arrays.asList( new String[100])); ...
For those who are still dealing with this, you may do it like this. ``` Object[] array= new Object[10]; array[0]="1"; array[3]= "3"; array[2]="2"; array[7]="7"; List<Object> list= Arrays.asList(array); ``` But the thing is you need to identify the total size first, this should be just a comment but I do not have mu...
10,629,803
Currently I'm using an ArrayList to store a list of elements, whereby I will need to insert new elements at specific positions. There is a need for me to enter elements at a position larger than the current size. For e.g: ``` ArrayList<String> arr = new ArrayList<String>(); arr.add(3,"hi"); ``` Now I already know th...
2012/05/17
[ "https://Stackoverflow.com/questions/10629803", "https://Stackoverflow.com", "https://Stackoverflow.com/users/822377/" ]
Your requirements are contradictory: > > ... I will need to insert new elements at specific positions. > > > There is a need for me to enter elements at a position larger than the current size. > > > These imply that positions are stable; i.e. that an element at a given position remains at that position. > > ...
Use Vector class to solve this issue. Vector vector = new Vector(); **vector.setSize(100);** vector.set(98, "a"); When "setSize" is set to 100 then all 100 elements gets initialized with null values.
10,629,803
Currently I'm using an ArrayList to store a list of elements, whereby I will need to insert new elements at specific positions. There is a need for me to enter elements at a position larger than the current size. For e.g: ``` ArrayList<String> arr = new ArrayList<String>(); arr.add(3,"hi"); ``` Now I already know th...
2012/05/17
[ "https://Stackoverflow.com/questions/10629803", "https://Stackoverflow.com", "https://Stackoverflow.com/users/822377/" ]
Your requirements are contradictory: > > ... I will need to insert new elements at specific positions. > > > There is a need for me to enter elements at a position larger than the current size. > > > These imply that positions are stable; i.e. that an element at a given position remains at that position. > > ...
For those who are still dealing with this, you may do it like this. ``` Object[] array= new Object[10]; array[0]="1"; array[3]= "3"; array[2]="2"; array[7]="7"; List<Object> list= Arrays.asList(array); ``` But the thing is you need to identify the total size first, this should be just a comment but I do not have mu...
84,038
The Update Manager recently started itself and found two updates. I can tell by the icon in the launcher. The icon has a (2) on it and a little white arrow saying the application is running. I can also see the update-manager process in a 'ps -A' list. Alt-Tab also shows the Update Manager. The problem is I can't get U...
2011/11/30
[ "https://askubuntu.com/questions/84038", "https://askubuntu.com", "https://askubuntu.com/users/26562/" ]
I have the same problem. I didn't find this specific issue on launchpad either. For me, even though the update manager doesn't completely open, it still can be closed from the "x" on the top right panel or ctrl+q. Once closed it reopens fine.
I have this problem with libreoffice. You can use 'super + w'. You will get all the window on screen, click the window you want.
84,038
The Update Manager recently started itself and found two updates. I can tell by the icon in the launcher. The icon has a (2) on it and a little white arrow saying the application is running. I can also see the update-manager process in a 'ps -A' list. Alt-Tab also shows the Update Manager. The problem is I can't get U...
2011/11/30
[ "https://askubuntu.com/questions/84038", "https://askubuntu.com", "https://askubuntu.com/users/26562/" ]
I have the same problem. I didn't find this specific issue on launchpad either. For me, even though the update manager doesn't completely open, it still can be closed from the "x" on the top right panel or ctrl+q. Once closed it reopens fine.
This is a bug with Unity, it seems to happen with LibreOffice too. I don't think there is any fix yet, Unity is still being worked on. Link: <https://bugs.launchpad.net/ubuntu/+source/unity/+bug/942222> You can just update manually using a terminal by typing these in sequence: ``` sudo apt-get update sudo apt-get upg...
84,038
The Update Manager recently started itself and found two updates. I can tell by the icon in the launcher. The icon has a (2) on it and a little white arrow saying the application is running. I can also see the update-manager process in a 'ps -A' list. Alt-Tab also shows the Update Manager. The problem is I can't get U...
2011/11/30
[ "https://askubuntu.com/questions/84038", "https://askubuntu.com", "https://askubuntu.com/users/26562/" ]
I have the same problem. I didn't find this specific issue on launchpad either. For me, even though the update manager doesn't completely open, it still can be closed from the "x" on the top right panel or ctrl+q. Once closed it reopens fine.
I've seen scenarios where application windows end up outside of the screen area. Sometimes its caused by having windows placed on secondary screens then disconnecting the screen. Leaving the application "unreachable" * Go to the desktop that seems to have the application running. * Make sure the application is selecte...
84,038
The Update Manager recently started itself and found two updates. I can tell by the icon in the launcher. The icon has a (2) on it and a little white arrow saying the application is running. I can also see the update-manager process in a 'ps -A' list. Alt-Tab also shows the Update Manager. The problem is I can't get U...
2011/11/30
[ "https://askubuntu.com/questions/84038", "https://askubuntu.com", "https://askubuntu.com/users/26562/" ]
I have this problem with libreoffice. You can use 'super + w'. You will get all the window on screen, click the window you want.
I've seen scenarios where application windows end up outside of the screen area. Sometimes its caused by having windows placed on secondary screens then disconnecting the screen. Leaving the application "unreachable" * Go to the desktop that seems to have the application running. * Make sure the application is selecte...
84,038
The Update Manager recently started itself and found two updates. I can tell by the icon in the launcher. The icon has a (2) on it and a little white arrow saying the application is running. I can also see the update-manager process in a 'ps -A' list. Alt-Tab also shows the Update Manager. The problem is I can't get U...
2011/11/30
[ "https://askubuntu.com/questions/84038", "https://askubuntu.com", "https://askubuntu.com/users/26562/" ]
This is a bug with Unity, it seems to happen with LibreOffice too. I don't think there is any fix yet, Unity is still being worked on. Link: <https://bugs.launchpad.net/ubuntu/+source/unity/+bug/942222> You can just update manually using a terminal by typing these in sequence: ``` sudo apt-get update sudo apt-get upg...
I've seen scenarios where application windows end up outside of the screen area. Sometimes its caused by having windows placed on secondary screens then disconnecting the screen. Leaving the application "unreachable" * Go to the desktop that seems to have the application running. * Make sure the application is selecte...
16,245,508
Here's my code so far, ``` $('label').click(function () { if ($('label input').is(':checked')) { $(this).addClass('checked'); $('.donate-now label').not(this).removeClass('checked'); var donateAmount = $(".checked input").val(); $('p').append(donateAmount); ...
2013/04/26
[ "https://Stackoverflow.com/questions/16245508", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1229113/" ]
Try changing your selector to: ``` $('label input').click(function () { .... }); ``` <http://jsfiddle.net/YB8UW/18/> Your problem is that you are clicking the label AND radio when you click on the radio. Since you are clicking the child element, the event fires twice. If you focus the selector in a little more and ...
Instead of append, use: ``` $('p').html(donateAmount); ``` Append will put a new element in that `<p>` element everytime, rather than replacing the contents of it.
16,245,508
Here's my code so far, ``` $('label').click(function () { if ($('label input').is(':checked')) { $(this).addClass('checked'); $('.donate-now label').not(this).removeClass('checked'); var donateAmount = $(".checked input").val(); $('p').append(donateAmount); ...
2013/04/26
[ "https://Stackoverflow.com/questions/16245508", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1229113/" ]
Instead of append, use: ``` $('p').html(donateAmount); ``` Append will put a new element in that `<p>` element everytime, rather than replacing the contents of it.
You should `.empty()` the container before you append it. :) <http://jsfiddle.net/droppedonjapan/YB8UW/29/> Why your event is being fired twice, I'm not 100% sure, but I think it may be the way the labels' click event goes off. I'm pretty sure it's delegated to your radio input, which then triggers another label clic...
16,245,508
Here's my code so far, ``` $('label').click(function () { if ($('label input').is(':checked')) { $(this).addClass('checked'); $('.donate-now label').not(this).removeClass('checked'); var donateAmount = $(".checked input").val(); $('p').append(donateAmount); ...
2013/04/26
[ "https://Stackoverflow.com/questions/16245508", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1229113/" ]
Instead of append, use: ``` $('p').html(donateAmount); ``` Append will put a new element in that `<p>` element everytime, rather than replacing the contents of it.
you must try `.clone()[0].outerHTML` before append to parent element
16,245,508
Here's my code so far, ``` $('label').click(function () { if ($('label input').is(':checked')) { $(this).addClass('checked'); $('.donate-now label').not(this).removeClass('checked'); var donateAmount = $(".checked input").val(); $('p').append(donateAmount); ...
2013/04/26
[ "https://Stackoverflow.com/questions/16245508", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1229113/" ]
Try changing your selector to: ``` $('label input').click(function () { .... }); ``` <http://jsfiddle.net/YB8UW/18/> Your problem is that you are clicking the label AND radio when you click on the radio. Since you are clicking the child element, the event fires twice. If you focus the selector in a little more and ...
You should `.empty()` the container before you append it. :) <http://jsfiddle.net/droppedonjapan/YB8UW/29/> Why your event is being fired twice, I'm not 100% sure, but I think it may be the way the labels' click event goes off. I'm pretty sure it's delegated to your radio input, which then triggers another label clic...
16,245,508
Here's my code so far, ``` $('label').click(function () { if ($('label input').is(':checked')) { $(this).addClass('checked'); $('.donate-now label').not(this).removeClass('checked'); var donateAmount = $(".checked input").val(); $('p').append(donateAmount); ...
2013/04/26
[ "https://Stackoverflow.com/questions/16245508", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1229113/" ]
Try changing your selector to: ``` $('label input').click(function () { .... }); ``` <http://jsfiddle.net/YB8UW/18/> Your problem is that you are clicking the label AND radio when you click on the radio. Since you are clicking the child element, the event fires twice. If you focus the selector in a little more and ...
you must try `.clone()[0].outerHTML` before append to parent element
28,492,530
How do I make it so that if a response has been sent back, then no more responses should be sent? **Actually, the issue is that if a response is sent back, then express (or nodejs) shouldn't continue running through the rest of the code.** I've tried doing next() but terminal throws the error of next() being undefined...
2015/02/13
[ "https://Stackoverflow.com/questions/28492530", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1883614/" ]
Check the configuration file in /etc/apache2/sites-available/your\_site\_name.conf. If you have a Redirect "/" "<https://your_site_name.whatever>", it might be that the redirect is stripping the forward slash from the URL there. If this is the problem, just add a trailing forward slash to the redirect url. This is what...
Scour your Apache configuration for Redirect\* or Rewrite\* rules; also all .htaccess files in the DocumentRoot. If that doesn't turn up anything, examine the PHP application you're using.
52,905,718
I'm trying to build a RecyclerView filled with a card view items. For each item I need 2 small images that I load from URL. Everything works fine only if I load sample image from Picasso website ([http://i.imgur.com/DvpvklR.png](https://i.imgur.com/DvpvklR.png)). Every other picture I try to load doesn't show up. Her...
2018/10/20
[ "https://Stackoverflow.com/questions/52905718", "https://Stackoverflow.com", "https://Stackoverflow.com/users/10196657/" ]
For loops in R all run in the same scope, which means a variable defined in the loop will be shared by all iterations. This is an issue if you create a function in each loop iteration that accesses this variable, and assume that it'll be unique for each iteration. Here's a simple demo: ``` counter <- 0; funcs <- lis...
I've found a workaround but I guess it should be done in a more efficient way. It looks like this problem is related to lazy evaluation, so only the last object created has its observeEvent working. Thus, I've decided to create, for each iteration of the loop new variables using eval: ``` library(shiny) # Define the...
159,934
I have Yosemite. I am considering installing OS X server 4.0. According to [developer.apple.com](https://developer.apple.com/library/ios/documentation/IDEs/Conceptual/xcode_guide-continuous_integration/200-Adopting_a_Continuous_Integration_Workflow/adopt_continuous_integration.html#//apple_ref/doc/uid/TP40013292-CH3-SW...
2014/12/08
[ "https://apple.stackexchange.com/questions/159934", "https://apple.stackexchange.com", "https://apple.stackexchange.com/users/14731/" ]
OS X Server 4 is an application. (.app) that is installed over the OS. It won't require you to format the entire drive to install it. It will just add the needed features to take advantage of the Server.app suite.
OS X Server is primarily an interface. OS X contains (almost - mail and databases are the main exceptions) all the software you will need, so if you want to set things up from the command line it won't make any difference. However, balance your time to work out the command line setup against the $20 Server.app costs. ...
332,242
![exhibit A](https://i.stack.imgur.com/3WORAl.jpg) ![exhibit B](https://i.stack.imgur.com/XKdtzl.jpg) This showed up while I was playing Pokémon Go and I walked into the cloud, but nothing happened. I walked away and came back, still nothing. I think it might be a glitch. Has anybody out there seen this before and kn...
2018/05/12
[ "https://gaming.stackexchange.com/questions/332242", "https://gaming.stackexchange.com", "https://gaming.stackexchange.com/users/211530/" ]
Yes, I’ve seen this before. It’s a bug. That is the animation of a gym under attack, despite there being no gym at the center of it. I’m not sure if you got this the same way as me, but I frequently get this visual bug when I check on one of my Pokémon that is currently defending a faraway gym (one that is not within ...
It is a known bug. it happens because you feed or looked at your pokemon in a gym you are defending and someone attack it in the same time.
19,826
Is there a version of Snow White where her name is a longer description? [TVTropes says](https://tvtropes.org/Main/NameThatUnfoldsLikeLotusBlossom): > > Snow White. Her real name is "Lips Red as Blood, Hair Black as Ebony, Skin White as Snow" based on the wish her mother made. Everyone just calls her Snow White beca...
2021/10/24
[ "https://literature.stackexchange.com/questions/19826", "https://literature.stackexchange.com", "https://literature.stackexchange.com/users/566/" ]
Here’s the start of the story ‘Sneewittchen’ as given by the brothers Grimm: > > Es war einmal mitten im Winter und die Schneeflocken fielen wie Federn vom Himmel, da saß eine schöne Königin an einem Fenster, das hatte einen Rahmen von schwarzem Edenholz, und nähte. Und wie sie so nähte und nach dem Schnee aufblickte...
There are uses of the name "Snow White" in longer names, such as the Italian [Snow-White-Fire-Red](https://www.surlalunefairytales.com/book.php?id=110&tale=3437), or the Norwegian Snow-white and Rosy-red (in [The Twelve Wild Ducks](https://www.surlalunefairytales.com/s-z/six-swans/stories/twelvewilducks.html)). However...
11,112,515
I am messing around with Session in my webapp at the moment and I noticed that whenever I restart the development server (the built-in server that came with Django), the session does not reset itself. It carries over eventhough I have restarted the server over and over again. Where can I set it so that whenever I res...
2012/06/20
[ "https://Stackoverflow.com/questions/11112515", "https://Stackoverflow.com", "https://Stackoverflow.com/users/599378/" ]
Couldn't find a solution for this. Redownloaded and regenerated the font numerous times on different computers, clearing cache each time viewed and still didn't work. Other fonts work fine, so my conclusion is the eot generators don't like the font.
Try using the [font-face](http://www.fontsquirrel.com/fontface/generator) generator.
11,112,515
I am messing around with Session in my webapp at the moment and I noticed that whenever I restart the development server (the built-in server that came with Django), the session does not reset itself. It carries over eventhough I have restarted the server over and over again. Where can I set it so that whenever I res...
2012/06/20
[ "https://Stackoverflow.com/questions/11112515", "https://Stackoverflow.com", "https://Stackoverflow.com/users/599378/" ]
Couldn't find a solution for this. Redownloaded and regenerated the font numerous times on different computers, clearing cache each time viewed and still didn't work. Other fonts work fine, so my conclusion is the eot generators don't like the font.
Try this solution <http://fontface.codeandmore.com/blog/ie-7-8-error-with-eot-css3111/> as it worked many times for our users.
16,099,694
For example I have a sentence ``` "He is so .... cool!" ``` Then I remove all the punctuation and make it in a list. ``` ["He", "is", "so", "", "cool"] ``` How do I remove or ignore the empty string?
2013/04/19
[ "https://Stackoverflow.com/questions/16099694", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2289046/" ]
You can use a list comprehension: ``` cleaned = [x for x in your_list if x] ``` Although I would use regex to extract the words: ``` >>> import re >>> sentence = 'This is some cool sentence with, spaces' >>> re.findall(r'(\w+)', sentence) ['This', 'is', 'some', 'cool', 'sentence', 'with', 'spaces'] ```
I'll give you the answer to the question you *should* have asked -- how to avoid the empty string altogether. I assume you do *something* like this to get your list: ``` >>> "He is so .... cool!".replace(".", "").split(" ") ['He', 'is', 'so', '', 'cool!'] ``` The point is that you use [`.split(" ")`](http://docs.pyt...
16,099,694
For example I have a sentence ``` "He is so .... cool!" ``` Then I remove all the punctuation and make it in a list. ``` ["He", "is", "so", "", "cool"] ``` How do I remove or ignore the empty string?
2013/04/19
[ "https://Stackoverflow.com/questions/16099694", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2289046/" ]
You can use a list comprehension: ``` cleaned = [x for x in your_list if x] ``` Although I would use regex to extract the words: ``` >>> import re >>> sentence = 'This is some cool sentence with, spaces' >>> re.findall(r'(\w+)', sentence) ['This', 'is', 'some', 'cool', 'sentence', 'with', 'spaces'] ```
You can filter out empty strings very easily using a list comprehension: ``` x = ["He", "is", "so", "", "cool"] x = [str for str in x if str] >>> ['He', 'is', 'so', 'cool'] ```
16,099,694
For example I have a sentence ``` "He is so .... cool!" ``` Then I remove all the punctuation and make it in a list. ``` ["He", "is", "so", "", "cool"] ``` How do I remove or ignore the empty string?
2013/04/19
[ "https://Stackoverflow.com/questions/16099694", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2289046/" ]
You can filter it like this ``` orig = ["He", "is", "so", "", "cool"] result = [x for x in orig if x] ``` Or you can use `filter`. In python 3 `filter` returns a generator, thus `list()` turns it into a list. This works also in python 2.7 ``` result = list(filter(None, orig)) ```
You can use a list comprehension: ``` cleaned = [x for x in your_list if x] ``` Although I would use regex to extract the words: ``` >>> import re >>> sentence = 'This is some cool sentence with, spaces' >>> re.findall(r'(\w+)', sentence) ['This', 'is', 'some', 'cool', 'sentence', 'with', 'spaces'] ```
16,099,694
For example I have a sentence ``` "He is so .... cool!" ``` Then I remove all the punctuation and make it in a list. ``` ["He", "is", "so", "", "cool"] ``` How do I remove or ignore the empty string?
2013/04/19
[ "https://Stackoverflow.com/questions/16099694", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2289046/" ]
You can use a list comprehension: ``` cleaned = [x for x in your_list if x] ``` Although I would use regex to extract the words: ``` >>> import re >>> sentence = 'This is some cool sentence with, spaces' >>> re.findall(r'(\w+)', sentence) ['This', 'is', 'some', 'cool', 'sentence', 'with', 'spaces'] ```
``` lst = ["He", "is", "so", "", "cool"] lst = list(filter(str.strip, lst)) ```
16,099,694
For example I have a sentence ``` "He is so .... cool!" ``` Then I remove all the punctuation and make it in a list. ``` ["He", "is", "so", "", "cool"] ``` How do I remove or ignore the empty string?
2013/04/19
[ "https://Stackoverflow.com/questions/16099694", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2289046/" ]
You can use [`filter`](http://docs.python.org/2/library/functions.html#filter), with `None` as the key function, which filters out all elements which are `False`ish (including empty strings) ``` >>> lst = ["He", "is", "so", "", "cool"] >>> filter(None, lst) ['He', 'is', 'so', 'cool'] ``` Note however, that `filter` ...
You can filter it like this ``` orig = ["He", "is", "so", "", "cool"] result = [x for x in orig if x] ``` Or you can use `filter`. In python 3 `filter` returns a generator, thus `list()` turns it into a list. This works also in python 2.7 ``` result = list(filter(None, orig)) ```
16,099,694
For example I have a sentence ``` "He is so .... cool!" ``` Then I remove all the punctuation and make it in a list. ``` ["He", "is", "so", "", "cool"] ``` How do I remove or ignore the empty string?
2013/04/19
[ "https://Stackoverflow.com/questions/16099694", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2289046/" ]
You can filter it like this ``` orig = ["He", "is", "so", "", "cool"] result = [x for x in orig if x] ``` Or you can use `filter`. In python 3 `filter` returns a generator, thus `list()` turns it into a list. This works also in python 2.7 ``` result = list(filter(None, orig)) ```
``` >>> from string import punctuation >>> text = "He is so .... cool!" >>> [w.strip(punctuation) for w in text.split() if w.strip(punctuation)] ['He', 'is', 'so', 'cool'] ```
16,099,694
For example I have a sentence ``` "He is so .... cool!" ``` Then I remove all the punctuation and make it in a list. ``` ["He", "is", "so", "", "cool"] ``` How do I remove or ignore the empty string?
2013/04/19
[ "https://Stackoverflow.com/questions/16099694", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2289046/" ]
You can filter it like this ``` orig = ["He", "is", "so", "", "cool"] result = [x for x in orig if x] ``` Or you can use `filter`. In python 3 `filter` returns a generator, thus `list()` turns it into a list. This works also in python 2.7 ``` result = list(filter(None, orig)) ```
You can filter out empty strings very easily using a list comprehension: ``` x = ["He", "is", "so", "", "cool"] x = [str for str in x if str] >>> ['He', 'is', 'so', 'cool'] ```
16,099,694
For example I have a sentence ``` "He is so .... cool!" ``` Then I remove all the punctuation and make it in a list. ``` ["He", "is", "so", "", "cool"] ``` How do I remove or ignore the empty string?
2013/04/19
[ "https://Stackoverflow.com/questions/16099694", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2289046/" ]
``` lst = ["He", "is", "so", "", "cool"] lst = list(filter(str.strip, lst)) ```
You can do this with a `filter`. ``` a = ["He", "is", "so", "", "cool"] filter(lambda s: len(s) > 0, a) ```
16,099,694
For example I have a sentence ``` "He is so .... cool!" ``` Then I remove all the punctuation and make it in a list. ``` ["He", "is", "so", "", "cool"] ``` How do I remove or ignore the empty string?
2013/04/19
[ "https://Stackoverflow.com/questions/16099694", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2289046/" ]
``` >>> from string import punctuation >>> text = "He is so .... cool!" >>> [w.strip(punctuation) for w in text.split() if w.strip(punctuation)] ['He', 'is', 'so', 'cool'] ```
``` lst = ["He", "is", "so", "", "cool"] lst = list(filter(str.strip, lst)) ```
16,099,694
For example I have a sentence ``` "He is so .... cool!" ``` Then I remove all the punctuation and make it in a list. ``` ["He", "is", "so", "", "cool"] ``` How do I remove or ignore the empty string?
2013/04/19
[ "https://Stackoverflow.com/questions/16099694", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2289046/" ]
Python 3 returns an `iterator` from `filter`, so should be wrapped in a call to list() ``` str_list = list(filter(None, str_list)) # fastest ```
``` lst = ["He", "is", "so", "", "cool"] lst = list(filter(str.strip, lst)) ```
10,719,654
Can anybody suggest how to make the swapped boxes change background color on click when using the below plugin? <http://www.vertstudios.com/blog/swap-jquery-plugin/> (see demo) I'm not sure how to link to plugins in JSFiddle so can't demonstrate unfortunately. The methods animate the position of all boxes affecting ...
2012/05/23
[ "https://Stackoverflow.com/questions/10719654", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1405195/" ]
> > They want something as compact as the JS stated above > > > Who's "they"? Do "they" have any understanding that Objective-C is a compiled language and the "compactness" of the source code is largely irrelevant? Anyway, rant over. You can make a C array of CGPoints like this: ``` CGPoint myArray[] = {{0.0, 14...
If you need to manage variable-length arrays of vertices, C++ provides `std::vector<CGPoint>`.
216,295
Suppose I have the following list: ``` l = {"A", "A", "A", "E", "D", "D", "D", "C", "B", "E", "E", "E", "D", "B", "A", "D", "B", "E", "C", "A", "D", "A", "A", "A", "A", "C", "C", "C", "D", "D", "E"} ``` I want to count how many two letters I have namely how many AA, AB,... I have in list `l`. I know this is e...
2020/03/15
[ "https://mathematica.stackexchange.com/questions/216295", "https://mathematica.stackexchange.com", "https://mathematica.stackexchange.com/users/2871/" ]
How about ``` Partition[l, 2, 1] // Counts (* <|{"A", "A"} -> 5, {"A", "E"} -> 1, {"E", "D"} -> 2, {"D", "D"} -> 3, {"D", "C"} -> 1, {"C", "B"} -> 1, {"B", "E"} -> 2, {"E", "E"} -> 2, {"D", "B"} -> 2, {"B", "A"} -> 1, {"A", "D"} -> 2, {"E", "C"} -> 1, {"C", "A"} -> 1, {"D", "A"} -> 1, {"A", "C"} -> 1, {"C", ...
You can also use `SequenceCases` + `Counts`: ``` Counts[SequenceCases[l, {_, _}, Overlaps -> True]] ``` > > <|{"A", "A"} -> 5, {"A", "E"} -> 1, {"E", "D"} -> 2, {"D", "D"} -> > 3, {"D", "C"} -> 1, {"C", "B"} -> 1, {"B", "E"} -> 2, {"E", "E"} -> > 2, {"D", "B"} -> 2, {"B", "A"} -> 1, {"A", "D"} -> 2, {"E", "C"} ...
42,709,785
Below is my code to fetch a list of stores and then it's products Now the issue is, the API that returns me product list for a store has a rate limiter in place, i.e. 10req/sec. So If get more than 10 stores and I hit for products, the API starts giving me 503 and in the response I get undefined values along with actu...
2017/03/10
[ "https://Stackoverflow.com/questions/42709785", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1258489/" ]
First try using the upgrade command in pip and see if that fixes the version problem ``` pip3 install --upgrade pip ``` otherwise I would recommend uninstalling and performing a fresh install. Use the following commands to setup python ``` sudo apt-get update sudo apt-get -y upgrade sudo apt-get install python...
Many linux distribution provide tkinter, IDLE (which uses tkinter), and turtle (which also uses tkinter) as separate distribution. Searching SO for `[tkinter] install tkinter on ubuntu` displays previous questions with answers. ``` sudo apt-get install python3-tk ``` may be what you need but details may have change...
9,460,030
I'm using jQuery Cycle for a few slides, with content below it. jQuery Cycle sets the parent to relative and the child slides to absolute, so the content that should be below it is covered. Typically, I would give the parent container a height to solve my problem. Since the layout is responsive, the height can change....
2012/02/27
[ "https://Stackoverflow.com/questions/9460030", "https://Stackoverflow.com", "https://Stackoverflow.com/users/882428/" ]
You can use [`ready`](http://api.jquery.com/ready/) and [`resize`](http://api.jquery.com/resize/) events to trigger a function which will set the [`height`](http://api.jquery.com/height/) appropriately based on the [`width`](http://api.jquery.com/width/) of the `window`. As the page 'responds' to the current window wid...
i think you can do this: ``` $slideshow.cycle({ containerResize: false, slideResize: false, fit: 1 }); ``` basically, when window resizes, the slide container is forced to resized. (not sure if you should set all to true or false, please give it a try.)
9,460,030
I'm using jQuery Cycle for a few slides, with content below it. jQuery Cycle sets the parent to relative and the child slides to absolute, so the content that should be below it is covered. Typically, I would give the parent container a height to solve my problem. Since the layout is responsive, the height can change....
2012/02/27
[ "https://Stackoverflow.com/questions/9460030", "https://Stackoverflow.com", "https://Stackoverflow.com/users/882428/" ]
You can use [`ready`](http://api.jquery.com/ready/) and [`resize`](http://api.jquery.com/resize/) events to trigger a function which will set the [`height`](http://api.jquery.com/height/) appropriately based on the [`width`](http://api.jquery.com/width/) of the `window`. As the page 'responds' to the current window wid...
I had the same problem, solved it like this: HTML: ``` <div class="hp_slider"> <a href="#"><img class="slide" alt="" width="940" height="420" src="/assets/images/cache/17dd0cc96316523cbba09777c8e512769078b0bc.png" /></a> <a href="#"><img class="slide" alt="" width="940" height="420" src="/assets/images/cache/39fbcef5...
9,460,030
I'm using jQuery Cycle for a few slides, with content below it. jQuery Cycle sets the parent to relative and the child slides to absolute, so the content that should be below it is covered. Typically, I would give the parent container a height to solve my problem. Since the layout is responsive, the height can change....
2012/02/27
[ "https://Stackoverflow.com/questions/9460030", "https://Stackoverflow.com", "https://Stackoverflow.com/users/882428/" ]
I had the same problem, solved it like this: HTML: ``` <div class="hp_slider"> <a href="#"><img class="slide" alt="" width="940" height="420" src="/assets/images/cache/17dd0cc96316523cbba09777c8e512769078b0bc.png" /></a> <a href="#"><img class="slide" alt="" width="940" height="420" src="/assets/images/cache/39fbcef5...
i think you can do this: ``` $slideshow.cycle({ containerResize: false, slideResize: false, fit: 1 }); ``` basically, when window resizes, the slide container is forced to resized. (not sure if you should set all to true or false, please give it a try.)
9,460,030
I'm using jQuery Cycle for a few slides, with content below it. jQuery Cycle sets the parent to relative and the child slides to absolute, so the content that should be below it is covered. Typically, I would give the parent container a height to solve my problem. Since the layout is responsive, the height can change....
2012/02/27
[ "https://Stackoverflow.com/questions/9460030", "https://Stackoverflow.com", "https://Stackoverflow.com/users/882428/" ]
This is my solution: ``` $(window).resize(function(){ $('.cycle-container').each(function(){ $(this).height($(this).find('> *:first').outerHeight()); }) }); ```
i think you can do this: ``` $slideshow.cycle({ containerResize: false, slideResize: false, fit: 1 }); ``` basically, when window resizes, the slide container is forced to resized. (not sure if you should set all to true or false, please give it a try.)
9,460,030
I'm using jQuery Cycle for a few slides, with content below it. jQuery Cycle sets the parent to relative and the child slides to absolute, so the content that should be below it is covered. Typically, I would give the parent container a height to solve my problem. Since the layout is responsive, the height can change....
2012/02/27
[ "https://Stackoverflow.com/questions/9460030", "https://Stackoverflow.com", "https://Stackoverflow.com/users/882428/" ]
This is my solution: ``` $(window).resize(function(){ $('.cycle-container').each(function(){ $(this).height($(this).find('> *:first').outerHeight()); }) }); ```
I had the same problem, solved it like this: HTML: ``` <div class="hp_slider"> <a href="#"><img class="slide" alt="" width="940" height="420" src="/assets/images/cache/17dd0cc96316523cbba09777c8e512769078b0bc.png" /></a> <a href="#"><img class="slide" alt="" width="940" height="420" src="/assets/images/cache/39fbcef5...
22,149,795
Does anyone know of a way to make Amazon's Elastic Load Balancers timeout if an HTTP response has not been received from upstream in a set timeframe? Occasionally Amazon's Elastic Beanstalk will fail an update and any requests to the specified resource (running Nginx + Node if tht's any use) will hang any request page...
2014/03/03
[ "https://Stackoverflow.com/questions/22149795", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1764563/" ]
Using the first HTML sample: ``` grep '<strong>First ascent:</strong>' | sed 's/.*by \([^>]*\)<.*/\1/' ``` Output: ``` Sir Edmund Hillary and Tenzing Norgay Achille Compagnoni and Lino Lacedelli George Band and Joe Brown Kurt Diemberger, Peter Diener, Nawang Dorje, Nima Dorje, Ernst Forrer and Albin Schelbert Herma...
Firstly, go with the first page in your question. Here's a Java scraper for the "curl" downloaded file: ``` import java.util.Scanner; import java.io.*; public class PageInfo { public static void main(String[] args) { Scanner scan = new Scanner(new File(args[0])); //file you downloaded PrintWriter...
22,149,795
Does anyone know of a way to make Amazon's Elastic Load Balancers timeout if an HTTP response has not been received from upstream in a set timeframe? Occasionally Amazon's Elastic Beanstalk will fail an update and any requests to the specified resource (running Nginx + Node if tht's any use) will hang any request page...
2014/03/03
[ "https://Stackoverflow.com/questions/22149795", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1764563/" ]
You can use my [Xidel](http://videlibri.sourceforge.net/xidel.html) which does pattern matching on the html tree: ``` xidel http://www.alpineascents.com/8000m-peaks.asp -e "<tr><strong>Everest</strong><td/>{3}<td>{.}</td></tr>" ``` Just 109 characters... (Replace Everest with $1 if it is inside a script with that a...
Firstly, go with the first page in your question. Here's a Java scraper for the "curl" downloaded file: ``` import java.util.Scanner; import java.io.*; public class PageInfo { public static void main(String[] args) { Scanner scan = new Scanner(new File(args[0])); //file you downloaded PrintWriter...
22,149,795
Does anyone know of a way to make Amazon's Elastic Load Balancers timeout if an HTTP response has not been received from upstream in a set timeframe? Occasionally Amazon's Elastic Beanstalk will fail an update and any requests to the specified resource (running Nginx + Node if tht's any use) will hang any request page...
2014/03/03
[ "https://Stackoverflow.com/questions/22149795", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1764563/" ]
Using the first HTML sample: ``` grep '<strong>First ascent:</strong>' | sed 's/.*by \([^>]*\)<.*/\1/' ``` Output: ``` Sir Edmund Hillary and Tenzing Norgay Achille Compagnoni and Lino Lacedelli George Band and Joe Brown Kurt Diemberger, Peter Diener, Nawang Dorje, Nima Dorje, Ernst Forrer and Albin Schelbert Herma...
You can use my [Xidel](http://videlibri.sourceforge.net/xidel.html) which does pattern matching on the html tree: ``` xidel http://www.alpineascents.com/8000m-peaks.asp -e "<tr><strong>Everest</strong><td/>{3}<td>{.}</td></tr>" ``` Just 109 characters... (Replace Everest with $1 if it is inside a script with that a...
55,302
I think the question title says it all: Given a distribution board in the house (220 VAC), is it enough to shut off only the room's fuses, or must one shut off the main switch for the board before safely touching wires? Does the answer depend in any way on the fuse type?
2014/12/14
[ "https://diy.stackexchange.com/questions/55302", "https://diy.stackexchange.com", "https://diy.stackexchange.com/users/7302/" ]
And here is why you check it before hand, even though you have turned off that room. People get into Junction boxes and re-wire - joining two separate circuits into one - in that case one circuit in the house can be fed from two breakers (as long as they are on the same phase). Always check with testor - and NOT JUST a...
Yes. Once you shut off the room fuse, no electricity will be going to that room. However it is important to test all connections before working on them so you are positive that they are not powered.
55,302
I think the question title says it all: Given a distribution board in the house (220 VAC), is it enough to shut off only the room's fuses, or must one shut off the main switch for the board before safely touching wires? Does the answer depend in any way on the fuse type?
2014/12/14
[ "https://diy.stackexchange.com/questions/55302", "https://diy.stackexchange.com", "https://diy.stackexchange.com/users/7302/" ]
You say "that room". Circuits are not nearly always designated to one room or area. Many, many times a room will have some devices on one circuit while others on another circuit. It is pretty rare that rooms are strictly wired so that one circuit distinctly feeds one room. Also, panel directories are not always extrem...
Yes. Once you shut off the room fuse, no electricity will be going to that room. However it is important to test all connections before working on them so you are positive that they are not powered.
55,302
I think the question title says it all: Given a distribution board in the house (220 VAC), is it enough to shut off only the room's fuses, or must one shut off the main switch for the board before safely touching wires? Does the answer depend in any way on the fuse type?
2014/12/14
[ "https://diy.stackexchange.com/questions/55302", "https://diy.stackexchange.com", "https://diy.stackexchange.com/users/7302/" ]
And here is why you check it before hand, even though you have turned off that room. People get into Junction boxes and re-wire - joining two separate circuits into one - in that case one circuit in the house can be fed from two breakers (as long as they are on the same phase). Always check with testor - and NOT JUST a...
You say "that room". Circuits are not nearly always designated to one room or area. Many, many times a room will have some devices on one circuit while others on another circuit. It is pretty rare that rooms are strictly wired so that one circuit distinctly feeds one room. Also, panel directories are not always extrem...
7,305,997
You can see my fiddle of what i'm doing here: [fiddle](http://jsfiddle.net/tigreton/JGNmK/) In vote\_up.php I insert the vote into MySQL and replaces the link with 2 messages: "successful" or "error" But the problem now is, I don't need to change the link, I must update the 2 boxes showing a new question without rel...
2011/09/05
[ "https://Stackoverflow.com/questions/7305997", "https://Stackoverflow.com", "https://Stackoverflow.com/users/873444/" ]
You need a backend that gives the information back in a format (like JSON or XML) and then parse it into the page. When they click the vote link there happens a ajax request to vote. And the response of this ajax request is your new question. Then you parse the request, replace your old question with the new one. And ...
My problem resolved in other post: ``` $(document).ready(function() { $(document).delegate('.vote, .vote1', 'click', function() { ... ```
33,592,169
I'm currently reading K&R's "The C Programming Language" book. In "Structures" chapter, under the subtopic of "Table Lookup" (Page 144) I found this hash generating function ``` #define HASHSIZE 101 struct nlist { struct nlist *next; char *name; char *defn; } static struct nlist *hashtab[HASHSIZE]; unsi...
2015/11/08
[ "https://Stackoverflow.com/questions/33592169", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1463878/" ]
> > What I don't understand is what this function actually do? > > > It basically hashes the string pointed to by the `char *s` pointer, until it encounters the end of the string, which is marked by the null character `'\0'`. In other words, it calculates (or *maps*) a given input string to an integer value. You ...
Hash functions in general might generate the same hash value for different strings. Thats why a [collision resolution](https://en.wikipedia.org/wiki/Hash_table#Collision_resolution) is needed. About the value for HASHSIZE and hashval: I am not a expert in hash functions, but in the few ones I read about, the numbers u...
31,175,741
I'm passing db values using `json _encode()`. Below is the query and all works okay. But when I add an additional data to the array I get a number in front of the output data. ``` $sql = "SELECT item, price, availability FROM items WHERE category = :category ORDER BY item DESC"; $...
2015/07/02
[ "https://Stackoverflow.com/questions/31175741", "https://Stackoverflow.com", "https://Stackoverflow.com/users/4739628/" ]
Index numbers were assigned automatically because you have assigned an index yourself called "additional". In your code try changing ``` $data['additional'] = $someAdditionalData; ``` to ``` $data[] = array('additional' => $someAdditionalDat); ```
Use `array_values()` for your issue: ``` $arr['additional'] = array_values($arr['additional']); $arr = json_encode($arr); ``` Why? Because you're unsetting array's key without re-ordering it. So after this the only way to keep that in JSON will be encode keys too. After applying `array_values()`, however, you'll get...
31,175,741
I'm passing db values using `json _encode()`. Below is the query and all works okay. But when I add an additional data to the array I get a number in front of the output data. ``` $sql = "SELECT item, price, availability FROM items WHERE category = :category ORDER BY item DESC"; $...
2015/07/02
[ "https://Stackoverflow.com/questions/31175741", "https://Stackoverflow.com", "https://Stackoverflow.com/users/4739628/" ]
PHP chooses to serialise your array into an object when *any* array key is not numeric or when the array has missing indices. You can either push another element on the existing array: ``` $data[] = ['additional' => $someAdditionalData]; ``` Or, perhaps better, pick a different structure: ``` $items = []; foreach ...
Index numbers were assigned automatically because you have assigned an index yourself called "additional". In your code try changing ``` $data['additional'] = $someAdditionalData; ``` to ``` $data[] = array('additional' => $someAdditionalDat); ```
31,175,741
I'm passing db values using `json _encode()`. Below is the query and all works okay. But when I add an additional data to the array I get a number in front of the output data. ``` $sql = "SELECT item, price, availability FROM items WHERE category = :category ORDER BY item DESC"; $...
2015/07/02
[ "https://Stackoverflow.com/questions/31175741", "https://Stackoverflow.com", "https://Stackoverflow.com/users/4739628/" ]
PHP chooses to serialise your array into an object when *any* array key is not numeric or when the array has missing indices. You can either push another element on the existing array: ``` $data[] = ['additional' => $someAdditionalData]; ``` Or, perhaps better, pick a different structure: ``` $items = []; foreach ...
Use `array_values()` for your issue: ``` $arr['additional'] = array_values($arr['additional']); $arr = json_encode($arr); ``` Why? Because you're unsetting array's key without re-ordering it. So after this the only way to keep that in JSON will be encode keys too. After applying `array_values()`, however, you'll get...
55,029,842
I build an API, which will send data to another API when has been collect 10 hashes. The client sends 1 hash per hour. For example: 1. The client POST hash to API 2. API need to store it somewhere until the hashes number becomes to 10 3. When the number of hashes becomes 10 need to send data to another API and start ...
2019/03/06
[ "https://Stackoverflow.com/questions/55029842", "https://Stackoverflow.com", "https://Stackoverflow.com/users/-1/" ]
Sorry but your only options of storing data are either **memory** or **disk**. If you store data in variables, you're using **memory**. It is fast and instant but it's not durable as you already said. If you store data in database, you're using disk **storage**. It is slower but it is durable. If you need durability...
Maybe your problem will be solved with [Redis](https://redis.io/). I had one feature where I needed to use some user's pieces of information on the server side in runtime and it could not be persisted at the database. So, I used [this](https://www.npmjs.com/package/express-redis-cache). In simple words, the redis wi...
31,326,104
I need to find max date from a table(mysql database). I am storing my date as varchar. `select max(completion_date) from table_name` returns wrong value. <http://sqlfiddle.com/#!9/c88f6/3>
2015/07/09
[ "https://Stackoverflow.com/questions/31326104", "https://Stackoverflow.com", "https://Stackoverflow.com/users/768294/" ]
I am not sure why you would want to keep it as varchar not date. But this will work for varchar: ``` SELECT completion_date FROM test ORDER BY STR_TO_DATE(completion_date, '%m/%d/%Y') DESC LIMIT 1; ``` <http://sqlfiddle.com/#!9/c88f6/10>
``` <?php // Store dates $dates = array(); // Loop through and transfer the result set foreach ($result as $row => $data) { $dates[$row] = $data['date']; } // Sort the array usort( $dates, "date_sort_function" ); // Max is last date in array. foreach ($dates as $date) { $max = $date; } ?> `...
31,326,104
I need to find max date from a table(mysql database). I am storing my date as varchar. `select max(completion_date) from table_name` returns wrong value. <http://sqlfiddle.com/#!9/c88f6/3>
2015/07/09
[ "https://Stackoverflow.com/questions/31326104", "https://Stackoverflow.com", "https://Stackoverflow.com/users/768294/" ]
Assuming the date time format you have in your fiddle (e.g. '12/19/2012 05:30 PM') then: ``` select max(STR_TO_DATE(completion_date, '%m/%d/%Y %l:%i %p')) from test; ``` <http://sqlfiddle.com/#!9/c88f6/15> It's unclear if you want to factor the time into your rankings or just the date. This example accounts for tim...
I am not sure why you would want to keep it as varchar not date. But this will work for varchar: ``` SELECT completion_date FROM test ORDER BY STR_TO_DATE(completion_date, '%m/%d/%Y') DESC LIMIT 1; ``` <http://sqlfiddle.com/#!9/c88f6/10>
31,326,104
I need to find max date from a table(mysql database). I am storing my date as varchar. `select max(completion_date) from table_name` returns wrong value. <http://sqlfiddle.com/#!9/c88f6/3>
2015/07/09
[ "https://Stackoverflow.com/questions/31326104", "https://Stackoverflow.com", "https://Stackoverflow.com/users/768294/" ]
Assuming the date time format you have in your fiddle (e.g. '12/19/2012 05:30 PM') then: ``` select max(STR_TO_DATE(completion_date, '%m/%d/%Y %l:%i %p')) from test; ``` <http://sqlfiddle.com/#!9/c88f6/15> It's unclear if you want to factor the time into your rankings or just the date. This example accounts for tim...
``` <?php // Store dates $dates = array(); // Loop through and transfer the result set foreach ($result as $row => $data) { $dates[$row] = $data['date']; } // Sort the array usort( $dates, "date_sort_function" ); // Max is last date in array. foreach ($dates as $date) { $max = $date; } ?> `...
12,067,728
I have a styled file Upload laying on top the vanilla asp.net fileupload control, which is hidden. If the user comes back to edit his chosen files, there are buttons to view the file or delete it from the dataset; In addition the control is hidden. However the fake fileupload remains visible. I have written a custom me...
2012/08/22
[ "https://Stackoverflow.com/questions/12067728", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1249641/" ]
When you tilt the device your activity is destroyed and oncreate is called again . You have to retain the value you want to get back when its is restarted. There are several ways to do it . In shortcut you can just add a flag in Activity in manifest file which is android:configchanges = "orientation". ``` <activity ...
you need to assign `android:screenOrientation="landscape"` in AndroidManifest.xml, look at following code, ``` <application android:icon="@drawable/icon" android:label="@string/app_name"> <activity android:name=".MainActivity" android:label="@string/app_name" android:screenOrientation="landscape" > ...
12,067,728
I have a styled file Upload laying on top the vanilla asp.net fileupload control, which is hidden. If the user comes back to edit his chosen files, there are buttons to view the file or delete it from the dataset; In addition the control is hidden. However the fake fileupload remains visible. I have written a custom me...
2012/08/22
[ "https://Stackoverflow.com/questions/12067728", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1249641/" ]
You need to use onSaveInstanceState to save your data because data get lost when orientation changes. Google onSaveInstanceState and if you still have problems ask.
Activity's are destroyed and recreated when the screen orientation is changed. You can either lock it to one orientation. or Save the state of your application using [onSaveInstanceState](http://developer.android.com/reference/android/app/Activity.html#onSaveInstanceState%28android.os.Bundle%29) then restore it in o...
12,067,728
I have a styled file Upload laying on top the vanilla asp.net fileupload control, which is hidden. If the user comes back to edit his chosen files, there are buttons to view the file or delete it from the dataset; In addition the control is hidden. However the fake fileupload remains visible. I have written a custom me...
2012/08/22
[ "https://Stackoverflow.com/questions/12067728", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1249641/" ]
When you tilt the device your activity is destroyed and oncreate is called again . You have to retain the value you want to get back when its is restarted. There are several ways to do it . In shortcut you can just add a flag in Activity in manifest file which is android:configchanges = "orientation". ``` <activity ...
Yes, because your activity will be restarted. You need to save your data on orientation changes to saved instant or else you need to restrict orientation changes in your activity.
12,067,728
I have a styled file Upload laying on top the vanilla asp.net fileupload control, which is hidden. If the user comes back to edit his chosen files, there are buttons to view the file or delete it from the dataset; In addition the control is hidden. However the fake fileupload remains visible. I have written a custom me...
2012/08/22
[ "https://Stackoverflow.com/questions/12067728", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1249641/" ]
When you tilt the device your activity is destroyed and oncreate is called again . You have to retain the value you want to get back when its is restarted. There are several ways to do it . In shortcut you can just add a flag in Activity in manifest file which is android:configchanges = "orientation". ``` <activity ...
You need to use onSaveInstanceState to save your data because data get lost when orientation changes. Google onSaveInstanceState and if you still have problems ask.
12,067,728
I have a styled file Upload laying on top the vanilla asp.net fileupload control, which is hidden. If the user comes back to edit his chosen files, there are buttons to view the file or delete it from the dataset; In addition the control is hidden. However the fake fileupload remains visible. I have written a custom me...
2012/08/22
[ "https://Stackoverflow.com/questions/12067728", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1249641/" ]
Activity's are destroyed and recreated when the screen orientation is changed. You can either lock it to one orientation. or Save the state of your application using [onSaveInstanceState](http://developer.android.com/reference/android/app/Activity.html#onSaveInstanceState%28android.os.Bundle%29) then restore it in o...
Your activity is relaunched (onCreate is called) every time the activity changes orientation, to avoid this you can set in your androidmanifest android:configChanges="orientation" to the activity.
12,067,728
I have a styled file Upload laying on top the vanilla asp.net fileupload control, which is hidden. If the user comes back to edit his chosen files, there are buttons to view the file or delete it from the dataset; In addition the control is hidden. However the fake fileupload remains visible. I have written a custom me...
2012/08/22
[ "https://Stackoverflow.com/questions/12067728", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1249641/" ]
When you tilt the device your activity is destroyed and oncreate is called again . You have to retain the value you want to get back when its is restarted. There are several ways to do it . In shortcut you can just add a flag in Activity in manifest file which is android:configchanges = "orientation". ``` <activity ...
Your activity is relaunched (onCreate is called) every time the activity changes orientation, to avoid this you can set in your androidmanifest android:configChanges="orientation" to the activity.
12,067,728
I have a styled file Upload laying on top the vanilla asp.net fileupload control, which is hidden. If the user comes back to edit his chosen files, there are buttons to view the file or delete it from the dataset; In addition the control is hidden. However the fake fileupload remains visible. I have written a custom me...
2012/08/22
[ "https://Stackoverflow.com/questions/12067728", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1249641/" ]
Yes, because your activity will be restarted. You need to save your data on orientation changes to saved instant or else you need to restrict orientation changes in your activity.
Activity's are destroyed and recreated when the screen orientation is changed. You can either lock it to one orientation. or Save the state of your application using [onSaveInstanceState](http://developer.android.com/reference/android/app/Activity.html#onSaveInstanceState%28android.os.Bundle%29) then restore it in o...
12,067,728
I have a styled file Upload laying on top the vanilla asp.net fileupload control, which is hidden. If the user comes back to edit his chosen files, there are buttons to view the file or delete it from the dataset; In addition the control is hidden. However the fake fileupload remains visible. I have written a custom me...
2012/08/22
[ "https://Stackoverflow.com/questions/12067728", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1249641/" ]
You need to use onSaveInstanceState to save your data because data get lost when orientation changes. Google onSaveInstanceState and if you still have problems ask.
Your activity is relaunched (onCreate is called) every time the activity changes orientation, to avoid this you can set in your androidmanifest android:configChanges="orientation" to the activity.
12,067,728
I have a styled file Upload laying on top the vanilla asp.net fileupload control, which is hidden. If the user comes back to edit his chosen files, there are buttons to view the file or delete it from the dataset; In addition the control is hidden. However the fake fileupload remains visible. I have written a custom me...
2012/08/22
[ "https://Stackoverflow.com/questions/12067728", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1249641/" ]
you need to assign `android:screenOrientation="landscape"` in AndroidManifest.xml, look at following code, ``` <application android:icon="@drawable/icon" android:label="@string/app_name"> <activity android:name=".MainActivity" android:label="@string/app_name" android:screenOrientation="landscape" > ...
Your activity is relaunched (onCreate is called) every time the activity changes orientation, to avoid this you can set in your androidmanifest android:configChanges="orientation" to the activity.
12,067,728
I have a styled file Upload laying on top the vanilla asp.net fileupload control, which is hidden. If the user comes back to edit his chosen files, there are buttons to view the file or delete it from the dataset; In addition the control is hidden. However the fake fileupload remains visible. I have written a custom me...
2012/08/22
[ "https://Stackoverflow.com/questions/12067728", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1249641/" ]
Yes, because your activity will be restarted. You need to save your data on orientation changes to saved instant or else you need to restrict orientation changes in your activity.
Your activity is relaunched (onCreate is called) every time the activity changes orientation, to avoid this you can set in your androidmanifest android:configChanges="orientation" to the activity.
19,173,356
I'm newbie to Laravel and even Frameworks... I've tried some basic authentication in Laravel. Now here's my problem. I've got an LDAP login script in conventional PHP and I want to switch to Laravel LDAP login. Can anyone help me with the code/bundle or anything? I'll be very grateful for this help. ``` function check...
2013/10/04
[ "https://Stackoverflow.com/questions/19173356", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2845144/" ]
On the server use `header("Content-Disposition: attachment; filename='Original name'")`
Try Below Code ``` header('Content-Disposition: attachment; filename='.basename('newfilename.txt')); header('Content-Transfer-Encoding: binary'); header('Content-Length: ' . filesize('filename.txt')); ob_clean(); flush(); readfile('filename.txt'); ```
3,608,234
My `EditText` configured as follows won't show the hint: ``` <EditText android:layout_width="fill_parent" android:layout_height="wrap_content" android:gravity="right" android:hint="The hint..." android:scrollHorizontally="true" android:singleLine="true" /> ``` It works if I set `android:grav...
2010/08/31
[ "https://Stackoverflow.com/questions/3608234", "https://Stackoverflow.com", "https://Stackoverflow.com/users/435830/" ]
using `android:ellipsize="end"` fixed it for me Weird bug !! (but Android has a lot of these weirdo bug)
This is how, I did for by `EditText` to have hint in it. ``` <EditText android:id="@+id/productQuantity" android:layout_width="fill_parent" android:layout_height="wrap_content" android:gravity="right|center_vertical" android:hint="@string/quantity" android:inputType="numberSigned" android:e...
3,608,234
My `EditText` configured as follows won't show the hint: ``` <EditText android:layout_width="fill_parent" android:layout_height="wrap_content" android:gravity="right" android:hint="The hint..." android:scrollHorizontally="true" android:singleLine="true" /> ``` It works if I set `android:grav...
2010/08/31
[ "https://Stackoverflow.com/questions/3608234", "https://Stackoverflow.com", "https://Stackoverflow.com/users/435830/" ]
The below worked for me: ``` <EditText android:id="@+id/UserText" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_alignParentLeft="true" android:layout_alignParentTop="true" android:layout_alignRight="@+id/UserPassword" android:layout_marginTop="85dp"...
I changed the style to `"@style/Base.WidgetMaterialComponents.TextImputEditText"`. For me it wasn't gravity or color.
3,608,234
My `EditText` configured as follows won't show the hint: ``` <EditText android:layout_width="fill_parent" android:layout_height="wrap_content" android:gravity="right" android:hint="The hint..." android:scrollHorizontally="true" android:singleLine="true" /> ``` It works if I set `android:grav...
2010/08/31
[ "https://Stackoverflow.com/questions/3608234", "https://Stackoverflow.com", "https://Stackoverflow.com/users/435830/" ]
Using android:ellipsize="end" resolves the obvious platform bug. Unfortunately, Xperias still misbehave :( I found no other solution than to: ``` if (android.os.Build.MANUFACTURER.matches(".*[Ss]ony.*")) editText.setGravity(Gravity.LEFT); else editText.setGravity(Gravity.CENTER); ```
This is how, I did for by `EditText` to have hint in it. ``` <EditText android:id="@+id/productQuantity" android:layout_width="fill_parent" android:layout_height="wrap_content" android:gravity="right|center_vertical" android:hint="@string/quantity" android:inputType="numberSigned" android:e...
3,608,234
My `EditText` configured as follows won't show the hint: ``` <EditText android:layout_width="fill_parent" android:layout_height="wrap_content" android:gravity="right" android:hint="The hint..." android:scrollHorizontally="true" android:singleLine="true" /> ``` It works if I set `android:grav...
2010/08/31
[ "https://Stackoverflow.com/questions/3608234", "https://Stackoverflow.com", "https://Stackoverflow.com/users/435830/" ]
No need of `android:scrollHorizontally` attribute. Remove it.`EditText` is a fixed item on the screen. we want scroll the layout contains the EditText is enough. that is the best design too. you have put `android:ellipsize="end"` instead of `android:scrollHorizontally`.
This is how, I did for by `EditText` to have hint in it. ``` <EditText android:id="@+id/productQuantity" android:layout_width="fill_parent" android:layout_height="wrap_content" android:gravity="right|center_vertical" android:hint="@string/quantity" android:inputType="numberSigned" android:e...
3,608,234
My `EditText` configured as follows won't show the hint: ``` <EditText android:layout_width="fill_parent" android:layout_height="wrap_content" android:gravity="right" android:hint="The hint..." android:scrollHorizontally="true" android:singleLine="true" /> ``` It works if I set `android:grav...
2010/08/31
[ "https://Stackoverflow.com/questions/3608234", "https://Stackoverflow.com", "https://Stackoverflow.com/users/435830/" ]
Using android:ellipsize="end" resolves the obvious platform bug. Unfortunately, Xperias still misbehave :( I found no other solution than to: ``` if (android.os.Build.MANUFACTURER.matches(".*[Ss]ony.*")) editText.setGravity(Gravity.LEFT); else editText.setGravity(Gravity.CENTER); ```
I changed the style to `"@style/Base.WidgetMaterialComponents.TextImputEditText"`. For me it wasn't gravity or color.
3,608,234
My `EditText` configured as follows won't show the hint: ``` <EditText android:layout_width="fill_parent" android:layout_height="wrap_content" android:gravity="right" android:hint="The hint..." android:scrollHorizontally="true" android:singleLine="true" /> ``` It works if I set `android:grav...
2010/08/31
[ "https://Stackoverflow.com/questions/3608234", "https://Stackoverflow.com", "https://Stackoverflow.com/users/435830/" ]
using `android:ellipsize="end"` fixed it for me Weird bug !! (but Android has a lot of these weirdo bug)
Using android:ellipsize="end" resolves the obvious platform bug. Unfortunately, Xperias still misbehave :( I found no other solution than to: ``` if (android.os.Build.MANUFACTURER.matches(".*[Ss]ony.*")) editText.setGravity(Gravity.LEFT); else editText.setGravity(Gravity.CENTER); ```
3,608,234
My `EditText` configured as follows won't show the hint: ``` <EditText android:layout_width="fill_parent" android:layout_height="wrap_content" android:gravity="right" android:hint="The hint..." android:scrollHorizontally="true" android:singleLine="true" /> ``` It works if I set `android:grav...
2010/08/31
[ "https://Stackoverflow.com/questions/3608234", "https://Stackoverflow.com", "https://Stackoverflow.com/users/435830/" ]
You need to give text color to hint ``` android:textColorHint="#000000" ```
Using android:ellipsize="end" resolves the obvious platform bug. Unfortunately, Xperias still misbehave :( I found no other solution than to: ``` if (android.os.Build.MANUFACTURER.matches(".*[Ss]ony.*")) editText.setGravity(Gravity.LEFT); else editText.setGravity(Gravity.CENTER); ```
3,608,234
My `EditText` configured as follows won't show the hint: ``` <EditText android:layout_width="fill_parent" android:layout_height="wrap_content" android:gravity="right" android:hint="The hint..." android:scrollHorizontally="true" android:singleLine="true" /> ``` It works if I set `android:grav...
2010/08/31
[ "https://Stackoverflow.com/questions/3608234", "https://Stackoverflow.com", "https://Stackoverflow.com/users/435830/" ]
I wanted my single-line `EditText` box to scroll but keep the hint on the right also. I had the same issue and got the hint to stick by keeping `gravity="right"`, and setting `singleLine="true"` and `ellipsize="end"`.
No need of `android:scrollHorizontally` attribute. Remove it.`EditText` is a fixed item on the screen. we want scroll the layout contains the EditText is enough. that is the best design too. you have put `android:ellipsize="end"` instead of `android:scrollHorizontally`.
3,608,234
My `EditText` configured as follows won't show the hint: ``` <EditText android:layout_width="fill_parent" android:layout_height="wrap_content" android:gravity="right" android:hint="The hint..." android:scrollHorizontally="true" android:singleLine="true" /> ``` It works if I set `android:grav...
2010/08/31
[ "https://Stackoverflow.com/questions/3608234", "https://Stackoverflow.com", "https://Stackoverflow.com/users/435830/" ]
You need to give text color to hint ``` android:textColorHint="#000000" ```
I changed the style to `"@style/Base.WidgetMaterialComponents.TextImputEditText"`. For me it wasn't gravity or color.
3,608,234
My `EditText` configured as follows won't show the hint: ``` <EditText android:layout_width="fill_parent" android:layout_height="wrap_content" android:gravity="right" android:hint="The hint..." android:scrollHorizontally="true" android:singleLine="true" /> ``` It works if I set `android:grav...
2010/08/31
[ "https://Stackoverflow.com/questions/3608234", "https://Stackoverflow.com", "https://Stackoverflow.com/users/435830/" ]
You need to give text color to hint ``` android:textColorHint="#000000" ```
The below worked for me: ``` <EditText android:id="@+id/UserText" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_alignParentLeft="true" android:layout_alignParentTop="true" android:layout_alignRight="@+id/UserPassword" android:layout_marginTop="85dp"...
229,582
The [Antagonist](http://borderlands.wikia.com/wiki/Antagonist) Seraph shield explicitly states its Damage Reduction on the card (49% maximum, I believe, with the right parts). The [Blockade](http://borderlands.wikia.com/wiki/Blockade) does not explicitly state its Damage Resistance on the card, but [the Wiki](http://bo...
2015/07/27
[ "https://gaming.stackexchange.com/questions/229582", "https://gaming.stackexchange.com", "https://gaming.stackexchange.com/users/46216/" ]
The Blockade blocks more damage, when throwing Chain Lightning at my feet. I recorded some values (and don't remember other conditions, like level): ``` Antagonist (Hyperion) 1827 → 1005 (822) Blockade (Hyperion) 1403 → 710 (693) Blockade (max cap.) 2420 → 1727 (693) Blockade (1563 listed) ...
Antagonist blocks more. According to the [wiki](http://borderlands.wikia.com/wiki/Blockade) Blockade's damage resistance effect can be up to 38%. And the [Antagonist wiki](http://borderlands.wikia.com/wiki/Antagonist) shows an image of a level 61 shield with 49% damage reduction. The percentage of damage reduction f...