I'm trying to run a simple helloworld.py example for pygtk on Ubuntu 14, this is my Ubuntu version info:  This is my ubuntu version: Distributor ID: Ubuntu Description:    Ubuntu 14.10 Release:    14.10 Codename:   utopic   I have both Py2 and Py3 installed (Python2.7 and Python3.4), through Ubuntu package manager, but I want to run pygtk with python3.  Now I try to run the pygtk sample, and I get:  $ python3 helloworld.py  Traceback (most recent call last):   File "helloworld.py", line 2, in &lt;module&gt;     import pygtk ImportError: No module named 'pygtk'   Ok, so pygtk module is missing, so I try to install it using pip:  $ sudo pip3 install pygtk Collecting pygtk   Using cached pygtk-2.24.0.tar.bz2     ********************************************************************     * Building PyGTK using distutils is only supported on windows. *     * To build PyGTK in a supported way, read the INSTALL file.    *     ********************************************************************     Complete output from command python setup.py egg_info:     ********************************************************************      * Building PyGTK using distutils is only supported on windows. *      * To build PyGTK in a supported way, read the INSTALL file.    *      ********************************************************************      ----------------------------------------     Command "python setup.py egg_info" failed with error code 1 in /tmp/pip-build-4xuy8p4h/pygtk   The confusing part is, the pygtk site tell me:       PyGTK is included in most Linux distributions (including Debian,   Fedora, Ubuntu, Opensuse,  Gentoo, Mandrake, Redhat, SUSE...); the   source code can also be downloaded and compiled  from the links below.   Where and how is pygtk installed in my Ubuntu system, and what's the issue with all the errors I'm getting. Or is it that I need to build pygtk from source?  EDIT:  The other confusing part is the message about distutils; is pip part of distutils, so the message is telling me that pygtk cannot be installed using pip on systems other than Windows (probably it is and that's why the message is  generated, but one can't be too sure), or is it that pip not part of distutils, in which case pip CAN be used to install pygtk?! (Why do I need to trace the history of packages and their name changes and which scripts/tools belong to which packages just to understard an error message!)
I'm new to Linux but not to app development. I come from a RealBasic on a Mac background.   I've accepted that I need to learn a new language to develop for Linux (since RB won't run on 64 bit distros and is a cloed proprietary language) but I want to make sure I pick the right one.   I've been looking at Python and was all set to go until I read that PyGTK is becoming obsolete with the introduction of GTK 3. Is this true? The Ubuntu developer website stills seems to recommend it with Glade for the UI but I want to make sure that I don't learn something that's on the way out!
Getting a random object from NSArray without duplication I remember reading ages ago that it's a good idea to choose either www.example.com or domainexamplecom as your main URL and then set the other one as a 301 redirect to point to your domain? The reason provided was:  Some people may link to www.example.com Other links may point to example.com  In order to not lose 'SEO link juice', the individual recommended setting up a 301 redirect from one to the other. Has this changed? Is it true? I would have guessed that Google (and other search engines) would be smart enough to whack some code in their algorithm to understand that in most cases www.example.com = example.com? Write18: capturing shell (script) output as command/variable? Let's say I compile the following file with pdflatex -shell-escape test.tex:   \documentclass{minimal}  \begin{document}  File listing is:  \immediate\write18{ls /usr}  \end{document}   This will send the output of the command ls /usr to report/log of pdflatex (primarily to stdout).   There are then two cases I'd like to utilize:    The output of ls /usr being included directly in the document (LaTeX stream). The output of ls /usr becoming the contents of a \newcommand (by this I mean, that I'd like the script to be executed when the \newcommand is executed first - and upon subsequent calls to the new command, the shell code should not be executed anew).    I have read through , but I'm not sure if this "pipe input" can be applied to \newcommand.   I have also read through  - and it seems that Tex' file I/O should be used; but I'm quite disliking the fact that I'd still have to redirect the script output (actually, in this case, the ls /usr output) to a file, and then read it in, to have it as contents of a command.   So, is there an easier way to achieve what I'd want (hopefully, illustrated through an example based on the above code)?     EDIT: Ehm, I should have asked one more question earlier :) I'll try with an edit here, although it will probably get missed .. :)   I originally asked for a \newcommand that will execute shell code only upon its definition (i.e., in a sense it is "cached"); and the answer from @egreg does exactly that. But then - would it be possible to have a different \newcommand definition, such that each time this newcommand is called, the shell command is executed anew? I.e. executing something like \@@input|"cat tempfile" (which cannot be executed as such), where tempfile changes between calls? Clarification on maps in Salesforce I know this might be a very basic question but i'm pretty confused by this:  Map&lt;Id,Account&gt; accountWithOpportunities =      new Map&lt;Id,Account&gt;([SELECT Id,(SELECT Id FROM Opportunities) FROM Account]);   I have no clue on to where the Opportunities are relevant at all in this map and how they are stored or can be accessed?   Can anyone clear this out for me? Are $10\times 10$ matrices spanned by powers of a single matrix? How to determine surprise when only part of a side is stealthy? Comment font sizes are inconsistent on Android Find four groups of order 20 not isomorphic to each other and prove why they aren't isomorphic.   So far I thought of $\mathbb Z_{20}$, $\mathbb Z_2 \oplus\mathbb Z_{10}$, and $D_{10}$ (dihedral group), but I can't find another one. Would $U(50)$ work? I know it has order 20 and is cyclic but I'm not exactly sure how to move from there. Can someone to point me on the right direction? How to show google.com in an iframe? Maintenance plan for creating transaction log backups I have a database that is set to the 'Full' recovery model, and I'm creating a maintenance plan to backup the Transaction Log every 15 minutes. A full backup is then taken once every 24 hours.  I was wondering: will the maintenance plan for the transaction logs create a lot of different files every 15 minutes, or will it by default append to the same file for 24 hours?  Also: what is preferred? I couldn't find anything on this subject (or maybe I was Googling the wrong words).  Thanks for any pointers anyone can give me.  EDIT: I also see that the checkmark "Verify backup integrity" is OFF by default. Is there a risk with turning it on? It seems to be that it should be on by default, so is there a reason for not using this? What is the best way to "carve" a terrain created from a heightmap? In Random forest algorithm, Breiman (author) constructs similarity matrix as follows:   Send all learning examples down each tree in the forest If two examples land in the same leaf increment corresponding element in similarity matrix by 1 Normalize the matrix with number of trees   He says:     The proximities between cases n and k form a matrix {prox(n,k)}. From their definition, it is easy to show that this matrix is symmetric, positive definite and bounded above by 1, with the diagonal elements equal to 1. It follows that the values 1-prox(n,k) are squared distances in a Euclidean space of dimension not greater than the number of cases.    In his implementation, he uses sqrt(1-prox), where prox is a similarity matrix, to convert it to distance matrix. I guess it has something to do with the "sqaured distances in a Euclidean space"-quoted above.  Can somebody shine a little light on why it follows that 1-prox are squared distances in a Euclidean space and why he uses squared root to get distance matrix? How do I troubleshoot the "Error, press shutter release button again" message on my Nikon? The LCD on my Nikon D3000 is displaying the following error message:     Error. Press shutter release button again.   I have pressed the shutter release button but the camera still does not work. What causes javac to issue the "uses unchecked or unsafe operations" warning For example:  javac Foo.java Note: Foo.java uses unchecked or unsafe operations. Note: Recompile with -Xlint:unchecked for details. I would like to see an explicit example of a non-trivial elementary extension of the structure $(\mathbb{N}, +, \cdot, 0, 1)$ where $\mathbb{N}$ includes zero. Most of all I am interested in countable ones. I often run into this issue. I'm creating a file in Photoshop with masked layers etc. I want to make the final output available for some mock-ups in Illustrator, so I rasterize the layers and marquee select the entire area, copy and move to Illustrator.  Pasting the area in Illustrator flattens all transparencies, which is quite annoying. I'm left with my object and a flat white background.  Is there a reason for this? Why does Ubuntu force users to create a password upon installation? Tools for automating document compilation A lot of people write makefiles that say something like  paper.pdf: paper.tex         pdflatex paper         bibtex paper         pdflatex paper         pdflatex paper   To handle re-running TeX to get new/changed references and so forth. Is there a better way to do this? I've been looking for the name of a sci-fi romance book about space travel but haven't been successful so far. I came across it a few years ago, read the plot on its back cover but didn't read the book. It is about two spacecraft pilots, a man and a woman, who travelled at light speed (or maybe FTL, I can't remember) in separate ships. Every time they return to Earth, centuries have passed on Earth because of time dilation. They meet each other for a few times on Earth in different eras, but don't know when, if ever, they will meet again. I don't know how it ends.   If anyone knows which book I'm talking about, could you please tell me the name? Thanks a lot! Number of ways to distribute 5 distinguishable balls between 3 kids such that each of them gets at least one ball How many ways are there to distribute 5 distinguishable balls between 3 kids such that each of them gets at least one ball?   My approach is $ \binom{5}{3} 3! $ + $ \binom{2}{2} \binom{3}{2}2!$ which is equal to $66$?