Tuesday 7 July 2015

How to get weather data from api

just try to run the query in browser and check the result in console window .
just add some string after ?q="AnyStateName"

like ?q=London

var city = $('#city').val(); 
$.get("api.openweathermap.org/data/2.5/weather?q="; + city, function (data, status) {
 console.log(status);

 $.each(data, function (index,value)

 { 
console.log(index + ": " + value);

}



}); 

},"JSON");


and getting this success

 coord: [object Object]

sys: [object Object]

weather: [object Object] 

base: stations

 main: [object Object] 

wind: [object Object]

 clouds: [object Object] 

 rain: [object Object] 

 dt: 1436184609 

 id: 1259229 

name: Pune 

cod: 200

Wednesday 4 March 2015

How to pass data between WPF forms

Introduction

This article will help you to find out issues related to questions like this.
 
If you have any issue similar to above questions than this article may help you in some way.

Using the code

Just make a overload constructor which takes parameters of the window in which you want to retrieve value.
Example:
Suppose we want a user to login from our MainWindow( i.e Login Window ) and
we want to pass an int ID / string Email to our second form to retrieve data of logging user.
Than We have to first overload our second wpf form constructor.
You can either make default constructor to do this or make an overload constructor for this work.

SecondForm:
public secondForm()
 {

    //Your Default Constructor Logic 

 } 

public secondForm(string email_ ) 

 {    
   //Your Overload Constructor Logic
 }
Now in MainWindow from where we are logging and passing our EMail
MainWindow:
public void btnLogin()
 { 

     //On Success

     SecondWindow sw = new SecondWindow(txtBoxEMail.Content); 
     sw.Show(); 

  }

 

Monday 12 May 2014

Connection String for .sdf database in App_Data in WPF Application.

Connection String for .sdf database in App_Data in WPF Application.



first create a App_Data folder in your project then add .sdf database in it, after that include your app.config file if not present in your project by right clicking on project then new item then app.config. So in your app.config file write this line.

<configuration>
  <connectionStrings>
    <add name="my" 
connectionString =" Data Source =|DataDirectory|\App_Data\your_database_name.sdf; Persist Security Info=True"
            providerName="Microsoft.SqlServerCe.Client.4.0"/>
  </connectionStrings>
</configuration>

so, simple.
Enjoy.

Monday 23 December 2013

Text Shadow 

As name itself say what is about. It give shadow to text written in our web-page.

Code in your Page.

<!DOCTYPE html>
 
<html >
<head runat="server">
    <title>Text Shadow</title>
    <style type="text/css">
#text{
   -moz-text-shadow1px 2px 2px #555;     - For Mozilla Browser which doesn't support W3C
   -webkit-text-shadow: 1px 2px 2px #555;   - For Webkit Browser which doesn't support W3C
   text-shadow: 1px 2px 2px #555;           -For all if they support CSS standards as per W3C

     }
    </style>
</head>
<body>
<div>
<p id="text">Hello</p>
</div>

</body> 
</html>


Just run your .html/.aspx/.php web page in browser to see the effect .IE9+ supports text-shadow so don't do efforts for that.Overall others browsers support this functionality .

Live Example to see - http://www.apunkashaher.com
Here you can see Dark Shadow behind every character .
Change the values to see great effect & for fun .
Don't just copy & paste .
Be Creative :) .....

Thursday 12 September 2013

What is CSS ?

CSS (the game changer )

CSS - cascading style sheet .

But what is the use of css in web technologies , really are you thinking this ?.. lol.
The Websites, webpages anything which is alive on internet, which can be accessed from your computer by typing url in your Web Browser you have visited till now when you start using internet use CSS. Isn't that amazing ? yes it is ..

I am not telling you story when it started , there are plenty of sites on web to search it for .

So what i am doing, is giving you straight forward tips on CSS, for building great looking websites.

So dear, take a beer and bookmark this. There is many more to come here.