Recent Updates Toggle Comment Threads | Keyboard Shortcuts

  • huseyincakir 8:42 am on October 31, 2014 Permalink | Reply  

    My Android Application in Google Play 

    Facebook With Message

    It is a webview application that opens facebook.com. (No need extra application for facebook messages.)

    Download Link: https://play.google.com/store/apps/details?id=com.fcbookMes1.Mes

    api.qrserver.com

     

     
  • huseyincakir 7:40 am on September 24, 2014 Permalink | Reply  

    HTML Page To Create Vcard QR 

    
    <!DOCTYPE html>
    <html lang="TR">
    <head>
    <meta http-equiv="Content-type" content="UTF-8" />
    <script src="jquery.min.js"></script>
    <title>QR</title>
    <meta name="description" content="Find the latitude and longitude of a point using Google Maps.">
    <meta name="keywords" content="latitude, longitude, google maps, get latitude and longitude">
    <script type="text/javascript" src="http://maps.googleapis.com/maps/api/js?sensor=false"></script>
    <script type="text/javascript">
    //<![CDATA[
    
    var map = null;
    var latsgn = 1;
    var lgsgn = 1;
    var marker = null;
    var posset = 0;
    var mrks = {mvcMarkers: new google.maps.MVCArray()};
    var iw;
    var drag=false;
    
    function Gmap() {
    ll = new google.maps.LatLng(39.426871,27.141053);
    zoom=15;
    var mO = {
    scaleControl:true,
    zoom:zoom,
    zoomControl:true,
    zoomControlOptions: {style:google.maps.ZoomControlStyle.LARGE},
    center: ll,
    disableDoubleClickZoom:true,
    mapTypeId: google.maps.MapTypeId.ROADMAP
    };
    
    map = new google.maps.Map(document.getElementById("map"), mO);
    map.setTilt(0);
    map.panTo(ll);
    marker = new google.maps.Marker({position:ll,map:map,draggable:true,title:'Drag this pin and place you want!.'});
    
    google.maps.event.addListener(marker, 'click', function(mll) {
    var html= "<div style='color:#000;background-color:#fff;padding:5px;width:150px;'><p>Latitude - Longitude:<br />" + String(mll.latLng.toUrlValue()) + "<br /></p></div>";
    iw = new google.maps.InfoWindow({content:html});
    iw.open(map,marker);
    });
    google.maps.event.addListener(marker, 'dragstart', function() {if (iw){iw.close();}});
    
    google.maps.event.addListener(marker, 'dragend', function(event) {
    posset = 1;
    
    if (map.getZoom() < 10){map.setZoom(15);}
    map.setCenter(event.latLng);
    computepos(event.latLng);
    drag=true;
    setTimeout(function(){drag=false;},250);
    });
    
    google.maps.event.addListener(map, 'click', function(event) {
    if (drag){return;}
    posset = 1;
    popInfo(event.latLng) ;
    if (map.getZoom() < 10){map.setZoom(10);}
    map.panTo(event.latLng);
    computepos(event.latLng);
    });
    
    }
    
    function computepos (point)
    {
    var latA = Math.abs(Math.round(point.lat() * 1000000.));
    var lonA = Math.abs(Math.round(point.lng() * 1000000.));
    if(point.lat() < 0)
    {
    var ls = '-' + Math.floor((latA / 1000000)).toString();
    }
    else
    {
    var ls = Math.floor((latA / 1000000)).toString();
    }
    var lm = Math.floor(((latA/1000000) - Math.floor(latA/1000000)) * 60).toString();
    var ld = ( Math.floor(((((latA/1000000) - Math.floor(latA/1000000)) * 60) - Math.floor(((latA/1000000) - Math.floor(latA/1000000)) * 60)) * 100000) *60/100000 ).toString();
    if(point.lng() < 0)
    {
    var lgs = '-' + Math.floor((lonA / 1000000)).toString();
    }
    else
    {
    var lgs = Math.floor((lonA / 1000000)).toString();
    }
    var lgm = Math.floor(((lonA/1000000) - Math.floor(lonA/1000000)) * 60).toString();
    var lgd = ( Math.floor(((((lonA/1000000) - Math.floor(lonA/1000000)) * 60) - Math.floor(((lonA/1000000) - Math.floor(lonA/1000000)) * 60)) * 100000) *60/100000 ).toString();
    document.getElementById("latbox").value=point.lat().toFixed(6);
    document.getElementById("lonbox").value=point.lng().toFixed(6);
    }
    
    // Display box over pin and show Latitude and Longitude info
    function popInfo(point)
    {
    var html= "<div style='color:#000;background-color:#fff;padding:3px;width:150px;'><p>Latitude - Longitude:<br />" + String(point.toUrlValue()) + "<br /></p></div>";
    var iw = new google.maps.InfoWindow({content:html});
    var marker = new google.maps.Marker({position:point,map:map,icon:'/i/blue-dot.png',draggable:true});
    mrks.mvcMarkers.push(marker);
    google.maps.event.addListener(marker, 'click', function(event) {
    var html= "<div style='color:#000;background-color:#fff;padding:3px;width:150px;'><p>Latitude - Longitude:<br />" + String(event.latLng.toUrlValue()) + "<br /><br />Lat: " + ls +  "° " + lm +  "' "  + ld + ""<br />Long: " + lgs +  "° " + lgm +  "' " + lgd + ""</p></div>";
    var iw = new google.maps.InfoWindow({content:html});
    iw.open(map,marker);
    computepos(event.latLng);
    });
    }
    
    // Clear form value
    function reset() {
    mrks.mvcMarkers.forEach(function(elem, index) {elem.setMap(null);});
    mrks.mvcMarkers.clear();
    document.getElementById("latbox").value='';
    document.getElementById("lonbox").value='';
    marker.setPosition(map.getCenter());
    }
    
    
    function pincenter() {
    marker.setPosition(map.getCenter());
    computepos (map.getCenter());
    }
    function myFunction() {
    window.open("http://api.qrserver.com/v1/create-qr-code/?color=000000&bgcolor=FFFFFF&data=BEGIN%3AVCARD%0AVERSION%3A2.1%0AFN%3A" + document.getElementById("namebox").value+ "+" +  document.getElementById("surnamebox").value+"%0AN%3A" + document.getElementById("surnamebox").value+ "%3B"+ document.getElementById("namebox").value+"%0ATITLE%3A"+document.getElementById("titlebox").value+"%0ATEL%3BCELL%3A%2B"+document.getElementById("cellbox").value+"%0ATEL%3BWORK%3BVOICE%3A%2B"+ document.getElementById("workbox").value+"%0AEMAIL%3BWORK%3BINTERNET%3A"+ document.getElementById("emailbox").value+"%0AURL%3A"+ document.getElementById("urlbox").value +"%0AORG%3A"+document.getElementById("orgbox").value+"%0AADR%3A%3B%3B"+document.getElementById("latbox").value+","+document.getElementById("lonbox").value+"%0ANOTE%3A"+document.getElementById("adressbox").value+"%0AEND%3AVCARD%0A&qzone=1&margin=0&size=400x400&ecc=L");
    
    }
    
    //]]>
    </script>
    
    <link rel="stylesheet" href="//netdna.bootstrapcdn.com/bootstrap/3.1.1/css/bootstrap.min.css">
    <!-- Optional theme -->
    <link rel="stylesheet" href="//netdna.bootstrapcdn.com/bootstrap/3.1.1/css/bootstrap-theme.min.css">
    <style>
    .header{
    display: block;
    position: relative;
    }
    .navbar-brand img{
    position: relative;
    top: -10px;
    }
    .form-up{
    max-width: 330px;
    padding: 15px;
    margin: 0 auto;
    }
    .error{
    color: red;
    font-weight: bold;
    font-size: 18px;
    text-align: center;
    }
    .ftr-cnt{
    display: block;
    text-align: center;
    color: #ccc;
    font-weight: bold;
    margin-top: 10px;
    }
    .content{
    display: block;
    margin: auto;
    }
    .gap{
    display: block;
    margin: 20px auto 40px auto;
    }
    
    </style>
    
    </head>
    <body onload="Gmap()">
    <div class="header">
    <div class="navbar navbar-inverse navbar-static-top ">
    <div class="container">
    <!-- Add your navigation -->
    <div class="navbar-header">
    <!-- Button for responsive menu //-->
    
    
    </div>
    <div class="collapse navbar-collapse">
    
    </div>
    </div>
    </div>
    </div>
    <div id="content">
    <div id="map" style="width: 100%; height: 450px"></div>
    </div>
    
    <h3>QR Bilgileri Giriniz:</h3>
    
    <table>
    <tr>
    <td>Ad:</td>
    <td><input size="150" type="text" id="namebox" name="name" value="" ></td>
    </tr>
    <tr>
    <td>Soyad:</td>
    <td><input size="150" type="text" id="surnamebox" name="surname" value="" ></td>
    </tr>
    <tr>
    <td>Ünvan:</td>
    <td><input size="150" type="text" id="titlebox" name="title" value="" ></td>
    </tr>
    <tr>
    <td>Url:</td>
    <td><input size="150" type="text" id="urlbox" name="url" value="" ></td>
    </tr>
    <tr>
    <td>Org:</td>
    <td><input size="150" type="text" id="orgbox" name="org" value="" ></td>
    </tr>
    <tr>
    <td>Latitude:</td>
    <td><input size="150" type="text" id="latbox" name="lat" value="39.42680" ></td>
    </tr>
    <tr>
    <td>Longitude:</td>
    <td><input size="150" type="text" id="lonbox" name="lon" value="27.14102" ></td>
    </tr>
    <td>Cell:</td>
    <td><input size="150" type="text" id="cellbox" name="cell" value="" ></td>
    </tr>
    <td>Work:</td>
    <td><input size="150" type="text" id="workbox" name="work" value="" ></td>
    </tr>
    <td>Email:</td>
    <td><input size="150" type="text" id="emailbox" name="email" value="" ></td>
    </tr>
    <td>Adress:</td>
    <td><input size="150" type="text" id="adressbox" name="adress" value="" ></td>
    </tr>
    <td></td>
    <td> <button onclick="myFunction()">QR</button> </td>
    </tr>
    </table>
    
    
    <div class="container">
    
    </div>
    <!-- Latest compiled and minified JavaScript -->
    <script src="//netdna.bootstrapcdn.com/bootstrap/3.1.1/js/bootstrap.min.js"></script>
    
    <script>
    (function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){
    (i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),
    m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)
    })(window,document,'script','//www.google-analytics.com/analytics.js','ga');
    
    ga('create', 'UA-44831294-1', 'trinityblog.in');
    ga('send', 'pageview');
    
    </script>
    </body>
    </html>
    
    &nbsp;
    <pre>
     
  • huseyincakir 7:39 pm on January 6, 2014 Permalink | Reply  

    Sending Mail Async 

    This post is for an answer to “how can I show progress of sending mail” question for my old post: http://huseyincakir.wordpress.com/2010/03/11/mono-c-sending-mail-through-gmail/

    Here is my solution;

    using System;
    using System.Net.Mail;
    using System.Collections.Generic;
    using System.Text;
    using Gtk;
    using GtkSharp;
    using GLib;
    using System.Net;
    using System.Security.Cryptography.X509Certificates;
    using System.Net.Security;
    using System.Net.Mime;
    using System.Threading;
    using System.ComponentModel;
    namespace KentSoft
    {
     class printTest : Window
     {
     public printTest()
     : base("calisma")
     {
    
     try{
     MailMessage mail = new MailMessage();
     SmtpClient SmtpServer = new SmtpClient("smtp.gmail.com");
     mail.From = new MailAddress("yourmail@gmail.com");
     mail.To.Add("hismail@gmail.com");
     mail.Subject = "TEST";
     mail.Body = "This is for testing SMTP mail from GMAIL";
     SmtpServer.Port = 587;
     SmtpServer.Credentials = new System.Net.NetworkCredential("youmailwithout@gmail.com", "yourpassword");
     SmtpServer.EnableSsl = true;
    
     SmtpServer.SendCompleted += new SendCompletedEventHandler(client_SendCompleted);
    
     string userState = "test message1";
     SmtpServer.SendAsync(mail, userState);
     Console.WriteLine("Sending message... press c to cancel mail. Press any other key to exit.");
     string answer = Console.ReadLine();
     // If the user canceled the send, and mail hasn't been sent yet,
     // then cancel the pending operation.
     if (answer.StartsWith("c") && mailSent == false)
     {
     SmtpServer.SendAsyncCancel();
     }
     // Clean up.
     mail.Dispose();
     Console.WriteLine("Goodbye.");
     }
    
     catch(Exception e){
     Console.WriteLine("Ouch!"+e.ToString());
     }
     }
    
    void client_SendCompleted(object sender, AsyncCompletedEventArgs e)
     {
     // Get the unique identifier for this asynchronous operation.
     String token = (string) e.UserState;
    
    if (e.Cancelled)
     {
     Console.WriteLine("[{0}] Send canceled.", token);
     }
     if (e.Error != null)
     {
     Console.WriteLine("[{0}] {1}", token, e.Error.ToString());
     } else
     {
     Console.WriteLine("Message sent.");
     }
     mailSent = true;
     }
     static bool mailSent = false;
    
     public static void Main()
     {
     Application.Init();
     new printTest();
     Application.Run();
     }
     }
    }
    
     
c
Compose new post
j
Next post/Next comment
k
Previous post/Previous comment
r
Reply
e
Edit
o
Show/Hide comments
t
Go to top
l
Go to login
h
Show/Hide help
shift + esc
Cancel
Follow

Get every new post delivered to your Inbox.

Join 93 other followers