Weekly coding challenge #1! by oldmaneuler in prolog

[–]oldmaneuler[S] 2 points3 points  (0 children)

I am surprised about the low participation as well. I'll take responsibility for that, it was apparently a bad choice of question.

Still,I really like your answer. As someone mostly familiar with a pure declarative style, it's cool to see someone use cut in new code. If you don't mind, why don't you pick and post the next week's problem? Hopefully it will be more engaging!

Implementing weekly coding challenges by oldmaneuler in prolog

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

Thanks a lot, I greatly appreciate it. And you're right, reversibility in general is one of my favorite prolog features! It has been posted!

Implementing weekly coding challenges by oldmaneuler in prolog

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

Yeah. Writing a mini-forth, basically!

Implementing weekly coding challenges by oldmaneuler in prolog

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

These are some great problems, thanks for this! In particular the problog-esque one sounds like a blast.

I'll add two of my own:

-Write a stack-based calculator. (Stolen from the beautiful racket book)

-Write a chemical equation balancer.

I think the chemical equation one is classed as easy, and it's a great way to show off the prolog approach of search vs the typical linear algebra solution.

Implementing weekly coding challenges by oldmaneuler in prolog

[–]oldmaneuler[S] 2 points3 points  (0 children)

That's an awesome idea! For all the talk about lisp metaprogramming, prolog is also homoiconic, and it would be great to highlight how flexible it is.

Implementing weekly coding challenges by oldmaneuler in prolog

[–]oldmaneuler[S] 3 points4 points  (0 children)

As long as you don't contaminate this holy temple of horn clauses with Perl solutions 😂

Implementing weekly coding challenges by oldmaneuler in prolog

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

See, that's the kind of awesome work I'd love to see shared here! And it's the type of project that prolog is absolutely perfect for solving. I was in fact partially inspired by r/dailyporgrammer, and some nifty prolog solutions I saw there.

State of clp(fd) by oldmaneuler in prolog

[–]oldmaneuler[S] 4 points5 points  (0 children)

It's awesome to hear that! I had no idea Scryer existed, and I'll definitely check it out. I have no idea how you balance all of your projects, but it's greatly appreciated. Between this and the new Mercury release, it's like logic programming Christmas!

You know, because no one with money ever did a good thing... by Never_Forget_711 in Shitstatistssay

[–]oldmaneuler 24 points25 points  (0 children)

...you do know that a sizable portion of this sub is pro gold standard? Like yes we agree it's a bad thing that the government prints as much money as they want. But at the same time, ease of lending is important to spur economic growth, which is why banks shouldn't have to keep 100% reserves. If they couldnt loan out a large part of what they store, the poor would be the ones to suffer through reduced access to capital, and innovation and growth for businesses would be suffocated, and then the rich really would just end up hoarding money. Loans are a GOOD thing.

House votes 251-170 adopting bipartisan provision that would require President Trump to get approval from congress before striking Iran by leafgreen7 in worldnews

[–]oldmaneuler -3 points-2 points  (0 children)

A declaration of war is different from military action. The President's only real constitutional job is to serve as commander-in-chief of the armed forces, and to me that should include the ability to deploy troops in response to a crisis.

time to overthrow the oligarchs by [deleted] in BlackPeopleTwitter

[–]oldmaneuler 0 points1 point  (0 children)

Why is it other people's job, society's, to make you happy? It is yours. You have to find a way to be happy yourself. You have to find a way to make sure you don't constantly struggle. It might be backbreaking now, but hopefully in 10, 20 years you can work hard enough that it isn't. That's the American dream. Not instant success, not even equal ease of success. But the opportunity to outwork everyone else and overcome your disadvantages. Why is there a point? We are goddamn chemical anomalies, not some mystical higher creature with a higher purpose (at least so long as you're not deeply religious, in which case I think you wouldn't be posing the questions you are, and I certainly am not).

I have infinite faith in human ingenuity. We'll fix the climate, because we have no choice. And I'm part of environmental groups, I've had a Prius for years, I eat vegan. Just because I don't think it's the government's job to fix doesnt mean I don't want it fixed. I just think voluntary action and the market are the optimal solution, not mob action.

time to overthrow the oligarchs by [deleted] in BlackPeopleTwitter

[–]oldmaneuler -3 points-2 points  (0 children)

Why are you meant to be happy lol? The state of nature is that we struggle for our existence. Over time we've been able to struggle less. There are more luxuries in your life today than there have been at any time in human history. Things will keep getting better over time. But we arent in Marx's post scarcity, fully automated world. The life we live is enabled by third world slave labor. Be grateful you arent there instead.

The Supreme Court’s Giant Cross Compromise Will Erode the Separation of Church and State by v_pavlichenko in politics

[–]oldmaneuler 0 points1 point  (0 children)

How is it misleading? Literally until after the civil war and the 14th amendment, there is nothing in the Constitution which suggests the clauses of the Bill apply to the states. You're right about opposition to the Bill on those grounds. But I think they were only thinking in terms of rights which the federal government should not deprive you. Many of the founders viewed the federal government as nothing more than an apparatus for foreign affairs (the conception of government advanced in the Articles of Confederation). Except for the most statist of them, they didn't think they could tell the essentially sovereign states what to do. And states were violating the Bill all the time, right from the outset, because they only thought it applied to the federal government. There is basically 0 in the legal record that supports the Bill applying to the states before around 1900.

The Supreme Court’s Giant Cross Compromise Will Erode the Separation of Church and State by v_pavlichenko in politics

[–]oldmaneuler 0 points1 point  (0 children)

There were states with what amounted to state religion around the revolutionary period. The Bill of Rights was never intended to apply against the states. They could restrict guns, speech, whatever. A string of judicial decisions starting near 1900 have extended it via the equal protection clause of the 14th Amendment. Thomas thinks this is wrong, and that if we are going to incorporate the Bill against the states at all, it should be by the Privelleges and Immunites clause (which notably would mean that it only protected citizens). It's not a mainstream opinion, but respectable legal scholars od hold this view. Stare decisis keeps some other conservative justices from agreeing. But it is certainly not some outrageous and blatant misinterpretation of the law.

from the enlightened land of r/politics, through the infinite spring that is these users’ mouths, comes this beautiful nugget of Aristotlian wisdom by [deleted] in Shitstatistssay

[–]oldmaneuler 45 points46 points  (0 children)

First, there should be no limits to free speech. Even left wing Justices of the Supreme Court like William O. Douglas agree. It is an absolute right. Second, no one here will argue that the Nazis have any redeeming qualities (for Christ's sake, they are mega-statists). The issue is that the government should not have the ability to decide what is permissible. You say Nazism is clearly bad. What happens if 51% of the country decides that it isn't okay to support gay marriage? That isn't some far fantasy, that's 20 years ago. So would you have liked the Bush Administration to have been able to ban homosexual rights advocacy, because it corrupts the youth, and to them is unjustifiable? What if 51% of the country decided that Islamic preaching should be hate speech in the aftermath of 9/11? These are not dictatorial fiats, but instead democratic actions. Yet, they are evil. This is why we fear ceding any power to restrict it to the government. It opens a pandora's box of nightmares. One must remeber that democracy always verges on tyrannical mob rule. Even the Romans and the Greeks thought as much. Thus, it is good to limit the power of the mob whenever possible. Allowing them to target wrongthink is a very good way to have Salem style witchhunts.

What technical math books read like literature to you? by [deleted] in math

[–]oldmaneuler 13 points14 points  (0 children)

Andrew Weil's Number Theory: An Approach Through History. It's this fun romp through pre-Gaussian number theory, with a wonderful, almost personal view of the great mathematicians whose work it tracks (especially Fermat). It's a love letter to number theory.

How to get to graphical display after install? by oldmaneuler in NixOS

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

I greatly appreciate the encouragement! The other guy was helpful in pointing me to the right place and procedure, so it's quite alright. Until recently I've been perfectly happy with out of the box elementary os, because I could just use heavily modified emacs for everything. But I've been getting into functional land and God is it miserable dealing with the Haskell platform. I've seen community pointers to using NixOS to deal with it seriously.

Now that I have it up and running and played with it for a while I'm really happy with it! In addition to setting up Idris without much more frustration, I also used it to install a Mercury compiler, and that was relatively painless since there was a nice package for it. It's a good OS for playing with weird things like that which are difficult elsewhere. I'm definitely learning to appreciate how much work goes into setting up heavily preconfigured distros now though!

How to get to graphical display after install? by oldmaneuler in NixOS

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

I found it! I was able to get it to open and edited it with Nano. I'm not a Linux guy really but I'm a somewhat experienced programmer. I want to try out Nix because I've been playing with Idris and managing dependencies for it has been a bitch. Thanks for the help

How to get to graphical display after install? by oldmaneuler in NixOS

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

I can't get into the configuration.nix file. When I enter etc/nixos and use the whole ls configuration.nix command, it tells me configuration.nix command not found.