« first day (1999 days earlier)      last day (2845 days later) » 

12:00 PM
this is why i love C
#include "p1.h"

int main(int argc, char** argv) {
    if (argc < 2 || argc > 3) {
        printf("Processor/1 VM\nUsage: p1 <file> [memorysize=1024]\n");
        return 0;
    }
    size_t msize;
    if (argc == 3)
        msize = atoi(argv[2]);
    else
        msize = 1024;
    FILE *handle = fopen(argv[1], "rb");
    if (handle == NULL) {
        fprintf(stderr, "FATAL ERROR: Unable to open the specified file.\n");
        return 1;
    }
    fseek(handle, 0, SEEK_END);
    size_t handlesize = ftell(handle);
i think directly loading the file in p1->memory can be more memory efficient
and also remove a lot of free dom
 
2
Q: Draw a ladder and slide

atlasologistYour task is to create a program or function that takes, as input, a natural number (n) between 1 and 25 (inclusive) and prints an isometric representation of a slide and ladder with n number of rungs. Ladder and slide specifications The ladder is always oriented on the left and the slide on th...

 
ven
@aditsu are you against "strange" codepages?
 
12:23 PM
@LeakyNun alright there's my hard challenge
 
@orlp On PPCG?
 
well duh
 
1
Q: Sort a list of unknown values with the least amount of comparisons

orlpIn this optimization challenge you will write a program that sorts a single array by only comparing elements through asking the user on stdout to input comparison results on stdin. The below protocol is line-based, so everytime you print to stdout or read from stdin it is assumed a newline follo...

 
12:46 PM
every R, RI and RR instructions are implemented
\o/
 
now there is the RRR and the support of the IVT
and i will push it on my github
but without a assembler /o\
 
12:59 PM
ah
flaw discovered
:(
 
@Poke mon
 
@zʏᴀʙiɴ101 mon
 
my mouse is borked D:
 
@ven depends what you mean.. I am against non-ascii characters in language syntax
 
ven
@aditsu yeah? why?
 
1:05 PM
yeah
they're hard to type and even read
 
@aditsu some unicode chars can be typed via a US International keyboard, and a compose key can type almost everything.
 
ven
well, I guess I've done too much APL and Jelly and probably Agda by now...
 
@zyabin101 Now it's both :) — orlp 27 mins ago
:)
Cross-version for the win! (CVFTW - Share the love!)
 
ಠ_ಠ
 
from __future__ import print_function
:)
 
1:18 PM
IVT *p1_i_parse(Processor1 *state) {
    uint64_t ip = state->IP;
    if (ip == state->__ivt_cache.IP) return state->__ivt_cache.table;
    if (state->__ivt_cache.table != NULL) free(state->__ivt_cache.table);
    IVT *ivt = malloc(sizeof(IVT));
    uint64_t size = p1_m_read(state->memory, ip);
    ivt->size = size;
    ivt->vectors = malloc(size);
    size_t pointer = ip;
    for (size_t i = 0; i < size; i++) {
        ivt->vectors[i] = p1_m_read(state->memory, pointer);
        pointer += 8;
    }
ಠ_ಠ
god wat
 
from __future__ import time_machine
time_machine('back', 50, 'year')
 
@LegionMammal978 SyntaxError: future feature time_machine is not defined (<pyshell#0>, line 2)
In three words: not a chance.
But good joke :D
 
from __future__ import poll_results
print poll_results(2016, 'President')
 
SyntaxError: depends on country
 
import antigravity # work on python 3
my mouse is crazy ._.
 
1:22 PM
@TùxCräftîñg On Py2, works too.
 
import __future__
__future__.__import__('antigravity') # compatibility
 
each 10mn my computer start playing music with the sound when a peripheral is plugged in and when a peripheral is plugged out
 
@TùxCräftîñg and when a peripheral is plugged all about
 
AttributeError: 'module' object has no attribute '__import__'
 
i have sended a entire traceback
you just the exception
 
1:24 PM
Maybe I need to go further into the future
 
ninja invalid
 
D:
i was using python 3
and you python 2
 
import __future__
__future__.__import__('__future__').__import__('antigravity')
 
Python 2 is best python
 
s/2/3/
 
1:25 PM
^
 
s/3/2/
 
sharpens pitchfork
 
AAAAA
 
s/(2)/$1+1/
 
Wait, I figured it out! How to import Python 5.3:
future = __import__('__future__')
while future.__version__ < 5.3:
    future = future.__import__('__future__')
 
1:28 PM
tr/23/32/ or whatever the syntax is
 
@LegionMammal978 ಠ_ಠ
 
from __future__ import tron
tron.grid # returns a blank grid ._.
 
segfaultpython = lambda: print("O HAI!")
while 1:
    segfaultpython = segfaultpython.__call__
^C
 
from __future__ import past
 
ok now i must have a assembler to continue testing P/1
i am testing the IVT and i must run a lot of instructions
and coding in a hex editor is... hum...
instrs = """NOP-S
RET-S"""
tab = {x.split("-")[0]:x.split("-")[1]for x in instrs.split("\n")}
._.
 
1:48 PM
All, please move discussion about the ability or lack thereof of mechanical buttons to disagree with the President to Skeptics Chat. — Dawn 18 hours ago
 
Wow Skeptics chat is really inactive
 
i have a assembler now \o/
LI 0 1
LI 1 "ord('H')"
INT 0xFF
LI 1 "ord('i')"
INT 0xFF
assemble, execute and correctly print Hi to stdout \o/
 
2:04 PM
but i think the B instruction is borked in my VM :(
but...
> The first register operand is a mask to be applied to the CR. The second register operand contains an address to where to branch if all the bits of the mask matches the Control Register. For example, if R1 contains 00 00 00 00 00 00 00 04, the processor will branch if the last arithmetic operation gave 0 or the last comparison was equal (bit 61 of the Control Register is on).
WTFFF
o hai @Dennis
 
You know, Googology Wiki might have a googolquadragintiplexibit of a problem when naming their numbers...
 
@TùxCräftîñg Could you please stop pinging people for no reason?
 
ven
Okay I need a good RSS client for mac... Preferably open source. Any candidates?
 
@Downgoat JS/Cheddar thinks weird things.
 
2:15 PM
@orlp nice
 
Does anyone know of a good quick pastebin where you can easily paste stuff and get a raw link and it'll delete itself a few days later?
Or should I write one myself?
 
@thepiercingarrow http://pastebin.com
 
@LeakyNun Oh cool. The API is a bit complicated though...
 
@thepiercingarrow ptpb.pw
It's got a great CLI.
 
hmm
thats cool
Thanks!
 
3:11 PM
It's real quiet in here...
 
Any more feedback before I post meta.codegolf.stackexchange.com/a/9605/8478 ?
 
@MartinEnder Do it.
 
^
@MartinEnder Is the format a chameleon?
 
3:17 PM
No, I'm hoping that both the sequence generation and the ASCII art are important components of the challenge, because most languages will probably be better at one of those two, so I figured it would be interesting to mix them up.
 
@MartinEnder you can say that to those who do think that it is a chameleon
 
And it introduces the component where it's not obvious whether it's better to generate top/bottom and middle separately or to generate the entire thing and then separate out the bisections.
 
@LeakyNun I updated the script in the question
to also add flushes
and I also updated the Python script I posted
try grabbing both versions
and see if it works then
 
3:32 PM
@MatthewRoh 10/10
@thepiercingarrow sorry, i was sleeping
 
@orlp would appreciate if you can include the script in pastebin
because all your tabs are converted to spaces
 
@LeakyNun I use spaces
3
not tabs
 
@orlp what are you doing with your life?
 
@LeakyNun that's a deep question
 
@orlp nope.
 
3:40 PM
@orlp s/spaces/sane indentation/
 
@Downgoat -1
@orlp bubble sort should be n*(n-1)/2 ...
 
@LeakyNun what if you use python 3?
 
@orlp I use python 3
 
@LeakyNun I said it was the simplest version
that doesn't check for termination
@LeakyNun what happens when it hangs and you ctrl+c
 
3:43 PM
@orlp no, you just don't need to check the already sorted ones
like
after the first pass, the last is guaranteed to be sorted
@orlp nothing
 
@LeakyNun what?
 
@orlp literally nothing happens
it doesn't terminate even if I press ctrl+c
 
what if you kill the child process
 
@orlp how do I do that?
 
through process list
ctrl + shift + esc
 
3:47 PM
Traceback (most recent call last):
  File "q85941_quicksort.py", line 2, in <module>
    size = int(input())
EOFError
: C:\Users\******>EOF when reading a line
@orlp
 
-3
Q: Send me an E-mail without the letter e

tuskiomiThe challenge is simple, send me an email with the text ("I'm " + [username] + ", and I did it!") without using the letter 'e' in your source code. If your username has an e, you're allowed to filter it out. the Email you have to send it to is "12f7b2c5@opayq.com". 1) I must get an E-mail for y...

 
@NewMainPosts you shouldn't post questions with -3 vote here
 
@LeakyNun try bufsize=0
 
@orlp where?
 
@LeakyNun instead of bufsize=1
 
3:49 PM
@LeakyNun are you kidding me...
 
@MartinEnder what is the problem
 
what's the point of the comment after we just discussed this in here?
 
@MartinEnder because not everyone reads the chat history here.
 
@FryAmTheEggman ninja'd
 
heh, one-second difference
 
3:57 PM
To be fair, I think yours is a better explanation, rather than just my anecdote :P
 
@orlp Done, thanks.
 
@FryAmTheEggman The anecdote is probably more convincing though :D
 
@LeakyNun did that work?
 
@orlp yes, thanks
 
3
Q: Generate Pascal's Braid

Martin EnderThis is Pascal's Braid: 1 4 15 56 209 780 2911 10864 40545 151316 564719 1 3 11 41 153 571 2131 7953 29681 110771 413403 1542841 1 4 15 56 209 780 2911 10864 40545 151316 564719 I totally made that up. Blaise Pasc...

 
4:02 PM
@FryAmTheEggman why not post your answer?
 
Oh, it was really bad, also I don't have it anymore, would have to write it again
~50 bytes in Pyth IIRC, if you want a base line
 
@FryAmTheEggman alright
@orlp can we delete our comments?
 
@LeakyNun sure, don't forget to change your other answer
 
@orlp that one still has compatibility problem
because I don't have Python 2
 
@LeakyNun works fine for me after adding flushes
from __future__ import print_function
import sys
size = int(input())

def cmp(a, b):
    print(a, "<", b); sys.stdout.flush()
    return [1,-1][bool(int(input()))]

array = list(range(size))
array = sorted(array,cmp=cmp)

print("a", " ".join(str(i) for i in array)); sys.stdout.flush()
copy that into your answer
score is 23471
 
4:07 PM
@orlp I don't copy things with no tab
 
on my system
 
> You score your program by typing python score.py yourprogram.
should be really the command not the program right
@orlp care to send me each score?
 
@LeakyNun can be samething :P
btw your analysis isn't appropriate for quicksort on average
 
@orlp teach me
 
4:16 PM
@orlp is lg base 10?
 
@Fatalize I'm trying to add Brachylog to TIO (sorry for the delay, things have been kinda crazy here), but I need a little help. I seem to have compiled Brachylog successfully, but I can't figure out how to run programs.
 
@Dennis Have you tried this?
?- run_from_atom('>0,?=$pl1',Z).
 
@LeakyNun don't know
 
@orlp it is base 2
 
bit confused though
>>> sum(1.39*n*log(n, 2) for n in range(1,101))
41624.45167614378
>>> sum(1.39*n*log(n, e) for n in range(1,101))
28851.87132167273
 
4:21 PM
@orlp but this
 
@LeakyNun That seems to work (not sure what it does), but I need to do it non-interactively.
 
@Dennis then write a program to do it for you
@Dennis it's right here
@Dennis So Z seems to be the input
 
No it's not
 
@LeakyNun I've never used Prolog in my life, and I'm pretty lost right now.
 
@Dennis The instruction is also there
 
4:22 PM
Z is a variable that is unified with the output
 
@Dennis just read the README
 
You should probably let Fatalize help you out with this, you're going to have to sanitize the input pretty carefully and stuff
@LeakyNun no, it's going to be more complicated than that
 
@quartata alright, i'll step out then
 
Since sometimes output comes from STDOUT with w and sometimes it's from the Output output
hmm
 
@quartata Oh dear, I'll wait for Fatalize then.
This is the most-starred chat post in the Jelly room. ಠ_ಠ
in Jelly, Apr 1 at 18:42, by Dennis
I don't understand my language. ._.
5
Of course, complaining about stars attracts stars...
 
4:31 PM
yesterday, I had a post that got starred then unstarred, twice
 
Does anyone else remember Rokenbok? A toy company that used to be moderately (?) popular a decade ago, looks like it's downsized and rebranded as an educational company.
 
> Infinity|0
< 0
OK, I guess that makes sense.
Wait, no, it doesn't.
 
...I'll take that as a "no" to my question. Anyways, I just remembered that it existed, which brought to mind two things: 1) RIP my childhood. 2) Whatever happened to those half-dozen robot-based challenges I was planning on doing?
 
@PhiNotPi lol
 
@Dennis what
 
4:36 PM
s/h//
 
@Dennis how do you prevent malicious code from taking down the server?
 
@Dennis The scariest part is that must be hardcoded
 
@NathanMerrill Most recreational programming languages can't really do anything harmful. Some of them required a few fixes or a safe mode though. The only production language I have installed right now is Julia, and it's sandboxed. I want to sandbox all interpreters at some point, but the tool I'm using right now doesn't play nice with some languages.
 
Or maybe it's JS's weird type coercion
It probably coerces Infinity to an int or something
 
JS doesn't have ints. Infinity and 0 both have type number.
 
4:41 PM
Yeah but internally doing bitwise or casts it to int I think.
That's why asm.js does x|0 for integer parameters
 
@Dennis I'm here!
@Dennis I implemented an extra predicate so that you can call brachylog, programs outside Prolog's REPL
 
Great! How do I use that?
 
just a sec
 
Right now I'm working on a LEGO-WeDo-inspired language, and I'm trying to see if WeDo 2.0 (the sucessor to the version I have access to) has any important language features to incorporate... unfortunately Lego is very secretive about their software. They go as far as to censor out the names of the programming blocks in their publicly-available "software tour".
 
Also, quartata mentioned input sanitation. Anything I should be aware of?
 
4:47 PM
@MartinEnder Try doing it in Retina!
 
@Dennis do you pass a file path to the code?
 
@Dennis If you use run_as_atom you pass the input as a string, meaning you need to at minimum escape things
I don't know what this other thing Fatalize is talking about is
 
@Dennis swipl -g "consult('brachylog.pl'),run_from_atom_no_file('w',\"Hello world\")" -t "halt"
 
@PhiNotPi wait, how do you program in WeDo if you don't know the names of blocks (which is how you call them, I assume)?
 
If you give the path to the code it's slighly different
 
4:49 PM
@Dennis Why can I foresee that you will surpass my answer, just by translating my answer to Jelly
or using a similar approach
 
@NathanMerrill I have access to one version of their software, I was trying to see what features the second version had.
"Blocks" because it's a drag-and-drop interface for elementary-school kids.
 
@Fatalize That works. How would it go with a file? That sounds easier wrt input sanitation.
@LeakyNun What answer?
 
2
A: Generate Pascal's Braid

Leaky NunPyth, 44 bytes The number generation took 20 bytes, and the formatting took 24 bytes. jsMC+Led.e.<bkC,J<s.u+B+hNyeNeNQ,1 1Qm*;l`dJ Try it online! jsMC+Led.e.<bkC,J<s.u+B+hNyeNeNQ,1 1Qm*;l`dJ input as Q .u Q,1 1 repeat Q times, starting with [1,1], ...

 
@Dennis swipl -g "consult('brachylog.pl'),run_from_file_no_file('filename',Input','Output')" -t "halt"
In input and output you need to escape double quotes if there are any
there will not be single quotes in it
(I mean there shouldn't
 
I'm curious; what does run_from_file_no_file mean?
 
4:52 PM
run_from_file but without generating a file
I know it's a terrible name
basically it doesnt generate the transpiled Prolog code of the Brachylog code
 
@PhiNotPi I'm assuming that the blocks are the only way to program (or can the program in text-based format)?
be in*
 
@Dennis For inputs and outputs, basically there can only be none of the two, the Input, or both
hat's why I was talking about customizing inputs and args on the UI
 
What if there was a plant that produced carbon tetroxide?
 
It has some interesting quirks: First, it is really "simple" and doesn't even allow nested loops, and there's really only a single accumulator variable to use. Second, it directly supports multithreading and it has several I/O "channels."
 
4:54 PM
You can pass 'output' as an argument? I don't think I understand.
 
That's one big molecule you have there.
3
@NathanMerrill Yes.
 
@PhiNotPi so it has multiple accumulator variables, but each on their own thread?
 
@Dennis Yes, it's basically a standard name because it's usually used to "return" things but you can set both the input and the output
 
@NathanMerrill One shared accumulator. I'm not even sure if, with those restrictions, it fully meets the "definition of a programming language."
 
And if you want to get the value of Output, you need to give a variable name as Output
 
4:55 PM
that's actually an interesting premise for a language, stripping most functionionality, and doing everything multithreaded
 
@Fatalize Being able to read input from a file or from STDIN would be easier for me, but I guess I can manage without. I'd just have to escape quotes, right?
 
@Dennis e.g. if your code is ., input 1 and output Z, then it will print Z = 1, but if you instead set Output to 1 it will print true.
@Dennis yes
 
I have two main options when it comes to language design: the "purist" approach where I try to support as much of the original functionality as possible (even stuff like turning motors which don't really exist). Or, I can add support for many more variables, allowing it to actually be able to do stuff that a normal programming language can (like primality checking, etc).
 
Any way to get rid of the trailing true. in the output?
 
4:59 PM
@PhiNotPi I'd personally prefer the latter
 
@Dennis Not for now (but it should only print in some situations anyway). I will implement something so that you can indicate at the beginning of the program whether you want it or not
 
Well, I can just pipe to head -c -6.
 
No, because then if you run a predicate "check that the input is prime" then it wouldn't print anything
(it can also print false if the predicate fails)
 
@Dennis why not just pass the trailing true to the browser?
 
@Dennis (No problem for the delay btw)
The trailing true/false is meaningful because it indicates that the predicate suceeded or failed, which is used in "return a truthy value" type of challenge. It's only a problem (it doesnt print when input or output are variables) when you want to write only a specific string to stdout using w
 
5:07 PM
Crap, my internet died.
 
Liar, you're here
 
Only because I tethered my phone.
OK, I'll leave the true. Would it be possible to pass a command as input that reads from a file or STDIN? Escaping quotes in Bash is harder than I thought...
 
I can make it so that it reads the input and the output from a file
if that's easier for you
 
That would be a lot easier, yeah.
 
i'll need a few minutes then
 
5:11 PM
No problem.
 
@NathanMerrill That's what I was thinking. I'm assuming all variable will be global (otherwise the whole "no nested loops" thing means it's hard to get the variables to do anything useful). Also, the original software does multithreading by having multiple programs running at once (with programs able to start other programs) but it doesn't allow multiple copies of the same program to run at once.
As in, starting a program that's already running resets the execution of that program to its beginning.
 
huh
that's also unique
I just assumed it would be ignored
you could use that to your advantage: wait for program X to do Y, then restart it before it does Z
 
I thinking I'm going to keep that functionality.
 
do actions have a well-defined execution time?
 
I'm going to try to measure that.
 
5:21 PM
1
Q: Validating a CPR number

DanielValidating a CPR number A Danish CPR number (Person Identification Number) is date of birth followed by 4 digits (the last one being a control digit): DDMMYY-XXXX The final digit validates the CPR number using Modulo 11 by satisfying the following equation: where the are the ten digits of t...

 
I think they do, because they are "slow." The simple operations (like addition) take a fraction of a second, but if they didn't have a set execution time, then it would be nearly instantaneous.
Less certain to me is exactly how multithreading works.
 
@PhiNotPi likely real multithreading
aka, each part runs a different program
 
In an ideal world it would be fake multithreading that I could measure and replicate.
 
windoze people: what app do you recommend for transferring files easily from android to windoze in a local network?
 
@Dennis You can pull the new version of the file brachylog.pl
The command is now swipl -g "consult('brachylog.pl'),run_from_files_no_file('codefilename','inputfilename','‌​outputfilename')" -t "halt"
(run_from_files_no_file.... another terrible name)
 
5:37 PM
@aditsu I found this cool brick and mortar app called SDCard
 
bricks are not cool
 
@Dennis It expects that the file exists but is empty if the input and/or the output is empty
 
> If we are interested in telling a digital computer to translate texts from one language into another language, we are faced with two tasks. We first have to find out in detail how to translate a text from one language to another. Then we have to "tell" the computer how to do it. This paper is concerned with the second task. We will present here a specially devised language in which the linguist can conveniently "tell" the computer to do things that he wants it to do. (emphasis mine)
^ From a paper from the late 50s, before string-processing languages existed
 
is it ok to tag a popcon with ?
 
@dorukayhan which in particular?
 
5:44 PM
@dorukayhan technically, yes, but only if challenge needs it (which I doubt)
 
@dorukayhan if the popcon is about generating fixed output then of course you should tag it with .
 
> A valid date is a date that is valid date
 
tryitonline:prolog_parser# ls
brachylog.pl              hw                  string_predicates.pl  transpile.pl
cat                       math_predicates.pl  symbols.pl            utils.pl
compiled_brachylog.pl     o                   tests.pl
constraint_predicates.pl  predicates.pl       tokenize.pl
tryitonline:prolog_parser# swipl -g "consult('brachylog.pl'),run_from_files_no_file('cat','hw','o')" -t "halt"
ERROR: Prolog initialisation failed:
ERROR: Unknown message: 'The file does not exist.'
 
wat
 
0
Q: find combination of array values

tim3ini have an array having values as following char values[]={'A','B','D'}; and a key value char myKey = 'A'; i want to find all possible combinations of myKey with the array values based on input level for example if input level is 2 the result should be AA, AB, AD and if input level is 3 th...

 
5:48 PM
Feature request: Make the The file does not exist. message state the filename.
2
 
Fun fact: In JavaScript, 9007199254740992 is the largest integer. In Python, it is a small long.
>>> 9007199254740992
9007199254740992L # notice the L meaning long
 
@zʏᴀʙiɴ101 is there a long long?
 
>>> longlong()

Traceback (most recent call last):
  File "<pyshell#1>", line 1, in <module>
    longlong()
NameError: name 'longlong' is not defined
Nope :)
 
@zʏᴀʙiɴ101 exactly
 
5:50 PM
@Dennis Error messages like these are why Pytek will have pretty descriptive error messages. It's annoying to get an IndexOutOfBoundsError on a line with three indexings, so you have to do more work to figure out which one is the problem.
 
@Dennis does swipl -g "consult('brachylog.pl'),run_from_file_no_file('cat','"test"','"test"')" -t "halt" work on an empty cat file?
(note that this time it's from_file and not from_files...)
(should print true.)
 
ERROR: Prolog initialisation failed:
ERROR: Unknown message: 'Incorrect variable format.'
 
so far I found "WiFi File Transfer" by smarterDroid, seems acceptable
 
@Dennis this one actually swipl -g "consult('brachylog.pl'),run_from_file_no_file('filename')" -t "halt"
(Sorry for that mess)
 
@El'endiaStarman how are you going to solve the index out of bounds error?
 
5:58 PM
@Fatalize That prints true..
 
as it should
 
I mean, if you put a line number:character number, that's already been done, and most people ignore the character number
if you put the function that's being called, that's also been done, its called a stack trace
 
@Dennis I don't see any reason why it would say that the input or output file doesn't exist, when it works for the code file, it's the exact same predicate that reads files
do you have read access on the input and output files?
 

« first day (1999 days earlier)      last day (2845 days later) »