Tolong pilih kategori sesuai, jenis posting (pertanyaan atau bukan) dan sertakan tag/topik yang sesuai misal komputer, php, mysql, dll.
Promosi atau posting tidak pada tempatnya akan kami hapus.
Mencantumkan kode program di posting Anda, tolong ikuti aturan yang sesuai, baca http://diskusiweb.com/discussion/39204/aturan-cara-menyisipkan-kode-program-di-diskusiweb

Baca cara posting gambar/image di post Anda: http://www.diskusiweb.com/discussion/47345/cara-menyisipkan-menyertakan-image-pada-posting/p1

Aturan & Cara Menyisipkan Kode Program di Diskusiweb

edited December 2011 in Diskusi Pemrograman & IT
Kalau ingin posting kode dan tampil dengan format sintaks, gunakan tag pre dengan atribut lang diisi dengan nama bahasa programnya.

Contoh:<div class='geshi_syntax'><table><tr><td><div class='code'><pre class="php"><pre lang="php">
<span class="kw2"><?php</span>
<span class="re0">$variabel</span> <span class="sy0">=</span> <span class="st0">"VARIABEL"</span><span class="sy0">;</span>
<span class="kw1">echo</span> <span class="st0">"NGETEST"</span><span class="sy0">;</span>
<span class="sy1">?></span>
< /pre></pre></div></td></tr></table></div>

Hasilnya akan jadi seperti berikut:<div class='geshi_syntax'><table><tr><td><div class='code'><pre class="php"><span class="kw2"><?php</span>
<span class="re0">$variabel</span> <span class="sy0">=</span> <span class="st0">"VARIABEL"</span><span class="sy0">;</span>
<span class="kw1">echo</span> <span class="st0">"NGETEST"</span><span class="sy0">;</span>
<span class="sy1">?></span></pre></div></td></tr></table></div>
«1

Tanggapan

  • edited January 2011
    Perl. lang="perl"<div class='geshi_syntax'><table><tr><td><div class='code'><pre class="perl"><span class="re0">$n</span> <span class="sy0">=</span> <span class="st_h">'3 apples'</span><span class="sy0">;</span>
    <span class="re0">$m</span> <span class="sy0">=</span> <span class="st_h">'2 oranges'</span><span class="sy0">;</span>
    <span class="kw3">print</span> <span class="re0">$n</span> <span class="sy0">+</span> <span class="re0">$m</span><span class="sy0">;</span></pre></div></td></tr></table></div>

    Ruby. lang="ruby"<div class='geshi_syntax'><table><tr><td><div class='code'><pre class="ruby">say<span class="br0">[</span><span class="st0">'test'</span><span class="br0">]</span> = <span class="st0">"saya cinta ruby"</span>
    <span class="kw3">puts</span> say.<span class="me1">upcase</span></pre></div></td></tr></table></div>

    Python. lang="python"<div class='geshi_syntax'><table><tr><td><div class='code'><pre class="python"><span class="sy0">>>></span> <span class="kw1">import</span> <span class="kw3">math</span>
    <span class="sy0">>>></span> <span class="kw1">print</span><span class="br0">(</span><span class="st0">'The value of PI is approximately %5.3f.'</span> <span class="sy0">%</span> <span class="kw3">math</span>.<span class="me1">pi</span><span class="br0">)</span></pre></div></td></tr></table></div>

    Javascript. lang="javascript"<div class='geshi_syntax'><table><tr><td><div class='code'><pre class="javascript"><span class="kw1">for</span> <span class="br0">(</span>i<span class="sy0">=</span><span class="nu0">0</span><span class="sy0">;</span>i<span class="sy0"><=</span><span class="nu0">10</span><span class="sy0">;</span>i<span class="sy0">++</span><span class="br0">)</span> <span class="br0">{</span>
    <span class="kw1">if</span> <span class="br0">(</span>i<span class="sy0">==</span><span class="nu0">3</span><span class="br0">)</span> <span class="br0">{</span>
    <span class="kw1">break</span><span class="sy0">;</span>
    <span class="br0">}</span>
    document.<span class="kw1">write</span><span class="br0">(</span><span class="st0">"The number is "</span> <span class="sy0">+</span> i<span class="br0">)</span><span class="sy0">;</span>
    document.<span class="kw1">write</span><span class="br0">(</span><span class="st0">"<br />"</span><span class="br0">)</span><span class="sy0">;</span>
    <span class="br0">}</span></pre></div></td></tr></table></div>

    ASP. lang="asp"<div class='geshi_syntax'><table><tr><td><div class='code'><pre class="asp"><span class="sy1"><%</span>
    <span class="kw1">Dim</span> fs,fo
    <span class="kw1">Set</span> fs<span class="sy0">=</span><span class="kw1">Server</span>.<span class="kw3">CreateObject</span><span class="br0">(</span><span class="st0">"Scripting.FileSystemObject"</span><span class="br0">)</span>
    <span class="kw1">Set</span> fo<span class="sy0">=</span>fs.<span class="me1">GetFolder</span><span class="br0">(</span><span class="st0">"c:\test"</span><span class="br0">)</span>
    <span class="kw1">Response</span>.<span class="kw3">Write</span><span class="br0">(</span><span class="st0">"Folder created: "</span> <span class="sy0">&</span> fo.<span class="me1">DateCreated</span><span class="br0">)</span>
    <span class="kw1">set</span> fo<span class="sy0">=</span><span class="kw2">nothing</span>
    <span class="kw1">set</span> fs<span class="sy0">=</span><span class="kw2">nothing</span>
    <span class="sy1">%></span></pre></div></td></tr></table></div>

    Pascal. lang="pascal"<div class='geshi_syntax'><table><tr><td><div class='code'><pre class="pascal"><span class="kw1">procedure</span> MWritei<span class="br0">(</span><span class="kw1">const</span> i<span class="sy0">:</span> <span class="kw4">Integer</span><span class="br0">)</span>;
    <span class="kw1">begin</span>
    <span class="kw3">Write</span><span class="br0">(</span>i<span class="br0">)</span>;
    <span class="kw1">end</span>;</pre></div></td></tr></table></div>

    C++. lang="c"<div class='geshi_syntax'><table><tr><td><div class='code'><pre class="c"><span class="co2">#include <iostream></span>
     
    <span class="kw4">int</span> main<span class="br0">(</span><span class="br0">)</span>
    <span class="br0">{</span>
    std<span class="sy0">::</span><span class="kw3">cout</span> <span class="sy0"><<</span> <span class="st0">"Hello, world!<span class="es1">\n</span>"</span><span class="sy0">;</span>
    <span class="br0">}</span></pre></div></td></tr></table></div>

    C#. lang="c"<div class='geshi_syntax'><table><tr><td><div class='code'><pre class="c">public class Foo
    <span class="br0">{</span>
    <span class="coMULTI">/* A Multi-Line
    comment */</span>
    public <span class="kw4">static</span> <span class="kw4">void</span> Bar<span class="br0">(</span><span class="kw4">int</span> firstParam<span class="br0">)</span> <span class="br0">{</span><span class="br0">}</span>
    <span class="br0">}</span></pre></div></td></tr></table></div>

    Java. lang="java"<div class='geshi_syntax'><table><tr><td><div class='code'><pre class="java"><span class="kw1">package</span> <span class="co2">org.kodejava.example.java.util</span><span class="sy0">;</span>
     
    <span class="kw1">import</span> <span class="co2">java.text.DateFormat</span><span class="sy0">;</span>
    <span class="kw1">import</span> <span class="co2">java.text.SimpleDateFormat</span><span class="sy0">;</span>
    <span class="kw1">import</span> <span class="co2">java.util.Calendar</span><span class="sy0">;</span>
    <span class="kw1">import</span> <span class="co2">java.util.Date</span><span class="sy0">;</span>
     
    <span class="kw1">public</span> <span class="kw1">class</span> DateToString
    <span class="br0">{</span>
    <span class="kw1">public</span> <span class="kw1">static</span> <span class="kw4">void</span> main<span class="br0">(</span><span class="kw3">String</span><span class="br0">[</span><span class="br0">]</span> args<span class="br0">)</span>
    <span class="br0">{</span>
    <span class="co1">// Create an instance of SimpleDateFormat used for formatting </span>
    <span class="co1">// the string representation of date (month/day/year)</span>
    <span class="kw3">DateFormat</span> df <span class="sy0">=</span> <span class="kw1">new</span> <span class="kw3">SimpleDateFormat</span><span class="br0">(</span><span class="st0">"MM/dd/yyyy"</span><span class="br0">)</span><span class="sy0">;</span>
     
    <span class="co1">// Get the date today using Calendar object.</span>
    <span class="kw3">Date</span> today <span class="sy0">=</span> <span class="kw3">Calendar</span>.<span class="me1">getInstance</span><span class="br0">(</span><span class="br0">)</span>.<span class="me1">getTime</span><span class="br0">(</span><span class="br0">)</span><span class="sy0">;</span>
    <span class="co1">// Using DateFormat format method we can create a string </span>
    <span class="co1">// representation of a date with the defined format.</span>
    <span class="kw3">String</span> reportDate <span class="sy0">=</span> df.<span class="me1">format</span><span class="br0">(</span>today<span class="br0">)</span><span class="sy0">;</span>
     
    <span class="co1">// Print what date is today!</span>
    <span class="kw3">System</span>.<span class="me1">out</span>.<span class="me1">println</span><span class="br0">(</span><span class="st0">"Report Date: "</span> <span class="sy0">+</span> reportDate<span class="br0">)</span><span class="sy0">;</span>
    <span class="br0">}</span>
    <span class="br0">}</span></pre></div></td></tr></table></div>

    SQL. lang="sql"<div class='geshi_syntax'><table><tr><td><div class='code'><pre class="sql"><span class="kw1">SELECT</span> <span class="sy0">*</span>
    <span class="kw1">INTO</span> new_table_name
    <span class="kw1">FROM</span> old_tablename;
     
    <span class="kw1">SELECT</span> <span class="sy0">*</span>
    <span class="kw1">FROM</span> a
    <span class="kw1">INNER</span> <span class="kw1">JOIN</span> b
    <span class="kw1">ON</span> b<span class="sy0">.</span>id <span class="sy0">=</span> a<span class="sy0">.</span>id_b
    <span class="kw1">WHERE</span> a<span class="sy0">.</span>active <span class="sy0">=</span> <span class="st0">'yes'</span> <span class="kw1">OR</span> a<span class="sy0">.</span>active <span class="sy0">=</span> <span class="kw1">TRUE</span>
    <span class="kw1">LIMIT</span> <span class="nu0">5</span>;</pre></div></td></tr></table></div>
  • edited January 2011
    lang="vb"<div class='geshi_syntax'><table><tr><td><div class='code'><pre class="vbnet"><span class="kw2">Public</span> <span class="kw6">Function</span> TestMethod<span class="br0">(</span><span class="br0">)</span> <span class="kw2">As</span> <span class="kw3">Collection</span>
    <span class="kw6">Dim</span> c <span class="kw2">As</span> <span class="kw2">New</span> <span class="kw3">Collection</span>
    <span class="kw2">For</span> i <span class="kw2">As</span> <span class="kw4">Integer</span> <span class="sy0">=</span> <span class="nu0">0</span> <span class="kw2">To</span> <span class="nu0">10</span>
    c.<span class="me1">Items</span>.<span class="me1">Add</span><span class="br0">(</span>i<span class="br0">)</span>
    <span class="kw2">Next</span>
    TestMethod <span class="sy0">=</span> c
    <span class="kw6">End</span> <span class="kw6">Function</span>
     
    TestMethod<span class="br0">(</span><span class="br0">)</span></pre></div></td></tr></table></div>

    lang="vbnet"<div class='geshi_syntax'><table><tr><td><div class='code'><pre class="vbnet"><span class="kw2">Public</span> <span class="kw6">Class</span> TestClass
    <span class="kw2">Public</span> <span class="kw2">Shared</span> <span class="kw6">Function</span> TestMethod<span class="br0">(</span><span class="br0">)</span> <span class="kw2">As</span> <span class="kw3">Collection</span>
    <span class="kw6">Dim</span> c <span class="kw2">As</span> <span class="kw2">New</span> <span class="kw3">Collection</span>
    <span class="kw2">For</span> i <span class="kw2">As</span> <span class="kw4">Integer</span> <span class="sy0">=</span> <span class="nu0">0</span> <span class="kw2">To</span> <span class="nu0">10</span>
    c.<span class="me1">Items</span>.<span class="me1">Add</span><span class="br0">(</span>i<span class="br0">)</span>
    <span class="kw2">Next</span>
    <span class="kw2">Return</span> c
    <span class="kw6">End</span> <span class="kw6">Function</span>
    <span class="kw6">End</span> <span class="kw6">Class</span>
     
    <span class="co1">' wedew, kenapa keyword: Module gak berwarna yah?</span>
    <span class="kw2">Public</span> Module TestModule
    <span class="kw2">Public</span> <span class="kw6">Sub</span> Main<span class="br0">(</span><span class="br0">)</span>
    <span class="kw6">Dim</span> c <span class="kw2">As</span> <span class="kw3">Collection</span> <span class="sy0">=</span> TestClass.<span class="me1">TestMethod</span><span class="br0">(</span><span class="br0">)</span> <span class="co1">' <
    ini kok malah berwarna @_@<;/span>
    <span class="kw6">End</span> <span class="kw6">Sub</span>
    <span class="kw6">End</span> <span class="kw6">Class</span></pre></div></td></tr></table></div>

    lang="aspnet"<div class='geshi_syntax'><table><tr><td><div class='code'><pre class="vbnet"><span class="kw2">Public</span> <span class="kw6">Class</span> TestClass
    <span class="kw2">Public</span> <span class="kw2">Shared</span> <span class="kw6">Function</span> TestMethod<span class="br0">(</span><span class="br0">)</span> <span class="kw2">As</span> <span class="kw3">Collection</span>
    <span class="kw6">Dim</span> c <span class="kw2">As</span> <span class="kw2">New</span> <span class="kw3">Collection</span>
    <span class="kw2">For</span> i <span class="kw2">As</span> <span class="kw4">Integer</span> <span class="sy0">=</span> <span class="nu0">0</span> <span class="kw2">To</span> <span class="nu0">10</span>
    c.<span class="me1">Items</span>.<span class="me1">Add</span><span class="br0">(</span>i<span class="br0">)</span>
    <span class="kw2">Next</span>
    <span class="kw2">Return</span> c
    <span class="kw6">End</span> <span class="kw6">Function</span>
    <span class="kw6">End</span> <span class="kw6">Class</span>
     
    <span class="co1">' wedew, kenapa keyword: Module gak berwarna yah?</span>
    <span class="kw2">Public</span> Module TestModule
    <span class="kw2">Public</span> <span class="kw6">Sub</span> Main<span class="br0">(</span><span class="br0">)</span>
    <span class="kw6">Dim</span> c <span class="kw2">As</span> <span class="kw3">Collection</span> <span class="sy0">=</span> TestClass.<span class="me1">TestMethod</span><span class="br0">(</span><span class="br0">)</span> <span class="co1">' <
    ini kok malah berwarna @_@<;/span>
    <span class="kw6">End</span> <span class="kw6">Sub</span>
    <span class="kw6">End</span> <span class="kw6">Class</span></pre></div></td></tr></table></div>

    lang="csharp"<div class='geshi_syntax'><table><tr><td><div class='code'><pre class="csharp"> <span class="kw4">class</span> TestClass <span class="br0">{</span>
    <span class="kw1">public</span> <span class="kw1">static</span> <span class="kw4">string</span> TestMethod<span class="br0">(</span><span class="br0">)</span> <span class="br0">{</span>
    <span class="kw1">return</span> <span class="st0">'Test'</span><span class="sy0">;</span>
    <span class="br0">}</span>
    <span class="br0">}</span></pre></div></td></tr></table></div>

    lang="cpp"<div class='geshi_syntax'><table><tr><td><div class='code'><pre class="cpp"> <span class="kw2">class</span> TestClass <span class="br0">{</span>
    <span class="kw2">public</span> <span class="kw4">static</span> string TestMethod<span class="br0">(</span><span class="br0">)</span> <span class="br0">{</span>
    <span class="kw1">return</span> <span class="st0">'Test'</span><span class="sy4">;</span>
    <span class="br0">}</span>
    <span class="br0">}</span></pre></div></td></tr></table></div>

    lang="xml"<div class='geshi_syntax'><table><tr><td><div class='code'><pre class="xml"> <span class="sc3"><span class="re1"><div</span> <span class="re0">id</span>=<span class="st0">"TestDiv"</span><span class="re2">></span></span>
    <span class="sc-1"><!-- coba mouse over, ada yang aneh --></span>
    <span class="sc3"><span class="re1"><a</span> <span class="re0">href</span>=<span class="st0">"http://www.google.com"</span><span class="re2">></span></span>Test Link<span class="sc3"><span class="re1"></a<span class="re2">></span></span></span>
    <span class="sc3"><span class="re1"></div<span class="re2">></span></span></span>
    <span class="sc3"><span class="re1"><div</span> <span class="re0">id</span>=<span class="st0">"TestDiv2"</span><span class="re2">></span></span>
    <span class="sc3"><span class="re1"><a</span> <span class="re0">href</span>=<span class="st0">"javascript:alert('oke')"</span><span class="re2">></span></span>Test Link 2<span class="sc3"><span class="re1"></a<span class="re2">></span></span></span>
    <span class="sc3"><span class="re1"></div<span class="re2">></span></span></span></pre></div></td></tr></table></div>

    lang="css"<div class='geshi_syntax'><table><tr><td><div class='code'><pre class="css"> <span class="re0">#TestDiv</span> <span class="br0">{</span>
    <span class="kw1">font-weight</span><span class="sy0">:</span><span class="kw2">bold</span><span class="sy0">;</span>
    <span class="kw1">color</span><span class="sy0">:</span>whitesmoke<span class="sy0">;</span>
    <span class="br0">}</span>
    <span class="re0">#TestDiv2</span> <span class="br0">{</span>
    <span class="kw1">border</span><span class="sy0">:</span> <span class="re3">1px</span> <span class="kw2">solid</span> <span class="kw1">black</span><span class="sy0">;</span>
    <span class="kw1">padding</span><span class="sy0">:</span> <span class="re3">10px</span><span class="sy0">;</span>
    <span class="br0">}</span>
    a <span class="br0">{</span>
    <span class="kw1">color</span><span class="sy0">:</span> steelblue<span class="sy0">;</span>
    <span class="kw1">text-decoration</span><span class="sy0">:</span> <span class="kw2">none</span><span class="sy0">;</span>
    <span class="br0">}</span>
    a<span class="re2">:hover </span><span class="br0">{</span>
    <span class="kw1">color</span><span class="sy0">:</span>orange<span class="sy0">;</span>
    <span class="br0">}</span></pre></div></td></tr></table></div>

    lang="actionscript"<div class='geshi_syntax'><table><tr><td><div class='code'><pre class="actionscript"> <span class="kw2">class</span> com.<span class="me1">test</span>.<span class="me1">TestClass</span> <span class="kw3">extends</span> <span class="kw3">MovieClip</span> <span class="br0">{</span>
    <span class="kw3">public</span> <span class="kw2">function</span> TestClass<span class="br0">(</span><span class="br0">)</span> <span class="br0">{</span><span class="br0">}</span>
    <span class="kw3">public</span> <span class="kw2">function</span> <span class="kw3">onLoad</span><span class="br0">(</span><span class="br0">)</span> :<span class="kw3">Void</span> <span class="br0">{</span>
    <span class="kw2">var</span> txtTest:<span class="kw3">TextField</span> = <span class="kw3">this</span>.<span class="kw3">createTextField</span><span class="br0">(</span><span class="st0">"Test"</span>, <span class="nu0">0</span>, <span class="nu0">0</span>, <span class="nu0">0</span>, <span class="nu0">100</span>, <span class="nu0">100</span><span class="br0">)</span>;
    txtTest.<span class="kw3">text</span> = <span class="st0">"Test"</span>;
    <span class="br0">}</span>
    <span class="br0">}</span></pre></div></td></tr></table></div>

    lang="vbscript"<div class='geshi_syntax'><table><tr><td><div class='code'><pre class="vbscript"> ' gak kerender
    Dim x As String
    x = "Test"
    alert(x)</pre></div></td></tr></table></div>

    lang="jsharp"<div class='geshi_syntax'><table><tr><td><div class='code'><pre class="jsharp"> /* gak kerender */
    class TestClass {
    public static string TestMethod() {
    return 'Test';
    }
    }</pre></div></td></tr></table></div>

    lang="dos"<div class='geshi_syntax'><table><tr><td><div class='code'><pre class="dos"><span class="co1"> rem Tes Ping</span>
    <span class="sy0">@<;/span><span class="kw3">echo</span> off
    <span class="kw3">echo</span> Sedang ngeping detik.com, tekan Ctrl C untuk berhenti
    ping detik.com -l 1 -t <span class="sy0">></span> detik.txt</pre></div></td></tr></table></div>

    lang="bash"<div class='geshi_syntax'><table><tr><td><div class='code'><pre class="bash"> <span class="kw3">cd</span> <span class="sy0">/</span>var<span class="sy0">/</span>www
    <span class="kw3">echo</span> <span class="st0">"php_value magic_quotes_gpc 0"</span> <span class="sy0">></span> .htaccess</pre></div></td></tr></table></div>

    lang="asm"<div class='geshi_syntax'><table><tr><td><div class='code'><pre class="asm"> <span class="kw4">org</span> <span class="nu0">100h</span>
     
    <span class="kw1">mov</span> <span class="kw3">ah</span><span class="sy0">,</span> <span class="nu0">02</span>
    <span class="kw1">mov</span> <span class="kw3">dl</span><span class="sy0">,</span> <span class="nu0">07h</span>
    <span class="kw1">int</span> <span class="nu0">21h</span>
     
    <span class="kw1">int</span> <span class="nu0">20h</span>
     
    <span class="kw1">ret</span></pre></div></td></tr></table></div>

    lang="matlab"<div class='geshi_syntax'><table><tr><td><div class='code'><pre class="matlab"> <span class="co1">% Test</span>
     
    variable1 = <span class="nu0">2</span>;
    variable2 = <span class="nu0">4</span>;
    variable3 = <span class="nu0">8</span>;
     
    <span class="kw2">fprintf</span><span class="br0">(</span><span class="co2">'v1: %f, v2: %f, v3: %f\n'</span>, variable1, variable2, variable3<span class="br0">)</span>;
     
    <span class="kw2">fprintf</span><span class="br0">(</span><span class="br0">[</span><span class="co2">'This is a long string that'</span>,<span class="sy0">...</span>
    <span class="co2">' will have to be split!'</span>,<span class="sy0">...</span>
    <span class="co2">' Here are the variables: '</span>,<span class="sy0">...</span>
    <span class="co2">' variable1: %f, variable2: %f,'</span>,<span class="sy0">...</span>
    <span class="co2">' variable3: %f\n\n'</span><span class="br0">]</span>, variable1,<span class="sy0">...</span>
    <span class="me1">variable2</span>, variable3<span class="br0">)</span>;</pre></div></td></tr></table></div>
  • edited January 2011
    coba ah<div class='geshi_syntax'><table><tr><td><div class='code'><pre class="c"><span class="co2">#include <stdio.h></span>
     
    <span class="kw4">const</span> <span class="kw4">char</span> <span class="sy0">*</span>s <span class="sy0">=</span> <span class="st0">"abcdefghijklmnopqrstuvwxyz"</span><span class="sy0">;</span>
     
    <span class="kw4">int</span> main <span class="br0">(</span><span class="kw4">void</span><span class="br0">)</span>
    <span class="br0">{</span>
    <span class="kw1">return</span><span class="br0">(</span><span class="kw3">printf</span><span class="br0">(</span><span class="st0">"%s<span class="es1">\n</span>"</span><span class="sy0">,</span> s<span class="br0">)</span> <span class="sy0">&&</span> <span class="sy0">*</span>s<span class="sy0">++</span> <span class="sy0">&&</span> main<span class="br0">(</span><span class="br0">)</span><span class="br0">)</span><span class="sy0">;</span>
    <span class="br0">}</span></pre></div></td></tr></table></div>
  • <div class='geshi_syntax'><table><tr><td><div class='code'><pre class="php"><span class="kw2"><?php</span>
    <span class="kw1">echo</span> <span class="st0">"Test PHP Code, dan berhasil! haha ..thanks infonya :)"</span><span class="sy0">;</span>
    <span class="sy1">?></span></pre></div></td></tr></table></div>
  • edited December 2014
    <div class='geshi_syntax'><table><tr><td><div class='code'><pre class="visualfoxpro"><span class="kw1">LOCAL</span> lcTes
    lcTes <span class="sy0">=</span> <span class="st0">"Hello World.."</span>
     
    <span class="kw2">MESSAGEBOX</span><span class="br0">(</span>lcTes<span class="sy0">,</span> <span class="nu0">0</span><span class="sy0">+</span><span class="nu0">64</span><span class="sy0">,</span> <span class="st0">"Info"</span><span class="br0">)</span></pre></div></td></tr></table></div>
  • tes vb<div class='geshi_syntax'><table><tr><td><div class='code'><pre class="vb"><span class="kw4">dim</span> a <span class="kw4">as</span> <span class="kw1">string</span>
    a=<span class="st0">"Hello World"</span>
    <span class="kw4">print</span> a</pre></div></td></tr></table></div>
  • edited May 2011
    Nyoba ruby ah:<div class='geshi_syntax'><table><tr><td><div class='code'><pre class="ruby"><span class="kw1">class</span> MessagesController <span class="sy0"><</span> ApplicationController
    before_filter <span class="re3">:authenticate_user</span>!, <span class="re3">:only</span> <span class="sy0">=></span> <span class="br0">[</span><span class="re3">:create</span><span class="br0">]</span>
     
    respond_to <span class="re3">:html</span>, <span class="re3">:json</span>, <span class="re3">:xml</span>, <span class="re3">:except</span> <span class="sy0">=></span> <span class="re3">:create</span>
     
    <span class="kw1">def</span> index
    <span class="re1">@raw_messages<;/span> = current_convo.<span class="me1">messages</span>
    <span class="re1">@messages<;/span> = <span class="re1">@raw_messages<;/span>.<span class="me1">collect</span><span class="br0">{</span><span class="sy0">|</span>m<span class="sy0">|</span> <span class="br0">{</span>:uuid <span class="sy0">=></span> m.<span class="me1">uuid</span>, <span class="re3">:id</span> <span class="sy0">=></span> m.<span class="me1">id</span>, <span class="re3">:text</span> <span class="sy0">=></span> m.<span class="me1">body</span>, <span class="re3">:gravatar_url</span> <span class="sy0">=></span> m.<span class="me1">owner</span>.<span class="me1">gravatar</span> <span class="br0">}</span><span class="br0">}</span>
    respond_with <span class="re1">@messages<;/span> <span class="kw1">do</span> <span class="sy0">|</span>format<span class="sy0">|</span>
    <span class="kw3">format</span>.<span class="me1">html</span> <span class="br0">{</span> redirect_to convo_url<span class="br0">(</span>current_convo<span class="br0">)</span> <span class="br0">}</span>
    <span class="kw1">end</span>
    <span class="kw1">end</span>
     
    <span class="kw1">def</span> create
    <span class="re1">@message<;/span> = Message.<span class="me1">create</span><span class="br0">(</span><span class="re3">:convo</span> <span class="sy0">=></span> current_convo, <span class="re3">:owner</span> <span class="sy0">=></span> current_user, <span class="re3">:body</span> <span class="sy0">=></span> params<span class="br0">[</span><span class="re3">:text</span><span class="br0">]</span>, <span class="re3">:uuid</span> <span class="sy0">=></span> params<span class="br0">[</span><span class="re3">:uuid</span><span class="br0">]</span><span class="br0">)</span>
    respond_with<span class="br0">(</span><span class="br0">[</span>current_convo, <span class="re1">@message<;/span><span class="br0">]</span><span class="br0">)</span> <span class="kw1">do</span> <span class="sy0">|</span>format<span class="sy0">|</span>
    <span class="kw3">format</span>.<span class="me1">js</span> <span class="kw1">do</span>
    Socky.<span class="me1">send</span><span class="br0">(</span><span class="br0">{</span> <span class="re3">:text</span> <span class="sy0">=></span> params<span class="br0">[</span><span class="re3">:text</span><span class="br0">]</span>,
    <span class="re3">:uuid</span> <span class="sy0">=></span> params<span class="br0">[</span><span class="re3">:uuid</span><span class="br0">]</span>,
    <span class="re3">:gravatar_url</span> <span class="sy0">=></span> params<span class="br0">[</span><span class="re3">:gravatar_url</span><span class="br0">]</span> <span class="br0">}</span>.<span class="me1">to_json</span>,
    <span class="re3">:channels</span> <span class="sy0">=></span> <span class="st0">"convo_#{current_convo.id}"</span> <span class="br0">)</span>
    current_user.<span class="me1">visit</span> current_convo <span class="co1"># make sure to reset stats for this current convo</span>
    render <span class="re3">:nothing</span> <span class="sy0">=></span> <span class="kw2">true</span>
    <span class="kw1">end</span>
    <span class="kw1">end</span>
    <span class="kw1">end</span>
     
    private
     
    <span class="kw1">def</span> current_convo
    <span class="re1">@current_convo<;/span> <span class="sy0">||</span>= Convo.<span class="me1">find</span><span class="br0">(</span>params<span class="br0">[</span><span class="re3">:convo_id</span><span class="br0">]</span><span class="br0">)</span>
    <span class="kw1">end</span>
     
    <span class="kw1">end</span></pre></div></td></tr></table></div>
  • <div class='geshi_syntax'><table><tr><td><div class='code'><pre class="php"><span class="re0">$name</span> <span class="sy0">=</span> <span class="st0">"fatihurr"</span><span class="sy0">;</span>
    <span class="re0">$kenal</span> <span class="sy0">=</span> <span class="re0">$_POST</span><span class="br0">[</span><span class="st0">"salam"</span><span class="br0">]</span><span class="sy0">;</span>
    <span class="kw1">if</span><span class="br0">(</span><span class="re0">$kenal</span><span class="sy0">==</span><span class="st0">"ya"</span><span class="br0">)</span><span class="br0">{</span>
    <span class="kw1">echo</span> <span class="st0">"nama saya <span class="es4">$name</span>, salam kenal"</span><span class="sy0">;</span>
    <span class="br0">}</span><span class="kw1">else</span><span class="br0">{</span>
    <span class="kw1">echo</span> <span class="st0">"kalo gitu aku aja deh yang kenalan, salam kenal semua"</span><span class="sy0">;</span>
    <span class="br0">}</span></pre></div></td></tr></table></div>
  • edited December 2011
    <div class='geshi_syntax'><table><tr><td><div class='code'><pre class="java"><span class="kw1">public</span> <span class="kw1">class</span> diskusiweb<span class="br0">{</span>
    <span class="kw1">public</span> <span class="kw1">static</span> <span class="kw4">void</span> main<span class="br0">(</span><span class="kw3">String</span><span class="br0">[</span><span class="br0">]</span>args<span class="br0">)</span><span class="br0">{</span>
     
    <span class="kw3">String</span> a<span class="sy0">=</span><span class="st0">"Salam Kenal admin, ayas dari PARE-KEDIRI"</span><span class="sy0">;</span>
    <span class="kw3">String</span> b<span class="sy0">=</span><span class="st0">"Terima kasih atas info-infonya sangat membantu belajar program"</span><span class="sy0">;</span>
    <span class="kw3">String</span> c<span class="sy0">=</span><span class="st0">"See you again"</span><span class="sy0">;</span>
     
    <span class="kw3">System</span>.<span class="me1">out</span>.<span class="me1">println</span><span class="br0">(</span><span class="st0">"Assalamu'alaikum"</span><span class="br0">)</span><span class="sy0">;</span>
    <span class="kw3">System</span>.<span class="me1">out</span>.<span class="me1">println</span><span class="br0">(</span>a<span class="br0">)</span><span class="sy0">;</span>
    <span class="kw3">System</span>.<span class="me1">out</span>.<span class="me1">println</span><span class="br0">(</span>b<span class="br0">)</span><span class="sy0">;</span>
    <span class="kw3">System</span>.<span class="me1">out</span>.<span class="me1">println</span><span class="br0">(</span>c<span class="br0">)</span><span class="sy0">;</span>
    <span class="br0">}</span>
    <span class="br0">}</span></pre></div></td></tr></table></div>
  • edited December 2011
    echo "test doank";


  • edited December 2014
    <meta http-equiv="content-type" content="text/html; charset=utf-8">
    <meta http-equiv="Content-Type" content="text/html; charset=windows-1251">
    <meta http-equiv="content-language" content="en">
    <link rel="shortcut icon" href="favicon.ico">


    akhirnya
  • edited December 2011
    <?php
    echo "Hello";
    ?>


    Bisa euy...
  • edited December 2011
    #include<stdio.h>
    #include<conio.h>
    void main()
    {
    printf("Den ayunk")
    getche();
    }</conio.h></stdio.h>
  • <?php
    // Test PHP
    $nama = "Fery";
    $masih = "newbie";
    $pingin = "blajar pemrograman";
    ?>
  • edited February 2012
    static void Main()
    {
    //C# is cool
    string str = "this is C# code";
    Action lambdaExp = () => Console.WriteLine("this is lambda expression");
    }
  • edited April 2012
     
    /*
    * test
    */
     
    /* test..test */
     
    // test..test..test
     
    short v;
     
    /* test error */*
     
    int test;
     
    / */ */
     
    char ch;
  • edited May 2012
    <?php echo "tes"; ?>
  • <?php 
    echo "Nyoba yak..";
    ?>
  • edited June 2012




    <br><!--?php<br /--> <br>echo "coba";<br>?&gt;<br>


  • edited July 2012
    //test [code]
    echo "The Red Dog Run Over The Lazy Man";
  • edited July 2012
    <!--?php
    //test
    echo "Mantap";
    ?-->
  • edited August 2012
    Test:
    #include "stdio.h"
     
    int main(){
    int a,b;
    a = 10; b = 20;
    printf("jumlah=%d",a*b);
    return (0);
    }
  • R_2R_2
    edited August 2012
    <!--?java
    $variabel="Test";
    echo"coba";
    ?-->
  • edited September 2012
    Akhirnya...

    <!--?php
    $variabel = "VARIABEL":
    echo "TEST";
    ?-->
  • asldfklasdfjasd;fkjaldf
    <!--?php 
    $variabel = "VARIABEL";
    echo "NGETEST";
    ?-->
    &lt; /pre&gt;
  • coba aja om
    <!--?php 
    $int a = 20;
    $int b = 30;
    $int c = a + b;
    $System.out.println("c ="+c);
    ?-->
    &lt; /pre&gt;
  • procedure sayHello():String;
    begin
    Result:='My Name is Bugz';
    end;
  • edited January 2013
    Test
    procedure TForm1.FormCreate(Sender: TObject);
    begin
    with ADOQuery1 do
    begin
    SQL.Clear;
    SQL.Text := 'SELECT * FROM jatuh_tempo WHERE jt='+QuotedStr(FormatDateTime('yyyy-mm-dd',Now));
    Open;
    if ADOQuery1.RecordCount > 0 then
    ShowMessage('Ada yg jatuh tempo lho')
    end;
    end;


    ahahhaha
    akhirnya bisa jg :D
  • Test php dulu :D
     
    <?
     
    $bejo = "NGEPRET";
    echo $bejo;
     
    ?-->
  • edited February 2013
    testing

    <? echo"xxx"?>
  • edited March 2013
    <?php
    $nama="muzaen";
    echo $nama;
    ?>
  • int a,b,c;
    a=1;
    b= 10;
    c= a+b;
  • <Open "C:\Pemakai.Dat" For Random As #1 Len = Len(DatPemakai)
    End Type>
  • edited April 2013
    <?php 
    $variabel = "NGETEST";
    echo $variabel;
    ?>


  • <?php 
    $a = "Coba";
    $b = "Berhasil";
    $c = $a, $b;
    echo $c;
    ?>
  • edited June 2013
    <?php echo'testing';?>
  • <?php echo 'test';?>
  • echo 'Test ndan.!';
  • edited December 2014
     <?php echo 'hello world!'; ?>

  • coba lagi
    <!--?php <br /-->$variabel = "VARIABEL";
    echo "NGETEST";
    ?&gt;
  • $pesan="$nama terima kasih telah mendaftar di SMS Notifikasi Two Way, silahkan hubungi CS online kami untuk informasi lebih lanjut.";
    $uk='macan';
    $pk='amn9012';
     
    $url = "http://reguler.sms-notifikasi.com/apps/smsapi.php?";
    $curlHandle = curl_init();
    curl_setopt($curlHandle, CURLOPT_URL, $url);
    curl_setopt($curlHandle, CURLOPT_POSTFIELDS, 'userkey='.$uk.'&passkey='.$pk.'&nohp='.$nohp.'&pesan='.urlencode($pesan));
    curl_setopt($curlHandle, CURLOPT_HEADER, 0);
    curl_setopt($curlHandle, CURLOPT_RETURNTRANSFER, 1);
    curl_setopt($curlHandle, CURLOPT_TIMEOUT,30);
    curl_setopt($curlHandle, CURLOPT_POST, 1);
    $results = curl_exec($curlHandle);
    curl_close($curlHandle);


    ke highlight atau tidak?
  • edited February 2014

    <?php>
    echo "something";
    </?php
  • edited March 2014
    echo 'Hello, World!';
  • edited March 2014
    <?php
    echo "Hello World!";
    ?>
    <?php
    $sql = "SELECT * FROM tabel ORDER BY id LIMIT 5,5";
    $res = mysql_query($sql);
    while($row = mysql_fetch_array($res)) {
    echo $row[0]." | ".$row[1]." | ".$row[2]." | ".$row[3];
    }
    ?>
  • <!--?php
    echo "Test PHP Code, dan berhasil! haha ..thanks infonya :)";
    ?-->
    Ga berhasil tuh,.. smiley nya msh masuk, Haha
  •  <? echo" Testing"; ?>
  •  
    <?
     
    echo $apa; ?>
  • edited June 2014
    procedure TForm1.bisa
    begin
    end;
Sign In or Register to comment.