Questions

Convert Existing Eclipse Project to Maven Project

For a project at work, we're considering using the Maven plugin for Eclipse to automate our builds. Right now the procedure is far more complicated than it ought to be, and we're hoping that Maven wil...

17 Mar at 20:36

Set a div width, align div center and text align left

I have a small problem but I can't get it solved. I have a content header of 864px width, a background image repeated-y and footer image. Now I have this `<div>` over the background image and I want ...

20 Jan at 06:17

How to resize Twitter Bootstrap modal dynamically based on the content

I have database content which has different types of data, such as Youtube videos, Vimeo videos, text, Imgur pictures, etc. All of them have different heights and widths. All I have found while search...

What is the Java ?: operator called and what does it do?

I have been working with Java a couple of years, but up until recently I haven't run across this construct: ``` int count = isHere ? getHereCount(index) : getAwayCount(index); ``` This is probably ...

SQL Query to add a new column after an existing column in SQL Server 2005

I need a SQL query which add a new column after an existing column, so the column will be added in a specific order. Please suggest me if any `ALTER` query which do that.

25 Jul at 13:17

Pycharm/Python OpenCV and CV2 install error

I've been trying to install both OpenCV and cv2 from both Pycharm and from the terminal as suggested using: ``` pip install --user opencv pip install --user cv2 ``` but I'm getting the following er...

12 Jun at 15:54

Rails where condition using NOT NIL

Using the rails 3 style how would I write the opposite of: ``` Foo.includes(:bar).where(:bars=>{:id=>nil}) ``` I want to find where id is NOT nil. I tried: ``` Foo.includes(:bar).where(:bars=>{:i...

How to read and write XML files?

I have to read and write to and from an [XML](http://en.wikipedia.org/wiki/XML) file. What is the easiest way to read and write XML files using Java?

1 Apr at 19:59

IntelliJ: Never use wildcard imports

Is there a way to tell IntelliJ never to use wildcard imports? Under 'Settings > Code Style > Imports', I can see that you can specify the 'class count' prior to IntelliJ using wildcard imports. Howe...

27 Oct at 13:49

Clear back stack using fragments

I ported my Android app to honeycomb and I did a big refactor in order to use fragments. In my previous version, when I pressed the Home button I used to do a `ACTIVITY_CLEAR_TOP` in order to reset th...

23 Mar at 15:56

Jenkins pipeline if else not working

I am creating a sample jenkins pipeline, here is the code. ``` pipeline { agent any stages { stage('test') { steps { sh 'echo hello' } ...

24 Apr at 12:21

Auto refresh page every 30 seconds

I have a JSP page which has to display the status of various jobs that are running. Some of these jobs take time, so it takes a while for their status to change from processing to complete. Is it a g...

1 Feb at 00:40

Convert Json Array to normal Java list

Is there a way to convert JSON Array to normal Java Array for android ListView data binding?

23 Jul at 21:42

JOptionPane YES/No Options Confirm Dialog Box Issue

I've created a `JOptionPane` and it only has two buttons `YES_NO_OPTION` . After `JOptionPane.showConfirmDialog` pops out , I want to click `YES BUTTON` to continue opening the `JFileChooser` and if ...

15 Feb at 00:47

Bootstrap trying to load map file. How to disable it? Do I need to do it?

I'm recently playing with bootsrap3. I compiled it from sources and included distr js and css to my project. The thing is, I see in GH dev tools, that it's trying to get .map.css file. Why does it wan...

Creating a JavaScript cookie on a domain and reading it across sub domains

Below is a JavaScript cookie that is written on the user's computer for 12 months. After we set the cookie on our main domain such as `example.com`, should the user visit a subdomain like `test.examp...

23 Jul at 16:56

.prop('checked',false) or .removeAttr('checked')?

With the introduction of the prop method, now I need to know the accepted way of unchecking a checkbox. Is it: ``` $('input').filter(':checkbox').removeAttr('checked'); ``` or ``` $('input').filt...

29 May at 19:11

How to insert data into elasticsearch

I am new to Elasticearch, and I have been trying for 2 days to insert some data into Elasticearch. I found on Google that there are many pages to help to create an index (I am not clear about "index",...

23 May at 12:23

sweet-alert display HTML code in text

I am using sweet-alert plugin to display an alert. With a classical config (defaults), everything goes OK. But when I want to add a HTML tag into the TEXT, it display `<b>...</b>` without making it bo...

12 Dec at 18:25

CSS @media print issues with background-color;

I'm attempting to make a printable stylesheet for our app but I'm having issues with `background-color` in `@media print`. ``` @media print { #header{display:none;} #adwrapper{display:none...

29 Dec at 01:18

How can I mock the JavaScript 'window' object using Jest?

I need to test a function which opens a new tab in the browser ``` openStatementsReport(contactIds) { window.open(`a_url_${contactIds}`); } ``` I would like to mock 's `open` function, so I can ver...

4 Aug at 21:6

How to show current user name in a cell?

In most of the online resource I can find usually show me how to retrieve this information in VBA. Is there any direct way to get this information in a cell? For example as simple as `=ENVIRON('User'...

How do I get the IP address into a batch-file variable?

I have an odd question, not sure if its possible. I'd like to write a script, and for example I'm going to use ipconfig as my command. Now when you normally run this command theres a ton of output. ...

11 May at 19:15

Change Color of Fonts in DIV (CSS)

I am trying to change the color and size of H2 font and H2 link fonts based on the div they are in but have not been successful. What am I doing wrong? ``` <style> h2 { color:fff; font-size: 20px; }...

21 Oct at 16:16

Plot mean and standard deviation

I have several values of a function at different x points. I want to plot the mean and std in python, like the answer of [this SO question](https://stackoverflow.com/questions/19797846/plot-mean-stand...

23 May at 12:34