Linux.com

jabirali

jabirali

  • Linux.com Member
  • Posts: 157
  • Member Since: 30 Apr 10
  • Last Logged In: 10 Aug 11

Latest Posts

Posted by
Topic
Post Preview
Posted
  • jabirali
    RE: Distro question (experts, please read)
    If you want to stick to C++, then [url=http://doc.trolltech.com/4.0/aboutqt.html]Qt[/url] is a good choice. The libraries have predefined widgets for almost everything, and defining your own widgets is also quite easy. The GUI itself can either be designed graphically (using Qt Designer), or manually (by instantiating and initializing the widgets yourself). When the GUI has been defined, you simply use the "connect" macro to map events (signals) to your own methods (slots). If you're interested, they have extensive tutorials and examples [url=http://doc.trolltech.com/4.0/examples.html]here[/url] to get you started. Here's an example of defining your own widget in Qt, I wrote it when going through their tutorial: [code]class LCDRange : public QWidget { public: LCDRange(QWidget *parent = NULL); }; LCDRange :: LCDRange(QWidget *parent) : QWidget(parent) { // Instantiate widgets QLCDNumber *lcd = new QLCDNumber(2); QSlider *slider = new QSlider(Qt::Horizontal); QVBoxLayout *layout = new QVBoxLayout; // Initialize widgets lcd -> setSegmentStyle(QLCDNumber::Filled); slider -> setRange(0,99); slider -> setValue(0); // Connect signals to slots connect(slider, SIGNAL(valueChanged(int)), lcd, SLOT(display(int))); // Configure layout layout -> addWidget(lcd); layout -> addWidget(slider); setLayout(layout); }[/code] Other popular alternatives include [url=http://wxwidgets.org/]wxwidgets[/url] and [url=http://www.gtkmm.org/en/]gtkmm[/url]. I've never used them before, so I can't speak for those libraries :) [b][edit][/b] If you're interested in creating your own distribution, you should also take a look at the [url=http://www.linuxfromscratch.org/lfs/]Linux From Scratch[/url] project. They provide a mature handbook that'll hold your hand through the entire process ;)
    Link to this post 25 Jun 11

    If you want to stick to C++, then Qt is a good choice. The libraries have predefined widgets for almost everything, and defining your own widgets is also quite easy. The GUI itself can either be designed graphically (using Qt Designer), or manually (by instantiating and initializing the widgets yourself). When the GUI has been defined, you simply use the "connect" macro to map events (signals) to your own methods (slots). If you're interested, they have extensive tutorials and examples here to get you started.

    Here's an example of defining your own widget in Qt, I wrote it when going through their tutorial:

    class LCDRange : public QWidget
    {
    public:
    LCDRange(QWidget *parent = NULL);
    };

    LCDRange :: LCDRange(QWidget *parent) : QWidget(parent)
    {
    // Instantiate widgets
    QLCDNumber *lcd = new QLCDNumber(2);
    QSlider *slider = new QSlider(Qt::Horizontal);
    QVBoxLayout *layout = new QVBoxLayout;

    // Initialize widgets
    lcd -> setSegmentStyle(QLCDNumber::Filled);
    slider -> setRange(0,99);
    slider -> setValue(0);

    // Connect signals to slots
    connect(slider, SIGNAL(valueChanged(int)), lcd, SLOT(display(int)));

    // Configure layout
    layout -> addWidget(lcd);
    layout -> addWidget(slider);
    setLayout(layout);
    }

    Other popular alternatives include wxwidgets and gtkmm. I've never used them before, so I can't speak for those libraries :)

    [edit]
    If you're interested in creating your own distribution, you should also take a look at the Linux From Scratch project. They provide a mature handbook that'll hold your hand through the entire process ;)

  • jabirali
    RE: I'm looking for a distro ..
    Yes, there are several distributions that let you choose all your software packages yourself. Here are some examples: [ul] [li][url=http://www.archlinux.org]ArchLinux[/url][/li] [li][url=http://www.debian.org]Debian[/url][/li] [li][url=http://www.slackware.com]Slackware[/url][/li] [li][url=http://www.gentoo.org]Gentoo[/url][/li] [/ul] ArchLinux, Gentoo and Debian Unstable are rolling-release distributions, which means that new packages are being released into the repositories as soon as they're available upstream. Debian Testing, Debian Stable and Slackware instead make stable releases from time to time, where package versions are frozen and only bugfixes and security updates are released during the lifespan of that release. ArchLinux and Debian are primarily based around binary software packages fetched from online repositories, with automatic dependency-fetching and so on. Slackware uses binary packages without dependency checking, but there are multiple third-party package managers for Slackware that adds support for online repositories and dependency fetching. Gentoo is based around an automated build system called Portage, that compiles each program for your machine, and let's you customize everything with USE-flags and MAKE-flags. This requires some time for maintenance, though. They each have a bit different philosophies, so it's up to you to choose the best one for your use.
    Link to this post 19 Jun 11

    Yes, there are several distributions that let you choose all your software packages yourself. Here are some examples:
    [ul] [li]ArchLinux[/li] [li]Debian[/li] [li]Slackware[/li] [li]Gentoo[/li] [/ul]
    ArchLinux, Gentoo and Debian Unstable are rolling-release distributions, which means that new packages are being released into the repositories as soon as they're available upstream. Debian Testing, Debian Stable and Slackware instead make stable releases from time to time, where package versions are frozen and only bugfixes and security updates are released during the lifespan of that release.

    ArchLinux and Debian are primarily based around binary software packages fetched from online repositories, with automatic dependency-fetching and so on. Slackware uses binary packages without dependency checking, but there are multiple third-party package managers for Slackware that adds support for online repositories and dependency fetching. Gentoo is based around an automated build system called Portage, that compiles each program for your machine, and let's you customize everything with USE-flags and MAKE-flags. This requires some time for maintenance, though.

    They each have a bit different philosophies, so it's up to you to choose the best one for your use.

  • jabirali
    RE: Recommendations for good programming books
    I used the book "Absolute C++" by Walter Savitch, and was quite satisfied with it. The book is easy to read, and touches all the basics (pointers, object orientation, linked data structures, templates, exceptions, basic input/output, STL).
    Link to this post 09 Jun 11

    I used the book "Absolute C++" by Walter Savitch, and was quite satisfied with it. The book is easy to read, and touches all the basics (pointers, object orientation, linked data structures, templates, exceptions, basic input/output, STL).

  • jabirali
    RE: Is my laptop capable of running a linux OS?
    Another safe bet is [url=http://www.damnsmalllinux.org/]Damn Small Linux[/url], which works with as little as 16MB of RAM and a 486 (pre-pentium) processor.
    Link to this post 06 Jun 11

    Another safe bet is Damn Small Linux, which works with as little as 16MB of RAM and a 486 (pre-pentium) processor.

  • jabirali
    RE: Need help for a class project.
    Correct me if I'm wrong, but it sounds like you basically want to pay someone to do your homework for you. I'm not going to that. I can, however, give you a pointer in the right direction if you're willing to do the job yourself. [ul][li]Linux scripting is usually done using [url=http://tldp.org/LDP/Bash-Beginners-Guide/html/]bash[/url].[/li][li]Information about processes, including CPU and memory usage, can either be extracted from the [i]/proc[/i] filesystem, or discovered using the command [i]ps[/i] (see [i]man ps[/i]).[/li][li]Whether or not processes are necessary - this is not trivial. Except for the kernel and init, anything can be turned off without major problems - but every time something is turned off, you lose some functionality. Whether or not this functionality is necessary depends on what the machine is used for.[/li][li]How much memory is used can be extracted from [i]/proc/meminfo[/i], or using the command [i]free[/i][/li].[/ul]
    Link to this post 04 Jun 11

    Correct me if I'm wrong, but it sounds like you basically want to pay someone to do your homework for you. I'm not going to that. I can, however, give you a pointer in the right direction if you're willing to do the job yourself.
    [ul][li]Linux scripting is usually done using bash.[/li][li]Information about processes, including CPU and memory usage, can either be extracted from the /proc filesystem, or discovered using the command ps (see man ps).[/li][li]Whether or not processes are necessary - this is not trivial. Except for the kernel and init, anything can be turned off without major problems - but every time something is turned off, you lose some functionality. Whether or not this functionality is necessary depends on what the machine is used for.[/li][li]How much memory is used can be extracted from /proc/meminfo, or using the command free[/li].[/ul]

  • jabirali
    RE: Startup question?
    [b]mfillpot wrote:[/b] [quote]To accomplish the same task with custom scripts and applications I have added an additional entry to my PATH variable that points to my scripts directory, then placed that entry into my .bashrc file so it is only available to the single user[/quote]This is what I've done as well, and it's a lot easier to maintain between reinstalls since you don't wipe out /home without backups that often... Personally, I also keep my script folder in Dropbox, so that the scripts are automatically distributed to all my Linux computers. By the way, if you insist on symlinking your scripts into the system path, the conventional place is /usr/local/bin/ :)
    Link to this post 31 May 11

    mfillpot wrote:

    To accomplish the same task with custom scripts and applications I have added an additional entry to my PATH variable that points to my scripts directory, then placed that entry into my .bashrc file so it is only available to the single user
    This is what I've done as well, and it's a lot easier to maintain between reinstalls since you don't wipe out /home without backups that often... Personally, I also keep my script folder in Dropbox, so that the scripts are automatically distributed to all my Linux computers.

    By the way, if you insist on symlinking your scripts into the system path, the conventional place is /usr/local/bin/ :)

Who we are ?

The Linux Foundation is a non-profit consortium dedicated to the growth of Linux.

More About the foundation...

Frequent Questions

Join / Linux Training / Board