Tagged: teaching Toggle Comment Threads | Keyboard Shortcuts

  • CG 11:04 am on April 22, 2010 Permalink | Reply
    Tags: connection, , , ms access, teaching, web programming   

    How to connect Java with Microsoft Access 

    1. Install easysoft (download address: http://download.cnet.com/Easysoft-JDBC-ODBC-Bridge/3000-2065_4-10392636.html)
    2. Click ODBC Data Source Adminsitrator
    3. Choose System DSN Tab
    4. Click Add the fill in Data Source Name (ex: “test”, “my_db”)
    5. Click Select and choose the .mdb file then click OK
    6. Click Apply

    The code ( and should works ):

    import java.sql.*;
    public class Testdb
    {
    public static void main(String[] args)
    {
    try{
    Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
    Connection con = DriverManager.getConnection("jdbc:odbc:tes","","");
    Statement stmt = con.createStatement();

    //di DB saya ada tabel mhs dengan 3 field yaitu npm, nama dan alamat
    ResultSet rs = stmt.executeQuery("Select npm, nama, alamat from mhs");
    while (rs.next()) {
    int x = rs.getInt("npm");
    String s1 = rs.getString("nama");
    String s2 = rs.getString("alamat");
    System.out.println(x + " " + s1 + " " + s2 + "\n");
    }
    }
    catch (Exception e){
    System.out.println("Error: " + e);
    }

    }
    }

    Thanks to Lucky for sharing the how-to and the code.

    Useful links:

    1. http://oreilly.com/catalog/javadata/chapter/ch04.html
    2. http://www.planet-source-code.com/vb/scripts/ShowCode.asp?txtCodeId=2691&lngWId=2
    3. http://www.easysoft.com/applications/microsoft-access/jdbc-odbc.html
    4. http://java.sun.com/docs/books/tutorial/jdbc/overview/index.html
     
  • CG 10:51 pm on August 29, 2009 Permalink | Reply
    Tags: teaching   

    TA-ing for this semester 

    1. EL3010
    2. II5161
     
  • CG 6:02 pm on July 28, 2009 Permalink | Reply
    Tags: , teaching   

    Teaching again 

    Happy to teach about ECC again for IF5166 🙂

    IF5166 July 27 2009

    This time I explained things better than this and this, hopefully 🙂

     
  • CG 9:40 pm on March 31, 2009 Permalink | Reply
    Tags: , teaching   

    Teaching: always learn something new 

    Luckily had been offered to give a short session (again) in this class today. I become more aware that, explaining things that I think and learn everyday, is not always easy.

    Then it needs extra effort to deliver things that are clear in my head, transform it into simple blocks of ideas and then convert it to some understandable sequence of words.

    Simplify things. Use short keywords. Give example.

    [Image taken from http://www.icalweb.com/wiki/images/a/a7/Cartoon.jpg%5D

     
    • Budi Rahardjo 11:03 pm on March 31, 2009 Permalink | Reply

      That’s the fun part of teaching (and the most difficult one); trying to make complicated things easier to understand. Sometimes we have to do try many times before getting it “right”.
      And when you get it right (and the students / audience understand), it just feels so good.

      Keep up the good work!

    • CG 11:13 pm on March 31, 2009 Permalink | Reply

      BR: it’s an honor to teach in your class, sir 🙂

  • CG 4:01 pm on January 22, 2009 Permalink | Reply
    Tags: , teaching   

    tutorial and handbook 

    I’m now writing a handbook for helping the students learning java programming. The tutorial has been done but I’m going to make some revisions and add some stuff.

     
    • Budi Rahardjo 7:32 pm on January 23, 2009 Permalink | Reply

      the handbook is excellent!

    • CG 2:45 pm on January 25, 2009 Permalink | Reply

      @BR: aaaaaaaa, do you think it is? thaaank yoouuuu!
      btw the one you saw was the tutorial. the handbook is still in progress 😀

    • Budi Rahardjo 4:12 pm on January 25, 2009 Permalink | Reply

      oh that was the tutorial? great …

    • iffata 1:17 pm on January 28, 2009 Permalink | Reply

      Maaaaauuuu !!! 😀

  • CG 5:26 pm on January 21, 2009 Permalink | Reply
    Tags: , teaching   

    back to teaching again 

    picture-1I left my favorite session of coding and debugging today, because I was so excited being a teacher again!

    So let me pending the technical report about my research until tomorrow 😉

     
    • Budi Rahardjo 10:55 pm on January 21, 2009 Permalink | Reply

      yeah, teaching can be so rewarding.
      but hey, don’t forget your research!

    • CG 6:25 pm on January 23, 2009 Permalink | Reply

      @BR: 🙂 yes. moving blogs can also be so rewarding :))

  • CG 12:38 pm on November 20, 2008 Permalink | Reply
    Tags: , , teaching   

    Compiling with OS X 

    TA-ing this class, I have to explain about compilation system. Later found out that OS X does not support many of the tools that relate to loading, linking and executing programs. More about it here.

    To generate an assembly code from a c program saved as code.c :

    gcc -S code.c

    that will result code.s

    The file code.s looks like:

    picture-42

    Using optimization option

    gcc -O1 -S code.c
    
    picture-6
    
    gcc -O2 -S code.c

    picture-8

    to compile and assemble code:

    gcc -c code.c

    will result code.o in binary format

    to dump the object code, instead of

    objdump -d code.o

    i use

    otools -tv code.o

    picture-5

    [this posting is still being updated at any time

    i’m doing many things at the same time right now 🙂 ]

     
    • kusprasapta 6:03 pm on November 20, 2008 Permalink | Reply

      try to compile the code with several optimization level, such as -O1 or -O2.
      it will produce different assembly code’s instructions.
      you’ll love it 😀

    • CG 6:40 pm on November 20, 2008 Permalink | Reply

      @kusprasapta: i will update the posting right after i try the optimization level 😉

    • tetangga@sebelah.com 9:57 pm on November 20, 2008 Permalink | Reply

      kalau menurut Applied C++: Practical Techniques for Building Better Software
      ini lah cara tunning C++
      1. Measure performance with release builds and not debugging builds.
      2. Compute only those Items that you need.
      3. Compute or fetch items only once.
      4. Use Integer instead floating point when possible.
      5. Know the object being used In time-critical code, especially copy constructor end assignment operators.
      6. Remove all debugging and log-generated code from your time-critical code once It’is fully debugged.
      7. Deliver release versions or your software internally as early as possible.
      8. Avoid excessive operations with heavyweight objects, like the standard library string class. Pre-compute quantities to speed up run-time calculations.
      9. Avoid system calls and heap allocation In time-critical sections of code.
      10. Minimize locks In time-critical sections of code.
      11. Develop an efficient algorithm that works correctly before you start fine tuning your code. Use unit test to ensure that tuning hasn’t broken anything.
      12. Use a profiler to find out where the biggest performance problems are before doing. a lot of small optimizations.

      yang paling penting menurut pengalamanku nomer 11 dan 12. optimization menggunakan compiler tercangih, atau menggunakan tool tercanggih tidak bisa mengalahkan optimization secara manual dengan memperbaiki algoritma (math optimization)

    • CG 2:47 pm on November 21, 2008 Permalink | Reply

      @tetangga sebelah: a very detail explanation. thank you 🙂

    • kusprasapta 4:26 pm on November 21, 2008 Permalink | Reply

      setuju no 11 dan 12 yang paling penting.
      dalam suatu diskusi dengan pak Waskita, pernah dibahas tentang unit test ini.

  • CG 6:52 pm on November 3, 2008 Permalink | Reply
    Tags: , teaching   

    TA-ing graduate students… 

    Arrrrrrghghghgg… not the first time, but still, being a teaching assistant is no easy for me.Especially in this class, one of my most favorite class I never got bored to sit in. Not to mention the lecturer is one of the expert in my field of research, and maybe the best presenter I’ve ever known. Ssssooo scaarrrryy to teach his class, aaaaaaaaaarrrhhh!

    I was supposed to teach the class about symmetric and asymmetric key and the cryptosystems, and give them the big picture and ideas about cryptography. But like always, being nervous at the first time teaching a new class full of strangers, I started to hide behind the numbers and calculations. Too shy too look at the audience! And so be it: the class turned out to be too theoretical and too much math calculations 😦

    But the other TA, to whom I asked for help when the students asked about the real implementation of security, sucessfully wrapped up the class and gave them the big picture about cryptography. And once again, I learn about how to teach, and how to manage the stress. Thanks partner 😉

    [One more presentation to do at the math department! Tomorrrow, 11 am !!!]

     
    • Budi Rahardjo 12:24 am on November 4, 2008 Permalink | Reply

      Thanks for teaching in my class. Don’t worry about the class 🙂

    • chikaradirghsa 2:15 am on November 4, 2008 Permalink | Reply

      @BR: it’s been an honour to teach your class, sir! thx for the (very rare) opportunity!

    • Iffata 7:45 am on November 4, 2008 Permalink | Reply

      You’re welcome, partner 😉 I think WE managed to do it. Let’s keep up the good work! 😀

    • CG 8:52 am on November 4, 2008 Permalink | Reply

      @iffata: let’s! 😉

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