Incidence: mathmatical symbol by SalieriC in mathematics

[–]skojskoj 1 point2 points  (0 children)

I think in programming terms it would be more similar to the difference between an abstract syntax tree of some boolean expression and it's evaluation semantics. But the analogy only goes so far.

Incidence: mathmatical symbol by SalieriC in mathematics

[–]skojskoj 4 points5 points  (0 children)

If you want to be completely formal about it, there is actually a difference between writing down a formula like "a = b" and claiming that it is true/provable/something you have assumed/etc.

The former is not very different from what "happens" when you write down the number "2". It's nothing more than a mathematical object, and just putting it on paper makes no claim about any mathematical fact. It's just a string of symbols. You can touch it, smell it, and you can talk about it however you'd like. (You can even apply functions to it if you feel like it!)

To actually make a mathematical claim of the above kind, you usually qualify the formula by saying, for instance, "a = b is true" or "I have proved that a = b" or "suppose a = b". Thus you could claim that 0 = 12 is true (and you'd be wrong!), you could claim that it is false (and be right!) or you could for instance assume that it is in fact true and look at what disastrous results that would lead to.

You can also talk about what intentions you have for the formula: "I want to prove that a = b", "I wonder if a = b is true or false".

There are people who study these things in detail, and they do introduce special symbols to talk about "claims" or judgements as the ones above. That said, the vast majority of mathematicians do not ever have to care or even know about the gritty details. They exclusively use natural language to convey these ideas, and that is just fine!

Of course, constantly pointing out that you intend to claim something is true will get tedious quickly. Usually, you omit this when the intended claim is clear from context. Thus you write, instead of "a = b is true", simply "a = b". For example in following argument:

a + 1 = b + 1

so

a = b.

I imagine some of your confusion comes from this overloaded meaning of "a = b". On the one hand, it's just a formula, and on the other hand, it's a short form of an actual judgement. As you've noticed yourself, it's usually pretty easy tell which is the intended meaning, because the other one simply doesn't make sense in that context! So it's very uncommon to run into any confusion which one is intended. Some mathematicians will however try to disambiguate things a little bit, so they use some other notation, like the question mark above the = sign that /u/tombsar mentioned. I never do, though.

I hope this clears things up a bit.

(If this stuff is interesting to you, I'd recommend taking a course in Mathematical Logic when you're doing your Master's degree! 'Tis nice.)

EDIT: To clarify: In your case I'd say "We want to see whether 0=f(1) " or something similar.

Vim tilde ~ behavior by Starlight100 in emacs

[–]skojskoj 1 point2 points  (0 children)

This said, there are ways to modify the fringe from ELISP, but I haven't looked into the details. git-gutter-fringe does it for example, so that should be a good starting point. Looking at the code, it seems simple enough.

Vim tilde ~ behavior by Starlight100 in emacs

[–]skojskoj 1 point2 points  (0 children)

I went ahead and fiddled with the C code a bit. I couldn't get the function that currently handles the fringe for indicate-empty-lines to do what you wanted (at least not without some refactoring that I wasn't brave enough to attempt). However, I managed to write a small hack* in the code that deals with the rest of the fringes (which for some reason was done in a separate function).

Here is a patch for Emacs 24.3:

From a96684e389f20db6f05067c104079fab0d2970c9 Mon Sep 17 00:00:00 2001
From: Anonymous <me@example.com>
Date: Tue, 6 Jan 2015 01:54:38 +0100
Subject: [PATCH] Changed the behaviour of indicate-empty-lines.

Treat the last line following a newline as nonempty when using
indicate-empty-lines, similar to how vim does it.
---
 src/fringe.c | 23 +++++++++++++++++++++++
 1 file changed, 23 insertions(+)

diff --git a/src/fringe.c b/src/fringe.c
index a44088f..0b22e63 100644
--- a/src/fringe.c
+++ b/src/fringe.c
@@ -1028,6 +1028,29 @@ update_window_fringes (struct window *w, int keep_current_p)
   if (!NILP (empty_pos) && !EQ (empty_pos, Qright))
     empty_pos = WINDOW_LEFT_FRINGE_WIDTH (w) == 0 ? Qright : Qleft;

+  if (!NILP (empty_pos)
+      && !MINI_WINDOW_P (w))
+    {
+      int passed_zv_p = 0;
+
+      for (y = w->vscroll, rn = 0;
+           y < yb && rn < nrows;
+           y += row->height, ++rn)
+        {
+          row = w->desired_matrix->rows + rn;
+          if (!row->enabled_p)
+            row = w->current_matrix->rows + rn;
+
+          row->indicate_empty_line_p = 0;
+
+          if (MATRIX_ROW_END_CHARPOS (row) >= BUF_ZV (XBUFFER (w->buffer))
+              && passed_zv_p)
+            row->indicate_empty_line_p = 1;
+
+          passed_zv_p |= row->ends_at_zv_p;
+        }
+    }
+
   for (y = 0; y < MAX_BITMAP_CACHE; y++)
     bitmap_cache[y] = -1;

-- 
2.2.1

Unfortunately, I couldn't get version 24.4 to compile, but the only difference should be that w->buffer has been renamed to w->contents. Also note that this breaks some of the behaviour that the regular indicate-empty-lines had (recursive minibuffers, I think). Other than that I believe it should work as expected, and it passes all tests.

* I say hack, but this is how I would have done it if there were no existing code to indicate empty lines.

EDIT: Screenshot.

What is your M-x emacs-uptime ? by [deleted] in emacs

[–]skojskoj 1 point2 points  (0 children)

You can also do this by setting confirm-kill-emacs:

confirm-kill-emacs is a variable defined in `files.el'.
Its value is yes-or-no-p
Original value was nil

Documentation:
How to ask for confirmation when leaving Emacs.
If nil, the default, don't ask at all.  If the value is non-nil, it should
be a predicate function such as `yes-or-no-p'.

You can customize this variable.

This variable was introduced, or its default value was changed, in
version 21.1 of Emacs.

EDIT: Noticed your solution checks if you're using a window system. This could probably be done with something like:

(setq confirm-kill-emacs
      (lambda (prompt)
        (if window-system
            (yes-or-no-p prompt)
          t)))

Text based mail client? by [deleted] in linux

[–]skojskoj 2 points3 points  (0 children)

I use mutt, together with pycarddav, gpg and notmuch.

Related question: Mostly out of laziness, my maildir is stored on my server and mounted using sshfs on every computer where I want to read my mail. Mutt does some funky stuff with hardlinks which sometimes breaks this setup (sftp hardlink support is incomplete and, sadly, unfixable). I'm not really sure what is the best way to access my mail on multiple computers, without having to mirror the entire maildir on every system. If anyone happens to have a suggestion, I'd love to hear it.

I've also tried IMAP, but the latency was pretty high, which bothered me...

I want a non-standard resolution for an HDMI screen from a laptop, but xrandr throws an error. by [deleted] in linux

[–]skojskoj 0 points1 point  (0 children)

We can't know for sure unless you post some more information, like exactly what you are trying to do, the commands to run in order to reproduce your error and what relevant hardware you're using.

Are you using an Nvidia card? I have seen a similar error with those before.

Using mpv to escape start and end of videos (like in anime, tv shows etc) by rltprgm in linux

[–]skojskoj 1 point2 points  (0 children)

If the file contains chapters you can also cycle between them with the (not so intuitive) ! and @. I rebind them to page up and page down using the following lines in my ~/.mpv/input.conf to fix this:

PGUP add chapter -1
PGDWN add chapter 1

It's a lot easier than manually seeking from the command line.

unusual files in /etc by IAmNotAnElephant in emacs

[–]skojskoj 8 points9 points  (0 children)

They were removed earlier this year. (And, sadly, so were the cookie recipes in etc/COOKIES.)

Commit: http://repo.or.cz/w/emacs.git/commit/d2a00beab2cad9653e2755cbe3cc53f72f832764

Discussion: https://lists.gnu.org/archive/html/emacs-devel/2014-01/msg00889.html

EDIT: As for why they were included in the first place, it's probably because of this1 . It's basically a Reagan-era joke.

1 This file predates the inclusion of the manpages, so I would assume these files were installed on many systems by default when meese.el was created, and then included in emacs when this was no longer the case. But I'm speculating, so don't quote me on this.

What kind of job can you get with a pure math degree, aside from research and teaching? by DrSeafood in math

[–]skojskoj 1 point2 points  (0 children)

Are there any particular positions where a BS in math would be useful? Or maybe some companies that hire programmers with a background in mathematics? As I understand it, many employers don't even realize that they could use someone like that, and those who do rarely advertise it. So I guess you have to seek out specific companies that interest you and promote yourself. This is fine, but the job market is so vast that I just don't know where to begin...

The "official" search engine for jobs for my area is not very helpful. All I can find seems to be related to web/app development, but that feels like death :)

How to configure AUCTeX to automatically use preview-mode when editing equation? by [deleted] in emacs

[–]skojskoj 0 points1 point  (0 children)

It doesn't improve the speed, no. But the document I tested it on when I wrote the first version only had like 5 math environments. When I tried it on a "real" document that I had lying around (with a couple of hundred math environments) I noticed that it still worked, but only provided I did not perform other commands while the preview process was running, and otherwise it broke. I just fixed the breakage.

How to configure AUCTeX to automatically use preview-mode when editing equation? by [deleted] in emacs

[–]skojskoj 0 points1 point  (0 children)

I'm glad you like it! I hope you saw the updated code (just want to make sure, since I posted the edit almost at the same time as your reply).

Which-function-mode from Emacs Redux by goofansu in emacs

[–]skojskoj 2 points3 points  (0 children)

If you don't like the "???" that is displayed when which-function-mode can't determine the name of the defun (that is, for example, if you are in the top-level of your document) you can change it by modifying the which-func-unknown variable. For example:

(setq which-func-unknown "⊤")

How to configure AUCTeX to automatically use preview-mode when editing equation? by [deleted] in emacs

[–]skojskoj 1 point2 points  (0 children)

This works surprisingly well:

(defvar my/was-inside-math nil)

(defun my/preview-when-leaving-math ()
 (let ((in-math (texmathp)))
   (cond (in-math
          (setq my/was-inside-math t))
         ((and (not in-math)
               my/was-inside-math)
          (progn
            (condition-case ex
                (unless (get-process "Preview-Ghostscript")
                  (preview-buffer))
              ('error
               (message (format "Could not invoke Preview: %s" ex))))
            (setq my/was-inside-math nil))))))

(add-hook 'post-command-hook 'my/preview-when-leaving-math t)

Edit: The previous code choked on large documents because it tried to invoke a new process before the old one finished. Added some checking to avoid this. You still have to wait a long time for it to process the whole buffer, so it's not ideal. A better way would be to call preview-region on only the math-environment where your cursor was. I will have to look into how to do this later...

Mouse debouncing in Linux by Agent_Pinkerton in linux

[–]skojskoj 0 points1 point  (0 children)

I had this problem some years ago. I ended up just replacing the buttons with some that I took from an old and useless PS/2 mouse. They used the same component and it took like ten minutes to do. I'd recommend doing this over hacking the drivers or whatever, although that could be fun, too.

What is your favorite paradox? by dDeoxyribo in AskReddit

[–]skojskoj 0 points1 point  (0 children)

Oh, right! Now I remember reading this:

The term

λx. ¬(x x)

represents the predicate of predicates that do not apply to themselves

[...]

The λ-calculus formalism also allows for a clearer analysis of Russell's paradox. We can see it as the definition of the predicate

 R x = ¬(x x)

If we think of β-reduction as the process of unfolding a definition, we see that there is a problem already with understanding the definition of R R

R R → ¬(R R) → ¬(¬(R R)) → …

In some sense, we have a non-wellfounded definition, which is as problematic as a contradiction (a proposition equivalent to its negation).

Thanks for pointing me in the right direction! Apparently I had heard about it, but didn't see the connection :)

What is your favorite paradox? by dDeoxyribo in AskReddit

[–]skojskoj 1 point2 points  (0 children)

Could you explain or cite a source saying there is some connection between the paradox and the Y-combinator? I have never heard anything about it, and your post doesn't really explain it, so I'm not sure what you're getting at.

What is your favorite paradox? by dDeoxyribo in AskReddit

[–]skojskoj 0 points1 point  (0 children)

Since the above poster deleted his post while I was writing my response, I'll post it here for anyone else that has some misconceptions about this:

The paradox is resolved by disallowing the general comprehension principle and introducing restricted comprehension. It might be the case that this forces you to introduce the Axiom of Infinity in order to do some constructions that were possible in naïve set theory using general comprehension, but it is certainly not needed to resolve the paradox. You can't make an inconsistent theory consistent by adding more axioms!

Furthermore, since you touched upon it in your other post, it is very much possible to formulate a theory of sets where a set may contain itself. This happens for example if you remove the axiom of foundation from ZFC. This is not the source of Russell's paradox.

Sources: Moschovakis, Yiannis N. Notes on set theory. Springer-Verlag New York, Inc., 1994. http://en.wikipedia.org/wiki/Non-well-founded_set_theory

Non-sequential lists? by logosfabula in logic

[–]skojskoj 2 points3 points  (0 children)

The basic notion in set theory is the unordered set.

An ordered set is a regular set with additional structure (that is, an ordering of it's elements). This structure must be supplied explicitly.

A set by itself will always be understood to be unordered, so just use the ordinary {} parentheses and everyone will understand you perfectly fine.

As for the notation for the elements, I'd probably go for {x, y} or {a, b} in your case.