-
as seen on Ask Ubuntu
- Search for 'Ask Ubuntu'
I tried today to install a dvb-card on my Ubuntu 12.04 (Linux blauhai-linux 3.2.0-25-generic #40-Ubuntu SMP Wed May 23 20:30:51 UTC 2012 x86_64 x86_64 x86_64 GNU/Linux
). The installation failed with an error. After that, i tried to install python (it was already installed but i got this error):
linux:~$…
>>> More
-
as seen on Ask Ubuntu
- Search for 'Ask Ubuntu'
I installed sikuli-ide with
sudo apt-get install sikuli-ide
Everything was fine until I tried to start it from the terminal. I typed
sikuli-ide
But the only response I got was
[info] locale: en_US
The application was not started, furthermore there is no desktop file and sikuli-ide does not…
>>> More
-
as seen on Super User
- Search for 'Super User'
I can't import some python libraries (PIL, psycopg2) that I just installed with MacPorts. I looked through these forums, and tried to adjust my PATH variable in $HOME/.bash_profile in order to fix this but it did not work.
I added the location of PIL and psycopg2 to PATH.
I know that Terminal is…
>>> More
-
as seen on Stack Overflow
- Search for 'Stack Overflow'
I want to pass a chunk of Python code to Python in R with something like system('python ...'), and I'm wondering if there is an easy way to emulate the python console in this case. For example, suppose the code is "print 'hello world'", how can I get the output like this in R?
>>> print…
>>> More
-
as seen on Stack Overflow
- Search for 'Stack Overflow'
Hi,
I am currently struggling to call a non python program from a python script.
I have a ~1000 files that when passed through this C++ program will generate ~1000 outputs. Each output file must have a distinct name.
The command I wish to run is of the form:
program_name -input -output -o1 -o2…
>>> More
-
as seen on Stack Overflow
- Search for 'Stack Overflow'
I have n elements. For the sake of an example, let's say, 7 elements, 1234567. I know there are 7! = 5040 permutations possible of these 7 elements.
I want a fast algorithm comprising two functions:
f(number) maps a number between 0 and 5039 to a unique permutation, and
f'(permutation) maps the…
>>> More
-
as seen on Stack Overflow
- Search for 'Stack Overflow'
Hello!
I want to do permutation in perl. For example I have three arrays. ["big", "tiny", "small"] and then I have ["red", "yellow", "green"] and also ["apple", "pear", "banana"].
How do I get:
["big", "red", "apple"]
["big", "red", "pear"]
..etc..
["small", "green", "banana"]
I understand this…
>>> More
-
as seen on Stack Overflow
- Search for 'Stack Overflow'
Continuing to learn prolog, I'm trying to write a permutation(L1, L2) predicate. It should return true, only if L1 can be made up of all elements in L2. My code so far is the following:
permutation([], []).
permutation([H|T], L2) :- remove(L2, H, R), permutation(T, R).
Assuming that the predicate…
>>> More
-
as seen on Stack Overflow
- Search for 'Stack Overflow'
Let say a=[A, B, C, D], each element has a weight w, and is set to 1 if selected, 0 if otherwise. I'd like to generate permutation in the below order
1,1,1,1
1,1,1,0
1,1,0,1
1,1,0,0
1,0,1,1
1,0,1,0
1,0,0,1
1,0,0,0
Let's w=[1,2,3,4] for item A,B,C,D ... and max_weight = 4. For each permutation…
>>> More
-
as seen on Stack Overflow
- Search for 'Stack Overflow'
I'm interested making an implementation of the 14-15 puzzle:
I'm creating an array with the values 0 - 15 in increasing order:
S = { 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15 }
Now, what I want to do is shuffle them to create a new instance of the puzzle. However, I know that if I…
>>> More