This is really odd, not much to say about it.
┌────────────────────────────────────────────────────────────────────┐
│ SageMath version 8.5, Release Date: 2018-12-22 │
│ Using Python 2.7.15. Type "help()" for help. │
└────────────────────────────────────────────────────────────────────┘
That statement is actually true across the real and complex numbers. If t = 5, for example, then (1 - 5) ^ 2 == (5 - 1) ^ 2 is true.
(Also this question might be right on the edge of "off-topic" for Stack Overflow seeing as how it's really more a math question and not a programming question, but I guess Sage is a library as well... :-) )
Related
This question already has an answer here:
What is the "[" binary file in my "/bin" folder for? (MacOS Big Sur M1 chip) [closed]
(1 answer)
Closed 1 year ago.
I was poking around a new MacBook Air M1 running Big Sur. I came across an executable file in /bin called "[". Seemed strange to me so I looked into it a bit more but the mystery remains. Google/DuckDuckGo searches are fruitless. I copied the file into my homedir to do some more investigation. Here's what I found:
user#jackrabbit(s003) ~ % file foo
foo: Mach-O universal binary with 2 architectures: [x86_64:Mach-O 64-bit executable x86_64]
[arm64e:Mach-O 64-bit executable arm64e]
foo (for architecture x86_64): Mach-O 64-bit executable x86_64
foo (for architecture arm64e): Mach-O 64-bit executable arm64e
user#jackrabbit(s003) ~ % strings foo
#(#)PROGRAM:test PROJECT:shell_cmds-216.60.1
33333
$FreeBSD$
missing ]
unexpected operator
%s: %s
closing paren expected
argument expected
%s: bad number
%s: out of range
#(#)PROGRAM:test PROJECT:shell_cmds-216.60.1
33333
k#$FreeBSD$
missing ]
unexpected operator
%s: %s
closing paren expected
argument expected
%s: bad number
%s: out of range
user#jackrabbit(s003) ~ %
I tried running the executable with a few different arguments but didn't get any useful output.
Any ideas?
After some more thinking and poking around, it's a copy of /bin/test. It's got the same size and last modified time, so it appears to be part of the original OS install. Anyone with Big Sur able to verify if they also have /bin/[?
I recently installed GNAT Ada (2020) and GNAVI GWindows on a new PC.
On trying to build an old project developed under the 2015 version, I get this:
No candidate interpretations match the actuals:
Too many arguments in call to "Put"
expected private type "Printer_Canvas_Type" defined at gwindows-drawing.ads:603
found private type "Canvas_Type" defined at gwindows-drawing.ads:96
This is one of the several similar pieces of code that produce the same result (MapCanvas is declared elsewhere as Canvas_Type):
Put (MapCanvas, (DATUM_BASE_X +
(x * 10 * GRID_MONAD_SPACING)) +
(5 * GRID_MONAD_SPACING),
y - (GRID_MONAD_SPACING + 5),
Integer'Image (x));
Possibly related, I also get this in regard to the last argument in the call to Put - Integer'Image(x)
expected type "Standard.Wide_String"
found type"Standard.String"
As an experiment, I tried converting the last argument using To_Wide_String (Integer'Image (x)) but the result was the same.
Elsewhere, similar code with a literal compiles ok:
Put (MapCanvas, (DATUM_BASE_X - 1 +
(GRID_MONAD_SPACING / 2) +
(x * 10 * GRID_MONAD_SPACING)),
y + 20 + (60 * GRID_MONAD_SPACING),
"0 2 4 6 8 ");
On the previous PC with GNAT Ada 2015, everything compiled. I've compared the declarations
of Put in gwindows-drawing.ads in the old and new installations of GWindows and they are identical.
Unfortunately I can no longer build on the old PC without a lot of backtracking - the old project drive
is in use elsewhere, though I do have it all backed up.
I'd appreciate any ideas on where to look for the cause of the problem.
GWindows has two string modes matching Windows API: ANSI (8-bit character) and Unicode.
The type GString is either a String or a Wide_String.
You can switch the framework's mode with ansi.cmd and unicode.cmd .
Obviously your old project was in ANSI mode.
My filesystem tree looks like this:
C:.
└───static
├───custom_stuff
│ presets.css
│ presets.less
│
└───index
index.less
So, why index.less can't find presets.less, and throws me an error:
'/static/custom_stuff/presets.less' wasn't found. Tried -
/static/custom_stuff/presets.less
I'm using VS Code and this extension to compile LESS to CSS
Your path will be ../custom_stuff/presets.less
The man page does explain what the bracket-braces means (it refers to threads), but I'm wondering what just the braces means.
From this here I can see that auditd and node are like this.
❯ pstree
init─┬─agetty
├─atd
├─auditd───{auditd}
├─crond
├─dbus-daemon
├─dhclient
├─6*[mingetty]
├─ntpd
├─rsyslogd───3*[{rsyslogd}]
├─2*[sendmail]
├─sshd─┬─sshd───sshd───zsh───tmux
│ └─sshd───sshd───zsh───man───sh───sh───less
├─tmux─┬─2*[zsh]
│ ├─zsh───node───{node}
│ └─zsh───pstree
└─udevd───2*[udevd]
My current best guess is that it means they are blocked on input.
n*[{name}] means group of the n threads. If there is only one thread, pstree use {name}
{auditd} <=> 1*[{auditd}]
For group of threads, pstree use n*[{name}]:
├─rsyslogd───3*[{rsyslogd}]
equipvalent to:
├─rsyslogd─┬─{rsyslogd}
├─{rsyslogd}
└─{rsyslogd}
use command "pstree -a" to see the different.
I'm upgrading from rails 3 to 3.1.8 (and onwards). A couple of my tests are failing, one of which seemed at first glance to be because of the change from mysql2 gem (0.2.x to 0.3.x). However, it gets a little stranger. Here's what's happening.
In my test I am updating attributes on a model, and checking that they've saved:
...
post :create, :advertisement => #advertisement_attributes
assert_equal assigns(:blah).start_date, #blah_attributes[:start_date]
It is failing saying that they are different times.
If I put a binding.pry and jump in just before the assert_equal this is what I get:
a = assigns(:blah).start_date
b = #blah_attributes[:start_date]
a == b #false
a.to_s #"2012-10-17 20:46:12 UTC"
b.to_s #"2012-10-17 20:46:12 UTC"
a.to_i #1350506772
b.to_i #1350506772
a.to_i - b.to_i #0
So far.. I'm still confused as to why the == is returning false. But what is really odd is if I subtract the dates -
a - b #-0.989403009414673
If anyone can explain what's going on here I'd love to know!
Also, this same test was passing fine in rails 3 (no timezone was set for the application), any pointers to what has changed would also be handy!