12:16 AM
@DJMcMayhem ARSE is on the starboard twice from two completely unrelated contexts
8
CMC: Given a and b, find the smallest multiple of a that is greater than or equal to b.
@Maltysen ARSE is on the starboard thrice from three completely unrelated contexts
@ATaco *.EcFQe
@ATaco JavaScript (ES6), 18 bytes: (a,b)=>(a+b-1)/a|0
also 18 bytes: (a,b)=>(b/a-b|0)+b
12:24 AM
Nice solutions, I didn't think of using |0 to round.
@Adám isn't the third one related to the other two?
@DestructibleLemon Isn't the second one related to the first?
My equa.lua library would let me do n=(a+b-1)//a, however I also need to include the library, so it totals 25 bytes with require"equa"n=(a+b-1)//a
@Mego Global warming has really hit the penguin populations huh? You need sunglasses now?
@Adám the first one was about the australian space thing, the second one was about augmented reality SE, the third is about the other two being present on the starboard
@DestructibleLemon Downgoat responded to the first one, creating the second, which after a response from ATaco lead Downgoat to state the now much-starred phrase. Clearly they are all related. Anyway, off to bed…
12:36 AM
ok do we need a mod to unstar Maltysen's message for lying then?
Anonymous
@DJMcMayhem The transparency issue didn't fix :(
Anonymous
@ATaco My future is bright. Really bright. Save the ozone layer please.
6
Oh hey, I'm almost at 5K rep.
1:10 AM
Anyone know any fun math games? We got a new advisor for math club and she wants us to do fun math things on top of just competitions
Anonymous
@Maltysen Make magic squares
@Mego and have people solve them? or just make em?
Anonymous
@Maltysen Either
cool, I'll recommend that
proof-golf :D :D :D
1:17 AM
@HyperNeutrino rofl
it'll be hard with geometry, and I don't think most of my friends know group theory
ah ok :P
cuz how do constructions count as steps?
one step per line?
maybe?
idk exactly how it would work my group theory is probably better than my geometry lol
same lol
I was considering introducing my school's CS club to PPCG but I felt it wasn't on-topic there because CS club is all about algorithms and stuff and PPCG is about, well, short code and screw efficiency :D
1:20 AM
Guys we need to bring back AvocadOS.
@PhiNotPi totally
Most starbait possible
hi what would be a good symbol for complex number and 10**n number in my golflang
j, e?
1:24 AM
maybe but I want all ascii chars for builtins
complex and e-notation numbers aren't extremely common (I think) so I'd make them a bit harder to type because I want easier characters for more common things :P
.j .e?
lol
E for 10**?
Anonymous
@HyperNeutrino ⏨
@HyperNeutrino ⓙ, ⓔ?
Avoca.do is parked :(
1:34 AM
@ATaco a-ta.co
Yes, that is in fact a domain I own.
But I wanted Avoca.do
1:44 AM
@Mego huh I like that idea! thanks!
@DestructibleLemon hm... interesting suggestion but they look a bit weird IMO. thanks for the suggestion though!
anyway gtg lol o/
1

Let us consider a regular n-sided polygon where all of the sides are equal in length with n being a natural number larger than or equal to three. All of the vertices lie on the unit circle (circle of radius one centered at the origin) and one of the vertices is always at the coordinate (x,y)=(1,0...

2:11 AM
I'm probably just going to use Jelly's complex and exp notation
If anyone has the time to peruse some Python code, ping me. I need an opinion
Anonymous
@ZachGates What's up?
@Mego I'm having an argument with one of my friends/co-developers on a project, and we can't agree on which codebase to use. We each have a repo that branched off in the last 40 or so commits. We need an outside opinion on which one is cleaner/better
I'd offer to take a look, but my python code standard is "Don't"
Anonymous
2:23 AM
Here's the GH organization
Anonymous
I'll take a look in a few
Cool
My vote's on lookup-1
But I'm a Taco, and note my previous statement on aesthetics of python.
@ATaco And your Python code standard is "Don't"
:')
Anonymous
@ZachGates Any specific files to look at?
2:27 AM
@Mego The file structures are almost completely different
Anonymous
@ZachGates lookup-1 is definitely cleaner and easier to maintain
@Mego In what ways?
Anonymous
Better organization and modularity
is there a regex construct for given two regex parts a and b match a, b, or both, but not neither?
I could do a|b|ab but that's messy IMO
a?b?
2:33 AM
but that would match empty strings as well
Anonymous
@ATaco That can match neither
Oh, but not neither.
yeah
Anonymous
2:33 AM
@HyperNeutrino I think that's the cleanest way. You'd need to use lookaheads and lookbehinds otherwise.
oh rip
Yeah, I agree, that seems to be the best way.
Your other option is (ab?|a?b)
no it would be (ab?|a?b)
but yeah I could do that too
Yep, I'm a fool.
2:35 AM
If you're using the literal letters a and b you can use [ab]{1,2}
I mean, I already have a and b as .format arguments so it wouldn't be too long
@ATaco yeah that matches aa as well...
Right...
wait I could do a|a?b
@Mego It looks fine to me
or actually a?b|a
mhm got it
2:36 AM
My regexing is akin to removing paint with a sledge hammer.
"Paint's gone boss!"
Boss: "where's the wall?"
also I think my wifi's cutting off soon rip
@Mego IMO lookup-2 is better because it's almost totally PEP compatible. My problem with lookup-1 (speaking strictly of the style) is the 1-class-per-file structure and the camelCase
Sounds like Java. I like Java.
surely you can refactor the camelCase with any decent IDE
Anonymous
@ZachGates 1-class-per-file is a bit overkill, but it's still cohesive. Just dumping all of the source files in a single directory does not a maintainable repo make
Anonymous
2:43 AM
You should definitely work on PEP8-compliance in the actual code, but I was mainly looking at the organization
I only do one end of the extreme or the other.
RProgN1 is written in two files, RProgN2 is written in now over a hundred.
Anonymous
I'd rather have directories with 1-2 files each with 1-2 classes than a single flat source directory
I'd like to think RProgN2's source is infinitely more readable than RProgN1's.
But of course, it's also,
hi can someone help me with a regex thing
i'm wondering why ((-?([1-9][0-9]*)?\.([1-9][0-9]*)?)|(0|-?([1-9][0-9]*)|-))?ȷ((-?([1-9][0-9]*)?\‌​.([1-9][0-9]*)?)|(0|-?([1-9][0-9]*)|-))? doesn't match ȷ
It does match it..?
Which regex engine are you using?
2:52 AM
wait
i'm stupid
I didn't add it to my codepage so it got automatically removed ._.
geez i'm dumb
:\
there we go works perfectly
That's a bit of an X/Y problem :P
2:53 AM
@Mego Originally our program had insanely bad threading, so we decided to migrate to asyncio for performance benefits in concurrency. I was assigned that issue and started from scratch to do it; trying to get everything PEP compatible and as efficient as possible
@ATaco yup :P well I thought I wouldn't have such a dumb error as literally deleting my input but I overestimated my intellect... :P
anyway gtg now goodnight(/morning :P) ppcg o/
o/
@flawr Why (not ?) ? Okay, then what's a good example where using classes for such mathematical tasks make them more elegant ?
@AlexKChen points on elliptic curves are very elegant as classes with overloads
(id really know the context, just chiming in here)
3:54 AM
@Maltysen Eh ? What do you mean (and no sorry I still don't know eliptic curves :(
A simpler idea: How would you represent a vector?
@AlexKChen i don't the context of your conversation but saw ur question ans was just chimin gin
also you don't need to know the math to understand my point about elliptic curves
they way it works is that its helpful to do math where you "add" or "multiply" points on difernet elliptic curves
@Maltysen You can click the "reply" arrow to see which message I replied (given you'r'e not browing from a mobile)
@ATaco As a list ? It looks the most natural to do.
@AlexKChen lol, I clicked it once, but that didn't help me so I just gave up
It would seem, however then doing arithmetic on it is complicated, and consistency can be lost.
3:57 AM
@AlexKChen his point is that if its a list, then you can't use + or * to add or multiply
If you wanted to do vec1 + vec2, it would cry.
12 hours ago, by Alex K Chen
@flawr Thanks. So, can you give verbal comments on how class improves functionality/chunking in this, or say this ?
@ATaco Hmm reminds me of something that I actaullly did few weeks ago...and it was a pain in the ass. Wait a bit, showing the code
Using a class means you have a common template for all your vectors, which prevents any inconsistencies of their representation, and gives you the ability to override their operators, letting you do things like vec + vec, or vec * magnatude.
ef mul(s,t): // Multiplies two polynomials
u = []
p = len(s)
q = len(t)
for i in range(p+q-1):
a = 0
for j in range(i+1):
if j < p:
if (i-j) < q:
a = a+s[j]*t[i-j]
u.append(a)
return u

def nmul(s): //Product of polynomials from s
a = s[0]
if len(s) == 1:
return a
else:
for i in range(1, len(s)):
a = mul(a, s[i])
return a

def bincho(b, s): //Ignore it
t = []
for i in range(len(s)):
if b[i] == "1":
t.append(s[i])
return t

def er(a): //Distance from nearest integer
That's how I multiplied polynomials without using classes :\
Doable, yes, but it would have been much cleaner as a class.
4:00 AM
Okay, so is overidation of "+" or "*" possible ?
Anonymous
@AlexKChen Yep, via __add__ and __mul__
You can override: +, -, *, /, //, ^, %, calling, indexing, some bitwise operators and some others.
I mean, if I create a=Poly([A list of coefficients]), and b = Poly([Another list of coefficients]), then would a+b and a*b return what I want ?
Yep.
Oh even modulo too ! That looks interesting.
Okay, so what will happen outside the class ?
I mean, outside the class, if I normally type 3+2, what will show ?
4:02 AM
3+2 will still return 5, but poly + poly will call the overriden poly.__add__ function, and use it's return value.
So will poly + number, and number + poly.
Ah OK. And why they use classes in virtually all tkinter applets ?
That much I don't know, I don't speak python
Anonymous
@AlexKChen Classes are a convenient way to organize stuff
OK, now I understand. Thanks, ATaco and Malitsen
(There's also __radd__ for when the object is the right side of the operator and __iadd__ for +=)
4:23 AM
(In lua, you can set the class of the global table)
Anonymous
4:41 AM
@ATaco What purpose does that serve?
Given everything else I know about Lua, I assume it allows you to fully rewrite the language's syntax.
@Mego In some cases, you can set it's index function (And newindex) for some beneficial reasons.
Chatiquette says that posting "interesting pictures/animations is OK in moderation".
If you actually google "interesting pictures/animations", the results are completely random
@Mego As an example, equa.lua uses it to make unset variables into protovariables.
5:10 AM
stop
5:24 AM
@Pavel That's.... Terrifying
uBlock element zapper to the rescue!
starring so other people have to see it in future
muhahaha
The fact that there are not actually stars dissapointe me.
check if all things in a list of strings are plural:
java:
  public static boolean allPlural(String[] words) {
for (String s : words) {
if (s.isEmpty()) {
return false;
}
switch (s.charAt(s.length() - 1)) {
case 's':
case 'S':
continue;
}
return false;
}
return true;
}
python:
def allPlural(n):
return all(i[-1:].lower() == "s" for i in n)
haha python wins again
I can already think of a better way in Java
5:38 AM
or something
even if you said my i[-1:] drawing "" from "" is too hacky
you have
def allPlural(n):
return all(i and i[-1].lower() == "s" for i in n)
x=>x.every(s=>s.substr(-1).toLowerCase()=="s") Oops I spilled my JavaScript
or even then you can just add != "" if it's not explicit enough
@ATaco codereview would hate that though
probably
Codereview is boring.
boolean allPlural(ArrayList<String> words) {
return words.stream().allMatch(i -> i.matches("[sS]$")); } :P 5:40 AM @DestructibleLemon ^^ yes but I'm saying even when you're not golfing python is golfier and also more betterer Ehhhh x=>x.every(s=>s.match[sS]$) Golfed.
seriously though that solution I posted is straight from codereview
It is technically slightly faster than my method.
5:43 AM
python has readable list comprehensions and generator expressions and such
it is good
they also have less readable ones if you're interested...
C#: x=>x.All(s=>s.EndsWith("s", true))
you can nest list comprehensions like [i for inner in outer for i in inner]
like i see what it does but it's weird
C# has list comprehension with LINQ.
linq sounds dumb
so there
Wat
LINQ is the best thing to happen to C#
5:46 AM
ok can you provide example pleasE?
I don't have the best example in my clipboard but I have an example:
IEnumerable<int> numbers = Enumerable.Range(0, 10);
var evens = from num in numbers where num % 2 == 0 select num;
0

Please help me I don't quite understand on how will I begin in this problem, I need to create a program that will display a character in ascending order with a box that is (40x12) at the center of the screen. sp= space Output: Aa1(sp)Bb2(sp)Cc(sp)Dd4(sp)Ee5(sp)Ff6(sp)Gg7(sp)Hh8 Output: 09(sp)18...

Without LINQ:
ArrayList evens = new ArrayList();
ArrayList numbers = Range(10);
int size = numbers.Count;
int i = 0;

while (i < size)
{
if (i % 2 == 0)
{
}
i++;
}
@Pavel this is not a list comprehension this is a filter
which python has but I can't tell if this is the extent of it or not
Fine, var foo = from num in numbers select num + 1;
5:48 AM
that syntax is not very sweet
Equivalent too foo = [num + 1 for num in numbers]
ok fine
LINQ provides two syntaxes. The one you see here and one that uses regular function calls.
I like mine better
¯\_(ツ)_/¯
5:49 AM
it uses a list if it's supposed to be a list
also you got functions that use generator expressions?
Yes
IEnumerable<int> Infinity() {
for (var i = 0;; i++) {
yield return i;
}
}
so your linqs are like old version of python list comprehensions?
Well that wasn't the intended purpose
It's meant to allow you to write SQL in C#
5:52 AM
oh ok
bye for now
Consider this example:
Northwnd db = new Northwnd(@"c:\northwnd.mdf");

// Query for customers in London.
IQueryable<Customer> custQuery =
from cust in db.Customers
where cust.City == "London"
select cust;
6:27 AM
Suppose I have a python programme outputting a list of lists. How to open that in excel, so A[ i.][j] get mapped to the i th row and j th column in excel ?
@AlexKChen You could save the list into a CSV then open the CSV in excel
OK, thanks, but how do I export the python data in CSV ?
@AlexKChen open(file).write(data)
Suppose I have a notepad csv file named lorem ipsum in my desktop. And I have a python programme that outputs the list in IDLE. So what should I type in IDLE to save that in that notepad csv file ?
@HyperNeutrino However, we do supply a tool which is effectively the inverse for all arrays. See the footnote here.
6:34 AM
Darn bing search sux. Why it didn't showed that up :\
BTW, is it same for 3.x (Isn't that written for 2.x ?)
CMC: Given a list of strings, determine if they all end with either 'S' or 's'
@AlexKChen You can change the version at the top of the screen (dropdown menu)
6:50 AM
@ATaco Will they all have the same length?
Not necessarily.
They will however all match [a-zA-Z]+
@ATaco Try ∨⌿'sS'∘.=⊢/¨ for APL. How will you measure speed?
Can you run that on TIO?
@ATaco Sure, but do you have some test data?
{"this", "is", "somes", "testS"}
6:57 AM
@ATaco That's way too little, the overhead will completely obscure the actual performance.
I wasn't very prepared with test data.
@ATaco I can make you some.
@ATaco Also, the test data must have all words end with s or S so that no program can quit early.
Yes, of course.
Although a true benchmark should catch those programs that fail to optimize for it.
Anonymous
7:11 AM
@ATaco C, quite fast. Exits with 0 for true and 1 for false (as per POSIX standard).
Anonymous
Even faster with the appropriate compiler options (like -Ofast)
I think your solution is milliseconds slower than mine, but the variance is too great to determine.
Anonymous
-Ofast actually makes it 10ms slower.
Anonymous
The use of varargs makes mine slower
7:17 AM
Feel free to write a faster solution :P
Anonymous
7:28 AM
Oh, I just realized something. The TIO time includes compilation time, which is increased with -Ofast.
Anonymous
Anonymous
Anonymous
151 ms for I/O and compilation, 1 ms for running
Uh, hastebin seems to grind to a halt when I want to save my 16348 words test data.
7:56 AM
@ATaco APL, consistently under 1 ms: ∧/∨⌿'sS'∘.=(+\≢¨s)⊃¨⊂∊s (list of strings stored in s)
hi all
8:18 AM
0

Let us consider a regular n-sided polygon where all of the sides are equal in length with n being a natural number larger than or equal to three. All of the vertices lie on the unit circle (circle of radius one centered at the origin) and one of the vertices is always at the coordinate (x,y)=(1,0...

@Lembik Thanks.
the situation with infertile woman is surely more complicated though
(just saying :) )
Anonymous
8:26 AM
8 hours ago, by Mego
@ATaco My future is bright. Really bright. Save the ozone layer please.
Is it really though? :p
Anonymous
Actually it's because I made a bunch of bad puns earlier, so DJ made me a new avatar :P
there is no such thing as a bad pun!
@Lembik [citation needed]
@Adám :) It was a general exclamation in favor of puns not to be taken literally
8:35 AM
def vp(a, p):
i = 0
while (a % p) == 0:
i = i +1
a = int(a/p)
return i
Darn why the above programme vp(27**13-1,13) is showing v_13(27**13-1) to be $1$ when it's clearly $2$ ?
https://www.wolframalpha.com/input/?i=((27**13)-1)%2F1691
(The programme (should) output the highest exponent of prime p dividing a)
@AlexKChen Mathjax doesn't work here.
@AlexKChen v ​₁₃(27¹³–1) ?
Yeah. Any idea why it doesn't works ? Very puzzling.
@AlexKChen What? Your code or Mathjax?
My code. Works perfectly for small numbers
@AlexKChen Are you losing precision by subtracting a small number from a very large one?
8:43 AM
No well it works fine now anyway after replacing int(a/p) with a//p
Anonymous
Probably floating point imprecision
@AlexKChen Writing a class makes (in my opinion) only sense if you actually model some kind of object, but in this case you'd probably end up writing a class full of static methods, and if there are so few you could as well just omit the class.
@flawr OK, so it should make sense to write class when modelling a double pendulum (or ants in IMOSL 2011 C5) in python tkinter, right ?
I mean you can write classes for algebraic or complex numbers, but it only makes sense if you write methods that actually belong to each instance.
@AlexKChen Another thing to consider is that writing classes also makes more sense if you plan on using multiple instances.
But this is just my opininon other people might possibly tell you the oposite:)
9:01 AM
@flawr What do you mean "a class full of static methods" vs " methods that actually belong to each instance." ?
9:12 AM
haha, there's even a shoutout to TIO.
@Ven You mean the text box that says Space here for code {⍺+⍵} pictures etc.?
lol, I'm in the PDF :o
@Ven Ah, well the uploaded slides are mostly the actual files that the presenters used. When in presentation mode, that is invisible. If you are just looking at the file in edit mode, you won't see all the cool animations either.
That's so cool! I'm really sad I couldn't attend the conference. Knowing my message here was quoted is something :P. The one-day "conference" in Paris was really awesome.
@Ven How did you get a PDF?
9:17 AM
I mean the PPTX, sorry.
@Ven More TIO in D12
I'm reading them in order :-). I'll look at it.
@Ven Oh cool. I'll let my colleagues know that it is valuable. Hopefully, the talks will begin to populate dyalog.tv soon.
@Ven Which Paris meeting was that? Last year?
@Adám Yes, it was. Those are definitely valuable! I keep my "APL cheatsheet" I got in Paris with me at all time, and evangelize it once in a while :P.
9:24 AM
@Adám I confirm I'm in there :P
That day was an absolutely amazing day :-)
was seated next to Morten during \$foodtime, chatting with him was a really nice opportunity, and really interesting.
@Ven Oh, but now you need to get the new cheat sheet for version 16.0. It is the "Reference Card" the front row are holding in the picture you're talking about, right?
I'm the one reading it instead of looking at the camera :-)
@Ven Actually, if you use it to evangelize, maybe I should send you a few of them?
9:31 AM
@Adám I have a few students I got interested. Definitely would be amazing if I could get a few ones!
@Ven How many do you want? We have an entire shelf of them.
@Adám I'm not sure how many is reasonable, to be honest? I have a dozen stuff I got set up with the education version of dyalog (before the personal version was free), so about a dozen would be the greatest :)
but I can understand it's a bit much
It'd be really nice if someone could order them, but I can understand it's not something a lot of people do...
@Ven I just talked with our documentation manager to see if we can publish the PDF so people can print them. Problem is that they use an odd paper size…
True
Well, keep me posted. It'd be amazing to get a single Reference Card already :-).
@Ven I've filled an envelope with 12 Reference Cards. Now I'm just waiting for your address to arrive.
9:45 AM
@Adám Wow! That's great. Sent an email to adam at dyalog :).

2 hours later…
11:18 AM
@Ven lol my Star wars APL quote is included in a Dyalog presentation. WTF
@Fatalize \o/
11:29 AM
@Ven OK, sent. 12 cards should be by you in a couple of days.
@Adám I have no idea how to thank you, but if I do meet you I'd love to pay you a beer/coffee/tea/... and talk about APL :).
@Ven Now that Dan can't go ;-( maybe I will…
@Ven Remember Dan Baronet? He's standing by the door in the photo.
11:34 AM
@Ven Yes.
Oh no...
I didn't know :(. My condolences :(.
Found it...
I remember him as very nice and very forward.
12:24 PM
Is there a character limit for the input fields on TIO?
Can I give an input list with 1000 integers? 10,000?
It was a bit slow, but 2381400 zeros worked at least.
Why 2381400? Because ctrl+a, ctrl+v, ctrl+v + ctrl+a, ctrl+v, ctrl+v + ctrl+a, ctrl+v, ctrl+v + ctrl+a, ctrl+v, ctrl+v + ctrl+a, ctrl+v, ctrl+v ...
@StewieGriffin Well, somewhere, 2MB had to be transferred.
I know... :) I just wanted to test if there was a 30k limit or something (like SO has).
I feel a bounty coming on... :)
12:34 PM
I'm thinking about making a challenge where the test cases are very large, so I can't post the test cases in the question itself.
@Lembik Why? Where?
and why.. because it's a nice question that needs clever coders :)
Good morning, everyone o/
12:54 PM
@J.Salle Quebec?
Brazil
yeah here it's almost 4pm
0

90 % fail this challenge! I guess I'm not the only one that have seen this kind of image on Facebook (and other sites). The picture above was posted 12 days ago, and has accumulated 31 k comments. Some answers: 0, 4, 8, 48, 88, 120, 124 and so on. Challenge: The mathematics in the question...

@EriktheOutgolfer 2PM
you're in gmt I guess?
12:58 PM
GMT +1 I think?
I think gmt has daylight savings too
Maybe, yeah
@EriktheOutgolfer UK time, whatever that is.
I'm in GMT-3 and it's 10am here