Monday, 2 September 2013

Make a Child Div Extend to Browser Size

Make a Child Div Extend to Browser Size

I was wondering how to make a div with position:absolute extend to the
bottom of the browser when it is the child of a div with
position:relative. Here is the html:
<div id='square'>
<div id='rectangle' /></div>
And here is the css:
#square {
position:relative;
height:100px;
width:100px;
background:red;
}
#rectangle {
position:absolute;
width:50px;
background:blue;
height:100%;
}
http://jsfiddle.net/mHpuW/

Why doesnt collapseActionView() close SearchView

Why doesnt collapseActionView() close SearchView

I have an Android application that employs an ActionBar SearchView
Everything works fine when requesting a search, the search icon expands to
allow text entry, the softkeyboard appears, i enter a query string and
this is passed to my designated SearchActivity to display the search
results.
The problem is that on pressing the back button and returning to the
original activity the SearchView is still expanded, and still contains my
search query. I have attempted to call collapseActionView() on the
searchMenuItem however this doesn't work.
When i test the menuItem for isActionViewExpanded it returns false.
how do i get the desired behaviour?

Import MySQL data from xampp

Import MySQL data from xampp

I have created a MySQL-database for a website in xampp. Today got my new
server which is running ubuntu. Everything is installed and working fine.
I want to move database which I created in xampp and move it to my server,
can someone tell me how to do this? The database is created with
phpmyadmin.
Best regards! Emil

Compatibility issues when installing MS JVM on Win 7

Compatibility issues when installing MS JVM on Win 7

I am trying to install MS JVM on Windows 7. However, it will pop up a
dialog (shown in the screenshot) about compatibility issues. I have
followed the instruction here (http://support.microsoft.com/kb/304930) to
try to install the MS JVM with silent mode , but the dialog will still
display. Is there any way to skip the compatibility dialog?

Sunday, 1 September 2013

java collection usage as map and retrieving data

java collection usage as map and retrieving data

Map<String, List<OfferBean>> map = new HashMap<String, List<OfferBean>>();
List<OfferBean> al=new ArrayList<OfferBean>();
OfferBean of=null;
sql="select * from catgory";
ps1=c.prepareStatement(sql);
ps1.execute();
rs=ps1.getResultSet();
if(rs.next())
{
System.out.println("inside loop of if");
sql="select * from catgory";
ps1=c.prepareStatement(sql);
ps1.execute();
rs=ps1.getResultSet();
while(rs.next())
{
of=new OfferBean();
System.out.println("inside loop of while");
of.setCategory(rs.getString("catgoryname"));
al.add(of);
}
map.put("key", al);
i want use two array list the both array list i will put inside map by
using key and i want to pass to the jsp side in the jsp side i want
retrieve the data using jstl how to reteive it plz any one help me

Postcode and Country Match with Javascript

Postcode and Country Match with Javascript

i have some difficulties to get a regex running for this cases - sorry i´m
very new to regex and can´t figure it out.
the pattern look like this
12 (true)
123 (true)
1234 (true)
12345 (true)
123 münchen (false)
12345 münchen (true)
12345 mün (true)
münchen 123 (false)
mün 12345 (true)

so if combined with letters, postcode has to fullfill the max lenth given
in the range like {2,5}
I tried with this one, but is doesn´t work like i need it

/^([0-9]{2,5})(\s+[^a-zA-Z]{2,})?$/
can somebody help me out thx in advanced

Fade in and Fade out list items on hover

Fade in and Fade out list items on hover

I have the menu created as below. I want the menu items to fade in and
fade out slowly on mouse hover. I am using the below Jquery to achieve
this but some how it doesn't works. Can anyone help me with this?
<style>
/* Main Menu */
#menu {
width: 100%;
margin: 0;
padding: 10px 0 0 0;
list-style: none;
background: #111;
background: -moz-linear-gradient(#DCDCDC, #DCDCDC);
background: -webkit-gradient(linear,left bottom,left
top,color-stop(0, #111),color-stop(1, #DCDCDC));
background: -webkit-linear-gradient(#DCDCDC, #DCDCDC);
background: -o-linear-gradient(#DCDCDC, #DCDCDC);
background: -ms-linear-gradient(#DCDCDC, #DCDCDC);
background: linear-gradient(#DCDCDC,#DCDCDC);
-moz-border-radius: 50px;
border-radius: 50px;
-moz-box-shadow: 0 2px 1px #DCDCDC;
-webkit-box-shadow: 0 2px 1px #DCDCDC;
box-shadow: 0 2px 1px #DCDCDC;
}
#menu li {
float: left;
padding: 0 0 10px 0;
position: relative;
line-height: 0;
}
#menu a {
float: left;
height: 25px;
padding: 0 10px;
color: #999;
text-transform: uppercase;
font: bold 11px/25px Arial, Hengou; /*syed*/
text-decoration: none;
text-shadow: 0 1px 0 #000;
}
#menu li:hover > a {
color: #fafafa;
}
#menu li:hover > ul {
display: block;
}
/* Sub Menu */
#menu ul {
list-style: none;
margin: 0;
padding: 0;
display: none;
position: absolute;
top: 45px;
left: 0;
z-index: 99999;
background: #444;
background: -moz-linear-gradient(#DCDCDC,#DCDCDC);
background: -webkit-gradient(linear,left bottom,left
top,color-stop(0, #111),color-stop(1,#DCDCDC));
background: -webkit-linear-gradient(#DCDCDC,#DCDCDC);
background: -o-linear-gradient(#DCDCDC, #DCDCDC);
background: -ms-linear-gradient(#DCDCDC, #DCDCDC);
background: linear-gradient(#DCDCDC, #DCDCDC);
-moz-box-shadow: 0 0 2px rgba(255,255,255,.5);
-webkit-box-shadow: 0 0 2px rgba(255,255,255,.5);
box-shadow: 0 0 2px rgba(255,255,255,.5);
-moz-border-radius: 5px;
border-radius: 5px;
}
#menu ul ul {
top: 0px;
left: 195px;
}
#menu ul li {
float: none;
margin: 0;
padding: 0;
display: block;
-moz-box-shadow: 0 1px 0 #111111, 0 2px 0 #777777;
-webkit-box-shadow: 0 1px 0 #111111, 0 2px 0 #777777;
box-shadow: 0 1px 0 #111111, 0 2px 0 #777777;
}
#menu ul li:last-child {
-moz-box-shadow: none;
-webkit-box-shadow: none;
box-shadow: none;
}
#menu ul a {
padding: 10px;
height: 10px;
width: 165px;
height: auto;
line-height: 1;
display: block;
white-space: nowrap;
float: none;
text-transform: none;
}
*:first-child + html #menu ul a /* IE7 */ {
height: 10px;
}
#menu ul a:hover {
background: #808080;
background: -moz-linear-gradient(#808080,#808080);
background: -webkit-gradient(linear, left top, left bottom,
from(#808080), to(#808080));
background: -webkit-linear-gradient(#808080,#808080);
background: -o-linear-gradient(#808080, #808080);
background: -ms-linear-gradient(#808080, #808080);
background: linear-gradient(#808080, #808080);
}
#menu ul li:first-child > a {
-moz-border-radius: 5px 5px 0 0;
border-radius: 5px 5px 0 0;
}
/*Set lines between menu*/
#menu ul li:first-child > a:after {
content: '';
position: absolute;
left: 30px;
top: -10px;
width: 0;
height: 0;
border-left: 12px solid transparent;
border-right: 12px solid transparent;
border-bottom: 16px solid #DCDCDC;
}
#menu ul ul li:first-child a:after {
left: -10px;
top: 5px;
width: 0;
height: 0;
border-left: 0;
border-bottom: 12px solid transparent;
border-top: 12px solid transparent;
border-right: 16px solid #DCDCDC;
}
#menu ul li:first-child a:hover:after {
border-bottom-color:#DCDCDC;
}
#menu ul ul li:first-child a:hover:after {
border-right-color: #DCDCDC;
border-bottom-color: transparent;
}
#menu ul li:last-child > a {
-moz-border-radius: 0 0 5px 5px;
border-radius: 0 0 5px 5px;
}
/* Clear floated elements */
#menu:after {
visibility: hidden;
display: block;
font-size: 0;
content: " ";
clear: both;
height: 0;
}
* html #menu { zoom: 1; } /* IE6 */
*:first-child+html #menu { zoom: 1; } /* IE7 */
</style>
<ul id="menu">
<li><a href="">Home</a></li>
<li>
<a href="#">My Company</a>
<ul>
<li>
<a href="">About Me</a>
</li>
<li>
<a href="">New Menu</a>
</li>
<li>
<a href="">Board of Trustees</a>
</li>
<li>
<a href="#">Core Services</a>
<ul>
<li><a href="">Membership</a></li>
<li><a href="">Investments</a></li>
<li><a href="">Benefits</a></li>
<li><a href="">Students Loan</a></li>
</ul>
</li>
<li>
<a href="">Executive Committee</a>
</li>
<li>
<a href="">Mission and Vision</a>
</li>
</ul>
</li>
<li><a href="">Statistics</a></li>
<li><a href="">News</a></li>
<li><a href="">Resources</a></li>
<li>
<a href="#">Self Services</a>
<ul>
<li>
<a href="#">Benefit Application</a>
</li>
<li>
<a href="#">Employer Enrolment</a>
</li>
<li>
<a href="#">Member Enrolment</a>
</li>
</ul>
</li>
<li><a href="">FAQs</a></li>
<li>
<a href="#">Contact Us</a>
<ul>
<li>
<a href="">Contact Information</a>
</li>
<li>
<a href="">Customer Ser Loc</a>
</li>
<li>
<a href="">Telephone Directory</a>
</li>
<li>
<a href="">My Menu Locations Map</a>
</li>
</ul>
</li>
<li><a href="http://www.google.com/">Apps</a></li>
<li><a href="http://www.google.com/">Enquiries</a></li>
</ul>
<script type="text/javascript">
jQuery(document).ready(function () {
// $('#subList').hide();
$("#menu li a").hover(function () {
var timeOutId = window.setTimeout(function () {
// timeoutId = null;
$(this).children("ul").delay(3000).fadeIn();
}, 2000);
},
function () {
$(this).children("ul").delay(3000).fadeOut();
})
});
</script>