Thursday 28 November 2013

hiding keyboard in ios

call below code from event like clicking close button will close keyboard in ios
-(void)close:(id)sender{
    [text field name resignFirstResponder];
 }

sharing via option for ios

Using UIActivityViewController you can share anything from app, see the below example code

Import two packages

#import <Social/Social.h>
#import <MobileCoreServices/MobileCoreServices.h>

-(IBAction)shareLink:(NSArray *)link{
    link = @[@""];     //for single object either text ot image or etc
    UIActivityViewController *act = [[UIActivityViewController alloc] initWithActivityItems:link applicationActivities:nil];
    [self presentViewController:act animated:YES completion:nil];
}

Friday 22 November 2013

how to use like for multiple values in oracle

we can use or keyword with below  statement

(columns1 like  '%XXXX%' or column1 like '%yyyy%' or column1 like '%zzzz%') is same as 

Wednesday 20 November 2013

event.returnValue is deprecated. Please use the standard event.preventDefault() instead.

download jquery-1.9.1.js file search for event.returnvalue(***.returnvalue) and replace with event.preventDefault(***.preventDefault) and save this js file and place in supporting file.

$ is not defined

$ is not defined while running jquery script code , replace header file with below links

<link rel="stylesheet" href="https://code.jquery.com/ui/1.10.3/themes/smoothness/jquery-ui.css" />

<script src="js/jquery-1.9.1.js" type="text/javascript"></script>

<script src="https://code.jquery.com/ui/1.10.3/jquery-ui.js" type="text/javascript"></script>
  <link rel="stylesheet" href="/resources/demos/style.css" />

it will work

Saturday 16 November 2013

error adding setOnKeyListener in android

myEditText.setOnKeyListener(new OnKeyListener() {
    public boolean onKey(View v, int keyCode, KeyEvent event) {
Above code in android gets compiling error because it uses View's V so 
replace with below code
 myEditText.setOnKeyListener(new View.OnKeyListener() {
  public boolean onKey(View v, int keyCode, KeyEvent event) {


Wednesday 13 November 2013

window.alert bold text


we cannot change inbuilt window.alert functionality but below code customizes window.alert for example we can get bold text etc.

copy paste the code in your notepad and save with .html and check.

<html>
<style type="text/css">
#modalContainer {
position:absolute;
width:100%;
height:100%;
top:0px;
left:0px;
z-index:10000;
}
#alertBox {
position:relative;
width:350px;
min-height:150px;
margin-top:0px;
border:1px solid LightGray;
background-repeat:no-repeat;
background-position:20px 30px;
}
#modalContainer > #alertBox {
position:fixed;
}
#alertBox p {
font:0.8em verdana,arial;
height:50px;
padding-left:5px;
}
#alertBox #closeBtn {
display:block;
position:relative;
left:125px;
top:30px;
margin:5px auto;
padding:5px 0 8 0;
border:1px solid blue;
width:70px;
font:bold 0.7em verdana,arial;
text-decoration:none;
text-align:center;
color:black;
}
</style>
<script language="javascript">
if(document.getElementById) {
window.alert = function(txt) {
createCustomAlert(txt);
}
}
function createCustomAlert(txt) {
d = document;
if(d.getElementById("modalContainer")) return;
mObj = d.getElementsByTagName("body")[0].appendChild(d.createElement("div"));
mObj.id = "modalContainer";
mObj.style.height = document.documentElement.scrollHeight + "px";
alertObj = mObj.appendChild(d.createElement("div"));
alertObj.id = "alertBox";
if(d.all && !window.opera) alertObj.style.top = document.documentElement.scrollTop + "px";
alertObj.style.left = (d.documentElement.scrollWidth - alertObj.offsetWidth)/2 + "px";
msg = alertObj.appendChild(d.createElement("p"));
msg.innerHTML = txt;
btn = alertObj.appendChild(d.createElement("a"));
btn.id = "closeBtn";
btn.appendChild(d.createTextNode("OK"));
btn.href = "#";
btn.onclick = function() { removeCustomAlert();return false; }
}
function removeCustomAlert() {
document.getElementsByTagName("body")[0].removeChild(document.getElementById("modalContainer"));
}
</script>
<body>
<input type="button" value = "Test the alert" onclick="alert('<b>This</b> is a custom alert dialog that was created by over-riding the window.alert method.');" />
</body>
</html>