Sunday, July 5, 2015

POSISI MATAHARI DAN PENENTUAN JADWAL SALAT

Dalam penentuan jadwal salat, data astronomi terpenting adalah posisi matahari dalam koordinat horizon, terutama ketinggian atau jarak zenit. Fenomena yang dicari kaitannya dengan posisi matahari adalah fajar (morning twilight), terbit, melintasi meridian, terbenam, dan senja (evening twilight). Dalam hal ini astronomi berperan menafsirkan fenomena yang disebutkan dalam dalil agama (Al-Qur'an dan hadits Nabi) menjadi posisi matahari. Sebenarnya penafsiran itu belum seragam, tetapi karena masyarakat telah sepakat menerima data astronomi sebagai acuan, kriterianya relatif mudah disatukan.
            Di dalam hadits disebutkan bahwa waktu shubuh adalah sejak terbit fajar shidiq (sebenarnya) sampai terbitnya matahari. Di dalam Al-Quran secara tak langsung disebutkan sejak meredupnya bintang-bintang (Q.S. 50:40). Maka secara astronomi fajar shidiq difahami sebagai awal astronomical twilight (fajar astronomi), mulai munculnya cahaya di ufuk timur menjelang terbit matahari pada saat matahari berada pada  kira-kira 18 derajat di bawah horizon (jarak zenit z = 108o). Saaduddin Djambek mengambil pendapat bahwa fajar shidiq bila z = 110o, yang juga digunakan oleh Badan Hisab dan Ru'yat Departemen Agama RI. Fajar shidiq itu disebabkan oleh hamburan cahaya matahari di atmosfer atas. Ini berbeda dengan apa yang disebut fajar kidzib (semu) -- dalam istilah astronomi disebut cahaya zodiak -- yang disebabkan oleh hamburan cahaya matahari oleh debu-debu antarplanet.
            Waktu dzhuhur adalah sejak matahari meninggalkan meridian, biasanya diambil sekitar 2 menit setelah tengah hari. Untuk keperluan praktis, waktu tengah hari cukup diambil waktu tengah antara matahari terbit dan terbenam.
            Dalam penentuan waktu asar, tidak ada kesepakatan karena fenomena yang dijadikan dasar pun tidak jelas. Dasar yang disebutkan di dalam hadits, Nabi SAW diajak shalat asar oleh malaikat Jibril ketika panjang bayangan sama dengan tinggi benda sebenarnya dan pada keesokan harinya Nabi diajak pada saat panjang bayangan dua kali tinggi benda sebenarnya. Walaupun dari dalil itu dapat disimpulkan bahwa awal waktu asar adalah sejak bayangan sama dengan tinggi benda sebenarnya, ini menimbulkan beberapa penafsiran karena fenomena seperti itu tidak bisa digeneralilasi sebab pada musim dingin hal itu  bisa dicapai pada waktu dhuhur, bahkan mungkin tidak pernah terjadi karena bayangan selalu lebih panjang daripada tongkatnya. Ada yang berpendapat tanda masuk waktu asar bila bayang-bayang tongkat panjangnya sama dengan panjang bayangan waktu tengah hari ditambah satu kali panjang tongkat sebenarnya dan pendapat lain menyatakan harus ditambah dua kali panjang tongkat sebenarnya. Pendapat yang memperhitungkan panjang bayangan pada waktu dzhuhur atau mengambil dasar tambahannya dua kali panjang tongkat (di beberapa negara Eropa) dimaksudkan untuk mengatasi masalah panjang bayangan pada musim dingin. Badan Hisab dan Ru'yat Departemen Agama RI menggunakan rumusan: panjang bayangan waktu asar = bayangan waktu dzhuhur + tinggi bendanya; tan(za) = tan(zd) + 1. Saya berpendapat bahwa makna hadits itu dapat difahami sebagai waktu pertengahan antara dhuhur dan maghrib, tanpa perlu memperhitungkan jarak zenit matahari. Hal ini diperkuat dengan ungkapan 'salat pertengahan' dalam Al-Qur'an S. 2:238 yang ditafsirkan oleh banyak mufassir sebagai salat asar. Kalau pendapat ini yang digunakan, waktu salat asar akan lebih cepat sekitar 10 menit dari jadwal salat yang dibuat Departemen Agama.
            Waktu maghrib berarti saat terbenamnya matahari. Matahari terbit atau berbenam didefinisikan secara astronomi bila jarak zenith z = 90o50' (the Astronomical almanac) atau z = 91o bila memasukkan koreksi kerendahan ufuk akibat ketinggian pengamat 30 meter dari permukaan tanah. Untuk penentuan waktu salat maghrib, saat matahari terbenam biasanya ditambah 2 menit karena ada larangan melakukan salat tepat saat matahari terbit, terbenam, atau kulminasi atas.
            Waktu isya ditandai dengan mulai memudarnya cahaya merah di ufuk barat, yaitu tanda masuknya gelap malam (Al-Qur'an S. 17:78). Dalam astronomi itu dikenal sebagai akhir senja astronomi (astronomical twilight) bila jarak zenit matahari z = 108o).
            Posisi matahari telah dapat diformulasikan dalam algoritma sederhana dengan kecermatan plus-minus 2 menit untuk daerah lintang antara 65 derajat LU dan 65 derajat LS. Algoritma itu telah saya ubah menjadi program komputer sederhana penentuan jadwal salat. Untuk daerah dengan lintang lebih  dari 48 derajat pada musim panas senja dan fajar bersambung (continous twilight) sehingga dalam program saya itu waktu isya dan shubuh diqiyaskan (disamakan) pada waktu normal sebelumnya.

10  'JADWAL SALAT SELURUH DUNIA ANTARA LINTANG 65 S - 65 U
20  'OLEH T.DJAMALUDDIN (LAPAN BANDUNG)
30  'MENGIKUTI KRITERIA DEPAG RI
40  '*********************************************
50  INPUT "NAMA FILE, e.g. D:SALAT.JAD"; FILE$
60  OPEN FILE$ FOR OUTPUT AS #1
70  RAD = 3.14159 / 180
80  INPUT "NAMA KOTA                             ="; CITY$
90  INPUT "BUJUR ;  BB:-, BT:+ (DERAJAT)         ="; LAMD
100 INPUT "LINTANG; LS:-, LU:+ (DERAJAT)         ="; PHI
110 PRINT "BEDA WAKTU= WAKTU STANDAR - GMT, e.g. WIB:7 "
120 INPUT "BEDA WAKTU; BB:-, BT:+ (JAM)          ="; TD
130 PRINT #1, "       JADWAL SALAT "; CITY$: PRINT #1, " ": PRINT #1, " "
140 LAMD = LAMD / 360 * 24
150 PHI = PHI * RAD
160 DATA "JANUARI",31,"FEBRUARI",28,"MARET",31,"APRIL",30,"MEI",31
170 DATA "JUNI",30,"JULI",31,"AGUSTUS",31,"SEPTEMBER",30
180 DATA "OKTOBER",31,"NOVEMBER",30,"DESEMBER",31
190 N0 = 0
200 FOR MN = 1 TO 12
210   READ MONTH$, D
220   PRINT #1, "            ", MONTH$
230   PRINT #1, " "
240   PRINT #1, "TGL SHUBUH  TERBIT  DHUHUR  ASHAR  MAGHRIB  ISYA"
250   FOR K = 1 TO D
260     N = N0 + K
270     A = 6
280     Z = 110 * RAD: GOSUB 540
290     IF ABS(X) > 1 THEN GOTO 310
300     T(1) = ST
310     Z = (90 + 5 / 6) * RAD: GOSUB 540
320     T(2) = ST
330     A = 18
340     Z = (90 + 5 / 6) * RAD: GOSUB 540
350     SUNSET = ST: T(5) = ST + 2 / 60
360     Z = 108 * RAD: GOSUB 540
370     IF ABS(X) > 1 THEN GOTO 390
380     T(6) = ST
390     A = 12: GOSUB 540
400     MIDDAY = ST: T(3) = MIDDAY + 2 / 60
410     ZD = ABS(DEK - PHI): A = 15: GOSUB 540: T(4) = ST
420     PRINT USING "###"; N: PRINT #1, USING "##"; K; : PRINT #1, "  ";
430     FOR I = 1 TO 6
440       TH = INT(T(I)): TM = INT((T(I) - TH) * 60)
450       PRINT #1, USING "##"; TH; : PRINT #1, ":";
460       PRINT #1, USING "##"; TM; : PRINT #1, "   ";
470     NEXT I: PRINT #1, " "
480   NEXT K: N0 = N
490   PRINT #1, " ": PRINT #1, " "
500 NEXT MN
510 CLOSE
520 SYSTEM
530 END
540   T = N + (A - LAMD) / 24
550   M = (.9856 * T - 3.289) * RAD
560   L = M + 1.916 * RAD * SIN(M) + .02 * RAD * SIN(2 * M) + 282.634 * RAD
570   LH = L / 3.14159 * 12: QL = INT(LH / 6) + 1
580   IF INT(QL / 2) * 2 - QL <> 0 THEN QL = QL - 1
590   RA = ATN(.91746 * TAN(L)) / 3.14159 * 12
600   RA = RA + QL * 6
610   SIND = .39782 * SIN(L)
620   COSD = SQR(1 - SIND * SIND)
630   DEK = ATN(SIND / COSD)
640   IF A = 15 THEN Z = ATN(TAN(ZD) + 1)
650   X = (COS(Z) - SIND * SIN(PHI)) / (COSD * COS(PHI))
660   IF ABS(X) > 1 THEN GOTO 720
670   ATNX = ATN(SQR(1 - X * X) / X) / RAD
680   IF ATNX < 0 THEN ATNX = ATNX + 180
690   H = (360 - ATNX) * 24 / 360
700   IF A = 18 THEN H = 24 - H
710   IF A = 12 THEN H = 0
720   IF A = 15 THEN H = 24 - H
730   TLOC = H + RA - .06571 * T - 6.622
740   TLOC = TLOC + 24
750   TLOC = TLOC - INT(TLOC / 24) * 24
760   ST = TLOC - LAMD + TD
770   RETURN


Contoh hasilnya

JADWAL SALAT BANDUNG
              JANUARI
TGL SHUBUH  TERBIT  DHUHUR  ASHAR  MAGHRIB  ISYA
 1   4:11    5:37   11:54   15:19   18:10   19:24   
 2   4:12    5:37   11:55   15:20   18:10   19:25   
 3   4:13    5:38   11:55   15:20   18:11   19:25   
 4   4:13    5:38   11:56   15:21   18:11   19:25   
 5   4:14    5:39   11:56   15:21   18:12   19:26 
http://simbi.kemenag.go.id/sihat/berita/detail/6-POSISI-MATAHARI-DAN-PENENTUAN-JADWAL-SALAT

Saturday, July 4, 2015

ADDTHIS PLUGIN CENTRE ALIGNMENT and responsive

#addthis{max-width:100% !important}
@media all and (max-width:480px){.at300b, .addthis_counter{clear:both !important}}

/* ADDTHIS PLUGIN CENTRE ALIGNMENT
----------------------------------------------- */
div.addthis_toolbox {
width:54%;
margin-left: 23%;
margin-right: 23%;
}

ADDTHIS PLUGIN CENTRE ALIGNMENT

div.addthis_toolbox {
width:54%;
margin-left: 23%;
margin-right: 23%;
}

How to Make AddThis Responsive


The responsive craze has pretty much reached its peak, and has plateaued. Albeit, it’s plateaued quite high where many people are downright obsessed with making every aspect of their website completely responsive.
The problem is someone will pick up an all responsive WordPress theme for example and they’ll add all sorts of widgets and plugins to it, often times 3rd party add-ons are not responsive. As most people are not web designers/programmers they tend to not think of it in the correct terms. If something is not responsive their immediate response is often:
What the heck? I thought this theme was suppose to be responsive, then why does [insert 3rd party name here] look bad on small screens?
Essentially blaming the theme as if it’s broken or that the claim that it was responsive was somehow misleading. This is just silly, but comes up over and over again.
A lot of companies haven’t jumped on the bandwagon for any number of reasons. Perhaps they don’t care, don’t know how to make their works responsive or specifically choose not to make their works responsive because they feel it’s not a “good” thing. But, with a little extra work, we can accommodate in order to integrate our favorite tools into our responsive design.

Your Most Common AddThis Embed

Code

<div class="addthis_toolbox addthis_default_style" id="addthis">
<a class="addthis_button_facebook_like" fb:like:layout="button_count"></a><a class="addthis_button_tweet"></a><a class="addthis_button_google_plusone" g:plusone:size="medium"></a><a class="addthis_counter addthis_pill_style"></a>
</div>
<script type="text/javascript" src="https://s7.addthis.com/js/250/addthis_widget.js"></script>

Add the Following to Your Stylesheet to Make it Responsive

#addthis{max-width:100% !important}
@media all and (max-width:480px){.at300b, .addthis_counter{clear:both !important}}

Demo

https://startupwp.com/giveaways/ – See the share icons near the bottom of the page. Squeeze/resize the page horizontally until the icons stack.
That’s it. This is of course a very basic example and there’s all sorts of extra little things you can do to make it nicer, but simple is good enough for me.
Thanks for reading, Bryan

Thursday, July 2, 2015

How to create the “More” link button to display rest of the text

i want doing a project then i need something similiar like the "more" link
I have a long text but i want to display only a certain number of text if i click on the "More" this link it will appear those text that is being hide
Like those people have a very long comment, Facebook will appear a short text and it use the "More" link to display the rest of the text
So how to create using JavaScript language ?
Urgently need help in this!!!!!!!!!!!!!!!!!!!!!!!!!
There's a couple of ways you can do this, depending on the length of the content, how many items are displayed and the type of content it might be better to limit the text through PHP and then request the rest through AJAX.
Since I guess this is a few steps too far and probably not needed, this is how you do it with pure jQuery.
(If you aren't using jQuery yet, download it from jquery.com124, it improves javascript by a lot and you'll need it to use the following code)
Imagine your HTML looks like this:

<div class="item">

    This is the first part of the text, the part that will be seen originally.<br/>
    <a href="#" class="read_more">Read More</a><br/>

    <span class="more_text">
        This is the extra text, that will be shown after pressing the link above.
    </span>

</div>

What we're going to do through jQuery is find all 'a' elements with the read_more class, and bind those to an event that will show the span.more_text that is next to it.

$(function(){ /* to make sure the script runs after page load */

    $('a.read_more').click(function(event){ /* find all a.read_more elements and bind the following code to them */

        event.preventDefault(); /* prevent the a from changing the url */
        $(this).parents('.item').find('.more_text').show(); /* show the .more_text span */

    });

});

Actually, you could take it a step further if you really want to be lazy with the HTML.
Simply use this HTML:

<div class="item">
    Text goes in here.
</div>

With this jQuery (explanations inside the code again):

$(function(){ /* to make sure the script runs after page load */

 $('.item').each(function(event){ /* select all divs with the item class */
 
  var max_length = 150; /* set the max content length before a read more link will be added */
  
  if($(this).html().length > max_length){ /* check for content length */
   
   var short_content  = $(this).html().substr(0,max_length); /* split the content in two parts */
   var long_content = $(this).html().substr(max_length);
   
   $(this).html(short_content+
       '<a href="#" class="read_more"><br/>Read More</a>'+
       '<span class="more_text" style="display:none;">'+long_content+'</span>'); /* Alter the html to allow the read more functionality */
       
   $(this).find('a.read_more').click(function(event){ /* find the a.read_more element within the new html and bind the following code to it */
 
    event.preventDefault(); /* prevent the a from changing the url */
    $(this).hide(); /* hide the read more button */
    $(this).parents('.item').find('.more_text').show(); /* show the .more_text span */
   
   });
   
  }
  
 });
 
 
});

hi, just want to ask the javascript code can don't use jquery like pure javascript...cause i need to hide long text and show a shorter version ...so i have the below cause...what code should i add to count the text so that the extra words are hide and a show more link is presented to user.
function ShowHide(divId)
{
if(document.getElementById(divId).style.display == 'none')
{document.getElementById(divId).style.display='block';}
else{document.getElementById(divId).style.display = 'none';}
}
</script>
i need something like what you comment in your second comment but i cannot use jquery
Why can you not use jQuery, there is absolutely no reason not to.
Because i am going to use this in the infowindow as i doing project related to map, and i am not sure how to use the jquery into the infowindow....or do you know how to incooperate with the infowindow
Hmm, I haven't tried using jQuery inside google maps before so sadly enough I won't be able to help you with that (doesn't it just work if jQuery is included on the page as well?).
I also never write Javascript without jQuery, so I wouldn't know how to do it in pure Javascript either frowning
oh okay
but i saw this code but it don't work for firefox
<script language="JavaScript">
function truncate() {
var len = 100;
var p = document.getElementById('truncateMe');
if (p) {
var trunc = p.innerHTML;
if (trunc.length > len) {
  trunc = trunc.substring(0, len);
  trunc = trunc.replace(/\\w+$/, '');

  /* Add an ellipses to the end and make it a link that expands
     the paragraph back to its original size */
  trunc += '&lt;a href="#" ' +
    'onclick="this.parentNode.innerHTML=' +
    'unescape(\\''+escape(p.innerHTML)+'\\');return false;"&gt;' +
    '&lt;span style="font-size: 10px;"&gt;[ more ... ]&lt;/span&gt;&lt;\\/a&gt;';
  p.innerHTML = trunc;



  }
}
}
</script>
http://community.sitepoint.com/t/how-to-create-the-more-link-button-to-display-rest-of-the-text/7437/8

Wednesday, July 1, 2015

WP-PostRatings


Build Status

Development

Translations

Credits

Donations

I spent most of my free time creating, updating, maintaining and supporting these plugins, if you really love my plugins and could spare me a couple of bucks, I will really appreciate it. If not feel free to use it without any obligations.

https://wordpress.org/plugins/wp-postratings/

CSS3 Digital Clock with jQuery

Hello everyone, this tutorial I wanted to create a simple digital clock with date and time, with the help of jQuery script and CSS3 for a little animation, there’s nothing hard enough to understand the various methods and use your creativity in the best of ways. This is just the beginning!

HTML

The markup is really simple and flexible and adapts to many possible scenarios you might encounter. Create a div “clock“, create another div id “Date” it will contain our data, finally defines an unordered list that will contain the hour, minutes and seconds.
<div class="clock">
<div id="Date"></div>
  <ul>
      <li id="hours"></li>
      <li id="point">:</li>
      <li id="min"></li>
      <li id="point">:</li>
      <li id="sec"></li>
  </ul>
</div>

CSS

The styling is very simple, you can create anything with your creativity, this is just a default setting for your future applications.
/* If you want you can use font-face */
@font-face {
    font-family: 'BebasNeueRegular';
    src: url('BebasNeue-webfont.eot');
    src: url('BebasNeue-webfont.eot?#iefix') format('embedded-opentype'),
         url('BebasNeue-webfont.woff') format('woff'),
         url('BebasNeue-webfont.ttf') format('truetype'),
         url('BebasNeue-webfont.svg#BebasNeueRegular') format('svg');
    font-weight: normal;
    font-style: normal;
}

.container {
    width: 960px;
    margin: 0 auto;
    overflow: hidden;
}

.clock {
    width: 800px;
    margin: 0 auto;
    padding: 30px;
    border: 1px solid #333;
    color: #fff;
}

#Date {
    font-family: 'BebasNeueRegular', Arial, Helvetica, sans-serif;
    font-size: 36px;
    text-align: center;
    text-shadow: 0 0 5px #00c6ff;
}

ul {
    width: 800px;
    margin: 0 auto;
    padding: 0px;
    list-style: none;
    text-align: center;
}

ul li {
    display: inline;
    font-size: 10em;
    text-align: center;
    font-family: 'BebasNeueRegular', Arial, Helvetica, sans-serif;
    text-shadow: 0 0 5px #00c6ff;
}

#point {
    position: relative;
    -moz-animation: mymove 1s ease infinite;
    -webkit-animation: mymove 1s ease infinite;
    padding-left: 10px;
    padding-right: 10px;
}

/* Simple Animation */
@-webkit-keyframes mymove {
    0% {opacity: 1.0;
    text-shadow: 0 0 20px #00c6ff;
}

50% {
    opacity: 0;
    text-shadow: none;
}

100% {
    opacity: 1.0;
    text-shadow: 0 0 20px #00c6ff;
} 
}

@-moz-keyframes mymove {
    0% {
        opacity: 1.0;
        text-shadow: 0 0 20px #00c6ff;
    }

    50% {
        opacity: 0;
        text-shadow: none;
    }

    100% {
        opacity: 1.0;
        text-shadow: 0 0 20px #00c6ff;
    };
}

JQUERY

The first step is to call the jQuery file.
<script type="text/javascript" src="http://code.jquery.com/jquery-1.6.4.min.js"></script>
Create a new script tag and insert the code.
<script type="text/javascript">
$(document).ready(function() {
// Create two variable with the names of the months and days in an array
var monthNames = [ "January", "February", "March", "April", "May", "June", "July", "August", "September", "October", "November", "December" ]; 
var dayNames= ["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"]

// Create a newDate() object
var newDate = new Date();
// Extract the current date from Date object
newDate.setDate(newDate.getDate());
// Output the day, date, month and year   
$('#Date').html(dayNames[newDate.getDay()] + " " + newDate.getDate() + ' ' + monthNames[newDate.getMonth()] + ' ' + newDate.getFullYear());

setInterval( function() {
 // Create a newDate() object and extract the seconds of the current time on the visitor's
 var seconds = new Date().getSeconds();
 // Add a leading zero to seconds value
 $("#sec").html(( seconds < 10 ? "0" : "" ) + seconds);
 },1000);
 
setInterval( function() {
 // Create a newDate() object and extract the minutes of the current time on the visitor's
 var minutes = new Date().getMinutes();
 // Add a leading zero to the minutes value
 $("#min").html(( minutes < 10 ? "0" : "" ) + minutes);
    },1000);
 
setInterval( function() {
 // Create a newDate() object and extract the hours of the current time on the visitor's
 var hours = new Date().getHours();
 // Add a leading zero to the hours value
 $("#hours").html(( hours < 10 ? "0" : "" ) + hours);
    }, 1000); 
});
</script>

THE LOGIC

  1. new Date()
    This creates a new Date object with the value of the current date and time on the browser PC.
  2. setDate() and getDate()
    The setDate() method sets the day of the month (from 1 to 31), according to local time, while the getDate() method returns the day of the month (from 1 to 31) for the specified date, according to local time.
  3. getSeconds(), getMinutes() and getHours()
    These methods allow to extract the seconds, minutes and hours of the current time on the browser PC.
  4. ( seconds < 10 ? "0" : "" ) + seconds)
    Add a leading zero to the seconds value, the same applies for the minutes and hours. The ? and : symbols used above comprise the ternary operator. This is a special operator that returns the value before the colon if the condition before the query (?) is true, or the value after the colon if the condition is false.
  5. setInterval function
    setInterval is a standard JavaScript function, not part of jQuery. You call it with a function to execute and a period in milliseconds.

CONCLUSION

Finally, we created a simple digital clock using CSS properties and jQuery. If anyone has any questions, concerns, or comments please feel free to let me know!
http://www.alessioatzeni.com/blog/css3-digital-clock-with-jquery/
http://www.jqueryrain.com/2011/11/14-best-jquery-clock-tutorials-both-analog-and-digital-clocks/
http://www.sitepoint.com/10-cool-jquery-clock-tutorials-analog-digital/