19 Aralık 2014 Cuma

Raspberry Pi Raltek 8188eus Kablosuz USB Adaptörü Kurulumu

Ebay'den bu sayfada uyumlu donanımlar listesinde olan Realtek 8188eus yongasına sahip Comfast CF-WU810N-2 usb adaptörünü aldım (yaklaşık 10 lira).
Çok zahmet çekmeden donanımı tanıtmayı umarken karşıma çok fazla sayıda problemle karşılaşan insan ve herbirinin farklı çözümleri çıktı.

İki akşam birçok yöntemi denedikten sonra sonunda şu adresteki çözümle adaptörü çalıştırmayı başardım: http://www.raspberrypi.org/forums/viewtopic.php?p=462982#p462982

Aslında çözümlere bakarken çözüme giden yolun kernel sürümüne uygun sürücü olduğunu farkediyorsunuz. Ancak onu bulmak deneme yanılma ile oluyor. Buradaki çözümde farklı kernel sürümleri için uygun sürücüler dropbox'a yüklenmiş. Oradan kernelinize uygun sürücüyü indirip kuruyorsunuz. Gerçekten birkaç satır ile sorunu halloluyor.

En sonunda  ifconfing ile wlan0 ayarlarını ekranda görebiliyor olmanız lazım.

Kurulumun ardından bu sayfada verilen bilgiler doğrultusunda ağınızın kullandığı güvenlik protokolüne uygun olarak ağ adınızı ve parolasını kaydediyorsunuz. Yeniden başlatırken adaptörün ışığı yanıp sönecek ve kısa sürede ağa bağlanacaktır.

Kolay gelsin, iyi şanslar.

    Raspberry Pi wireless RTL8188eus set up

    I was looking for a wireless dongle that Raspberry Pi suppors in order to set my pi free and I bought this item from ebay. It is a Comfast CF-WU810N-2 dongle. (the item says N-1 but I got an N-2-a new version). The dongle has a Realtek 8188eus chipset. You can find more information about the supported chips and models in this page.

    No one expects a smooth setup when it comes to wireless USB dongles on Linux (but hopes). As expected I needed to try many workarounds and different websites to make it work.

    At the end I found the one: http://www.raspberrypi.org/forums/viewtopic.php?p=462982#p462982

    It is so simple:
    • check your kernel version 
    • find the corresponding file name from the tables
    • download the file from dropbox
    • unzip & install
    that's all..

    After you follow the steps you should be seeing wlan0 when running ifconfing

    One thing to consider after setting up the wireless dongle is to save the name and the password of your wireless network. Here you can find  a tutorial in which you can update the /etc/network/interfaces file according to the security method your network uses.



    8 Kasım 2014 Cumartesi

    Bir tabControldeki seçilmiş checbox sayısının elde edilmesi

    Eğer bir tabControl içinde birden fazla tabınız varsa ve bu tablardaki checkboxlardan kaç tanesinin seçilmiş olduğu bilgisine ihtiyacınız varsa aşaığdaki satırlar işinizi görecektir.

    int number = 0;
    foreach (TabPage tp in tabControl1.Controls)
         foreach (Control c in tp.Controls)
              if (c is CheckBox)
                   if (((CheckBox)c).Checked)
                        number++;

    MessageBox.Show("" + number);

    Kodda ufak değişiklikler yaparak checkbox yerine istediğiniz control tipinden istediğiniz durumda olanların sayısını da elde edebilirsiniz.

    Counting the number of checked checkboxes in a TabControl

    If you have multiple tabs in a tab control and you want to know the total number of checked checkboxes in this tab the following lines will be helpful:

    int number = 0;
    foreach (TabPage tp in tabControl1.Controls)
         foreach (Control c in tp.Controls)
              if (c is CheckBox)
                   if (((CheckBox)c).Checked)
                        number++;

    MessageBox.Show("" + number);

    You may change the code easily to get the number of non-null textboxes and so on..

    14 Eylül 2014 Pazar

    Kendime Notlar

    C# byte[] to String

    C#'da elinizdeki bir byte array'ini string hale getirmek için aşağıdaki kodu kullanabilirsiniz. 


    string result = System.Text.Encoding.UTF8.GetString(byteArray)
    Eğer UTF8 den faklı bir kodlamaya ihtiyacınız varsa ASCII ya da Unicode da kullanabilirsiniz.
    kaynak: http://stackoverflow.com/questions/1003275/how-to-convert-byte-to-string


    Java Dosya Yazma İşlemleri

    Java'da bir dosya oluşturup bu dosyaya veri yazmak için aşağıdaki satırları kullanabilirsiniz.

    Writer writer = null;
    
    try {
        writer = new BufferedWriter(new OutputStreamWriter(
              new FileOutputStream("dosyaAdi.txt"), "utf-8"));
        writer.write("Biseyler biseyler");
    } catch (IOException ex) {
      // Exceptionları yakala
    } finally {
       try {writer.close();} catch (Exception ex) {}
    }
    
    Kaynak: http://stackoverflow.com/questions/2885173/java-how-to-create-and-write-to-a-file