Does anyone here use PHP-GTK? Is there a better alternative? - php-gtk

I had made some questions regarding PHP-GTK (there are only 4 php-gtk tagged questions and three are mine) and I end up answering myself because no one answer them.
I know it is a strange language selection but I was attracted to it because it runs on several OSs and the fact that I can reuse some of my code (also the apps end up looking good and I can make little installers in NSIS that just rocks).
Is there a better alternative, that is free (as in freedom) and can run on several platforms?

Both Python and Ruby can work with the GTK libraries. These may be better chocies of languages for you (you'll certainly get more folk here answering your questions :)
See Is Ruby any good for GUI development? and https://stackoverflow.com/questions/115495/is-python-any-good-for-gui-development for links for Ruby and Python respectively.

Does it have to be GPL, or are other open source solutions acceptable? Python has much more mature GTK integration and it's open source but not GPL. You can bundle python scripts into an executable with a runtime. You can generate these executables for many platforms including Windows.

To answer the first part of your question. Yes - I use php-gtk. This could be the start of a beautiful friendship.

To answer your question from the other side.
Other GUI applications that can be coded in PHP include wxWidgets and Qt, both of which have PHP bindings available: wxPHP and PHP-Qt

Related

Anjuta/Glade Tutorials or Better IDE?

I am attempting to develop a GUI application for Tails. I'm doing the initial development on Debian 8 since development directly in Tails can be a pain.
I started out using Anjuta, but the documentation is essentially non-existent. The Anjuta website has nothing at all about how Glade is integrated or how to use it. I can't even track down documentation on how to change the main window title. The only tutorial I found has you start a project and build it using the default files that are generated for a GTKmm project.
Is there a good book or online tutorial out there for doing GUI development in Anjuta?
This is maybe not a complete answer, but it's too large to put in as a comment. I use Anjuta fairly regularly, but I share your feeling about the missing documentation (which is, by the way, not unique for Anjuta). I appreciate Anjuta (and Glade) very much, so don't take the following as criticisms on either program.
I would recommend you consider using PyGTK for GUI creation. It is a lot more productive. You can design the GUI in Glade - exactly the same way you would do for C/C++ - and then implement the code in Python, which you can also edit and manage from Anjuta. There are plenty of code examples, for example on the nullege code search engine.
About the work flow in Anjuta (for C/C++). It is based mainly on the Autotools system, so you should really read up a little on make, Makefile, and related tools. Though in principle Anjuta manages this, you will, sooner or later hit a problem, and some knowledge about Autotools will help you a long way (also this tutorial or this one. This slide series is interesting - probably because it is more graphical. There are even some video tutorials, like this one.).
There is no real necessity to use Glade from inside Anjuta. In fact, Glade has passed a long process distancing itself from 'code generation'. It now only contains an XML generator, which can be called separately. I find the screen space left for Glade inside Anjuta insufficient for comfortable work anyway.
So, in conclusion: If you mainly need a GUI, consider Python + Gtk. If you do need C or C++, Anjuta is a great IDE, but look at Gtk Development examples (like this one). Following those, the use of Anjuta should be a lot clearer.
EDIT:
Very useful answer. I have some underlying legacy code that has to be
C++. Is there a way to mix Python and C++ in Anjuta, or do you know of
any guideposts or tutorials for such?
You can open a C++ project in Anjuta - maybe even import you legacy code directly as a Makefile project. You can also add new files to your C/C++ project and create them as Python files. I've never tried to do that though, and I'm not sure how Anjuta would treat them, for example, in the Makefile(s). I don't have large projects mixing languages at the moment, but for small projects, I like 'Geany', because it doesn't get in the way. You do have to maintain the Makefiles manually.

ncurses-like bindings in interpreted languages

Are there any bindings for ncurses or a similar menuing framework in interpreted languages that make the process of creating console menus and interacting with options absurdly simple?
I want to quickly prototype out a terminal-only configuration utility that runs on a Linux machine, in order to leverage some local resources previously installed.
There's a PERL module exposing CURSES:FORM and CURSES:WIDGETS, though I'm sure they're quite ancient. They may be fine for prototyping, however.
http://tldp.org/HOWTO/NCURSES-Programming-HOWTO/tools.html#PERLCURSES
urwid for Python is pretty simple (see some examples) and is actively maintained.
The Dialog utility might be what you want.
The Python standard library comes with a curses module that you can use for this. Also, here is a HOWTO.

How do I start contributing to GNOME?

How do I start contributing to GNOME? I can program in C++ and Python, but have never touched C. I am not familiar with GTK even.
To be honest, I have no idea how GNOME works. All I have is a deep desire to somehow contribute to it.
Where do you recommend do I start? Any tutorial, mailing list or anything. I am ready to do the hard work, I just need a direction.
PS: I could have googled for the problem, but nothing beats the experience I have seen since Google returns SO for most of the questions.
Visit Join GNOME.
Figure out what you want to do for them
If it's development, then:
learn C and GTK
checkout the source code
browse through the bug-tracker to find a reasonably sized task and ask for help of more senior committers to tell you what is at your level
fix it and submit a patch
wait for roses and glory
But maybe you can help with other things, as mentioned on Join GNOME
Translations
Design / Artworks
Technical Documentation (review, proofreading)
Best of luck and thank you for trying to contribute.
Be sure to check out GNOME Love as well. It's a site aimed at getting people started with GNOME.
You may find it handy and useful by creating new extensions for Gnome shell.
There are a lot of extensions on https://extensions.gnome.org/. It requires JavaScript programming. It will also give you insights of how things work in Gnome.
start simple program with below manual.
The GTK+ tutorial
GTK+ 2 Reference Manual
GTK+ 3 Reference Manual
show your program here: http://www.gtkforums.com/ (Project Showcase)
also to note:
you don't have to learn C (even though it's a good idea). You can use PyGtk for GTK development in python (but i won't recommend that because of the speed of python).
GTK bindings for c++ also exit it's called gtkmm. It have binding for many other librays (Cluttermm, Cairomm, Pangomm).
there are bindings for A LOT of languages but native C is the best solution.
I would recommend learning vala because of it's ease of use but also because of it's speed (but that's just personal preference).
also check the gnome-devel-demo out. can be useful

Recommended IDE for R under linux [duplicate]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
Questions asking us to recommend or find a tool, library or favorite off-site resource are off-topic for Stack Overflow as they tend to attract opinionated answers and spam. Instead, describe the problem and what has been done so far to solve it.
Closed 9 years ago.
Improve this question
What good IDEs are there for R in Linux?
I've tried Rcmdr and Eclipse, but neither seems to have the same usability as Tinn-R in Windows. Are there any other options?
A newcomer to the scene, which IMO looks very promising - and downright baller - relative to other existing IDEs like Rattle and JGR, is RStudio. It's free software, is cross-platform, looks very polished, and even has features like automatic refactoring.
Update 2012-04-12: I've been running it for a bit on our DB server, and I love that it's a web app that saves your sessions, resume-able from anywhere else. Plotting requires not only no X tunneling or png-writing but is easier to use than out-of-the-box R. Extremely easy to get up and running, and it comes with packages for Debian/Ubuntu (which I use).
The company/development is moving pretty fast, aiming to be the de facto standard IDE for all R users. If I'm gushing, it's probably because I was pleasantly surprised by the quality of the IDE after a long time of using sub-par IDEs, not just for R but for plenty of other languages. So this was a bit out of the blue. I still need more time to really dig into it but I like what I'm seeing so far.
JGR isn't bad:
http://rforge.net/JGR/
Most people I know rave about Emacs + ESS:
http://ess.r-project.org/
But it's not quite the same thing as Tinn-R.
Along different lines ...
If you're looking at a high level functions for data mining, then Rattle is an option:
http://rattle.togaware.com/
and another high level app for interactive plotting:
http://code.google.com/p/playwith/
I have found that the Emacs-ESS combination is well worth the learning curve. I enjoy being able to:
have code and R console side by side
send the current line, paragraph, file, or function to the R console without touching the mouse
easily interact with R sessions on remote computers
enjoy all the editing abilities of Emacs
Here's the website for the project:
http://ess.r-project.org/
Here's a helpful document about ESS in particular:
http://www.demog.berkeley.edu/Refs/ess.pdf
Brand new IDE out there (as of Feb 2011) is http://www.rstudio.org/. Seems very promising from what I've seen so far.
Although Eclipse was mentioned by the OP, I do not know if he ment it with the StatET plugin.
Eclipse with StatET is a really great IDE besides e.g. EmacsSpeaksStatistics (ESS), but as in other environments the user have to learn it's the basic usage first. The only handicap of this IDE could be the relatively high resources requirements as based on Java, but this makes the program OS independent of course.
Why I really would suggest to take the time to learn use StatET efficiently (cauction: very subjective list!):
be able to run your code really fast and easily with comfigurable shortcuts (by Ctrl+r by default),
thanks to the script editor and running environment is heavily integrated, debuging and reviewing your code cannot be easier,
configurabled environments by default (e.g.: R scripts),
you may define templates for frequent commands and those's environment (e.g.: loop, if conditions etc),
highly customizable syntax highlight,
TeXlipse integrated to view and edit tex code with ease (LaTeX support for Eclipse),
Roxygen support for literate programming (very handy at package development to automatically generate Rd files (manuals) from inline comments),
easily extendable with othet Eclipse plugins (e.g.: spell checking, (SQL) database management, image viewer, running external programs like Sweave).
A nice guide to read is A Guide to Eclipse and the R plug-in StatET by Longhow Lam.
Gedit + RGedit plugin + Snippets plugin
You've suggested eclipse; there is a plugin called StatEt which work quite well (even Sweave is supported!).
There is a KDE 4 based IDE called RKward. It's nice because of:
Workspace Browser
Integrating the R console
data.frames editor
Syntax colored editor
GUI frontend for installing CRAN packages
For my case, I would recommend RKward for linux, it is a KDE. I've been using RStudio in Windows, but when I switched to Ubuntu, I find RKward easy to use, and has a good interface.
You can create a data frame without coding it with data.frame() function.
If you are used to Eclipse, StatET (mentioned by mbq) is probably the right choice for you.
That being said I have a more exotic choice to offer that you might want to consider, if you like auto suggestion and pure syntax highlighting is not enough for you. At least for me auto completion of R-Code did not work with StatET.
Now I use Komodo Edit with Sciviews-K and R64. Sending Code from editor to R works really well and the editor offers auto-completion for R-Code which is really nice – in particular if you are new to R. I work on a Mac, but it should be easy to setup for Linux too.
I think it has lost some popularity because it wasn't to stable in the past, but at I feel it's much better now and it hardly crashes in my setup. So you might wanna give it a chance too.
EDIT: If you work on Mac Textmate with the corresponding R bundle might be interesting, too. Recently I am about to switch to Textmate. If you don't care about the $45 for textmate, it's probably the most stable choice I tested so far. But it's only available on a Mac. But hey I am really amazed by this editor (and as you can see I like testing setups ;).
EDIT: I realize this thread is still being read by someone, so I definitely need to mention RStudio. It came out of nowhere and quickly became the choice of a lot of people. And it's well deserved. It still has some bugs (like not being able to stop RSessions) but it has tremendous auto-complete with context help. But at least on my setup (Mac) it's more stable than StatET / Eclipse. Sweave and ROxygen is not really supported yet, but the developers are very active. Definitely worth trying.
EDIT II: Because it's fun to track this here's another edit. RStudio continues to win more and more users. The combination of RStudio, Roxygen2 and particularly knitr integration has likely been the largest contribution to this development. While Rstudio was rather used by applied users and in teaching and has improved to dramatically that there's isn't many situations in which another IDE / editor is a better choice. Being maried to ESS seems like to only valid reason left to not use it. Also the documentation of its ecosystem is just great. The latest: Package development by Hadley http://r-pkgs.had.co.nz/description.html and his advanced programming http://adv-r.had.co.nz/
I strongly recommend learning emacs+ess, but for a more modern-looking interface you can try RKward: http://sourceforge.net/apps/mediawiki/rkward/index.php?title=Main_Page.
I use Geany in combination with R. Geany provides a terminal in which one can start an R session and shortcuts an be defined in order to send highlighted text to the terminal.
www.geany.org
RGedit, great tool if you're keen on GNOME default text editor. Lacks autocompletion in script mode, though... but you can define snippets in a separate plugin (Snippets)... You can send code directly to R session running in the terminal window, tabbed multiple R sesions, there are several GUI templates for common data analysis (t-test, correlation), long story short, take a look at:
http://sourceforge.net/projects/rgedit/
Few months ago (when I gave my blogging skills a try), I wrote a review for RGedit, here's a link (and a little bit of self-advertising):
http://psy-stat.com/?p=12
EDIT:
Oh, and you can use Geany and set it up so you can send code chunks to R session... I've never done it, but I know it's manageable!
EDIT #2:
here's a helpful link: http://sgsong.blogspot.com/2010/08/integrating-r-with-geany.html
This might be what you're looking for. It integrated Komodo and the SciViews package. I found it a bit too fiddley (I prefer vi) but if you're looking for a full blown IDE/editor for R in Linux it's pretty close to Tinn-R for Windows and it's written by the same guys!
Link:
http://www.sciviews.org/SciViews-K/index.html
Rattle: http://rattle.togaware.com/
Emacs with ESS. Probably not as polished as Eclipse, but I do like it.
Personnaly, I use gedit and my console. It works great :)

Linux programming - getting started, how?

I've taken the plunge and installed Linux (Linux Mint 9 if that's important) on one of the boxes - and I'd like to start some small-time programming... but where to start.
My background:
Mostly LOB-applications in C#/WPF
Some XAL-basic
A wee bit of VB/VBA and SilverLight
I would like to turn to a new programming language - but still focused on desktop applications.
What I need:
An editor - preferably with good intellisense
A programming languages and the resources to get started
If anyone can point me in the right direction, I'd be happy for a little push...
EDIT:
Thanks for all the advice - I've come up with the following:
I'll start out with Python - and use Vim for the editor
I'll definetly try out Vala and Perl later and have MonoDevelop as backup editor - and if all else fails, I'll turn to C++. I've upvoted all answers as they all helped me.
EDIT2:
Okay - Vim was a bit too hardcore... Installed Cream on top.
Unlike the Windows world, where everything is designed to be Windows-only, I think it is quite typical to find that the rest of the world designs software to specifications, not to implementations. If you are developing in Java, then it doesn't matter what platform you intend to use, and Eclipse and NetBeans provide excellent tooling for Java on all platforms, Linux included. If you are developing in C++, then Boost and Qt provide excellent cross-platform support. If you need to go outside of Boost or Qt, then before delving into Linux-specific features, it is best to target the Single UNIX Specification also known as IEEE Std. 1003.1 POSIX, which will ensure that your application not only runs on Linux, but also on any UNIX-compliant operating system (including Mac OS X, FreeBSD, Solaris, and others).
As for IDEs and other editors... I think most programmers on UNIX platforms build from the commandline (using CMake, Make, scons, or some other standard build tool); however, there are plenty of IDEs with support for those that can run such tools automatically. Anjuta C++ and KDevelop are probably the easiest IDEs to use on Linux. Emacs (emacs, emacs-gtk, xemacs) and Vim (vim, gvim) provide a great deal of power and flexibility, but take a little bit more time to get used to. You might also want to consider a basic text editor such as GEdit (Gnome) or Kate (KDE); GEdit, though billed as a simple text editor, supports some more advanced coding features via a number of plugins. I don't recall whether it supports autocompletion, but it does support line numbers, automatic indenting, using spaces instead of tabs, commenting a block of code en-masse, and executing a Makefile with a shortcut.
Depends on how much you want to learn (from the easiest option to the hardest one):
Just use C# via Mono - that gives you access to most of the POSIX interfaces via Mono.UNIX, access to GTK# so you can do desktop apps, access to many linux libraries, so you can do more advanced stuff / integrate better. (you can program in Monodevelop - it's a Sharpdevelop clone, kind of VS-ish)
Learn Vala - it's a language compiled down to C, very similar to C# but closer to the bare minimum. It's gathers anti-MS people who wanted a response to C# IMHO. (never really used it, but apparently there's a Vala plugin for Monodevelop and the language itself is becoming more popular)
Learn Python - it's a scripting language. It's got bindings to most popular libraries (also GTK and QT) (IDE: anything that can edit text - you won't get good intellisense from a dynamic language anyways)
Learn C++ and QT, or C and GTK - although those are very low level languages where you will spend a lot of time just getting used to the environment. (IDE: Anjuta, Kdevelop, Monodevelop with C++ plugin, Eclipse+CDT, emacs, vim, etc. - anything goes really)
If you want "something new", but don't want to spend loads of time learning a completely new environment, I'd recommend trying out Vala. If you're more curious about different styles, go for Python, which I think has a very good tutorial for new people (but not new to programming): Tutorial or Beginner's Guide. With Python you also have an advantage of having the whole environment available in packages in any distribution, no such luck with Vala (yet).
Try perl and python and see what appeals to you. Learn bash to get around happily at the command-line. If you're feeling adventurous, give C/C++ a shot.
As for editors, this will probably spark up a holy war, but if you're using at the command line, check out vim and emacs, pick one, and lament never making friends of those in the "enemy camp." :-)
I say Python + Emacs or gEdit (what ever suits you)
Linux Mint is a KDE environment, right? That would make it pretty convenient for you to get started writing KDE apps in C++. The Qt toolkit which KDE is based on is widely considered to be relatively developer-friendly, which should make it easy for you to get started.
If you want to go on that route, I'd suggest downloading KDevelop, which is KDE's IDE (optimized for developing KDE programs, but it can handle several different languages). Alternatively, you could use Eclipse, which has C++ capability. You can find tutorials on how to develop KDE apps at http://techbase.kde.org/Development/Tutorials. (Unfortunately I think those are not as good as the documentation they used to have before KDE 4 came out, but it should be enough to get you started.)
EDIT: Come to think of it, you may want to try your hand at writing some C++ console (non-GUI) applications first, since it's probably easier to get comfortable with basic C++ before you jump into GUI programming. Given your experience, it shouldn't be too hard to pick up. Unfortunately I don't know of any particularly good resources to learn C++ with, but I'm sure that information is somewhere on this site, and KDevelop or Eclipse would work fine as an IDE for simple C++ console apps as well.
Weird that nobody suggested ALP, even if it is a bit outdated, it teached me a lot of things regarding the UNIX way of programming.
First, Learning C is a MUST!
Perl is underused for most stuff and you'll want to learn BASH Shell Scripting instead.
Grock the C code of existing (stable, well-written software) example is the Linux kernel itself! Google "Linux LXR"
Once you learn the basics to C (in Linux) the manpages are an invaluable resource. Just do man printf for information on writing characters to the screen, for example.
If you are talking GRAPHICAL GUI Programs, you need to learn GTK+ or one of the many cross-platform GUI toolkits (e.g. wxWidgets). Do not learn to program the X Windows System directly unless you are crazy.
For text editors, I like Komodo Edit and SciTE.

Resources