« first day (1935 days earlier)      last day (2901 days later) » 

3:06 PM
cool
chat is dead
 
All rooms must die.
 
What is dead may never die?
 
How do you kill that which has no life?
 
3:09 PM
Death is but the next great adventure.
 
@Geobits Java
Tables in HTML
 
@Rainbolt with a wooden stake?
 
I'm pretty sure both those are still used. You can debate their merits, of course.
 
@Geobits regex parsing HTML.
 
I'm not sure if that's even a thing. More like a verb.
 
3:12 PM
@EᴀsᴛᴇʀʟʏIʀᴋ H̳̻̓̋͐ͤ̀Ế̴̘̼́̈́̒͗͒͑̂́ ̨̥̗͍̦͈̙͓ͦͤ̽C̗͍̠̝͔̾ͣ̚Ơ̛͈̙̪͈̭̜̩̫̋ͭ̄ͭͪ̓͢M̵͓̼̤̠̰͍ͯ͑E̵ͮ͑ͥ͋̒̃͌ͯͮ͏͕̭͔̦̱͎̥̰S͓̠̿̾̔ͩ̈́͋̀̈͠‌​̰͎̞
 
:-)
 
By the way, perfect use-case for increasing the speed of the video.
 
I've just noticed. My retrocomputing profile has 1 gold, 2 silver and 8 bronze.
 
3:28 PM
@wizzwizz4 I wish there was a badge level between bronze and silver.
You could get 1 gold, 2 silver, 4 <badge level between bronze and silver> and 8 bronze!
@Doorknob Can you please status Babble?
 
indefinite hiatus?
 
it needs 5 bronze instead
 
@Doorknob D:
 
@Doorknob -1 not sassy enough
 
@El'endiaStarman noice!
 
3:31 PM
@Quill $answer: eventually;
 
Well, I got a quantum fourier transform working.
 
@PhiNotPi Publish on the quantum playground.
 
Any suggestions what I should transform with it, if I run it on the actual IBM computer?
 
The first link goes to Code Review
 
3:37 PM
@EᴀsᴛᴇʀʟʏIʀᴋ it probably strips the unicode out
 
@El'endiaStarman language design. A common problem is "count the number of times you do X until Y is true". Is there some sort of syntax that would make this better?
aka, the common solution is:
x = 0
while (cond):
    x++
    other stuff
x = count (cond):
    other stuff
that could work
 
@zyabin101 I'm not sure how to do that.
I have the IBM "quantum score"
 
>_>
Ah, so you have the quantum score. I don't know how to do that.
 
@zyabin101 qCAD supports that AFAIK.
 
@NathanMerrill Hmm. That is a pretty common pattern.
 
3:44 PM
@PhiNotPi How does it look?
 
@El'endiaStarman it whitespace significant in your language?
regardless, the really cool thing about making while loops return the number of times they iterated
 
@mınxomaτ Where is qCAD?
 
is that if they didn't iterate at all, they return 0 (falsy)
 
@NathanMerrill Only for separating tokens.
 
so you could do
 
3:45 PM
@PhiNotPi You can gist the code output of the score.
@zyabin101 qcad.osdn.jp
 
if (!while(cond){
    do stuff
    }){
    do if while didn't run
   }
 
@mınxomaτ Ah.
 
Implementing programming languages is fun.
 
h q[2];
cx q[1], q[2];
h q[0];
t q[1];
tdg q[2];
t q[0];
cx q[1], q[2];
h q[0];
h q[1];
t q[2];
t q[0];
h q[2];
h q[0];
tdg q[2];
tdg q[0];
h q[2];
h q[0];
t q[2];
tdg q[0];
h q[2];
h q[0];
t q[2];
tdg q[0];
h q[2];
h q[0];
tdg q[2];
t q[0];
h q[2];
h q[0];
t q[2];
t q[0];
h q[2];
h q[0];
t q[2];
cx q[0], q[2];
tdg q[2];
h q[2];
tdg q[2];
h q[2];
t q[2];
h q[2];
tdg q[2];
h q[2];
tdg q[2];
cx q[0], q[2];
cx q[1], q[2];
h q[1];
h q[2];
cx q[1], q[2];
h q[1];
h q[2];
cx q[1], q[2];
cx q[0], q[2];
 
One possibility is to keep track of how many iterations loops ran for and provide that to the user through the use of a special command.
 
3:47 PM
yeah, but then you run into scoping issues
but considering your use of ~ and _ that doesn't seem to be super important to you
 
Could restrict them to scopes like other variables.
 
while(){
   stuff
}
while(){
   otherstuff
}
if you wanted to access the count of the first while, you'd need to do a a = magic command before the second
 
Usage notes: the input qubits are [q2,q1,q0] and the output qubits are [q0,q2,q1] in those orders (most-significant first).
 
also true for inner loops
 
@NathanMerrill Not if you treat it like the error array in .NET or Java or whatnot
 
3:50 PM
keeping an array of values?
way too much overhead
 
@NathanMerrill I'm not sure what you think ~ does (maybe you're thinking of ~>, which indeed used to be ~, which feeds an initial argument list into a chain of functions), but _ will always take values from a special "feed" list provided by the outer scope.
 
Well, having the user wanting how many iterations a loop ran is already asking for some overhead.
 
Oooooh, just installed qCAD.
It's cool.
 
For loops basically give you that automatically. You can usually look at the value of the loop variable.
 
Problem solved - only allow for loops
 
3:52 PM
So maintaining such an array of iteration counts would have as much overhead as changing each while loop into a for loop.
 
@El'endiaStarman I may be wrong with ~, but I'm not a huge fan of auto-assigned variables like _, firstly because they seem like magic, secondly, because they have scoping issues.
 
I now have a simulated quantum computer at my hand.
Without registration or sane graphics card.
It's wonderful.
 
for range():
    for otherrange():
       a = _
    b = _
 
Who likes old computers?
Note: I am not selling any.
 
I followed the retrocomputing beta in A51 but I never got into the site once it launched
 
3:55 PM
@Quill You can join now!
 
I mean, in the first case, its easy to see what a is
 
I joined the site, I just never got around to contributing
 
but b?
 
@NathanMerrill Oooh, I should've put "scope" into quote marks. a there would come from otherrange() and b would come from range().
 
but do you scope outside of loops?
for range():
    for otherrange():
       a = _
    b = _
    c = a
is a defined?
 
3:56 PM
@zyabin101 I see. I still like having control to edit the HTML at will and knwoing what my program does
 
@NathanMerrill Yes. a is just a normal variable.
 
therefore, _ has weird scoping rules
it magically gets assigned
when you leave a loop
 
@Quill Contribute if you want free badges. I got a gold one on my first post!
 
Let me translate your code into Python.
 
actually, do you have shadowing of variables at all?
 
3:58 PM
@wizzwizz4 meh
 
@zyabin101 it's a BF interpreter iirc
 
for x in range():
    for y in otherrange():
        a = y
    b = x
    c = a
No mystery now is there?
 
"Gold badges" -> "meh"
?!?
 
right, but you're using _ twice
 
@Zgarb whoa. that's interesting.
 
3:59 PM
_ is only "fed" from what it's inside.
 
It's not getting re-assigned, it's just context switching.
 
right, the inner loop _ is shadowing the outer loop _
 
HAI @CᴏɴᴏʀO'Bʀɪᴇɴ
 
but that doesn't happen with any other variable
for range():
    a = 1
        for otherrange():
            a = 2
    b = a
 
4:02 PM
If I was a betting man, I'd wager that the compiler/interpreter in the background is treating them as two separate variables, like how El'endia explicitly pointed out.
 
You would win that bet.
 
Just because it's a shorthand notation for "the current thingy" doesn't mean it's a literal variable _
 
probably
but it feels and acts like a variable
actually, what happens if you try to assign to it
 
TIL avocet is a bird.
The four species of avocets /ˈævəsɛt/ are a genus, Recurvirostra, of waders in the same avian family as the stilts. Avocets have long legs and long, thin, upcurved bills (giving their scientific name Recurvirostra) which they sweep from side to side when feeding in the brackish or saline wetlands they prefer. The plumage is pied, sometimes also with some red. Members of this genus have webbed feet and readily swim. Their diet consists of aquatic insects and other small creatures. They nest on the ground in loose colonies. In estuarine settings they may feed on exposed bay muds or mudflats. The...
@AlexA. are you sure you are a magpie, not an avocet?
 
@NathanMerrill That'll error, most likely.
 
4:03 PM
An avocet.
 
In PowerShell it's treated as a variable.
 
@NathanMerrill it works
 
It's meant to convey the concept of "fill in the blank".
 
at least, in the REPL
Python 3.4.2 (v3.4.2:ab2c023a9432, Oct  6 2014, 22:15:05) [MSC v.1600 32 bit (In
tel)] on win32
Type "help", "copyright", "credits" or "license" for more information.
>>> _ = 5
>>> _
5
>>> _ = -3
>>> 3
3
>>> _
-3
>>>
 
PS C:\Tools\Scripts\Golfing> 1,2,3|%{$_;$_=0;$_}
1
0
2
0
3
0
 
4:05 PM
@CᴏɴᴏʀO'Bʀɪᴇɴ In the Python REPL, yes.
We were talking about Pytek's _.
 
Just like how with a for loop you can re-assign your counter variable.
 
so, lets say I wanted to use the squares of 1 through 10
 
Though Nathan was using Pythonesque pseudocode.
 
that's why :p
 
4:05 PM
for range(10):
    _ = _ * _
I couldn't do that
 
So if Pytek should make any lick of sense, it should follow already established standards. And if Python and PowerShell both agree on something, it's pretty much an industry standard. ;-)
 
I'd have to do
for range(10):
    a = _ * _
 
Why not just stick _^2 wherever you would put a?
 
@TimmyD there are often good reasons to break standards. I'm ok with breaking standards, as long as its for a good reason
 
>_> it's probably a proof of concept
 
4:07 PM
@El'endiaStarman you're trying to save calculations
 
@TimmyD I decided long ago that Pytek wasn't necessarily gonna follow any traditions or standards. :P
 
aka, you're going to use the value multiple times throughout the function
 
@CᴏɴᴏʀO'Bʀɪᴇɴ Nothing is greater than the current item is greater than nothing
 
Well, then what's the problem with assigning to a new variable? You usually have to (or should) do that anyway.
 
@TimmyD that sounds like a python comparison
0>x<0
 
4:08 PM
I could make _ assignable. We'll see.
 
@CᴏɴᴏʀO'Bʀɪᴇɴ You typed >_>
 
@El'endiaStarman there's technically no problem. Programmers simply often do that using the same variable, but it would be surprising if it didn't work on _
 
@TimmyD ... ah
 
but that said
 
so _ is the current value in a for loop?
 
4:09 PM
I think if you are going to _ magic, you should make it act different
so, I'd be in favor of it not being assignable
 
Alright, that was my original plan.
 
_ is a placeholder variable for "current item" in lots of languages
 
@CᴏɴᴏʀO'Bʀɪᴇɴ That's one use, yes.
 
Ah
I second the idea of nonassignable
 
@TimmyD && is logical AND in lots of languages too. ......except Python. (And Pytek.)
 
4:10 PM
just making sure you realize the implications :)
now, back to my original idea
a = for something():
 
Not PowerShell! We get to use -and and -or etc. We do get to use ! for logical-not, though.
 
or while
 
@NathanMerrill Yes, the problem of knowing how many times a loop ran.
 
it basically makes for/while loops a function that returns the number of times it ran
 
@TimmyD -and and -or look like flags. is that why?
 
4:11 PM
Well, Minkolang has the command i that pushes the loop's counter on the stack.
 
@mınxomaτ so... my fourier transform works great in the simulator, but terrible on the real device, like totally wrong.
 
@El'endiaStarman hmmm, the current counter is useful, but it doesn't ever contain the number of iterations
 
@CᴏɴᴏʀO'Bʀɪᴇɴ Kinda. There's a whole slew of operators that have - at the front ... -replace ... -split ... etc.
 
aka, if & stored the current counter, you'd have to assign it to a variable in the loop, and then add one after the loop
 
@TimmyD is that because the parser looks for a symbol then a string of letters or something?
 
4:13 PM
@NathanMerrill Yeah, to do that, I basically push the counter and then break the loop.
 
for some_gen():
    a = &
iterations = a+1
 
Really, it seems to me like the main problem with keeping an array of iteration counts is that it's a little harder to get counts of inner loops. So you could either "scope"-restrict or make the array a little more magical by allowing some sort of indexing to get the count of the inner loop.
 
@CᴏɴᴏʀO'Bʀɪᴇɴ I think it really stems from the fact that | represents the pipeline, and since PowerShell is a shell/language hybrid, the pipeline is really important. As a result, something other than || would be needed for "or", so I think the operators followed from there.
Do note that -not is valid, too, we just get an alias with !
 
Like I've said before, the overhead will be minimal, I think. Just convert every while loop to a for loop and you basically have that exact same overhead.
 
@TimmyD oh. couldn't they've built the parser such that two || is a pipeline? I don't think two pipelines could appear next to each other... right?
 
4:16 PM
Possibly. It's certainly a style decision, and they probably just chose this for clarity.
 
@CᴏɴᴏʀO'Bʀɪᴇɴ I think the point is that they took the shell they already had and integrated a language into it. For backwards compatibility reasons, they chose not to make the pipeline token something else.
 
for some():
     for this():
          ...
     for that():
          ...
how does that work with arrays?
 
@El'endiaStarman Ah
 
Supposing that the loops ran twice, thrice, and once each, maybe you could have...
magicarray[0] # 2
magicarray[0][0] # 3
magicarray[0][1] # 1
 
@mınxomaτ I don't know if you can see this link, but here is the realistic simulation and here is the actual execution.
 
4:19 PM
This can be done with a custom Python class, incidentally.
 
I don't understand that array
so, the first #2 indicates that some() ran twice?
 
but if it ran twice, then why didn't this() run twice
 
@PhiNotPi Nope. Can't see. Can you share it somewhere (screenshot etc)?
 
....oh, hmm. Well, my thought was that this() ran thrice the last time, which is the behavior you'd have when you looked at for loop variables.
 
4:21 PM
ok
if I'm inside some(), then is magicarray[0] equal to 3?
assuming I'm on the second iteration?
also, what happens if that() runs the first time, but not the second?
does it have a value? or is the the count of the first time?
even better question. What happens if that() runs the first time, and this() runs the second?
@El'endiaStarman ^
 
hmm
@NathanMerrill ...yyyes? I suppose so? It could 2 instead, or 1 if it's the first iteration. That would probably make more sense, especially if you consider this in the sense of copying for loops with counters as their variables.
 
wait...
 
@mınxomaτ okay, so here is the "ideal" result (keep in mind bits 2 & 3 are swapped)
 
@NathanMerrill I would presume that magicarray[0][1] == 0 because it didn't run.
 
4:28 PM
@El'endiaStarman I should clarify. By "didn't run" I mean that there was an if statement that surrounded it that was false
 
@Zgarb or @quartata (J programming) I can use jconsole <file.ijs> to run file.ijs before entering the environment, but I want to perform a calculation on command line arguments--can I do this? Say I want to add 5 to an argument.
 
Here is the "realistic simulation." There's a lot of noise, but the central hump is still slightly visible.
 
@NathanMerrill Either 0 or None. I guess that's something that would have to be sussed out in actual usage.
 
huh
 
4:29 PM
Here are the actual results:
 
@El'endiaStarman this wasn't what I mean. Inside the loop, magicarray should be [0,1], otherwise, my code has to care how many loops I'm currently nested inside
@El'endiaStarman so, your code is going to look at my code in advance, and count the number of for loops, and then build an array of that size
for some():
     if False:
         for neverrun():
     for willrun()
 
As you can see, the large percentage of 000 makes me think my program was too long for their computer to handle.
 
after some(), magic array will contain {3, {None, 4}}
 
@NathanMerrill You're making my brain hurt with the smartness and thinking things.
 
sorry :)
 
4:32 PM
:D
 
@PhiNotPi Well, the significant point are still clearly visible. The only result that breaks it is at 000, all other scale very well and have almost a uniform noise floor. I guess the execution time is too long and it get's too noisy
ninja'd ._.
 
A multi-dimensional array of arrays?
No, that won't work.
 
@mınxomaτ The percentage of 011 is totally out whack, more so than everything else.
 
\o/ I found out how to use localhost!
 
actually
oooh, this is cool
 
4:34 PM
Assign each loop to a hashtable entry, where its index is its name plus the name and current-loop-count of the parent.
 
let magicarray be equal to the value of the last statement of the for loop
for some():
     4
b = magic_array
then, b would be an array of 4s
you could call len(b) to get the number of times it ran
and for loops are natural maps
as far as getting inner loop counts, who cares
 
@NathanMerrill @{'some1this'=2;'some1that'=1;'some2this'=3;'some2that'=1;'some'=2}
 
gross
you really want to write code to parse that
 
I didn't say it was pretty, I just said it was a solution.
 
you have to start writing splits just to use the builtins
lol
 
4:37 PM
Implementation is left as an exercise for the reader.
 
enumerate = for some(){
    (&, _)
}
^ that's still my favorite way of doing it
 
what is the significance of "ETIANMSURWDKGOHVF L PJBXCYZQ" in everything in the morse code translator challenges? I can't figure out how some of the programs work, specifically the c# and golf script answers which seem to use a similar technique
 
also
is there another term like yield or return?
(like a synonym)
it sets the return value
but doesn't actually stop the flow
oooh
keep
no, report
yeah, that's the way to do it
 
4:58 PM
@Quill or @Downgoat -- in node js, I have an array of RGB values. How do I save that to a file/convert that to base64 as a PNG?
 
no idea
 

« first day (1935 days earlier)      last day (2901 days later) »