Page 1 of 2 12 LastLast
Results 1 to 10 of 13

Thread: Linux programming how to?

  1. #1
    Join Date
    Feb 2010
    Location
    India
    Beans
    29
    Distro
    Ubuntu 9.04 Jaunty Jackalope

    Question Linux programming how to?

    Dear friends ,


    i am a wannabe linux programmer, i'm using ubuntu and wish to add a functionality like this :
    the system should indicate the successful detection of usb device by a sound signal , please tell me how do i get started
    i am a beginner in linux programming , please help me.

  2. #2
    Join Date
    Mar 2007
    Beans
    66

    Re: Linux programming how to?

    The easiest way to do that would be to write a udev/HAL (is that still used?) rule that launches a command-line media player like mplayer - how you would go about doing this I don't know. You could probably do it quite easily for hardware in general though, not just USB devices. I haven't written a udev rule in years though so I've almost forgotten how to do it I'm afraid - you could google around or wait for someone to give a better answer.

    Writing an actual program (or script) to do it would be possible but it would definitely be easier to figure out udev rules - you would need to parse output from the command dmesg for mentions of USB devices being inserted.

  3. #3
    Join Date
    May 2007
    Beans
    121
    Distro
    Ubuntu 7.04 Feisty Fawn

    Re: Linux programming how to?

    Linux programming is a very, very wide subject!
    For example, there are a lot of different programming languages used in a linux system nowadays.

    The first thing to know is whether you already know some programming language or not.
    If you do, then tell us which one and maybe someone can tell you where to start to do get your project done.
    If not, then you should first choose a programming language, learn a bit about it, and start playing around.

    Linux folklore dictates that C or C++ should be your first choice. It is a very wide language in its scope and you can learn a lot by only using it, but it may get very complicated at some point. So I would recommend to start with something easier like python. With it you can write short snippets as well as big programs with user interfaces and so on. Try looking for a tutorial, there are a lot of them. Follow the simpler examples and given some time, you will be able to code your project.

    have fun!

  4. #4
    Join Date
    Nov 2008
    Location
    S.H.I.E.L.D. 6-1-6
    Beans
    Hidden!
    Distro
    Ubuntu Development Release

    Re: Linux programming how to?

    Quote Originally Posted by Muzer View Post
    The easiest way to do that would be to write a udev/HAL (is that still used?) rule that launches a command-line media player like mplayer - how you would go about doing this I don't know. You could probably do it quite easily for hardware in general though, not just USB devices. I haven't written a udev rule in years though so I've almost forgotten how to do it I'm afraid - you could google around or wait for someone to give a better answer.

    Writing an actual program (or script) to do it would be possible but it would definitely be easier to figure out udev rules - you would need to parse output from the command dmesg for mentions of USB devices being inserted.
    HAL is being removed in Lucid.
    http://ubuntuforums.org/showthread.php?t=1381844
    Don't waste your energy trying to change opinions ... Do your thing, and don't care if they like it.

  5. #5
    Join Date
    Feb 2010
    Location
    US
    Beans
    53
    Distro
    Ubuntu 10.10 Maverick Meerkat

    Re: Linux programming how to?

    Quote Originally Posted by beren.olvar View Post
    Linux folklore dictates that C or C++ should be your first choice. It is a very wide language in its scope and you can learn a lot by only using it, but it may get very complicated at some point. So I would recommend to start with something easier like python. With it you can write short snippets as well as big programs with user interfaces and so on. Try looking for a tutorial, there are a lot of them. Follow the simpler examples and given some time, you will be able to code your project.

    have fun!
    I have to agree with starting with Python. I do some web scripting (php, asp, etc) but just moved into programming a few months ago. I started learning Java and have since moved to Python. Java can be useful if you want to program for smartphones, etc but not the best when just programming for Linux.

  6. #6
    Join Date
    Jul 2009
    Location
    Mentakab, Malaysia
    Beans
    1,864
    Distro
    Ubuntu 9.10 Karmic Koala

    Re: Linux programming how to?

    Keep your important files in HOSTS when ubuntu is installed with WUBI
    How to install ANYTHING in Ubuntu!
    'No PUB KEY' error? Try this!


  7. #7
    Join Date
    Jul 2008
    Beans
    54

    Re: Linux programming how to?

    i think the answer to this question would be valuable to all linux noob programmers, so sorry if im hijacking.
    is GTK a programming language, in the way that if you understand its language you could potentially rewrite the GUI of many applications?
    i have been curious about this for a while, as i work with live audio the interface control can be very powerful

  8. #8
    Join Date
    Oct 2009
    Location
    Amman, Jordan
    Beans
    93
    Distro
    Ubuntu 11.04 Natty Narwhal

    Re: Linux programming how to?

    Jordan Open Source Association | E-mail
    Macbook (late 2008) - 2.4Ghz Core2Duo - 4GB RAM - nVidia 9400 - 250GB HDD

  9. #9
    Join Date
    Feb 2010
    Location
    India
    Beans
    29
    Distro
    Ubuntu 9.04 Jaunty Jackalope

    Re: Linux programming how to?

    well i have had a course on c and c++, so that's my domain , now please tell me where to start
    thanks for response till now,
    love you linux-people

  10. #10
    Join Date
    Apr 2008
    Location
    Melbourne, Australia
    Beans
    328
    Distro
    Ubuntu 10.04 Lucid Lynx

    Re: Linux programming how to?

    Quote Originally Posted by thecliff View Post
    Java can be useful if you want to program for smartphones, etc but not the best when just programming for Linux.
    Java has everything, from midi to net, i've been using/learning java for 2 years and until they work out how to speed up the jvm it will be in c++ shadow,

    i agree with the learn python first crowd because it's a strictly typed language also code conventions in other languages like indenting blocks, it has a strong library and it uses alot of the C functions also

    so when you do learn C it wont be as confusing. And C is good to learn because it gives you a basis for C++, C#, objective C.
    (i realize objective-C and C# dont have much to do with linux )
    Last edited by ja660k; February 15th, 2010 at 03:10 PM.
    "Oh Ubuntu, you are my favorite linux based operating system" Dr. Sheldon Cooper.

Page 1 of 2 12 LastLast

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •