Search Results

Search found 7 results on 1 pages for 'cobie'.

Page 1/1 | 1 

  • Using dot To Access Object Attribute and Proper abstraction

    - by cobie
    I have been programming in python and java for quite a number of years and one thing i find myself doing is using the setters and getters from java in python but a number of blogs seem to think using the dot notation for access is the pythonic way. What I would like to know is if using dot to access methods does not violate abstraction principle. If for example I implement an attribute as a single object and use dot notation to access, if I wanted to change the code later so that the attribute is represented by a list of objects, that would require quite some heavy lifting which violates abstraction principle.

    Read the article

  • Of what significance is the solution to the game of checkers in AI research?

    - by cobie
    I have been doing some research into artificial intelligence and I came across a 2007 paper titled "Checkers is Solved" on the game of checkers being solved by AI techniques after more than 16 years of trial. A solution to the game is defined by the team as "determining the final result in a game with no mistakes made by either player". The search for a solution started back in 1989 and it was finally found in 2007. Of what importance is this to the field of AI?

    Read the article

  • Climbing the hacker ladder

    - by cobie
    This is not a question in which I am asking for opinions rather I am asking for first hand experience. I have been programming in python for quite a while and I feel solid enough in python programming. I can come up with algorithms for problems and implement them but I somehow feel I am stuck with remaining an apprentice. What are some first hand experiences on how to climb up the ladder and become better at programming as in learning about browsers security, compilers etc. Personal experiences would be valued in responses.

    Read the article

  • Difference between a socket and a port

    - by cobie
    Could someone please explain quite clearly the difference between a port and a socket. I know that a port serves as a door into the network for an application process and that the application process uses a socket connection to the given port number to handle network communication but when you have multiple processes listening on a single port number, I am finding it difficult to understand the difference between the socket and the port and how they all fit together.

    Read the article

  • Programs and memory consumption [closed]

    - by cobie
    I have a 4gb ram macbook pro but I still run out of memory when I have chrome and a few other light weight applications open such as multiple windows of macvim. These programs are written in C/C++ so technically should be memory efficient but why do they suck up all these memory. is it just bad engineering or graphical user interfaces because I have read about incredible feats performed in software dev back in the early computing days with very limited memory but now it just feels like the applications expand to fill all my memory.

    Read the article

  • Is this buffer overflow working on Mac OSX? [migrated]

    - by cobie
    Was reading through some text and playing around with attempting to write past the size of an array in C i.e buffer overflow. The text indicates that whenever you attempt to write to say array[5] when the length of the array is 5 then you get a segmentation fault but I dont seem to be getting that When using the code below. The code actually runs. #include <stdio.h> #include <string.h> int main () { int i; int array[5] = {1, 2, 3, 4, 5}; for (i = 0; i <= 255; i++) { array[i] = 10; } int len = sizeof(array) / sizeof(int); printf("%d\n", len); printf("%d\n", array[254]); } On execution of the last statement, a 10 is printed. Am wondering whether this is a vulnerability or if there is something I am missing. I am running the code from iterm2 on a macbook pro.

    Read the article

  • Improving python code

    - by cobie
    I just answered the question on project euler about finding circular primes below 1 million using python. My solution is below. I was able to reduce the running time of the solution from 9 seconds to about 3 seconds. I would like to see what else can be done to the code to reduce its running time further. This is strictly for educational purposes and for fun. import math import time def getPrimes(n): """returns set of all primes below n""" non_primes = [j for j in range(4, n, 2)] # 2 covers all even numbers for i in range(3, n, 2): non_primes.extend([j for j in range(i*2, n, i)]) return set([i for i in range(2, n)]) - set(non_primes) def getCircularPrimes(n): primes = getPrimes(n) is_circ = [] for prime in primes: prime_str = str(prime) iter_count = len(prime_str) - 1 rotated_num = [] while iter_count > 0: prime_str = prime_str[1:] + prime_str[:1] rotated_num.append(int(prime_str)) iter_count -= 1 if primes >= set(rotated_num): is_circ.append(prime) return len(is_circ)

    Read the article

1