• Member Avatar for Gribouillis
    Gribouillis

    Replied To a Post in Farmer duck corn wolf

    I posted a solution in python for this problem [Click Here](https://www.daniweb.com/programming/software-development/code/504761/farmer-crossing-river-with-wolf-duck-bag-of-corn). The algorithm could perhaps give you some ideas to compare with your code.
  • Member Avatar for Gribouillis
    Gribouillis

    Edited Farmer crossing river with wolf, duck, bag of corn

    This snippets contains a python program to find a shortest solution to the problem of the farmer who whishes to cross a river. The boat can only contain two things, …
  • Member Avatar for Gribouillis
    Gribouillis

    Created Farmer crossing river with wolf, duck, bag of corn

    This snippets contains a python program to find a shortest solution to the problem of the farmer who whishes to cross a river. The boat can only contain two things, …
  • Member Avatar for Gribouillis
    Gribouillis

    Gave Reputation to rubberman in harrassed

    1. Get a new phone and change all your phone passwords. 2. Wipe all your systems, including the BIOS flash memory. This would include using an industrial strength disc eraser …
  • Member Avatar for Gribouillis
    Gribouillis

    Replied To a Post in [C#] Efficient way to wait for threads to stop?

    Is there no `join()` method in c# ?
  • Member Avatar for Gribouillis
    Gribouillis

    Replied To a Post in Farmer duck corn wolf

    @AssertNull running astyle --style=allman --align-pointer=middle --max-code-length=79 farmer.cpp does a pretty good job on formatting Builder_1's code
  • Member Avatar for Gribouillis
    Gribouillis

    Replied To a Post in python phonebook assignment HELP

    Before `print('No entry found')` you could add `print(name)` and `print(firstname)` to see why the `if name in firstname` returned false.
  • Member Avatar for Gribouillis
    Gribouillis

    Replied To a Post in Plotting 3D polygons in Python 3

    Your zip call looks correct. Can you post the whole traceback and code ?
  • Member Avatar for Gribouillis
    Gribouillis

    Replied To a Post in Capturing cpu&memory readings of a process from linux in python

    There is a great module named [<psutil>](https://pypi.python.org/pypi/psutil) which can tell you all this import psutil for proc in psutil.process_iter(): try: pinfo = proc.as_dict() except psutil.NoSuchProcess: pass else: print(pinfo) break To …
  • Member Avatar for Gribouillis
    Gribouillis

    Replied To a Post in How to get the specific field in python using regex

    This seems to work, I'm looking for a sequence of characters which are not a newline, or a newline followed by a non alphanumeric character. import re content = """ …
  • Member Avatar for Gribouillis
    Gribouillis

    Replied To a Post in Need Help With a Java Program That Will Indent Code From Another Java File

    Astyle [Click Here](http://astyle.sourceforge.net/astyle.html) looks nice. It is even included in ubuntu linux (but it is not coded in java!).
  • Member Avatar for Gribouillis
    Gribouillis

    Replied To a Post in Python Not Sharing Variables with Function

    The problem is that when a variable appears **on the left hand side** of the `=` operator in a function, such as in def foo(): started = "fubar" then the …
  • Member Avatar for Gribouillis
    Gribouillis

    Replied To a Post in Change Multiple File Name not the File Extension

    You need to pass an argument to the script python test1.py /path/to/folder/containing/files
  • Member Avatar for Gribouillis
    Gribouillis

    Replied To a Post in Reading properties file in Python, except using ConfigParser()

    @freak_1 Hello, interesting small module, but your install steps are horrible! Never clutter python's own library with your own modules. In order to distribute easily your python modules, you must …
  • Member Avatar for Gribouillis
    Gribouillis

    Gave Reputation to sofoklis in LOGICAL GATES

    I HAVE THIS PROBLEM AND I DON'T KNOW HOW TO SOLVE IT
  • Member Avatar for Gribouillis
    Gribouillis

    Replied To a Post in Python Multithreading: Unhandled Exception error

    The first rule of thread programming in python is **not to use the thread module**. Use the `threading` module instead. The reason is that the thread module is too low …
  • Member Avatar for Gribouillis
    Gribouillis

    Replied To a Post in ssh connection using python script in windows server

    The best thing to do is to try again with pip. Yesterday there was some problems with the pypi site, and you may have a bad internet connection or something …
  • Member Avatar for Gribouillis
    Gribouillis

    Replied To a Post in Change Multiple File Name not the File Extension

    This python script may work. Python is very powerful for such tasks #!/usr/bin/env python # -*-coding: utf8-*- '''doc ''' from __future__ import (absolute_import, division, print_function, unicode_literals) from argparse import ArgumentParser …
  • Member Avatar for Gribouillis
    Gribouillis

    Replied To a Post in ssh connection using python script in windows server

    From your previous error message, it seems that there is a problem with your PyCrypto module. Try to run python -c "import Crypto.Random; print Crypto.__version__" It should print 2.6.1. If …
  • Member Avatar for Gribouillis
    Gribouillis

    Replied To a Post in ssh connection using python script in windows server

    The correct way to install paramiko is by typing pip install paramiko in a terminal (right now it may fail because pypi is having an outage as I'm writing this …
  • Member Avatar for Gribouillis
    Gribouillis

    Replied To a Post in ssh connection using python script in windows server

    How did you install paramiko ? Which version of python are you using ?
  • Member Avatar for Gribouillis
    Gribouillis

    Replied To a Post in ssh connection using python script in windows server

    Use module paramiko to connect the ssh server and execute commands. See this code [Click Here](https://www.daniweb.com/programming/software-development/threads/319372/sending-the-password-automatically#post1363982) for connection. Execute commands with `ssh.exec_command()`. See this post [Click Here](http://www.iodigitalsec.com/ssh-sftp-paramiko-python/) for example.
  • Member Avatar for Gribouillis
    Gribouillis

    Replied To a Post in Upstream and downstream python

    A google search yields [speedtest-cli](https://pypi.python.org/pypi/speedtest-cli/) which does just that. I don't know if it works in windows, but the author(s) put it in > Operating System :: OS Independent so …
  • Member Avatar for Gribouillis
    Gribouillis

    Replied To a Post in awk command gives "Argument too long" error.

    You could start with find /absolute/path/to/csv/directory -maxdepth 1 -name "*.csv" > ~/csvlist.txt this would create a file with the list of all csv files to process. Edit: Then you would …
  • Member Avatar for Gribouillis
    Gribouillis

    Replied To a Post in How to write a coding in java

    Go [here](http://www.drjava.org/) and click "download jar file via http". Then open a terminal and go to the directory where the file `drjava...` has been downloaded. Then type java -jar drjava* …
  • Member Avatar for Gribouillis
    Gribouillis

    Replied To a Post in How to write a coding in java

    Go [here](http://www.drjava.org/) and click "download jar file via http". Then open a terminal and go to the directory where the file `drjava...` has been downloaded. Then type java -jar drjava* …
  • Member Avatar for Gribouillis
    Gribouillis

    Replied To a Post in Upstream and downstream python

    I don't understand the question nor how it is related to python. I understand that you already have a script for Ubuntu, can you post that script or a link …
  • Member Avatar for Gribouillis
    Gribouillis

    Replied To a Post in awk command gives "Argument too long" error.

    Use python
  • Member Avatar for Gribouillis
    Gribouillis

    Replied To a Post in error correction in python 3.5

    @jnneson It is not an error. When a program asks for a yes/no answer, it is customary to give a default answer which applies if the user hits the enter …
  • Member Avatar for Gribouillis
    Gribouillis

    Replied To a Post in Pygame Code Not Responding

    Your code is almost the same as code in this tutorial[Click Here](https://pythonprogramming.net/displaying-images-pygame/). There are missing calls to `arrowimg()` and `pygame.display.update()` at the end of your code. Also it is an …
  • Member Avatar for Gribouillis
    Gribouillis

    Replied To a Post in error correction in python 3.5

    You need a loop to handle the case where the answer is not yes or no. For example def yesno(question): while True: ans = input(question + ' (Y/n) ') ans …
  • Member Avatar for Gribouillis
    Gribouillis

    Replied To a Post in Problems importing Pygame: ImportError

    Why do you need python 2.5. The obvious thing to do is to uninstall 2.5 and install 2.7.
  • Member Avatar for Gribouillis
    Gribouillis

    Replied To a Post in I have a problem with vector

    I think there shouldn't be a `for` loop in `Read()`. Also there is an error in `get_smallest()` #include <cassert> #include <iostream> #include <vector> #include <string> #include <sstream> using namespace std; …
  • Member Avatar for Gribouillis
    Gribouillis

    Replied To a Post in C Array to pointer

    This one works #include <stdio.h> #include <string.h> int main(int argc, char **argv) { char ar[200] = "Hello World"; strcat(ar, " !"); printf("%s\n", ar); char* q = ar; char **p = …
  • Member Avatar for Gribouillis
    Gribouillis

    Replied To a Post in C Array to pointer

    I would try `ptr = &myArray;`
  • Member Avatar for Gribouillis
    Gribouillis

    Replied To a Post in Analyze the running time complexity of the following piece of code

    Compute how many times the `if` statement is executed.
  • Member Avatar for Gribouillis
    Gribouillis

    Gave Reputation to slate in Python: Creating Seperate Functions

    Hello there! Short version: I do not understand the question. Long version: My eagle eye detected you posting the [second](https://www.daniweb.com/programming/software-development/threads/504480/python-comparing-two-values-of-lists-) question about the same project. This should be a very …
  • Member Avatar for Gribouillis
    Gribouillis

    Replied To a Post in Python Comparing two values of lists.

    If you're using python 3, use for rule, member in zip(file1, membersFile): ... If you're using python 2, use rather from itertools import izip for rule, member in izip(file1, membersFile): …
  • Member Avatar for Gribouillis
    Gribouillis

    Replied To a Post in Python Comparing two values of lists.

    The most obvious thing in your code is that "Members.txt" will be opened many times, one for each iteration of the lines in "Rules.txt". This is probably not what you …
  • Member Avatar for Gribouillis
    Gribouillis

    Replied To a Post in Why we use "->" in this code? [question about an example in "Teach yourself

    If `X` is a list instance, one can access its members with `X.tail` or `X.next`. On the other hand if `X` is a pointer to a list instance, one writes …
  • Member Avatar for Gribouillis
    Gribouillis

    Replied To a Post in C CODE TO PYTHON CONVERTER

    It's a lot of code. You could perhaps go to the Job Offers section...
  • Member Avatar for Gribouillis
    Gribouillis

    Replied To a Post in object oriented programming

    One problem with OO tutorials is that they teach you a very formal point of vue about OOP, how to carefuly plan subclasses, method overriding etc. After many years of …
  • Member Avatar for Gribouillis
    Gribouillis

    Gave Reputation to AssertNull in object oriented programming

    Yes, especially the "and so on" part. Google "and so on". Lots of hits. Sorry to be sarcastic, but really, did you google these topics and not get any worthwhile …
  • Member Avatar for Gribouillis
    Gribouillis

    Replied To a Post in Python Steganography Help !

    Try `int('ff', base=16)` edit: also have a look at standard modules binascii and array.
  • Member Avatar for Gribouillis
    Gribouillis

    Replied To a Post in Hard Disk Full cannot Track

    It seems that you can run `xhost +localhost` in the terminal, then try to run your command again.
  • Member Avatar for Gribouillis
    Gribouillis

    Replied To a Post in Hard Disk Full cannot Track

    If you are a sudoer, try `gksudo baobab` in a terminal (or perhaps `sudo -i baobab`). If you can't run it as root, you can perhaps try to run it …
  • Member Avatar for Gribouillis
    Gribouillis

    Replied To a Post in How to get the a list populated using regex in Python

    A reasonable way to start good parsing is to write a tokenizer from __future__ import print_function import re from collections import namedtuple regex = re.compile(r'(\w+[.]\w+)|(\w+|[{}\[\],])|(\n)') d1 = { 'sourceFiles': 'SOURCEFILES', …
  • Member Avatar for Gribouillis
    Gribouillis

    Replied To a Post in Regular expression to extract content between tags from an html output

    Hm, I missed that part of the post.
  • Member Avatar for Gribouillis
    Gribouillis

    Replied To a Post in Hard Disk Full cannot Track

    You can type `which baobab` or `which filelight` first in a terminal to see if any of them is installed. Then launch the program as root.
  • Member Avatar for Gribouillis
    Gribouillis

    Replied To a Post in Regular expression to extract content between tags from an html output

    I'm not a Java programmer but any pythonista would answer to use the beautifulsoup library. From what I read here and there, the java equivalent is named **JSoup**. I think …

The End.