Arif widiyanto

mind, passions, spirit and hopes

KOHANA !

Posted by arifw pada Rabu, 11 Februari 2009

Gak lama setelah nulis PUSING CI Neh !, browsing sana sini eh malah nemu KOHANA !

kayaknya dpt solusinya nih yaitu migrasi ke kohana. setelah lihat intronya kayaknya gak bakalan lama pelajarinnya, basisnya dari ci sih

eh kalo ada yg belum tahu kohana bisa lihat-lihat di kohanaphp.com, kalo perbandingan ama ci bisa dilihat di sini

buat para master php framework, kasih saran ya ttg kohana ini, takutnya wasting time, soalnya basisnya dari komunitas baru, jadi dokumentasinya gak lengkap dan forumnya masih sepi

btw, masih semangat nih pelajarin kohana, kayaknya potensial banget :D

Posted in PHP | Dengan kaitkata: , , | 4 Comments »

PUSING CI Neh !

Posted by arifw pada Rabu, 11 Februari 2009

Baru-baru ini kulak-kulik CI (CodeIgniter) buat bikin aplikasi sederhana tapi dah mau dipikirin multi templatenya dan kalo bisa bisa manggil view di dalam view atau snippets html yang di panggil dari template parentnya. tapi susah juga di CI kayaknya, ato emang masih newbie ya.

Detailnya sih gini:

Pada controller aku pengen bisa load view suatu template, tapi dalam view tsb juga bisa load view yg lain (potongan html) yg pengaturannya semua pada controller.

pada controller:

//manggil view template.php dg dikasih param $g

$this->load->view(‘template’,$g);

….

nah pada template.php aku pengen manggil view laen yg berupa potongn/blok html

<div id=”content”>

<!–

disini aku pengen manggilnya

misal :

<?php   $this->load->view($content);  ?>

$content berisi nama view yang mau dipanggil

–>

</div>

jadi aku pengen semua mesti lewat template.php (untuk penyeragaman tampilan) tapi isi blok content ( div id=”content” ) diatur pada function di controller, misal kalo function index() nampilin list suatu tabel, kalo function add() nampilin form nambah data.

Blok html buat list suatu tabel/form nambah data ini mau tak pisahin pada vew tersendiri (yang harus dipanggil view template.php)

udah tak coba kayak gini:

pada controller,

function add(){

// $g tak kasih array berisi nama view anak (add.php) yg harus di load & isi dari view add.php yg harus ditampilin  (‘bla..bla..’)

$g['content'] = array( array( ‘add’=>’bla..bla..’)  );
$this->load->view(‘template’,$g);

}

pada view template.php:

….

<div id=”content”>
<?php

//kalo $content berupa array aku load view anaknya sekaligus isi yg mau ditampilin

if ( !is_array($content) )
$this->load->view($content);
else{
foreach ($content as $s => $var ) $this->load->view($s,$var);
}
?>
</div>

…..

tapi… gagal !! #:-S

puuusing nih…!!:((

ada yg mau kasih pencerahan ??

Posted in Tanpa kategori | Dengan kaitkata: , , | 1 Comment »

Blog wordpress gratis dari Best4u Blogs

Posted by arifw pada Senin, 5 Januari 2009

Dapatkan Blog wordpress gratis :

Best4u Blogs

Best4u Blogs

  • Plugins On, lot of best quality plugin
  • Multi Themes
  • 100 MB Space !
  • Adsense Support !

100 % Gratis, cepat DAFTAR

TERBATAS 10 USER !

KETENTUAN:

  • Tidak melanggar TOS
  • Isi Blog berupa bebas

Posted in Blog++ Gratis | Dengan kaitkata: , , , | Komentar Dimatikan

Pengen lihat tv gratis ?

Posted by arifw pada Senin, 5 Januari 2009

Pengen lihat tv gratis ?

Watch TV On PC Free internet tv music movies documentaries tv episodes:

Watch TV On PC Free

Watch TV On PC Free

Posted in Multimedia | Dengan kaitkata: , , , , | Komentar Dimatikan

Get the version of a file

Posted by arifw pada Minggu, 11 Mei 2008

function GetVersion(sFileName:string): string;
var
  VerInfoSize: DWORD;
  VerInfo: Pointer;
  VerValueSize: DWORD;
  VerValue: PVSFixedFileInfo;
  Dummy: DWORD;
begin
  VerInfoSize := GetFileVersionInfoSize(PChar(sFileName), Dummy);
  GetMem(VerInfo, VerInfoSize);
  GetFileVersionInfo(PChar(sFileName), 0, VerInfoSize, VerInfo);
  VerQueryValue(VerInfo, ‘\’, Pointer(VerValue), VerValueSize);
  with VerValue^ do
  begin
    Result := IntToStr(dwFileVersionMS shr 16);
    Result := Result + ‘.’ + IntToStr(dwFileVersionMS and $FFFF);
    Result := Result + ‘.’ + IntToStr(dwFileVersionLS shr 16);
    Result := Result + ‘.’ + IntToStr(dwFileVersionLS and $FFFF);
  end;
  FreeMem(VerInfo, VerInfoSize);
end;

procedure Form1.Button1Click(Sender: TObject);
begin
  ShowMessage(GetVersion(‘c:\test.exe’));
end;

Posted in Delphi, Programming | Dengan kaitkata: , | Komentar Dimatikan

Delphi – Mencari tahu jenis koneksi internet

Posted by arifw pada Sabtu, 26 April 2008

uses
WinInet;

const
MODEM = 1;
LAN = 2;
PROXY = 4;
BUSY = 8;

function GetConnectionKind(var strKind: string): Boolean;
var
flags: DWORD;
begin
strKind := ”;
Result := InternetGetConnectedState(@flags, 0);
if Result then
begin
if (flags and MODEM) = MODEM then strKind := ‘Modem’;
if (flags and LAN) = LAN then strKind := ‘LAN’;
if (flags and PROXY) = PROXY then strKind := ‘Proxy’;
if (flags and BUSY) = BUSY then strKind := ‘Modem Busy’;
end;
end;

procedure TForm1.Button1Click(Sender: TObject);
var
strKind: string;
begin
if GetConnectionKind(strKind) then
ShowMessage(strKind);
end;

Posted in Delphi, Internet/Lan, Programming | Dengan kaitkata: | Komentar Dimatikan

.NET – Mengambil RSS feeds

Posted by arifw pada Kamis, 24 April 2008

RSS (Really Simple Syndication) adalah protokol populer yang dapat membuat suatu situs menyebarkan isi dalam format XML. Karena RSS hanyalah XML kita dapat menggunakan rutin standard .NET XML untuk membacanya. Contoh berikut menunjukkan bagaimana mengambil isi RSS dari situs Microsoft MSDN dan menampilkan pada grid :

Dim reader As XmlTextReader = New XmlTextReader(“http://msdn.microsoft.com/rss.xml&#8221;)
Dim ds As DataSet = New DataSet
ds.ReadXml(reader)
DataGrid1.DataSource = ds.Tables(2)

Untuk informasi selengkapnya tentang RSS, lihat link dibawah:

Apa itu RSS?
http://www.xml.com/pub/a/2002/12/18/dive-into-xml.html

Membuat sebuah RSS Feed pada FrontPage Web Site
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/odc_fp2003_ta/html/OfficeFrontPageCreateRSS.asp

Majalah MSDN RSS Feeds
http://msdn.microsoft.com/msdnmag/rss/default.aspx

Posted in .NET, Programming | Dengan kaitkata: , | Komentar Dimatikan

Tips and Tricks for the Visual Studio .NET IDE

Posted by arifw pada Kamis, 24 April 2008

A compendium of short cuts, tips and tricks, features, whatcha-may-callits for the Visual Studio .NET IDE.

I love Vim. And the power it gives is almost corrupting. Actually it
is corrupting. Which is why I try to see if any editor provides all the
functionality provided by Vim. Visual Studio .NET has quite a lot of
useful options. Many of them are out there in the open in the menus but
I did not see them for long until I went hunting for them. Some others
are very obvious, but when I show them to some people, they are amazed
that I can do that; so I have included some of those too. So here is a
list of useful hints that I gathered. If you have any more, please do
send them and I’ll add them here with due recognition to the
contributor. :-) By the way, I do not take credit for these hints but I
will take credit for putting them together from various sources on the
net.

1. Record and play temporary macro

Ctrl+Shift+R to record a new temporary macro. Press Ctrl+Shift+R to stop recording. Ctrl+Shift+P to play the recorded macro.

This works similar to *recording* in Vim. If you think you are going
to be repeating a set of keyboard keys, then record them once and play
them each time after.

2. Multiple copy/pastes

Ctrl+Shift+V cycles through the clipboard
ring. You can copy/cut multiple times from one area of code, then go to
another area and paste them one after another.

3. Drag and drop code snippets

The Toolbox (Ctrl+Alt+X) window has
multiple tabs. You can drag and drop code onto this window and copy it
elsewhere. Some tabs do not allow dropping code into them; those that
allow will have the appropriate icon. The General tab works for me.

4. Previous cursor positions

Ctrl+- i.e. Ctrl + Hyphen. This cycles you through the code positions you visited.

Ctrl+Shift+- to navigate in the opposite direction.

5. Incremental search

To incrementally search for text as you type, first press Ctrl+i.
Then type the word you want to search. Hit backspace to clear a
character and enter to finish. Pressing F3 after this will work as
usual, i.e. search for the next occurrence of previous search.

Ctrl+iCtrl+i works like F3.

6. Matching brace/comment/region/quote

Ctrl+] takes you to the matching brace. It
also takes you to the matching comment, region or quote depending on
what is at the cursor now.

7. Vertical block selection

Press Alt and then select the area you want with your mouse.

8. Closing/Showing support windows

There are a bunch of necessary/useful windows in the Visual Studio IDE like Properties (F4), Solution Explorer (Ctrl+Alt+L), Output Window (Ctrl+Alt+O), Task List (Ctrl+Alt+K) etc. However, they take up a lot of space. An easy way around this is to use the auto hide feature.

Open the window you want. Right click on its title and choose Auto
Hide. The window will dock in whenever your mouse is not hovering over
it.

9. Tab groups – group code editor windows

If you have many source code windows open, you can group them
logically using tab groups. Right click the tab of the code window and
choose New Horizontal Tab Group. This will
move the window into a split window, allowing you to see both files.
You can add more files to this new tab group and also move files back
to the previous group by choosing Move To Previous Tab Group.

10. Track things you have to do with Task List

The Task List window (Ctrl+Alt+K) allows you to keep track of the things you have to do. Right click on the Task List window and choose Show Tasks|All to see a list of tasks. Ctrl+Shift+F12 to cycle through your list of tasks.

By default, comments marked with a TODO will appear in the task list.

11. Edit Task List Comment Tokens

You can add your own set of comment tokens (like the TODO comment token). Goto Tools|Options|Environment|Task List|Comment Tokens and make your changes. You can change the priority appearance of each comment token too.

12. Add Task List Shortcut

Add a shortcut to the task list with Ctrl+K, Ctrl+H. This will add the current line to the task list.

13. Auto-complete

Press Ctrl+Space or Alt+RightArrow to auto-complete the word. Intellisense suggestions may pop up a window if there is more than one possibility.

14. Intellisense suggestions window

Press Ctrl+Shift+Space to bring up the
intellisense suggestions window. When giving parameters for functions,
I often need to escape the suggestions window to check another part of
code. To bring it back, I used to delete a comma and then type it
again; but this is easier.

15. Word wrap

Ctrl+R Ctrl+R

or

Tools|Options|Text Editor|All Languages|General|Word Wrap

If you want to set this option for only one language, then choose the appropriate language instead of All Languages.

16. Line numbering

Tools|Options|Text Editor|All Languages|General|Line numbers.

If you want to set this option for only one language, then choose the appropriate language instead of All Languages.

17. Customizing Visual Studio’s Code Generation Templates

Customizing Visual Studio’s Code Generation Templates.

18. Default Shortcut keys

MSDN.

19. Favorites window

Your IDE also functions as a browser. To see your list of favorites, press Ctrl+Alt+F or choose View|Other Windows|Favorites.

20. Bookmarks

Bookmarks are available through Edit|Bookmarks. Bookmarks allow you to mark places in your code that you would want to come back to.

  • Create/Remove Bookmark – Ctrl+K, Ctrl+K
  • Move to next bookmark – Ctrl+K, Ctrl+N
  • Move to previous bookmark – Ctrl+K, Ctrl+P
  • Clear all bookmarks – Ctrl+K, Ctrl+L

21. Code Formatting

  • Auto-format selection – Ctrl+K, Ctrl+F
  • Convert to lower case – Ctrl+U
  • Convert to upper case – Ctrl+Shift+U
  • Comment selection – Ctrl+K, Ctrl+C
  • Uncomment selection – Ctrl+K, Ctrl+U

22. Outlining

I like this feature that allows me to hide code that is irrelevant to what I’m currently working on.

  • Fold/Unfold the current code block – Ctrl+M, Ctrl+M
  • Unfold all – Ctrl+M, Ctrl+L
  • Stop outlining – Ctrl+M, Ctrl+P
  • Fold all – Ctrl+M, Ctrl+O

23. Build and Debug

  • Build – Ctrl+Shift+B
  • Run – Ctrl+F5
  • Debug – F5
  • Cycle through build errors – F8

By SathishVJ

Posted in .NET, Programming | Dengan kaitkata: | 1 Comment »

Delphi – Merekam wave files (*.wav)

Posted by arifw pada Kamis, 24 April 2008

uses mmSystem;

{….}

procedure TForm1.Button1Click(Sender: TObject); // Record

begin

mciSendString(‘OPEN NEW TYPE WAVEAUDIO ALIAS mysound’, nil, 0, Handle);

mciSendString(‘SET mysound TIME FORMAT MS ‘ + // set time

‘BITSPERSAMPLE 8 ‘ + // 8 Bit

‘CHANNELS 1 ‘ + // MONO

‘SAMPLESPERSEC 8000 ‘ + // 8 KHz

‘BYTESPERSEC 8000′, // 8000 Bytes/s

nil, 0, Handle);

mciSendString(‘RECORD mysound’, nil, 0, Handle)

end;

procedure TForm1.Button2Click(Sender: TObject); // Stop

begin

mciSendString(‘STOP mysound’, nil, 0, Handle)

end;

procedure TForm1.Button3Click(Sender: TObject); // Save

var

verz: String;

begin

GetDir(0, verz);

mciSendString(PChar(‘SAVE mysound ‘ + verz + ‘/test.wav’), nil, 0, Handle);

mciSendString(‘CLOSE mysound’, nil, 0, Handle)

end;

Posted in Delphi, Multimedia, Programming | Dengan kaitkata: | Komentar Dimatikan

Delphi – Menggunakan Microsoft Speech API

Posted by arifw pada Kamis, 24 April 2008



uses Comobj;

procedure TForm1.Button1Click(Sender: TObject);

var

voice: OLEVariant;

begin

voice := CreateOLEObject(‘SAPI.SpVoice’);

voice.Speak(‘Hello World!’, 0);

end;

Posted in Delphi, Multimedia, Programming | Dengan kaitkata: | Komentar Dimatikan

 
Ikuti

Get every new post delivered to your Inbox.