Questions about programming for and on Ubuntu.

learn more… | top users | synonyms

4
votes
2answers
2k views

Print terminal output in gedit automatically?

the command time ./myprog displays the time it took to run myprog on the screen. Now i would like to write this information to a text file. How?
4
votes
5answers
11k views

Where is Python source code?

I have Python 2.7 installed for learning purposes (I'm a starting programmer reading 'Learn Python The Hard Way') and wanted to know how some things were done. I installed it from Synaptic and want ...
4
votes
3answers
2k views

How I can monitor new files in a directory and move/rename them into another directory?

A program generates output textfiles, named output.txt, after every 15th iteration of a certain process. Doing so, it overwrites the last output.txt. I want to keep the files however, and I can't ...
4
votes
2answers
10k views

Howto install google-mock on Ubuntu 12.10

I am having hard time trying to install Google C++ Mocking Framework. I have successfully run sudo apt-get install google-mock. Then I tried to compile this sample file #include "gmock/gmock.h" int ...
4
votes
2answers
874 views

I've installed golang with accordance with the wiki yet “go get” is missing

I've installed everything go-related from synaptic and later added ppa as described in the wiki: https://wiki.ubuntu.com/Go yet I cannot do "go get" for example go get code.google.com/p/gorilla/mux ...
4
votes
2answers
2k views

How to distribute applications?

I am new to Ubuntu development. As a learning experience, I have written a custom chat application using qt4 and I want to deploy it in some sort of setup file. Whats the easiest way of deploying an ...
4
votes
5answers
278 views

How do I find the .desktop information for a given binary?

Given the path to an executable (say /usr/bin/gvim), how can I find the Gnome .desktop file for that application? I'm futzing around in python, so a python-specific answer would be most helpful.
4
votes
1answer
11k views

How to get screen size through python curses

I'm writing a terminal program and need to get the size of the TTY I'm using. The Internet seems to suggest this can be done with curses, but I can't seem to find out how in python. I'm trying to ...
4
votes
2answers
8k views

C# on ubuntu 12.04

Is C# a good choice for ubuntu programming? E.g unity, or applications that will run on ubuntu? Am I doing good wanting to learn C# when I'm determined to stick with ubuntu and develop on it or for ...
4
votes
3answers
2k views

How to shutdown/restart/suspend … without authentication or confirmation?

I am looking for a terminal command to shutdown without having to write down my password and without installing any extra programs. As when clicking the shutdown button, why it is not asking me for ...
4
votes
1answer
3k views

QML: How to do variables?

In QML, I am just looking for a way to do fairly simple variables: Bool String Integer
4
votes
3answers
2k views

How to see object code generated by g++?

g++ -c xyz.cpp creates an object file xyz.o But when I open it in vim editor it shows some crazy text... How can I see the machine code? What package can use to open and see that machine code?
4
votes
1answer
934 views

What is a good folder structure for multi-platform distribution of a Python application? [closed]

Sorry about the wall of text, but I am trying to provide a good background to my question. Actually, there are like a million questions here because I am utterly confused. I recently learned some ...
4
votes
1answer
15k views

Downloading and Installing Latest Version of KILE

In the TeX - LaTeX group of Stack Exchange, I posed a question about the versions of TeXLive under Ubuntu. As I have installed the latest version of TeXLive under Ubuntu, I want to be able to use it ...
4
votes
1answer
6k views

Why can't I use conio.h or ncurses.h?

I am new user to Ubuntu. I wrote a simple program in C. When I try to compile it to use conio.h, the compiler gives me fatal error. So I tried by ncurses.h, but still I am getting same error.
4
votes
1answer
164 views

What is the maximum allowed files open?

Is 1048577 the limit of open files in Ubuntu? If I try the following code it works. However, if I change the value to 1048578 the setrlimit function will return the code 1 and errno will be set to 1 ...
4
votes
1answer
1k views

How do I write raw bytes to a sound-device?

In the olden days, you used to be able to open /dev/dsp for reading and writing, now, with PulseAudio this doesn't work anymore. I thought you could do it with padsp, but this code doesn't run: ...
4
votes
1answer
287 views

PyGObject: Gio.File.copy_async() doesn't exist in Ubuntu 12.04

According to GIO Reference Manual Gio.File has a methode copy_async. In Ubuntu 12.04 I'm getting an AttributeError when I try to call this method. What should I use instead to for asynchronous ...
4
votes
1answer
41 views

How can you figure out the dependencies of your project?

I am going to start a project soon, and want to make sure all libs are included that are not natively installed. Is there a way to check this without compiling on a clean machine?
4
votes
2answers
671 views

Prolog files recognized as Perl

Prolog .pl files are shown as Perl files, both in files browser and in Geany/Gedit syntax-highlighting. Is there a way to let it recognized Prolog files as non Perl files?
4
votes
0answers
379 views

(QML) Flickable not working as supposed

So, while building an Ubuntu app I needed to use Flickable for scrolling, so now I have code of the form Page{ ... Flickable { anchors.fill: parent content.height: element1.height + ...
4
votes
1answer
250 views

Rhythmbox plugin code for hot key not working - why?

def activate(self,shell): self.shell = shell self.copy_selected() self.action = gtk.Action ('foo','bar','baz',None) self.activate_id = self.action.connect ('activate', ...
3
votes
7answers
2k views

Recommendation for a non-programmer's guide to self-teaching Python

I am new to Ubuntu and to programming, and I am seeking to teach myself Python. I installed the software from the Software Center and was wondering how to be sure it is up to date with the latest ...
3
votes
3answers
434 views

Is Ubuntu or Linux OS more on coding? [closed]

There is some problem when install this OS because I cant connect to wifi so i saw some tutorial about using nautilus keyword and works. I switch to use Ubuntu just now but is Ubuntu more on coding or ...
3
votes
3answers
7k views

Do we have to install Python or It is already installed in Ubuntu 14.04LTS?

I need it for learning Python language. Please Help!
3
votes
4answers
3k views

Which package contains the C standard library?

Which package contains the C standard library?
3
votes
1answer
888 views

What is the logical mistake in this code?

I have written some code for downloading favicons. It has a logical error which I am not able to see. #!/bin/bash ico="1"; if [[ $ico =~ ^-?[0-9]+$ ]]; then wget -P $HOME/Downloads/ ...
3
votes
2answers
7k views

What computer languages do Linux-based OSes use?

What programming languages are used to make/create Linux-based Operating Systems?
3
votes
2answers
150 views

Under the hood, what is Quickly made of?

under the hood, What is Quickly made of? It's a wrapper to python? It's a compiled language? It's portable? What about the architecture and the design?
3
votes
2answers
5k views

Python Compared to BASH

I've been studying bash for the past three weeks or so, and it is very easy to learn since it is basically just command line inputs. I've decided to now move onto python but I've been lost the whole ...
3
votes
1answer
340 views

How to apply a patch to indicator applet?

I have a patch named "incator.patch". How can I apply that to the application "indicator applet" and get it running? The bug will solve a bug with key-binding caused by "indicator applet". Patch is ...
3
votes
2answers
4k views

How to add a system call to the Linux Kernel?

I'm currently reading Operating System Concepts 7th edition by Silberschartz, Galvin and Gagne. At the end of chapter 2, there is an exercise "Add a system call to the Linux Kernel". Unfortunately, I ...
3
votes
3answers
3k views

How do I get C++ to work with Code:Blocks?

I installed code blocks, selected a GNU/gcc compiler, and created a new empty project and file. When I try to execute a basic Hello World program, no console window pops up and no errors are ...
3
votes
2answers
4k views

Auto indentation in Gedit

I'm using Gedit to program C and CPP, and I've enabled auto indentation in Edit->Pref. However, it still doesn't work. Is there anything I can do?
3
votes
1answer
729 views

Is there any ubuntu API?

in Windows, a programmer can use Windows API to write a Windows application. Windows API can be used with C (not necessarily C++). In Windows API you have a message loop and you have to program ...
3
votes
2answers
32k views

is there an IDE and compiler for c# in ubuntu? [duplicate]

Possible Duplicate: Visual Studio style tool? I'm looking for an IDE and compiler for C# in linux like visual studio or... to design forms an run programs. I'm moved to linux newly.
3
votes
2answers
2k views

How make a configure/makefiles from an C file?

Hope this is not a stupid question. But here it goes... Over the last month I have learned Programming in C and Gtk to a point where I have written a small program in C. I would like to make a ...
3
votes
1answer
70 views

How does Ubuntu One know when to automatically sync files?

I am curious about how Ubuntu One automatic file sync works under the hood. When I add or change a file in my file manager, how does it know that the change occurred and it needs to sync it? This will ...
3
votes
2answers
2k views

Install Elixir to System

How can I install Elixir on Ubuntu 13.04 so that I can easily use it from the command line and update it easily by cloning git. I have installed Erlang 16 by getting package from here Erlang ...
3
votes
1answer
532 views

PyGTK changing theme for popup menu

I spent few hours searching on google and I gave up now... I need to change background for popup menu in my app. It set to whatever system default theme is... and I need this to be set to Radiance ...
3
votes
2answers
2k views

symlink for dbus headers

Source code for something that won't compile has the line #include <dbus/dbus.h> but in real life that header file is in /usr/include/dbus-1.0/ Similar situation exists for the dbus-c++ ...
3
votes
1answer
382 views

C++ programming - Is there a way to make gedit recognize new classes?

I'm C++ programming in ubuntu 12.04 using gedit and it recognizes c++ default commands. I was wondering if I can make it able to recognize the new classes I define and change their color in the code ...
3
votes
2answers
185 views

What version of C++ does 12.04 use?

If anybody knows or has a way for me to check it would be much appreciated. Isn't there a certain version of C++ that you need to use with the gcc? Sorry, I don't know much about programming, but I ...
3
votes
1answer
33 views

Store in environment variable

I tried storing the contents of a file in an environment variable using one of those commands. a= cut -f 1 abc.txt cut -f 1 abc.txt >a neither works . So , can anybody help me out?
3
votes
2answers
2k views

How to add buttons in Glade and resize

Trying to create the framework for a calculator. I add the window I add the vbox using 2 boxes. 1 for the display, the other for the buttons When I add 1 button it fills the entire panel and I can't ...
3
votes
1answer
333 views

How can I test if a variable matches another value and move to another function?

I am writing a script where I store a predetermined line of text into a string (we will call abc). I am storing the results from grep -iqs $USER file (we will call def) into another string. How can ...
3
votes
2answers
2k views

syscall_table_32.S file not found

I want to add a systemcall to Linux, but in training data we need to change the file linux/arch/i386/kernel/entry.S or arch/x86/kernel/syscall_table_32.S. I can not found the files. I looked and ...
3
votes
1answer
752 views

how to find a samba share's gvfs path?

If Nautilus is used to drop a file on a samba share into an app, then the app will see: "SMB://server/share/file" How is the app supposed to detect real, working gvfs path of that file ? different ...
3
votes
1answer
3k views

How to draw on mouse click in Gtk.DrawingArea using pygi

I am writing a small application using PyGI which will interactively draw a line on a Gtk.DrawingArea between mouse clicks. But I am unable to figure out how to draw using the cairo context at the ...
3
votes
2answers
314 views

How do I daemonify my daemon?

As part of the Ubuntu Accomplishments system I have a daemon that runs as well as a client that connects to it. The daemon is written in Python (using Twisted) and provides a dbus service and a means ...