« first day (1539 days earlier)      last day (3443 days later) » 

12:09 AM
@overexchange so you don't understand what data encapsulation means at all or how it was done in this class?
we can tell you how it was done, but without reaching the understanding of the underlying concepts, it won't be useful to you
 
"Clojure is the New C"... That makes about as much sense as "Dog is the New Cat."
 
@RobertHarvey is that because its full of segfaults?
 
user55340
12:45 AM
@RobertHarvey no... thats C++... "Oh my God, its full of *s"
 
user55340
@RobertHarvey he was coming from the "we wrote C because it was easier than assembly in the days of old... but machines are absurdly fast now and have way more memory. Programming time is way more expensive than computing time today. Don't spend all that time trying to understand C, C++, or Objective C - write something that is easier to reason about even if its a bit slower."
 
user55340
A key bit there is that easy to reason about thread safety is the key to making things go even faster in the future. Thread safety in C, C++, Objective C, Java (and I'm fairly sure C#) is difficult to reason about. "There's a lock over here and a lock over there and... oh, a dead lock here." Thread safety in Clojure is very easy to reason about by comparison.
 
1:04 AM
@MichaelT i thought thread safety was more about algorithm design and less about language features
if the algorithm isn't parallelizable, multithreading won't be much of a performance boost
 
user55340
But what if it is parallelizable? And lots is, but is just a pain normally.
 
user55340
Some clojure code:
 
user55340
(defn run [nvecs nitems nthreads niters]
  (let [vec-refs (vec (map (comp ref vec)
                           (partition nitems (range (* nvecs nitems)))))
        swap #(let [v1 (rand-int nvecs)
                    v2 (rand-int nvecs)
                    i1 (rand-int nitems)
                    i2 (rand-int nitems)]
                (dosync
                 (let [temp (nth @(vec-refs v1) i1)]
                   (alter (vec-refs v1) assoc i1 (nth @(vec-refs v2) i2))
                   (alter (vec-refs v2) assoc i2 temp))))
 
@MichaelT you fp guys always have tiny variable names
 
user55340
This code creates two arrays of 1000 elements and swaps them around.
 
user55340
1:06 AM
(run 100 10 10 100000)

([0 1 2 3 4 5 6 7 8 9] [10 11 12 13 14 15 16 17 18 19] ...
 [990 991 992 993 994 995 996 997 998 999])
Distinct: 1000
 
user55340
100 vectors, 10 items, 10 threads, 100k iterations.
 
user55340
And when you run it, you don't mangle your memory.
 
user55340
([382 318 466 963 619 22 21 273 45 596] [808 639 804 471 394 904 952 75 289 778] ...
 [484 216 622 139 651 592 379 228 242 355])
Distinct: 1000
 
user55340
After its run, you still have the same number of distinct items.
 
user55340
No race conditions happened... and when you look at the code... there's no need for locks or semaphores or other concurrency structures... its baked into the language from the start.
 
user55340
1:08 AM
(clojure docs: refs and transactions)
 
user55340
This comes with a price though... you've gotta work with immutables.
 
@MichaelT so if the same pair of elements are swapped by two different threads at the same time, no explosion?
 
user55340
@MattGiltaji none.
 
@MichaelT that is handy
 
user55340
@MattGiltaji It is very handy... and being able to reason about the code means that one can write better code more simply.
 
user55340
1:11 AM
Think about the code that you'd need to write a thread safe version of that code in C++, or even Java.
 
user55340
The example that is in the talk is working on a gravity simulator... adding up all the vectors of acceleration for all of the objects on every object, summing them up with the current velocity vector.
 
user55340
That's inherently parallizable.
 
user55340
infoq.com/presentations/clojure-c - a neat bit in that talk is at 1:04:50 about how clojure handles new object allocation
 
one thing I don't quite get, if we are dealing with immutables, is the system creating and destroying tons of intermediate results before finally producing the end result vectors?
or did I miss something
 
user55340
Watch that video at 1:04:50.
 
1:14 AM
k, i'll do it at home
 
user55340
(slightly before to get a bit more context)
 
user55340
The thing is that Clojure applies masks on top of objects.
 
user55340
You aren't creating new objects... you're applying changes on to the old object with new data.
 
@MichaelT similar to storing a base revision and then deltas on top of that?
 
user55340
There's a bit more about STM (transactional memory) in Clojure at 1:19:00
 
1:18 AM
k
 
user55340
@MattGiltaji yep.
 
user55340
One of my favorite bits in looking at how Strings work (I like Strings) is in the 1.6 version. grepcode.com/file/repository.grepcode.com/java/root/jdk/openjdk/…
 
user55340
643     // Package private constructor which shares value array for speed.
644     String(int offset, int count, char value[]) {
645         this.value = value;
646         this.offset = offset;
647         this.count = count;
648     }
 
user55340
Granted, this was taken out with 1.7 because people abuse strings more often than they use them right (lets have a 1 megabyte xml file and take a substring of it... and then ignore the rest of the xml but hang on to that string... and we're having on to 1 megabyte)
 
user55340
BigDecimal (I think) fails to take advantage of this as well as it could.
 
user55340
1:22 AM
You've got scale, precision, and the number as different values within the class... and its an immutable.
 
user55340
Change the scale, and you've got a new object (and its new - not the delta that clojure uses).
 
user55340
It could have been a delta though... could have had "actual number" be wrapped by another class that has the scale on top of it when all you need to do is scale it.
 
user55340
298     // Cache of zero scaled by 0 - 15
299     private static final BigDecimal[] ZERO_SCALED_BY = {
300         zeroThroughTen[0],
301         new BigDecimal(BigInteger.ZERO, 0, 1, 1),
302         new BigDecimal(BigInteger.ZERO, 0, 2, 1),
303         new BigDecimal(BigInteger.ZERO, 0, 3, 1),
304         new BigDecimal(BigInteger.ZERO, 0, 4, 1),
305         new BigDecimal(BigInteger.ZERO, 0, 5, 1),
306         new BigDecimal(BigInteger.ZERO, 0, 6, 1),
307         new BigDecimal(BigInteger.ZERO, 0, 7, 1),
 
user55340
though I will certainly grant that smarter people than I wrote BigDecimal, and there might be bits that I'm missing to its design.
 
user55340
And to an extent, it does have that wrapper... hmm.
 
user55340
1:26 AM
(because BigInteger is another class that actually has the number in it)
 
@MattGiltaji when i try to understand data encapsulation in general, i get confused with data abstraction so i thought to provide some abstract data types like class RunLengthEncoding & abstract class Critterand then go for understanding data encapsulation
 
@overexchange the words sound similar but the concepts are very different
 
let me tell u my interpretation of ADT
 
"encapsulate" basically means "put into a capsule", meaning put it into a container for protection
 
user55340
Compare Java's private and protected fields with C's struct (everything is there for everyone).
 
1:40 AM
you protect your data by only allowing your chosen methods to interact with it
so something else can't come along and change values
let's say you have a clock class that tracks hours and minutes
if the data is not protected, someone can come and set clock.minutes = 75
but minutes should be between 0 and 59 for your business rules
so instead of allowing others to change the value directly
instead they have to go through a method
in that method you can put validations and other code
 
and how would you define abstraction?
 
so you can enforce that minutes are between 0 and 59 by throwing errors or whatever needed
abstraction is more about taking common functionality out of multiple places
and putting it into a single common place instead
 
is class java.util.Date an abstraction?
 
and using inheritance (or something similar) to have that common functionality refer to the single class
 
user55340
Java's StringBuilder and StringBuffer both extend common functionality from AbstractStringBuilder.
 
user55340
1:47 AM
java.util.Date inherits from Object. The only thing that extends it is java.sql.Date because of some awkwardness between SQL's date format and Java's.
 
@MichaelT thank you for editing my question, i did not have a copy+paste facility to paste the text itself
 
user55340
@overexchange Images of text in questions bug me because you can't search them.
 
user55340
As a side bit, its a technique used by many students who have screen shots of their code to prevent their prof from finding it with an easy search.
 
@MichaelT make sense, but did you see the last answer, it is interesting
 
user55340
A really fast way to get a student to self delete the question before it gets answers is to transcribe the text.
 
1:50 AM
am not a student, am a self learner it has been more than 10 yeats am out of school
 
user55340
I know... just thinking of all the +2/-2 I get on Stack Overflow from doing that.
 
@MichaelT am not sure about the meaning of these statements, but am not deceiving anybody by pasting images. am learning java as i did not get chance to in my past 10 years of IT support job. Please place the comment directly in the query for any concern.
 
user55340
There's a fair bit of 'fix this code for me' on stack overflow (especially at the end of the semester). They either have pastebin, gist, or screen shots so that the question code is not in the question text to make it harder for professors to search SO for the code they turned in.
 
Please review my qestions, i have all queries in text, @MichaelT if you are referring me, then we can take it sometime later
 
user55340
@overexchange I am fairly certain you are not a college student for a grade... I was just reminiscing of my rep on Stack Overflow.
 
1:56 AM
oh ok then sorry about that
 
user55340
(and mentioning some of the difficulties in general about images of text in a textual media)
 
@MattGiltaji for my question you said: java.util.Date inherits from Object. that means abstraction concept is defined by abstract class but not class?
 
@overexchange sorry, that was finishing up my previous comment, not about your java.util.data question
 
user55340
@overexchange Object doesn't really have any abstraction to it. It is something there because everything needs to inherit form object and there needs to be some base functionality (equals, hashcode) to make the system work.
 
user55340
Note that Java's class hierarchy isn't about abstract classes in most cases, its about interfaces.
 
user55340
1:59 AM
(most of the times I've seen an abstract class in code, its been a mistake to make it an abstract class)
 
user55340
Let me rephrase that a bit... abstract classes are things to be discovered rather than designed most of the time.
 
user55340
Here is class A, here is class B... and you realize that they have common functionality that really should be pulled into one place. Then you create an abstract class that holds that common functionality and extend the two subclasses from it.
 
user55340
But the thing is to write class A and class B first and then refactor if it is appropriate.
 
user55340
When you start out with the abstract class and then try to extend it, you'll find yourself writing so many cases and exceptions that it gets convoluted.
 
@MattGiltaji as you said: abstraction is more about taking common functionality out of multiple places and putting it into a single common place instead--- so an abstract class is always(must) ideally be an abstraction but class may or may not be for example class Object is not an abstraction. Please bear with me if am wrong.
am i correct?
@MichaelT nice explanation. as you said: But the thing is to write class A and class B first and then refactor if it is appropriate. this is what ideally suppose to happen in real time?
 
user55340
2:13 AM
You write code, and then you refactor. That is 'real time'. You're not sitting in front of a clock.
 
@MichaelT but next question would be, why do we need to refactor as abstract class? any advantage? why class A & classB can't be alone without inheriting somebody?
 
user55340
You could leave A and B as they are (and honestly, many times time pressure does just that). But that means later when you need to modify the common functionality, you have to modify it in two places.
 
is that the only advantage about easy maintenance of code? or do you think it also help you write polymorphic code(during initial development) that looks structured using dynamic method look up?
 
user55340
For me, at the end of the day - its about maintenance. You will spend more time maintaining code than writing new code. Every bit of time you can spend to make that easier, later, so that you can react faster to future changes the better.
 
but in my code in this link in addtion to common behaviour aspect, i thought of introducing class Critter because to access Shark and Fish methods can be accessed stuctured way in Ocean class.
public Ocean timeStep() {

        Ocean nextTimeStepSea = new Ocean(width, height, starveTime);

        for (int row = 0; row < this.height; row++) {
            for (int col = 0; col < this.width; col++) {
                Critter creature = this.cellContents(row, col);
                nextTimeStepSea.addCritter(creature.update(this));
            }
        }
        return nextTimeStepSea;
    }
was my thought process wrong here? creature.update(this)
 
user55340
2:22 AM
It looks reasonable.
 
but you say that abstract class are basically to gather common behaviour. is that comfortable take this as complete definition
 
user55340
Does it have common behavior? I can't see that from that function call.
 
user55340
If there is no method that Shark or Fish share that is identical between the two of them, it should be an interface instead.
 
update() is the common method
abstract class Critter implements IPeripheralBehaviour {


    Point location;


    public Critter(int x, int y){
        location = new Point(x,y);
    }

    public Point getLocation(){
        return location;
    }


    public boolean equals(Object obj) {
		if (this == obj)
			return true;
		if (obj == null)
			return false;
		if (this.getClass() != obj.getClass())
			return false;
		return true;
	}


    public abstract Critter update(Ocean currentTimeStepSea);


}
 
user55340
I'd suggest that getLocation is rather weak...
 
2:26 AM
toEncode() is not common so i thrown it in interface IPeri..
 
user55340
(IIRC the problem, a shark doesn't need to know if its at 5,6 or 7,8 - its at some spot - it asks the ocean what is around it... but it doesn't need to know its position)
 
i thought critter knows its position but not ocean so getLocation() here
 
user55340
I'd do it as the ocean knows its location. The critter can ask the ocean about what is around it if it needs to.
 
ya you are right
 
user55340
The equals is... I think thats not implemented correctly. Two sharks would always be equal... which isn't correct.
 
2:28 AM
i override equals() in Shark unlike Fish so equals() should be part of interface
 
user55340
See? Not common functionality between the two.
 
user55340
Shouldn't be in the abstract class.
 
yayayaya
i got you
 
user55340
At that point, you're left with: public abstract Critter update(Ocean currentTimeStepSea);
 
i should throw equals() in interface right?
 
user55340
2:29 AM
equals is already part of Object.
 
user55340
It is already part of the contract of being an Object.
 
ok
part of the contract of being an Object mean? what is contract?
 
user55340
For Java to work correctly, certain methods must be defined in all objects. These are defined in Object.
 
user55340
2:32 AM
Most of them, you'll never have to touch. hashCode and equals are the ones you often have to touch.
 
when i say, update() method is part of the contract of being a Critter. what does that mean?
 
user55340
You must implement these methods to be a Critter.
 
user55340
There's also a much stronger form of the contract in some languages (Java is no where near that):
 
user55340
Design by contract (DbC), also known as contract programming, programming by contract and design-by-contract programming, is an approach for designing software. It prescribes that software designers should define formal, precise and verifiable interface specifications for software components, which extend the ordinary definition of abstract data types with preconditions, postconditions and invariants. These specifications are referred to as "contracts", in accordance with a conceptual metaphor with the conditions and obligations of business contracts. == History == The term was coined by Bertrand...
 
so can i say, update() method is part of the contract of being a Shark.
 
user55340
2:36 AM
Just something to read about and consider... DbC has preconditions and postconditions that must be verifiably valid when a function is called. (To call 'pop' on a Stack, you must have a size of 1 or more)
 
user55340
@overexchange yep.
 
what is the contract that Shark is giving? with the class in this link .
 
user55340
Shark is adhering to a contract... not giving a contract.
 
sorry, what is Shark adhering to?
 
user55340
@overexchange class Shark extends Critter{
 
2:39 AM
ok?
 
user55340
That's the information about what it is.
 
user55340
Its implementing the abstract methods defined in that class.
 
so the Shark is adhering to a contract which says Shark implements all methods in Critter. is that what you say?
 
user55340
@overexchange thats a reasonable summary.
 
so how this summary(contract) helpful or useful to anybody? significance in realtime?
 
user55340
2:45 AM
@overexchange It lets me concentrate on just the parts of the class that need to be shown to that block of code.
 
user55340
If I have a class that implements List, Collection, and Deque and the (LinkedList), and I have a function that says "I want a List" as a parameter... i don't need to worry about the Deque nature of the LinkedList.
 
ok so, contract level will also be at method level like update() method in Shark? how do i describe the contract for update() method?
 
user55340
If you have a Critter, I know it has update. I don't care what else it has. That makes it easier for me to reason about it.
 
user55340
This lets me write code more quickly.
 
here Critter only has prototype Shark and Fish have their own implementations for that prototype. so Critter does not have the common implementation. is this wrong?*
 
user55340
2:49 AM
It also means that the person who implements Shark doesn't need to concern me with the bits of state that Shark has (how hungry it is, how old it is, etc...). This means that they can change the implementation without worry about breaking my code - as long as update works the same way.
 
user55340
This again means that the person writing the code for Shark doesn't need to worry about what is using the code as long as the interface / contract remains the same.
 
user55340
@overexchange having Critter being an interface is a simpler structure. Until such a time as you find common code between two classes, interfaces are likely better to use.
 
user55340
You may find that you are going to implement GreatWhite and HammerHead that use the same update() function, but have some other bits that are different.
 
user55340
At that point, instead of copying update into those classes, you then have those two classes extend an abstract shark.
 
user55340
2:52 AM
But don't make an abstract class before you need it. It leads to less flexible design later.
 
user55340
@gnat more Java 9 features announced: jaxenter.com/new-java-9-features-announced-112654.html (common jvm logging (class loader, compiler, gc, etc...), finer grained JIT controls, some cleanup of deprecated gc, Coin getting smother out)
 
@MichaelT so i can think of interface while designing hierarchy when a method has no common implementation in class A or class B and you say class A implements interface{} this is what happens in real time?
 
user55340
@overexchange an interface defines some functionality that all classes that implement it share.
 
user55340
Thinking about hierarchies is... challenging. Its rarely true that you'll find yourself with a deep class structure except in contrived problems.
 
user55340
2:58 AM
For most cases, hierarchies and such make for inflexible code designs because small changes affect many more things.
 
user55340
33
Q: Why should I prefer composition over inheritance?

illmathI always read that composition is to be preferred over inheritance. A blog post on unlike minds, for example, advocates using composition over inheritance, but I can't see how polymorphism is achieved. But I have a feeling that when people say prefer composition, they really mean prefer a combin...

 
user55340
75
Q: Where does this concept of "favor composition over inheritance" come from?

Mason WheelerIn the last few months, the mantra "favor composition over inheritance" seems to have sprung up out of nowhere and become almost some sort of meme within the programming community. And every time I see it, I'm a little bit mystified. It's like someone said "favor drills over hammers." In my ex...

 
@MichaelT so when you have different implementation(in Shark/Fish) for same method update() prototype then fo for interface despite all are Critters is that correct?
 
user55340
@overexchange most likely. Don't mistake common behavior with common code.
 
user55340
ArrayList and LinkedList share common functionality. You can call add(Object o) on each of them. But there is no common code that the two share.
 
3:03 AM
yaya common behaviour, i interpret as void update(Ocean sea); but not as void update(Ocean sea){}.
 
user55340
There is no time when you want to change the code in LinkedList and have a similar code change be done in ArrayList.
 
so an an interface defines some functionality that all classes that implement it share. so this is the reason List<E> is an interface because boolean isEmpty() has different implementations?
 
user55340
@overexchange correct.
 
ok
just an imgaination, Ideally Oracle technicians had first written all implementation class LinkedList, class ArrayList and then filtered what are common code methods and thrown in abstract class and also filtered common functionaly and thrown in interface this is how interface List<E> and abstract AbstractList emerged . am i correct?
 
user55340
AbstractList is mostly an anachronism from the days of Vector.
 
3:11 AM
but my idea in general mentioned above is fine right?
 
user55340
That they had Vector (which was an array list under the covers) and when moving to Java 1.2 to get rid of excess synchronization made an AbstractList that ArrayList and Vector both extend - because they are common code.
 
user55340
the class is also there in case someone wants to extend it for some other reason, without all of the additional functionality of ArrayList.
 
user55340
But for the most part - yea. You can look at the code of AbstractList : grepcode.com/file/repository.grepcode.com/java/root/jdk/openjdk/…
 
user55340
and note that all you've really got in there is some basics with a lot of abstract functions.
 
user55340
Also note that a lot of those functions that are implemented in the AbstractList class are calling functions that aren't implemented.
 
user55340
3:16 AM
107    public boolean add(E e) {
108        add(size(), e);
109        return true;
110    }

147    public void add(int index, E element) {
148        throw new UnsupportedOperationException();
149    }
 
user55340
This speaks to one of my favorite check style design rules: DesignForExtension: checkstyle.sourceforge.net/config_design.html
 
user55340
> Checks that classes are designed for extension. More specifically, it enforces a programming style where superclasses provide empty "hooks" that can be implemented by subclasses.

The exact rule is that nonprivate, nonstatic methods of classes that can be subclassed must

* be abstract or
* be final or
* have an empty implementation.

Rationale: This API design style protects superclasses against being broken by subclasses. The downside is that subclasses are limited in their flexibility, in particular they cannot prevent execution of code in the superclass, but that also means that subcl
 
oh there is no common implementation in above add() method as we discussed. How do i see this?
 
user55340
add(int index, E element) is effectively an empty implementation.
 
user55340
The add(E e) function is "put this at the end of the list"
 
user55340
3:19 AM
And, by default, would be the same as add(size(), e);
 
user55340
78     public abstract int size();
 
user55340
Note that size is an abstract method.
 
user55340
Though isEmpty happens to be common because size() exists:
 
user55340
85     public boolean isEmpty() {
86         return size() == 0;
87     }
 
user55340
If you do find yourself designing abstract classes, that check style rule is a good one to turn on and validate your code with.
 
3:25 AM
sticking to the basics that we touched about when to think of introducing a common code in class abstract and common functionality in interface, the above paragraphs are something design specific? i am recording all your chat msgs in a local file. i will read these 2 paragraphs later.
 
user55340
@overexchange Checkstyle is a static analysis tool for Java. I like it quite a bit - it keeps code consistent and if you have everyone in a project using it, you don't get niggliing edits changing form one style to another. It has some design rules too - things that kick out and say "you should think about this"
 
user55340
Some people like those rules, others don't. I think its a good rule to follow and enforces a particular discipline on the structure of the code that makes it easier for other people to understand when coming back to it later.
 
professor statement about abstract_datatype @cs61B UOC,Berkeley :An Abstract_Data_Type (ADT) is a class that has a well-defined interface, but its implementation details are firmly hidden from other classes. That way, you can change the implementation of a class without jeopardizing the programs that depend on it. The Date class is an ADT.
is ADT different from abstraction?
@MichaelT how do u see this definition of ADT?
we will continue the discussion from here tomorrow, is that fine? it is office time now ):
so nice to learn this stuff from you
see u tomo
 
 
2 hours later…
5:43 AM
@michaelT What sort of math is that?
 
user55340
@RobertHarvey the NFA? Basic CS theory. One of my favorite classes back when I took it in college.
 
Gee, thanks, Basic CS theory. Shows you how many CS Theory classes I took.
 
user55340
You just follow the lines. In a non deterministic finite automata, you can follow the ε connections for free.
 
user55340
There's a ε from the start state to the accept state (accept states have two circles) which means "you can match the empty string with this transition"
 
That's all the epsilon does?
 
user55340
5:46 AM
 
user55340
Because XKCD is always appropriate.
 
user55340
Note, this is also why perl regexes don't bother me much at all.
 
user55340
@RobertHarvey Yep. You only see them in NFAs. Deterministic ones require that you are only in one state at a time.
 
user55340
That NFA, the instant you start out, you are in state 9, 10, and 7... and 1 and 5 following all the ε.
 
user55340
DFA (deterministic) don't have any epsilon transitions... for example...
 
user55340
5:49 AM
 
user55340
Thats one that happens to match binary numbers that are divisible by 3.
 
I hate to say this, but you lost me at NFA.
 
user55340
DFA are easier to understand.
 
user55340
Take the number 6 in binary (110). Follow the arrows there.
 
user55340
(start takes you to S0, then the 1 takes you to S1, then 1 takes you back to S0, and the 0 loops to S0... which is an accept state and so yes, 110 is divisible by 3)
 
5:51 AM
Which state corresponds to a number divisible by 3? S<sub>0</sub>?
ACK!
 
user55340
9 is 1001. S0 -> S1 -> S2 -> S1 -> S0. Yep, 9 is divisible by 3.
 
user55340
Thats all a deterministic finite state automata is. They run real fast and don't take up much memory.
 
user55340
(that one takes up 2 bits of memory to store the state)
 
user55340
A non deterministic one is one that can be in multiple states at the same time.
 
5:53 AM
Cool.
 
user55340
 
user55340
That one is "a series of 1s and 0s that end in a 1"
 
user55340
But that one is just normal... doesn't have any epsilon transitions.
 
user55340
In the automata theory, a nondeterministic finite automaton with ε-moves (NFA-ε)(also known as NFA-λ) is an extension of nondeterministic finite automaton(NFA), which allows a transformation to a new state without consuming any input symbols. The transitions without consuming an input symbol are called ε-transitions or λ-transitions. In the state diagrams, they are usually labeled with the Greek letter ε or λ. ε-transitions provides a convenient way of modeling the systems whose current states are not precisely known. ε-transitions does not add any extra capacity of recognizing formal languages...
 
user55340
You can have one where it can just... well... slide to the next state without input.
 
user55340
5:56 AM
Those transitions are denoted by ε rather than some other input character (back in the class I took it was λ - same thing)
 
user55340
Neat bit - every NFA can be rewritten to be a DFA.
 
user55340
 
6:07 AM
Are they used for anything besides compilers?
 
user55340
@RobertHarvey interview questions.
 
user55340
Though you'll find state machines all over the embedded world.
 
user55340
Vending machine? Yea, thats a state machine under the covers.
 
user55340
Inputs are: 5, 10, 25
 
user55340
Lots of communication protocols have a state machine too.
 
user55340
6:11 AM
I've had to deal with state machines in point of sales too...
 
user55340
They're a Pattern, though one that people forget about when they are concerned about Singletons and Factories. And by Pattern I mean 'this is a solution for a problem when you discover that you've got a state machine' and they aren't that uncommon.
 
yield return is a state machine. More or less.
 
user55340
@RobertHarvey yep.
 
If only those pesky interviewers asked me the right questions.
[will eventually interview with a company who's using interview questions to crowdsource their internal development effort]
 
user55340
@RobertHarvey "If you searched Stack Overflow and found an answer that said... what would you do?" -- "I'd delete it - I'm a mod there."
 
user55340
6:24 AM
btw, looking for comment up votes:
 
user55340
... over here, you get crazy perl programmers who occasionally remember things they studied back in college. — MichaelT 17 secs ago
 
8:10 AM
@MichaelT i had been thru NFA & DFA long back, i think functional programming paradigm is more relevant to implement DFA right? using recursion? FP, i mean purefunction with no impurity(state).
 
9:02 AM
NFA/DFA is also useful if you know the input is a regular language (but too complex to create a regex for)
it tells you you only need O(1) extra memory to store the state of the processing
 
 
2 hours later…
10:58 AM
@MichaelT though storage "explodes" from O(log n) bit to O(n) bits
 
 
5 hours later…
user55340
3:49 PM
this was the edit that had me start with a speedy delete vote... if others want to join in.
 
AAAAAAAAAAAAAAAGGGG!!!!!!!!!!!!!!!
For New Applications or software including Proof of Concept, internally developed, software being scripted, or software being tested before scripting, or evaluation software that does not exist in the Master Application List
Security shot me down saying that EVEN POC's and software evaluations need to go through the beauracratic process of approval
THE WHOLE POINT OF A POC IS TO MAKE THE BEST DECISION BEFORE COMMITTING YOURSELF TO THE BUERACRACY!!!!
THE SLA IS OVER 45 DAYS!!!!!!!!!!!!!!!!!!!
WTF IS GOING ON?!!!
 
just quit
?
 
I can't, money problems right now
nobody will pay me what I need to get through some tough personal problems I am having
 
:(
 
4:10 PM
@MichaelT did they try and make their question blink?
 
user55340
@Ampt I'm really not sure.
 
That's a tag I haven't seen in a long, long time
Pulls back hood
 
user55340
@Ampt <marquee>There are some things that one should try to forget.</marquee> (side bit: do a search on google for "marquee tag" and look at the results)
 
oh google, you so funny
 
user55340
Oh ${Deity}! do not search google for "blink tag".
 
4:14 PM
google "zerg rush"
@MichaelT Oh come on the blink tag is fantastic!
 
@maple_shaft hahaha corporations are hilarious
 
oh my.... we could have totally tried that on that day where HTML in titles worked.
<marquee><blink><h1>
 
"You want a POC? Yeah in 45 days you might be able to start on that!" it's so funny the bizarre shit companies do against themselves
 
user55340
Btw, my issue with the MSO redesign:
 
user55340
6
A: Feedback Requested: Stack Overflow design update

MichaelTH2 and H3 are not significant enough in style difference. h1 h2 h3 I've often found myself using h2 and h3 because h1 was too imposing in the past. This isn't as much of a problem now, but the h2 and h3 don't seem different enough. When I've used them in recent post I've found that I ...

 
user55340
4:18 PM
(just checking... yep... made it on to the first page when sorted by votes)
 
user55340
4:33 PM
The latest What If (XKCD) is... troubling.
 
you could say that...
@psr I don't think any of you are old per se, you're just all curmudgeons and cynics in the worst way :)
 
@Ampt did you read what maple_shaft is dealing with above? Your mistake is to think his experiences are uncommon :P
 
@JimmyHoffa I feel for his plight but I'm not going to roll over and give up on my career if that's what you're looking for :)
 
user55340
@Ampt there there... thats a good cog... err... widget.
 
We didn't give up on our careers either, we just became cynical :)
 
4:42 PM
@MichaelT I had a fantastic glazed donut that made me think of you this morning.
 
user55340
@Ampt but mini doughnuts!
 
@JimmyHoffa which has changed so much, I'm sure :P
 
user55340
Could also set up a funnel cake machine in the break room too.
 
@Ampt I didn't think the industry was this screwed up when I started, no damn way lol, I can't imagine anyone knowing it without direct experience
 
I'm sure that that's a perfectly unique and original thought had by no one else in any other industry...
 
4:46 PM
I mean really - paying people decent salaries to sit on their hands for 45 days while your bureaucracy decides whether they can spend 2 weeks trying to prototype something in an attempt to find out if it'll save the company money to go that way vs. another way. This kind of stupidity just can't be imagined or even usually believed without being seen
 
don't get me started
today is NOT the day :P
 
user55340
@Ampt I'd contend some places you've got a better idea of what you are getting into. Retail? Yep - you are stocking shelves and doing the cash register thing. Factory? Yep - you're putting hinges on doors.
 
@enderland oh this has been an escalating thing over a few months now
> I can't imagine anyone knowing it without direct experience
 
Oh I know. I'm just really frustrated right now about similar things though not exactly the same things
 
you're really gonna say we're the only industry that could possibly say that?
 
4:48 PM
@Durandal: You're kidding, right? m3th0dman is claiming to be an expert here... why would I go poring through source code I know nothing about, when I've got an expert right here I can ask a simple question? — Robert Harvey ♦ 17 secs ago
 
I postulate that you all are the naive ones if we're really gonna assume that no industry could possibly be as broken and terrible as the software industry
 
user55340
We are artists... (and say that with a french accent)... any industry that holds out the carrot of "creative work" faces the same problem.
 
user55340
The photographer thinks that every day will be spent with camera and lens in hand in beautiful places creating things... and finds him or herself with accounting books and marketing and bidding against other photographers for the school photo contract. (and that's why I'm not a professional photographer)
 
@Ampt put it this way, here's *an actual task* I was derided for in a previous job for not accomplishing over a fair period before getting fired (the only job I've been let go from, and surprisingly not for this): My boss said he wanted me to setup a server to run automated builds, deployments, tests, and installer construction. Sure, great no problem. He wouldn't buy a server to do this on. He continually told me to get it running automatically on a server, and would ask for statusses on this task often. *The task was to setup something he refused to procure*.
 
I'm sorry but an industry a room full of opinions does not make.
Yes, that is messed up on a higher level
 
4:52 PM
@Ampt but does an management meeting make
 
The software development industry doesn't have a monopoly on Pointy-Haired Bosses.
 
@ratchetfreak words are hard, mmkay
 
user55340
(btw: pseudo-famous photograph in photography...)
 
user55340
 
user55340
Title: Even Ansel Adams Had to Earn a Living
 
@Ampt negatory, I wouldn't encourage someone who's decent at this shit like you away from this industry, other industries are screwed up too surely. This one is just screwed up in it's own special way, which gives us the right to be curmudgeons. You'll join our ranks, in time. Muaha!
 
every company is screwed up equally so
 
This industry is easy to get along in and make a decent living, you just have to deal with an amazing amount of WTFs per hour
 
the amount of money squandered in corporate america is astounding
 
@enderland I'll say
 
user55340
4:54 PM
If you're a decent coder, coding can be one of the best places to be... we don't have to lift 50 lbs... we often have flexible schedules and reasonable play. But there is so much wrong that the "engineer" wants to fix that its frustrating.
3
 
I like you guys but damn do you guys need a serious back hand from reality some days. I'm sure that 85% of the time you're just messing with me but still...
@JimmyHoffa Speaking of which I have been skipping the dailyWTF for a while.. looks like I have some reading to do this afternoon
 
user55340
@Ampt and its not even Friday yet...
 
haha aye I started skipping over that one years ago... too much to read. Been perusing Chris Stuccio's blog and A Slate Star Codex recently, interesting reading. Not as funny as daily WTF though...
 
user55340
Another factor in there... everyone is so focused on the 'rock star' programmer and forget that there is much more to software and development than one person.
 
user55340
> SPARC is looking for rock stars to join our team! If you’re all about innovative ideas, are a top performer who wants to change the world, and are looking for the best tech job you’ll ever have – then SPARC is your place!
 
5:04 PM
@MichaelT sounds like HR is posting job openings again...
or some "CEO" who "employees" half a dozen "contractors" and needs some more "rockstars"
am I doing this right?
 
not enough buzz words
you can never have enough buzzwords
 
user55340
Hmm... All Stuff, no Fluff in Denver this weekend. ( nofluffjuststuff.com/home/main )
 
user55340
Gotta keep my eye on that time when it shows up in Madison again.
 
user55340
5:28 PM
If my cat ran the universe, the sun would not move.
 
5:43 PM
Screening for a digital architect role tomorrow.... this is going to be interesting
am I way out of my league here?
 
user55340
@Ampt probably, but it will be useful to understand what the requirements are so that when you are ready to be there you will have a firmer idea... and also have an idea of what to do to get there.
 
@MichaelT I mean they have my resume and it clearly says when I graduated from College...
and they went to this step so...
 
user55340
Take advantage of it. Learn what is required and expected through the process so that when you are ready to take the step again you will be more prepared.
 
user55340
Furthermore, it gives you a better idea of what the people who are in that role (should) know and what you can rely on them for when working on a project.
 
user55340
Sometimes you are completely unaware of the complexity of a situation until you get tossed into it. Interviews are such a way to get a feel for that by the questions they ask.
 
user55340
5:47 PM
It also will help you understand if you do want to work in that direction in the future.
 
user55340
My brother had a comment about being in the navy "sometimes you need to get thrown in the ocean to realize you really don't like swimming."
 
5:58 PM
@MichaelT does "digital" architect sound like a bit of buzzy bullocks? Or is that a title you've ever heard of before? I haven't
 

« first day (1539 days earlier)      last day (3443 days later) »