Recent Updates RSS Toggle Comment Threads | Keyboard Shortcuts

  • huseyincakir 10:43 pm on December 9, 2011 Permalink | Reply  

    Refresh a Page Every 10 Seconds – incase someone needs 

    </pre>
    <script type="text/javascript">
    
    /***********************************************
    * IFrame SSI script II- © Dynamic Drive DHTML code library (http://www.dynamicdrive.com)
    * Visit DynamicDrive.com for hundreds of original DHTML scripts
    * This notice must stay intact for legal use
    ***********************************************/
    
    //Input the IDs of the IFRAMES you wish to dynamically resize to match its content height:
    //Separate each ID with a comma. Examples: ["myframe1", "myframe2"] or ["myframe"] or [] for none:
    var iframeids=["myframe"]
    
    //Should script hide iframe from browsers that don't support this script (non IE5+/NS6+ browsers. Recommended):
    var iframehide="yes"
    
    var getFFVersion=navigator.userAgent.substring(navigator.userAgent.indexOf("Firefox")).split("/")[1]
    var FFextraHeight=parseFloat(getFFVersion)>=0.1? 16 : 0 //extra height in px to add to iframe in FireFox 1.0+ browsers
    
    function resizeCaller() {
    var dyniframe=new Array()
    for (i=0; i<iframeids.length; i++){
    if (document.getElementById)
    resizeIframe(iframeids[i])
    //reveal iframe for lower end browsers? (see var above):
    if ((document.all || document.getElementById) && iframehide=="no"){
    var tempobj=document.all? document.all[iframeids[i]] : document.getElementById(iframeids[i])
    tempobj.style.display="block"
    }
    }
    }
    
    function resizeIframe(frameid){
    var currentfr=document.getElementById(frameid)
    if (currentfr && !window.opera){
    currentfr.style.display="block"
    if (currentfr.contentDocument && currentfr.contentDocument.body.offsetHeight) //ns6 syntax
    currentfr.height = currentfr.contentDocument.body.offsetHeight+FFextraHeight;
    else if (currentfr.Document && currentfr.Document.body.scrollHeight) //ie5+ syntax
    currentfr.height = currentfr.Document.body.scrollHeight;
    if (currentfr.addEventListener)
    currentfr.addEventListener("load", readjustIframe, false)
    else if (currentfr.attachEvent){
    currentfr.detachEvent("onload", readjustIframe) // Bug fix line
    currentfr.attachEvent("onload", readjustIframe)
    }
    }
    }
    
    function readjustIframe(loadevt) {
    var crossevt=(window.event)? event : loadevt
    var iframeroot=(crossevt.currentTarget)? crossevt.currentTarget : crossevt.srcElement
    if (iframeroot)
    resizeIframe(iframeroot.id);
    }
    
    function loadintoIframe(iframeid, url){
    if (document.getElementById)
    document.getElementById(iframeid).src=url
    }
    
    if (window.addEventListener)
    window.addEventListener("load", resizeCaller, false)
    else if (window.attachEvent)
    window.attachEvent("onload", resizeCaller)
    else
    window.onload=resizeCaller
    
    </script><script type="text/javascript">
    
    $(document).ready(function(){
     var j = jQuery.noConflict();
     j(document).ready(function()
     {
     j(".refreshMe").everyTime(10000,function(i){
     j.ajax({
     url: "refresh-me.php",
     cache: false,
     success: function(html){
     j(".refreshMe").html(html);
     }
     })
     })
     });
     j('.refreshMe').css({color:"red"});
    });
    </script>
    
    <div class="refreshMe">This will get Refreshed in 10 Seconds</div>
    <iframe id="myframe" src="http:/pagetoreload.tr/sonuc/sonuc.aspx" scrolling="no" marginwidth="0" marginheight="0" frameborder="0" vspace="0" hspace="0" style="overflow:visible; width:100%; display:none"></iframe>
    <pre>

    Sources:

    http://www.dynamicdrive.com/dynamicindex17/iframessi2.htm

    http://www.9lessons.info/2009/07/auto-load-refresh-every-10-seconds-with.html
     
  • huseyincakir 6:16 pm on May 10, 2011 Permalink | Reply  

    Google I/O 2011 

    May 10-11, 2011 / Moscone Center, San Francisco

    The events will be streaming the Google I/O keynotes on both days live via the Internet.

     
  • huseyincakir 7:08 pm on April 6, 2011 Permalink | Reply  

    mono:gtkSharp ~ Sliding Text at Drawing Area (Pango.Layout) 

    PROJECT REFERENCES:

    references

    CODE:

    using System;
    using Gtk;
    using System.Xml;
    
    //REFERENCE LINK: http://www.mono-project.com/Pango:Beginners
    
    public class sliding_MyWindow : Window
    {
     Pango.Layout layout;
     Gtk.DrawingArea da;
    
     int width = 500;
     int height = 500;
     int slideIndex=500;
     int arrayIndex=1;
    
     private string[] newsArray;
    
     public sliding_MyWindow()
     :base("sliding_MyWindow")
     {
     this.SetDefaultSize (width, height);
     this.DeleteEvent += new DeleteEventHandler (Onsliding_MyWindowDelete);
    
     da = new Gtk.DrawingArea();
     da.SetSizeRequest(width, height);
    
     layout = new Pango.Layout(this.PangoContext);
     layout.Width = Pango.Units.FromPixels(width);
     layout.Wrap = Pango.WrapMode.Word;
     layout.Alignment = Pango.Alignment.Left;
     layout.FontDescription = Pango.FontDescription.FromString("Arial bold 14");
    
     getNews("http://www.cnnturk.com/servisler/rss/turkiye.rss");
    
     GLib.Timeout.Add(45, new GLib.TimeoutHandler(updateText));
    
     this.Add(da);
     this.ShowAll();
     }
    
     bool updateText()
     {
     slideIndex=slideIndex-2;
    
     da.GdkWindow.Clear();
     da.GdkWindow.DrawLayout(da.Style.TextGC (StateType.Normal),slideIndex,5,layout);
    
     if(slideIndex==0)
     {
     layout.SetMarkup(newsArray[arrayIndex]);
     arrayIndex++;
     slideIndex=500;
     }
    
     return true;
     }
    
     private void getNews(string newsAddress)
     {
     try
     {
     XmlDocument rssDoc = new XmlDocument();
    
     System.Net.HttpWebRequest req = (System.Net.HttpWebRequest) System.Net.WebRequest.Create(newsAddress);
     req.Timeout = 1000; // milliseconds
     System.Net.WebResponse res = req.GetResponse();
     System.IO.Stream responseStream = res.GetResponseStream();
     rssDoc.Load(responseStream);
     responseStream.Close();
    
     XmlNodeList _ngroups = rssDoc.GetElementsByTagName("item");
     if(_ngroups.Count > 0)
     {
     newsArray = new string[_ngroups.Count];
    
     byte spaces0 = 8, spaces1 = 9, spaces2 = 10, spaces3 = 11, spaces4 = 12, spaces5 = 13;
    
     for(int x = 0; x < newsArray.Length; x++)
     {
     for (int y = 0; y< _ngroups[x].ChildNodes.Count; y++)
     {
     switch(_ngroups[x].ChildNodes[y].Name)
     {
     case "title":
     newsArray[x] = _ngroups[x].ChildNodes[y].InnerText + " : ";
     break;
     case "description":
     newsArray[x] += _ngroups[x].ChildNodes[y].InnerText;
     break;
     }
     newsArray[x] = newsArray[x].Replace('\n', ' ').Replace((char)spaces0, ' ').Replace((char)spaces1, ' ').Replace((char)spaces2, ' ').Replace((char)spaces3, ' ').Replace((char)spaces4, ' ').Replace((char)spaces5, ' ');
     }
     }
     }
     else
     {
     Console.WriteLine("_ngroups.Count < 0");
     }
     if(newsArray!=null)
     {
     if(newsArray.Length>0)
     {
     layout.SetMarkup(newsArray[0]);
     Console.WriteLine(newsArray[0]);
     }
     }
     }
     catch(Exception e)
     {
     Console.WriteLine("error in getNews():"+e);
     }
     }
    
     void Onsliding_MyWindowDelete (object sender, DeleteEventArgs a)
     {
     Application.Quit ();
     a.RetVal = true;
     }
    
     public static void Main()
     {
     Application.Init();
     new sliding_MyWindow();
     Application.Run();
     }
    
    }
    
    

    OUTPUT:

     
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 64 other followers