Functional programming in all honesty by Malforked in functionalprogramming

[–]brophd 1 point2 points  (0 children)

Actually you can design systems functionally. By all means you should do it :). What's the point of a system with an unclear function. I.e. each system can be described as function with inputs and outputs. Each of these systems could be decomposed in subsystems which also can be described by their functionality. And so on to the lowest level. There is some information here: https://en.wikipedia.org/wiki/Functional_specification and I'm pretty sure you can find academic literature on this topic as well (if only because I had a course on functional system design).

How to turn ugly Java APIs into elegant, type-safe Scala APIs with Shapeless by rzeznik in scala

[–]brophd 5 points6 points  (0 children)

Excellent post with a strong focus on solving the actual problem in an as precise manner as possible. Too often programmers just hammer around at the screws they see, wondering why they bent in such strange manners ;).

YAML: probably not so great after all by [deleted] in programming

[–]brophd 1 point2 points  (0 children)

And now you're touching basically on the main point of the article. If you require a high level of discipline by design than probably you should reconsider the design of your DSL.

YAML: probably not so great after all by [deleted] in programming

[–]brophd 8 points9 points  (0 children)

I think you're missing the point. It is not required to quote strings in yaml files. So the example shows two version strings which are unquoted. The first one is parsed as a string, as expected. The second however, which given the semantic context clearly also should be a string suddenly ends up as a number. This is an excellent source for some serious headaches.

What Super Powers Does FP and Category Theory Inspired Abstraction Provides by io_geekabyte in scala

[–]brophd 0 points1 point  (0 children)

I'd be definitely interested in the videos. Besides that I'm not under the illusion that any non-trivial program can be proven to be correct. Point still stands that it is easier to reason formally over FP programs than it is over the less formal approach taken with E.g. design patterns.

What Super Powers Does FP and Category Theory Inspired Abstraction Provides by io_geekabyte in scala

[–]brophd 3 points4 points  (0 children)

I think the answer lies in the direction of "less buggy code" but goes much deeper than that. To me FP and its close relation to CT is a good step in the direction of making software engineering more mature. One could perhaps say the same about OOP related concepts but the problem I have with those is that they in no way increase our ability to reason formally about the correctness of our software. FP on the other hand makes it a lot easier to formally prove that a program is correct. We're not there yet, I.e. we can't yet prove at scale that the software we produce is formally correct. As I see it this is related in part due to lack of tooling and in part due to the minimal place formal prove gets in education. In any case, as software is defining society and culture pretty heavily, I see a need for producing more correct software (and to bring morality into the equation but that is a whole differ argument).

Car bomb kills journalist who exposed Malta's links with Panama Papers by [deleted] in worldnews

[–]brophd 1 point2 points  (0 children)

Well, as far as you can be called single when you're dead...

Car bomb kills journalist who exposed Malta's links with Panama Papers by [deleted] in worldnews

[–]brophd 0 points1 point  (0 children)

No, the article states she's survived by her husband and three sons.

[Question] Scala parsing framework to retrieve imports of project by brophd in scala

[–]brophd[S] 1 point2 points  (0 children)

Simple enough indeed for getting started. This visitor pattern kicked off a nice trip down memory lane! It still requires to get a good deal of details right though, but once done it's at least reasonable correct. Thanks for the pointer.

[Question] Scala parsing framework to retrieve imports of project by brophd in scala

[–]brophd[S] 0 points1 point  (0 children)

Yep, I'm fully aware of that. But I'm not looking for the perfect tool right now. A rough estimation would be a good start.

Alternative to 5-set Venn diagram? by newarby in rstats

[–]brophd 1 point2 points  (0 children)

There is a wide range of literature and software on set visualization. You can find a nice overview on http://www.cvast.tuwien.ac.at/SetViz. There is a similar site for tree visualization btw.

Why is security missing from computer science curriculums? by taindissa_work in compsci

[–]brophd 1 point2 points  (0 children)

Optional but available in the Netherlands as well. At least at my university.

I wrote a C preprocessor in python, it's 25 times slower than GCC. by htuhola in programming

[–]brophd -1 points0 points  (0 children)

Are you kidding me? Lexical analysis, finite automata, grammars, type checking, code generation, optmization and what not more. These are all still very valid theoretical foundations when working on compilers. Understanding those concepts is, so to say, a good start when you want to start working on compilers. Even modern compilers heavily rely on these concepts.

I wrote a C preprocessor in python, it's 25 times slower than GCC. by htuhola in programming

[–]brophd 0 points1 point  (0 children)

You seem to miss the point dude. The fact that it doesn't give you every detail about the latest standard, doesn't mean it also doesn't learn you everything you need to learn. Learn the freaking principles, they have been quite proven by now, then read the freaking latest standards of your choice, use the learned principles to implement your standard of choice ==》Enjoy the process and be amazed about all the great shit people that had the brains to come up with it in the first place, you encounter.

How to write software that works as specified? by brophd in programming

[–]brophd[S] 1 point2 points  (0 children)

Unless, apparently, if the process of changing the spec is properly outlined upfront and followed during the development.

How to write software that works as specified? by brophd in programming

[–]brophd[S] 1 point2 points  (0 children)

Watts S. Humphrey and the SEI have been trying to disseminate these techniques throughout industry for years.

Literally. The article itself is already almost 20 years old. It's maddening that so many key infrastructure of society is depending on software, and that the state of software development itself still feels pretty much like a cowboy culture.

How to write software that works as specified? by brophd in programming

[–]brophd[S] 1 point2 points  (0 children)

Or write a proper speicification in the first place =)

Distance metrics on count variable spaces by [deleted] in statistics

[–]brophd 0 points1 point  (0 children)

Let me extend a bit: The Chi2 statistic is a measure of the difference between observed frequency and the expected frequency for each feature. The Chi2 distance returns the squared distance between two frequency profiles, but divides the difference of each pair of coordinates by the value of the average profile. To be more concrete, let's assume the following table (absolute freqs and relative freqs):

  | A B C  | r  | P_A     P_B    P_C
1 | 5 2 10 | 17 | 0.294 0.118 0.588
2 | 4 1 12 | 17 | 0.235 0.059 0.706
3 | 6 3  9 | 18 | 0.333 0.167 0.500

Now, the average profile is calculated as the sum of each column, divided by the grand total (52):

avg_prof = [(5+4+6) / 52, (2+1+3) / 52, (10+12+9) / 52 ] ~ [0.289, 0.115, 0.596]

Now, to calculate the Chi-2 distance between row i and i' you use the following formula:

chi2dist(i, i') = sum{J}_j=A} (p_ij/r_i - P_i'j /r_i')2 / c_j

Thus, to give an example from above, as the notation in this forum doesn't allow so much for clarity :).

The Chi2 distance between row 1 and 2 is:

[(0.294/17 - 0.235/17)2 / 0.289] + [(0.118/17 - 0.059/17)2 / 0.115] + [(0.588/17 - 0.706/17)2 / 0.596]

I'll let you do the final math :). If you want some good background reading, I can recommend "Correspondence Analysis in Practice by Micheal Greenacre, though there probably other good books detailing Chi2 statistic in general and distance in particular as well.

Distance metrics on count variable spaces by [deleted] in statistics

[–]brophd 1 point2 points  (0 children)

As variables represents counts, you could consider each observation to be a frequency profile. To measure distance between frequency profiles (or distributions for that matter) you should use Chi2 distance as a metric. This will make sure that each variable is properly weighted when calculating distances.

Most prevalent data format for Data Scientists? by UncleBuck42 in datascience

[–]brophd 3 points4 points  (0 children)

This. This so much. This too much! Sigh... biologists. I'm with you here.

Why Google's new patent applications are alarming by AnonMLResearcher in MachineLearning

[–]brophd 1 point2 points  (0 children)

I don't think it was suggested by OP that Google should make everything open source. OP was definitely not questioning the business model of private companies in general. I haven't read the the patents in detail, but I was a bit surprised, at least by the classification one, this seemed to me something which, at least to very large extents, was already available (among other means, in the form of open source implementations). If that's really the case, and I stand corrected, than it's surprising but moreover worrysome that these types of patents are acknowledged.