10,435 reputation
2453
bio website dmitry.cheryasov.in
location
age
visits member for 4 years, 3 months
seen 10 hours ago

I constantly try to expand the little I know about programming.

google profile


Mar
20
comment What is the preferred way to approach this problem in object-oriented design? - virtual disks abstraction
I'd take #2 for its clearer separation of concerns. If you happen to add another kind of storage (e.g. an EBS volume), you'll have easier time implementing it, without touching every disk type. Basically you need a pair (type of disk, storage location) with certain limitations on what types can be paired. Try thinking about this, too.
Mar
20
reviewed No Action Needed How can I avoid these nested repetitive ifs?
Mar
20
reviewed No Action Needed Python, namespace vs module with underscores
Mar
20
awarded  Curious
Mar
15
comment closure property of datatype “tuple” in python
@overexchange If an element of DList can be another DList, this will form a recursive data structure. If e.g. an element of DList can be a SList, and an element of SList can be a DList, this would be a mutually recursive data structure. If an element of type T cannot be a part of another element of type T, then T is not a recursive type.
Mar
14
comment closure property of datatype “tuple” in python
Something that has parts is not atomic. A struct of more than one field, or a tuple of more than one (or maybe more than zero) elements is non-atomic. A tuple that has another tuple as an element is definitely not atomic (that is, composite).
Mar
14
comment closure property of datatype “tuple” in python
@overexchange: yes, this is the idea.
Mar
13
comment closure property of datatype “tuple” in python
@overexchange: yes, closure property of tuples under the element substitution operation, that is, using a tuple as an element of another tuple, permits hierarchical structure.
Mar
13
comment closure property of datatype “tuple” in python
@overexchange: well, both is 'hierarchical' because its elements are not atomic, they are also tuples.
Mar
13
awarded  python
Mar
12
answered closure property of datatype “tuple” in python
Mar
7
revised Where to put css media queries in a CSS file?
made title clearer
Mar
6
comment Domination algorithm in graphs
Did you take a look at the standard representations?
Mar
4
comment Is there are any common pattern/practice to handle exception list (Java)?
To make you think in a different direction: consider parser combinators and railway-oriented programming to avoid exceptions altogether; instead, collect errors as you go. Sorry, I have nothing to say about the all-important recovery after parsing errors.
Mar
2
comment Is it good Python style to write a function that has no effect other than potentially raise exceptions?
You edited the question, I edited the answer a bit.
Mar
2
revised Is it good Python style to write a function that has no effect other than potentially raise exceptions?
added 11 characters in body
Mar
2
answered Is it good Python style to write a function that has no effect other than potentially raise exceptions?
Feb
21
comment Why is it impossible to produce truly random numbers?
@ThePopMachine: I specifically speak about generators whose external state is limited. Consider a generator that is based on a truly random process like radioactive decay. Its output, though, is a sequence of 32-bit integers. Once it has generated all possible distinct sequences of 32-bit integers, all 2^2^32 of them, it has to start repeating, even if the underlying bit-generating random process never repeats. (The latter results in a non-repeating pattern of sometimes-repeating sequences.)
Feb
19
comment Why is it impossible to produce truly random numbers?
@ThePopMachine: I'd appreciate if you toned down a bit. To quote, « non-repeating is also impossible for any generator with bounded output value (limited number of bits)». What you explicitly talk about is an unbounded number of bits, as a sequence of [binary] digits of an irrational number. Your statement, while true, is unrelated to the problem.
Feb
19
comment Why is it impossible to produce truly random numbers?
@ThePopMachine: you can generate a non-repeating sequence of bits of any length, equivalent to a non-repeating sequence of numbers of unbounded length. You cannot generate a non-repeating sequence of integer numbers of limited magnitude (e.g. 32-bit); once you have generated all permutations of 32-bit values, a sequence must repeat. You are right; we're just talking about different things.