« first day (2042 days earlier)      last day (2787 days later) » 

3:00 AM
i can kinda see why dbc is calling it less arbitrary and cleaner in a sense, but i imagine that in general it wouldn't make the programs themselves look cleaner
 
@TheBitByte I think it looks OK but I'd still leave it for longer so more people can see it
 
What's the best tool to convert .avi to .gif?
I just made a vim video, and I want to upload it to my answer
 
ffmpeg I think
 
“What’s the best tool to convert—” “ffmpeg
 
is that on windows?
 
3:05 AM
Sure
It works from the command line, though!
 
Can ffmpeg do gif? Trying to remember
 
That's fine by me. Even though I'm a microsoft peasant, I'm perfectly comfortable from the command line.
 
121
Q: How do I convert a video to GIF using ffmpeg, with reasonable quality?

Kamil HismatullinI'm converting .flv movie to .gif file with ffmpeg. ffmpeg -i input.flv -ss 00:00:00.000 -pix_fmt rgb24 -r 10 -s 320x240 -t 00:00:10.000 output.gif It works great, but output gif file has a very low quality. Any ideas how can I improve quality of converted gif? Output of command: ffmpeg -i...

 
That sure beats uploading a 45 MB .avi to an online converter >_>
 
which probably uses ffmpeg as the backend
 
3:07 AM
can ffmpeg trim mp3s without reencoding?
also, can it remove metadata?
 
@quartata Are you sure I should leave it for longer? I was going to press post right now, until I read your chat post.
@NathanMerrill Actually, what can't ffmpeg do? Haha.
 
Holy shit there's a lot of options...
 
It's overwhelming
 
wow, it can do my metadata task too
yeah, its totally the tool
(I asked because I used to do a name-that-tune with a music community I was involved with)
 
3:09 AM
Yes of course. You should leave it for 24+ hours so people from other timezones can see it
 
@NathanMerrill I hate CLIs, though. Gotta look up a manual each time. Clicking icons is so much better.
 
so I would trim thousands of songs, remove all metadata, and upload them
@TheBitByte nah, CLIs make things so much easier to automate
 
@NathanMerrill Sure, but GUIs are easier to use and you don't need to keep looking at manpages to understand them.
 
So now the question is, what's faster, waiting for it to upload, or taking the time to understand ffmpeg?
 
@TheBitByte psh, its not that hard to do -help
 
3:11 AM
@NathanMerrill To do it each and every time, though, I wouldn't bother.
 
question: where did the [a, b, c] syntax for arrays originiate?
 
@quartata oh okay
 
@Downgoat Not sure. Neither C nor Perl use it so it might be more recent.
 
@Downgoat I would guess from math
vectors do it (in linear algebra)
like: [1 2 3]
 
Yay, I figured it out!
 
3:18 AM
another question. What is the point of * in int* x. Without the * wouldn't x point to a int-sized block of memory anyway?
 
@Downgoat right, but a) int sized != pointer size b) c is a typed language, the * is there so the compiler knows its a pointer and lets you dereference it and stuff.
 
@Maltysen but isn't everything a pointer in C?
 
no?
 
wait wat why not?
 
Yay, my first vim answer with a gif! \o/
6
A: End the tabs versus space war

DJMcMayhemVim, 37 34 bytes :%s/\t/ /g :%norm ^F r/hv0r*r/ Try it online! This uses the V interpreter because it's backwards compatible. A very straightforward solution. Here's a gif that lets you see the solution happen in real time. I added some extra keystrokes to make it run slower so you can s...

 
3:21 AM
@DJMcMayhem -1 your vim looks boring :/
 
@Downgoat int x = 5; designates an int sized peice of memory and sets it to five. int* y=&x; gives you a pointer to that peice of memory and stores it in another piece of memory called y
 
That's not what my real vim looks like.
Although you're right, I dislike the plain white background.
 
@Maltysen wait so: int *y = &x does *y == x?
 
yup
y is just storing another number, but this number is actually a pointer to x
 
so then does int really mean anything in this case? I assume a pointer-sized peice memory is allocated rather than an int's
 
3:24 AM
yeah
int is system specific size
likewise with pointers
 
int* tells the compiler the type of what the pointer points to for type safety
 
if you want to allocate more memory, then use long
 
@Downgoat My real vim:
 
@quartata ahhh ok. that's what I was wondering. thx
@DJMcMayhem :D I use dark theme too
 
:O which one?
 
3:25 AM
solarized >_>
 
@Downgoat cuz you can have things like int** x
 
wheee double pointer
 
@Maltysen oh my
such pointer very goat brain lost track
 
@Downgoat try writing a linked list :D
much fun, very pointer
 
Has anyone ever seen a triple pointer in production?
That would be a double pointer
assuming your implementation is sane
 
3:28 AM
so what's the type of a pointer?
int?
 
@quartata no yeah, you're right
@Downgoat no, its its own type
and its size is system dependent
that's why int y = &x; is so dangerous
 
@Downgoat Int or Long depending on system
 
you'll prolly cut off half the pointer
 
@Maltysen do i have to figure it out or is there some ptrsize_t kinda thing?
 
@Downgoat sizeof
 
3:30 AM
I want to do ptrsize_t myPointerArray[] = { &goat, &sheep, &dog }
 
What are you writing in C anyways?
 
well I'm learning C++ rn anyway but I decided to get a good grip on C before I do C++
 
@Downgoat c is better than c++. *ducks*
 
I want to rewrite cheddar in a not slow, un-portable, bulky, and generally shit language
 
They are kind of different animals with regards to references.
 
3:33 AM
@Downgoat I'm serious though, If you want to learn C, writing a linked list is actually a great exercise
 
To answer your question though you would probably do malloc(sizeof(&goat) * 3) and then assign appropriately
 
malloc returns a pointer though. How do I know what size variable i need to store that pointer though ._.
 
Lemme see if there is a type in stdint.h
 
size_t?
 
@Downgoat no a pointer
 
3:35 AM
Actually a better way is just to do type** goats = {...}
 
like animal*
(if that's your type)
 
Not sure if impressive answer or spam...
0
A: Emulate an Intel 8086 CPU

MicroCore LabsNot sure proprietary cores are welcome here :) but I wanted to post to say that this question/challenge was one of my inspirations in developing the MCL86 core. I was exited to see that I was not alone in my affinity for the Intel 8086/8088 as it was the processor in my first computer, the IBM ...

 
ok but what if I want an array of pointers. And those pointers can point to whatever type. I just need to know the size of a pointer to solve everything in this case
 
@Downgoat you don't need to know what size to store it in, * takes care of that for you, just like you don't need to worry about the size of an int when you do int x = 5;
like say its an array of int pointers: int** = {&x, &y, &z};
@quartata that reminds me, triple pointer can be used in a 3d array for like a rgb bitmap or something
it wouldn't usually be a triple pointer, but it's possible
and if you don't know what the pointers point to: void** = {&blah1, &blah2};
 
@Lynn was. hi?
 
3:42 AM
ooops, I'm off to bed (it's 5:41 AM here)
Was just wondering if there's any obvious improvements to the Perl answer I linked
But, I'll find out tomorrow, maybe! *waves*
 
4:34 AM
Hey, wanna ask you about something.

My challenge (http://meta.codegolf.stackexchange.com/a/9960/58717), I was planning to do an edit where code without input must produce a quine, but when given normal input it should work normally. Is this interesting or too hard?
 
@El'endiaStarman Technically what I did wasn't very appropriate (if I had some private way of contacting you, that would have been the better course of action) :P
 
SE is offline for maintenance.
 
@xnor Coming up with a Python cop? :D
 
5:07 AM
0
A: Sandbox for Proposed Challenges

Wheat WizardSCĀN DĀC|TȲLĪC | HĒXĂMĚT|ĒR ĪN | A ŪNǏQUĚ | PŪZZLĚ As a terrible Latin student for several years I have learned to hate many things about Latin. However there is one thing I love. Latin scansion. Latin scansion has many of rules. For this problem we will be using simplified subset of those r...

 
does anyone know what happened to the people's python?
 
github.com/HelkaHomba/ThePeoplesPython apparently redirects to github.com/DJMcMayhem/ThePeoplesPython now, and was last updated 7 days ago?
 
Aug 24 at 3:16, by Helka Homba
Anyone want me to transfer repo ownership of https://github.com/HelkaHomba/ThePeoplesPython to them?
 
5:29 AM
@Sp3000 Yeah, I took over it. I haven't done anything interesting yet
 
6:19 AM
@DJMcMayhem can I be apart of this peoples python thing?
 
@DestructibleWatermelon Yeah, absolutely! What do you want to be?
 
@DJMcMayhem lemme think
 
@Lynn s,\t| ,/**/,g;s;//;**;g
might be considered invalid, due to the s;//;
 
@DJMcMayhem I think I'll be slice cos I'm a watermelon
wait, I changed my mind since sliceis useless
 
@DJMcMayhem Oh wait I can be ascii now
 
6:30 AM
Haha, that would be perfect
Just gimme a minute before I update it
@DestructibleWatermelon What do you want to be?
 
still thinking
 
OK, well I'm about to head to bead so unless you want it some other day, think faster! :P
 
can i be ord?
 
Oh, I thought someone else already had that. Apparently not.
What do you want the text to be? Just destructiblewatermelon? (it should be all lowercase)
 
> bead
 
6:39 AM
heh obviously I'm more tired than I thought
>>> help(ascii)
Help on built-in function ascii in module builtins:

ascii(obj, /)
Return an ASCII-only representation of an object.

As repr(), return a string containing a printable representation of an
object, but escape the non-ASCII characters in the string returned by
repr() using \\x, \\u or \\U escapes. This generates a string similar
to that returned by repr() in Python 2.

>>>
It's perfect for you.
 
Also
I have a suspicion The People's Python's golfiness will be close to that of Java
 
haha, maybe worse.
range == drgreeneggsandhamdj
if == calvins
 
So on Leaky Nun's encouragement, I think I'll try my hand at making a language
Trouble is, I have no idea how to do it, and only vague notions of what I want out of a language
 
Nice! What type of language? Golfing, serious, silly, etc.
 
Golfing, I think. I'll probably use an extended ASCII page or something
 
6:47 AM
CP1252 is pretty good.
 
I know it will be called Oxide. I know I want to create arrays/lists/infinite sequences with something like C's for(i=0;i<10;i++) syntax but modified
I always liked that syntax. Don't know why lots of the other languages abandoned it
 
Are you going for "golfing but readable" like golfscript or J, or "As short as humanly possible" like Jelly?
Cause that syntax looks very sub-optimal, even with modifications
 
Something more like (<init vars>;<end condition>;<inside loop>;<post-processing>)
 
@Sherlock9 What are you talking about, every C-like language has that
 
@ASCII-only Yeah, I said lots, not all
 
6:50 AM
I don't think many abandoned it
It's because they never had it in the first place
 
My point exactly
 
I have no idea what it'll end up looking like, but you should make it not stack-based, to keep it more interesting. Everybody has their own stack-based golfing language, they're kinda getting boring.
 
It's nice syntax. I don't know why they didn't use it
 
It's because people that don't use C-based languages like their syntax different/doesn't like C-style for loops
 
@DJMcMayhem Definitely. I haven't decided on what the order of operations (RPN, infix, prefix) and what the data structure will look like (separate variables, like Jelly, like Pyth, like Actually's registers and not its stack)
 
Anonymous
6:52 AM
@DJMcMayhem :(
 
Those registers may work, actually.
 
Anonymous
Registers are a nice way of doing simple data storage, but they have a lot of shortcomings
 
@Mego ¯\_(ツ)_/¯ sorry. It's kinda true though
 
Anonymous
@DJMcMayhem To be fair though, I made Seriously before the massive influx of stack-based languages
 
You were the instigator of the trend, not the bandwagoner. :P
 
Anonymous
6:53 AM
Yep
 
sorta ninja'd
 
Anonymous
I can't control the copycats
 
Oh just press <Ctrl><copycat> in vim
 
But you can't deny that they're kinda boring now.
or atleast, new ones are
 
Anonymous
Man, I'm sad. One of the interview questions I had at Google would make a fantastic challenge, but I signed a NDA
 
6:55 AM
;_;
BTW, I was just about to ask you, how did it go? Do you know anything more?
 
Anonymous
Some of the interviews were easy, some were tough. Overall, it went very well. I'll know more probably next week.
 
So it was a whole bunch of separate interviews?
 
Does Adnan's Oasis language have conditionals yet? Many of the sequence challenges on PPCG involve conditionals at some point.
@DJMcMayhem CP1252 has some missing characters, though
 
Yeah, it's true. AFAIK there aren't any common encodings that map to the control characters
21 mins ago, by DJMcMayhem
OK, well I'm about to head to bead so unless you want it some other day, think faster! :P
G'night everyone!
s/bead/bed
 
Anonymous
@DJMcMayhem You could also make a conglomeration code page, where the control characters are the CP437 dingbats
 
Anonymous
7:00 AM
And also fill in the blanks in the 80-9F range
 
Back in the day, people got off perfectly fine making their golfing languages with only printable ASCII.
Since your actual interest in developing a golfing language is not that high, you probably won't run out.
 
Anonymous
Back in the day, people didn't consider the additional golfing benefits by having commands/functions that spanned the entire single-byte range, rather than just printable ASCII (or thought that the additional difficulty of writing programs was not worth the golfing benefit). Granted, if your main focus isn't golfing, then it doesn't matter.
 
Back in the day meaning like 2-3 years ago?
 
Of course they were aware of the possibility, but somehow it was considered too obnoxious.
Or even 1.5 years ago.
 
I think I'd rather focus on getting the main ideas up an running before deciding on syntax. This means deciding on the data will be structured and getting the main features off the ground
 
Anonymous
7:06 AM
I still need to start on British :P
 
Anonymous
I might work on that tomorrow
 
Anonymous
 
Lists, infinite sequences, uniq() and flatten(), all of the cool list/string slicing stuff that Python has with some additions, some numerical stuff but not as much, functions, sequences.
 
Anonymous
Generators are the bomb
 
Lots of the stuff Actually has, if you don't my mind borrowing it Mego, and some of stuff from other languages that I like and wish were in one language
@Mego Indeed, but I may not understand them well
 
Anonymous
7:10 AM
@Sherlock9 Go for it :) Seriously/Actually is MIT-licensed, which means, if you borrow the actual code, you have to attribute it. If you just want to borrow commands, that's fair game, since algorithms can't be copyrighted.
 
Anonymous
@Sherlock9 Are you familiar with the concept of a continuation?
 
@Mego Remind me, why are generators so cool?
No, I am not. And the MIT license is duly noted. Should probably figure that out for Oxide, too.
 
Anonymous
Alright so:
 
Anonymous
In classical functions, you have something like def foo(x): do_stuff(); return x.
 
Anonymous
When you hit the return, the return value is passed out of the function, and the function's stack frame is destroyed.
 
Anonymous
7:12 AM
If you call the function again, it starts over from the beginning, and doesn't remember anything from previous invocations.
 
Anonymous
(unless you hack that functionality in through global state, but that's another discussion)
 
Anonymous
A continuation is like a function, except when it returns, the stack frame is stored, rather than destroyed. The next time you call the function, it picks up where it left off, with all of its state still intact, and runs until the next time it returns.
 
Anonymous
Only, we call it "yielding" rather than "returning" for continuations - it passes a value out, and then yields to the rest of the program, not starting again until it is told to do so.
 
Anonymous
Generators in Python work off of the concept of continuations - rather than having a function that runs completely before returning a value and having its stack frame destroyed, generator functions yield values in the middle of running, and continue when allowed.
 
Anonymous
Generator functions also work with iter(), meaning they can be used as iterables for loops, comprehensions, and the like.
 
Anonymous
7:19 AM
The classic approach to computing the first N Fibonacci numbers in Python would be something like this:
 
Anonymous
def first_fib_classic(N):
 nums = []
 a,b = 0,1
 for i in range(N):
  nums.append(a)
  a,b=b,a+b
 return nums
 
Anonymous
There's an obvious problem here: for large N values, not only do you have to wait a long time to get the result (since you have to wait for it to complete), but you also have large memory usage.
 
Anonymous
Generator functions solve that problem:
 
Anonymous
import itertools

def fib_gen():
 a,b = 0,1
 while True:
  yield a
  a,b = b,a+b

def first_fib_gen(N):
 return itertools.islice(fib_gen(), 0, N)
 
Anonymous
fib_gen is a generator function that will compute and yield consecutive Fibonacci values, while using a constant amount of memory (since it doesn't store previously-computed values). first_fib_gen uses itertools.islice (which is slicing for iterators) to limit it to only the first N being generated. Best of all, the generator lazily evaluates the values - no computation is done until you iterate over the generator.
 
Anonymous
7:24 AM
 
Wow
 
^^ the first message I see in PPCG this morning…
@Dennis Could you please pull Brachylog?
 
I should probably use generators more often. First thing I can think of is improving the time it takes to calculate Bernoulli numbers
 
Anonymous
Generators are great for a lot of things
 
Anonymous
The itertools module uses them extensively
 
Anonymous
7:35 AM
Most things in Actually that look like lists are actually generators that are only evaluated and converted to lists when absolutely necessary.
 
Anonymous
Most of the bugs with list-based commands are due to it being a bit too lazy with evaluating the generators
 
Ah, that makes sense. Have those list command bugs been fixed, by the way?
 
Anonymous
All of them that I have found or have had pointed out to me so far
 
Oh yeah, I was going through the commands and checking them earlier but I don't think I finished. Should also get back to the Actually docs soon
Alright so my main ideas for Oxide are the C-like loop syntax (<init vars>;<end condition>;<inside loop>;<post-processing>) with post-processing being a place to put commands that work on the resulting list/generator/infinity, like uniq(), flatten(), zip(), reduce(), repeat_loop_with_this_list()
The other thing I don't like about Python is to operate on a list you're building, you have to do it in two statements.
 
Anonymous
@Sherlock9 What do you mean?
 
7:47 AM
<loop_condition>:
    <stuff_with_list>
    <add_to_list>
 
Anonymous
I don't understand - an example, maybe?
 
Yeah, I'm trying to remember one
Oh now I remember what I mean
Ruby let's you do assignments inside statements. Python does not
So Ruby has z=(i=n**2)+1 or something
Wait, that may be an entirely different point. Can I back to you in a few minutes after I sort my thoughts out?
 
Yis
I have successfully made a truth-machine in Logicode!
Is anyone on?
 
I am. I'm trying to pick my words carefully
What, incidentally, is a truth machine?
 
Does the truth machine have to output 1?
 
7:58 AM
0
A: Sandbox for Proposed Challenges

NeilWhat is my birthday? In the system of surreal numbers, every number has a birthday, which is used to resolve ties in the case of there being more than one surreal number that would otherwise satisfy an equation. The very first surreal number to be created is zero, written as {|}. Its birthday i...

 

« first day (2042 days earlier)      last day (2787 days later) »