« first day (2776 days earlier)      last day (2060 days later) » 

Anonymous
12:05 AM
@Pavel collections.deque with the maxlen arg
 
Thanks!
 
Anonymous
But it doesn't support slicing, so that may not work for you
 
Anonymous
Also random access is super slow
 
Also check array for an array with fixed element type (but not fixed size)
 
@Mego Basically, I've gotten too used to C#, and going over to Python makes me incredibly paranoid about potential type errors and whatnot
Numpy's ndarray is both fixed-size and fixed element type, so I think I'll go with that
 
12:09 AM
For type checking, you might want type annotations added in Python 3
though you need a separate IDE (say, PyCharm) to actually run static analysis, etc.
 
I think there's a tool called mypy
 
Fine then
 
12:38 AM
Hi all!
 
Hello! What's up
 
I was wondering how to shorten this piece of code in JavaScript:

f=v=>(y=Math.sqrt,x=(y(8*y(v)+1)-1)/2)%1?0:x
I am attempting this challenge on CodeWars : codewars.com/kata/build-a-pile-of-cubes-code-golf/train/…
The code works well but is way ahead of the 34 bytes cap
Could anyone help?
Can it shortened or do I need to change my approach?
 
I don't suppose you can use **.5 instead of Math.sqrt?
 
Wow, I had completely forgotten about that operator, returning to programming after so many days!! Thanks. Now I got:

f=v=>(x=((8*v**.5+1)**.5-1)/2)%1?0:x
It's 36 though
 
-2
Q: java programe of array searching and sorting

Jay PatelWrite a java console application that allows the user to read, validate, store, display, sort and search data such as flight departure city (String), flight number (integer), flight distance (integer), flight price (double) and discounted flight price (double) for N flights. N should be declared ...

 
12:48 AM
@Arjun You can take out inner /2 to delete a pair of parens
 
And that seems to barely meet the cap!
 
@Bubbler Didn't quite understand that. How do I do that?
 
@Arjun Think about this: what smaller expression is equivalent to x/2%1 == 0?
 
1:10 AM
@Bubbler What is it? :P
 
@Arjun x%2==0
@Arjun well it's pretty new to JS
 
@ASCII-only Wouldn't I be required to add/2 at the end of the ternary expression (...?0:x/2), no?
ok, I understood what you all meant
f=v=>(x=(8*v**.5+1)**.5-1)%2?0:x/2
That's just 34 bytes! Hurray!
Thank you all
 
@Arjun TIO pls
@Arjun what's the minimum for JS rn? is 34 the limit?
 
@ASCII-only yep
@ASCII-only just a min
 
i've been thinking about changing my username.... hm
 
1:22 AM
@DestructibleLemon To what?
 
IndestructibleLime
 
i don't know
 
IDontKnow?
 
Has a nice ring to it
 
:D
 
1:26 AM
@Arjun :|
 
beep changed username and profile, been meaning to do that for a while
 
how about i colour invert my icon and be Wadestructible lemon
hmmm
 
hmmm
 
jsbin =/= tio
 
1:30 AM
I am not that experienced with TIO
Since JS has got several online playgrounds
:)
 
haha nice
 
2:16 AM
@ASCII-only @Downgoat what ever happened to cheddar?
 
@ConorO'Brien been working on VSL but work has stagnated because of school and also because implementing generics is hard
 
2:28 AM
I hate it when I get really proud of an elegant and well-golfed solution, and then see that there's a really trivially obvious approach that I missed completely and my original solution is about 5x longer than a sensible non-golfed implementation of the obvious approach.
It's like making a rube-goldberg machine fit in a cubesat when you could've just used a paperweight.
6
 
2:40 AM
CMC: Implement A249354 without using numbers in your source code
 
@ConorO'Brien You still have a zero at the end
 
Anonymous
@ConorO'Brien Actually, 11 bytes: ;;;τ+;(*+u*
 
@ConorO'Brien Clean, 73 bytes
 
@ConorO'Brien JavaScript: n=>n*((b=(a=+!![])+a+a)*n*n+b*n+a)
 
2:51 AM
@Bubbler 'abc'⍳'ddba'
 
Hooray for predefined zero and one constants
 
or just ⎕A⍳'DDBA'
 
I'm pretty sure I could actually do it with only whitespace, letters, and =
 
Jelly, 7 bytes: “¤¤¢¡‘ḅ
 
Isn't NaN a number? :)
 
It also works with other 3-byte built-in objects, say Map or Set
Direct translation to Japt gives 12 bytes
 
4:41 AM
One might find this useful: sum(1**2..n**2) == (2*n**3 + 3*n**2 + n)/6
 
5:36 AM
has anyone made a syntax highlighting theme for jelly yet
I would but I have zero knowledge of jelly syntax
 
6:26 AM
can someone link me to a proof explaining how the golden ratio identities make sense:
$$ \sqrt {1+{\sqrt {1+{\sqrt {1+{\sqrt {1+\cdots}}}}}}} = 1+{\cfrac {1}{1+{\cfrac {1}{1+{\cfrac {1}{1+\ddots }}}}}}$$
 
take x = 1/(1+1/(1+1/(...))).
Then x = 1 + 1/x
x^2 = x + 1
For the other one:
x = sqrt(1+x)
x^2 = 1 + x
The solution that makes most sense to this quadratic, in the context of the original expression in phi
 
huh ok
 
 
1 hour later…
7:38 AM
Morning
I'm back
 
Morning
 
 
2 hours later…
9:20 AM
1
Q: A simple matrix puzzle

ArnauldDefinition Given a matrix \$M\$ of non-negative integers and a non-negative integer \$k\$ we define \$F_k\$ as the function that removes all rows and all columns in \$M\$ that contain \$k\$. Example: $$\begin{align}M=\pmatrix{\color{magenta}6&\color{magenta}1&\color{red}5\\1&2&\color{magenta}8...

 
10:19 AM
\o/ just noticed I joined the 30k club
 
@Mr.Xcoder Congratulations! :)
 
@Emigna Thanks :) Btw, I wonder how short an answer in 05AB1E would be here
 
Looks interesting. I might give it a try later if I have the time and no one beats me too it. My gut says that it likely won't get the shortest solution though :P
 
Hey, how do I use TIO to run multiple tests at once?
 
You can use the footer, but that depends on the language
 
10:25 AM
But yeah, not sure how to use it with Mathematica
 
'A simple matrix puzzle' is not a very descriptive title... Maybe I should change that to 'Chop off the matrix and get the correct sum' or something along those lines?
 
Okay, something like that should work, thanks
 
@Arnauld I like that. I had Discard the intruders in a matrix to get the desired sum in mind, or something among those lines. I like yours better, though
 
@Mr.Xcoder I like the notion of 'intruders', but that's a bit long. Thanks for your feedback. :)
@Mr.Xcoder Maybe 'Chop off the matrix to get the desired sum'?
 
10:33 AM
That's good too.
 
@Mr.Xcoder well done :-)
@Arnauld maybe Kick the intruders and their comrades out? :P
 
@EriktheOutgolfer That's neat, I like that more than the current title.
@EriktheOutgolfer Thank you! You're very close too
 
eh, it's not like I really care about joining "x∈[0,9],y≥4:x*10^y clubs" or anything
 
@EriktheOutgolfer Neat but not a lot more descriptive than my initial title. ;)
 
so you want a pretty descriptive title
how about Remove excess rows and columns?
but it doesn't incorporate the way they're removed
 
10:44 AM
And it doesn't cover the sum to $S$ either :|
 
the sum is kinda implied
> I have 2 oranges and 3 oranges. how many oranges do I have?
like, that notion of "totality"
 
@NewMainPosts I have a feeling that some Jelly-er will wreck the leaderboard there using multidimensional indices.
 
@EriktheOutgolfer Well, I'm happy with the current title even if it's not particularly fun. Updating the title several times in a row is probably not a very good idea, so I'll make sure to ask before posting the next time. :)
 
Tbh I expect the Jelly solution to be less than 15 bytes
 
looks like somebody's strict with their titles
:P
 
10:49 AM
@Mr.Xcoder Of course it will, Pyth can't win a challenge lol
 
 
3 hours later…
2:07 PM
Jelly has multidimensional stuff now?
I have waited so long for this :D
 
@HyperNeutrino ?
 
like multienumerate and multiindexer
this makes things SO MUCH nicer
not sure how long it's been here since it's been a while since i've done anything of this sort in jelly
 
@HyperNeutrino Sounds APLy.
 
@Adám indeed
 
2:22 PM
What do you guys think is the easiest golf language to learn? I wanna try something new...
@Pavel miles late, but i use pip freeze — local | grep -v ‘^\-e’ | cut -d = -f 1 | xargs -n1 pip install -U
 
@Quintec Not a golfing language, but APL is easy to learn.
 
Currently losing to both 05AB1E and Pyth, but my approach is rather naive right now so that should change eventually (I do think Jelly might have the advantage here, though 05AB1E might still win. Not sure yet).
 
2:39 PM
@Adám I'm assuming Dyalog is trustworthy enough for me to provide it with my address... or should I just use unregistered Dyalog, or how should I run APL?
I'm a bit confused already, lol
 
@Quintec You can absolutely trust us not to abuse your personal data. We only need it to ensure you don't use the product for commecial purposes.
@Quintec You can also start learning APL on TryAPL or in The APL Orchard.
 
Thanks for all the info
 
APLs are tasty
 
@HyperNeutrino My family and I are the APL Jews, but we like APLs as well.
 
lol :P
 
3:14 PM
hi all
if you have n line segments, what's the maximum number of intersections you can have?
 
can segments share the same orientation (be right on top of each other) :]?
 
no
 
aw
 
:)
but actually I am not ever sure that helps
I think the answer might be (n^2-n)/2
or something like that
 
if more than 2 lines cross at the same point, are you considering that multiple intersections or just one
 
3:19 PM
just one
 
0
Q: How can i get the number after point on double?

user82687Ex i input 10.98 and i want to display .98 but the answer on my code is 0.98. Can someone help me? Thanks Double numOne,numTwo; System.out.print("Enter a decimal num: "); numOne= Double.parseDouble(br.readLine()); numTwo = numOne - Math.floor(numOne) ; System.out.printf("%.2f", numTwo);

 
@Anush seems like each additional line is able to intersect all previous lines
something something basket weaving
 
3:43 PM
Expressif just released their ESP8266 (a very popular and fast microcontroller) successor. It's about 50ct more expensive ($5), but has 1 more CPU core, double the CPU clock freq on all cores, 4x bigger flash and 131x more RAM. Exciting times.
 
 
3 hours later…
7:01 PM
So Microsoft had a rather significant outage yesterday. So they "fixed" it:
> As part of our follow-up remediation actions stemming from the issue reported under service incident MO147606, an update was introduced to the components that manage authentication. We've determined that this update has resulted in users receiving a message indicating they are being throttled when attempting to access Outlook and Skype. We're reverting the update to remediate the problem.
 
7:23 PM
The problem being that users were being notified?
 
The problem being that you get a pop-up stating "Throttled" and that's it. You can't access your email.
Also, A+ for rolling out a code change in the middle of the business day.
 
it's always the middle of the business day somewhere in the world
 
Sure, but don't roll out the code change to the NA cluster in the middle of NA business day. You don't need to roll code at the same time worldwide.
 
7:39 PM
"I'm a student"
 
8:38 PM
i love that post
 
9:01 PM
do you think romero would block me if I just tweeted the word "daikatana" at him
 
 
1 hour later…
10:09 PM
0
Q: What did we forget?

W WYour task is to write a non-empty computer program comprised of some sequence of bytes. If we choose a particular byte in the program and remove all instances of it from the program, the modified program should output the removed byte. For example if our program were aabacba Then bcb would o...

 
10:30 PM
I'm continuing my Windows kernel experiments and I'm glad to say I'm making good progress on adding a Brainf#ck subsystem, so one can run BF code with a single syscall.
5
 
I've always wondered how you actually run kernel code. Do you just use a spare computer? A VM?
I mean, you could run it on your primary machine, but I imagine the chances of ruining it would be quite high
 
I mean the actual kernel, not code in kernel mode. The way it works with the Windows kernel is that you build it, place it (the init, HAL etc.) into System32 and use the boot-switch kernel to load your new custom kernel. Depending on the destructiveness (do you get a GUI or not), you can do local kernel debugging on the machine itself or attach another PC via Serial and debug over that.
VMs help :)
 
Anonymous
@mınxomaτ You're doing good and important work.
 
My thoughts exactly.
This is my favorite of the comments I've encountered today (in the LSA audit log code):
// Post NT5 auditing will provide a better/flexible design that will address
// this issue. For now, to delight some valuable customers, we provide this
// hack / registry based solution. This solution will be removed post NT5.
 
11:22 PM
@mınxomaτ Dang
 

« first day (2776 days earlier)      last day (2060 days later) »