« first day (2090 days earlier)      last day (3048 days later) » 

Anonymous
00:01
@feersum If new == old, then the value is 0. But, there are an infinite number of alternative possibilities, so new == old has probability 0.
The number of possibilities seems finite to me. You can only store so much code in the observable universe.
Tip: add . to $PATH
Anonymous
@feersum If a number can't fit on a chalkboard, it's essentially infinite.
?
then you can execute scripts in the current working dir
00:05
Someone made a thing where they put an executable file named ls in a directory.
That makes no difference since you can have a universe-sized chalkboard.
It wipes the home directory.
@DmitryKudriavtsev that dude shouldn't have access to your home directory...
they could've wiped it directly
no, it was like a flashdrive or something
and it should require sudo
00:06
open it, run ls, and bam
@noɥʇʎPʎzɐɹC Seriously, don't, just ./script is fine
actually, you own your home directory, so it does not require sudo
have fun losing all your files
If the attacker can insert foreign objects into your machine, you have probably already lost.
It's not the attacket.
For example, you pick up a flash drive.
Insert it (terrible idea)
If you're the attacker -- even worse!
00:10
I only insert random flash drives on a separate testing machine, and only after taking a btrfs snapshot
@feersum If so then gdb is lying to me
@Mego One second let me clean it up
There's no way to identify stack corruption in general.
Remember, the stack includes local variables, not only return addresses.
I can access all of the other members of the class though
@Everyone help, what order should uppercase/lowercase/numeric/whitespace/symbol be in for maximum compression for ASCII-art challenges?
Anonymous
00:13
@feersum Alright, fine. Since you want to make this more difficult than it needs to be, let's do the math. The universe can contain a maximum of about 10**123 bits (computing the Bekenstein bound of the observable universe). Therefore, the probability of two programs containing exactly the same number of bytes is 10**(-123). That's essentially 0.
#include <cstdio>
#include <vector>
#include <ucontext.h>

#define IDLE 0
#define RUNNING 1
#define DONE 2

class PytekGenerator {
public:
  std::vector<int> results;
  ucontext_t generator;
  ucontext_t me;
  int state:2;

  int operator[](int index) {
    state = RUNNING;

    while (results.size() <= index && state != DONE) {
      swapcontext(&me, &generator);
    }

    return results.at(index);
  }

  PytekGenerator() {
    state = IDLE;
    results = std::vector<int>();
  }
};

PytekGenerator* result() {
Sorry for the horrid C++
It's probably a ucontext thing. I'm going to try pthreads instead
It should be 1) symbol 2) kanji 3) hangul 4) lower 5) numeric 6) whitespace 7) upper
it's called cout
Hangul is really good if you need to draw space invaders.
But how would I compress Kanji/Hangul
00:14
The same way you compress other characters?
But I compress using base conversion
Anonymous
@quartata The issue might be due to the fact that your vector isn't marked as volatile
Anonymous
Also you never seem to initialize the me context oh wait swapcontext
I'll try marking it as volatile. It's worth noting that if you comment out the push it segfaults at the generator swapcontext so
->state is fine though
Anonymous
00:21
You might want to mark state as volatile also
Anonymous
Anything that can be changed by multiple threads should be volatile
Anonymous
That will keep the compiler from trying to be smart and "optimize" things (which actually breaks everything in multithreaded programs)
Weeell you should really never use volatile for multithreading...
Anonymous
@feersum Yeah, locks/mutexes are much better. But, volatile makes more sense in this case.
Yeah you should
00:27
As this case isn't multithreading at all.
Anonymous
Since contexts aren't quite multithreading - only one thread is running at a time, but you swap between them
I guess you can try throwing random voodoo at it such as volatile.
Anonymous
volatile isn't random voodoo
There's no clear reason why it should help.
Oh, are you working with interrupts?
00:29
No with something far worse
Anonymous
@feersum Sure there is - the problem could very well be due to hyperaggressive optimization by the compiler, which volatile helps solve.
ucontext
I need to read an image into an rgb array. which language should I use if python hates me?
@Mego Can you give an example of an optimization that could be problematic in this scenario?
@ConorO'Brien JS if it's PNG, JS if it's PNG/JPG/GIF
00:31
@ASCII-only command line.
Java's ImageIO is great
@ConorO'Brien brb adding image IO to cheddar and then responding here saying cheddar
@Downgoat :D please do
powerful, but easy image IO was one of first reason i made cheddar
one call and you have a bufferedimage that you can getRGB to your heart's content
00:33
I'm not making a java project to do a simple scripting task
groovy then
Then make 1 file in a text editor?
@ConorO'Brien I know Java gets a bad rep in general for verbosity but this is actually something it's good at and it's super short
Sample:
@ConorO'Brien ;_; y u not use node + npm module
@Downgoat because png-js will be the third module tried.
@ConorO'Brien They don't work?
@ASCII-only if they did I wouldn't be trying more now would I :P
@Downgoat ninja'd
@ConorO'Brien Why would they not work
Anonymous
@ConorO'Brien Python doesn't hate you. pip install pillow && python -c 'from PIL import Image; img = Image.open("whatever.png"); print([[img.getpixel((x,y)) for x in range(img.size()[0]] for y in range(img.size()[1])])'
ImageIO.read(file url...).getRGB(x, y)
ez
00:38
sure it does. `'pip' is not recognized as an internal or external command,
operable program or batch file.`
I tried installing pip. it uninstalled itself
@ConorO'Brien python3 -m pip install pillow
If you really dislike public static void main then just use Groovy
Anonymous
@ConorO'Brien You're using Windows. There's the source of your problems. Make sure your Python bin folder is on your %PATH%
@Mego it is.
Anonymous
Specifically, <python dir>\Scripts
00:41
import javax.imageio.ImageIO;

def image = ImageIO.read(new URL("file:///home/quartata/test.png"));

print image.getRGB(0, 0);
That sure was a lot of typing
Anonymous
Or just use Cygwin/alwsl and avoid all of those problems
@quartata dude i get it. bc I'm not responding to you doesn't mean I didn't see your messages >_<
Is alwsl finished? I thought he was still working on it
Just demonstrating. Not all the memes about JVM languages are true
@quartata I honestly like Java.
00:42
@DJMcMayhem For what I've seen it's usable-ish
Anonymous
@DJMcMayhem It's usable enough to run pip and simple Python scripts, from my understanding
@quartata I think I'll try groovy
@DJMcMayhem He is, but it's more than usable enough, it can run Firefox pretty well
@quartata But Groovy != Java
The memes about Java are true, but Java isn't the only language on the JVM
@Mego I tried slathering volatile in it and got a nasty compile-time error since apparently volatile std::vector is a different type
But somewhat amusingly
Not entirely sure how well Python/Ruby work in the JVM, but they may work as well
00:45
Putting volatile on state caused it to output garbage instead of segfaulting
Anonymous
@ASCII-only Jython works well, and interfaces nicely with Java
This happened to me before when state was always equal to idle
Strange things happen when you return five times I suppose
What signal does pause() wake up on again?
Any signal?
Looks like it
0
A: Sandbox for Proposed Challenges

OliverPieces of sushi Given a number N, print N pieces of sushi in the following way: 1st piece always looks like this ,;'''''''';, |',________,'| | | '.________.' Every next piece gets blocked a little by the piece before it and also gets moved a little up ,;'''''''';, ,;'''...

okay guys. I'm the biggest idiot ever to exist. I switched width and height in my svg so it looked weird all the time
I have a wonderful hack that uses four different language but does what I want
I think I'd cause a heart attack to CR
01:20
If I didn't screw anything up, these are the densest characters in Consolas:
 `.-':_",~^!=;><*\/+c?|rLvzT)s(J7[ti{}nuxlC3fI1oFY]yZ5ewajh2SkPE9Vbp6UdqKGmA4OHXRD8#B0M%N$Wg&Q@
(space at the beginning)
Help, what would the solution be for this in the ideal ASCII_art golfing language
@ConorO'Brien TIL space is one of the densest
densest at the end >_<
@ConorO'Brien You mean characters by density?
yes
calculated by summing rgb values :P
@ConorO'Brien 0/10 you could have just turned off ClearType/set hinting to high or whatever and counted the white pixels
01:24
huhwat
IDK, just without weird half-on pixels they would all have been either foreground or background color
> Remove as many characters as possible without changing the meaning of the condition
CS HW is PPCG confirmed
@Downgoat If you had a full code sample (i.e. with variable declarations) you could make it much shorter more unreadable
my god they are using ifs instead of ternaries why
01:30
@Downgoat Wait where
"Look teacher! I got it down to 49 bytes!" (rest of class: wait mine was like 232) "It's not a contest downgoat" "Oo, another one off!" "... what's wrong with you"
> downgoat
^^^ @Downgoat Oh no it looks like your teacher is onto you
I want to know your bytecount when you're done with it.
01:32
what good is that if you don't know what he started with ? :P
I'd guess ~400, it's Java (I think) after all
Hey @ConorO'Brien can you do that with 12 point terminus as well? (16px / 12pt)
@DmitryKudriavtsev terminus? is that a font?
@PhiNotPi 185 -> 41
yes. my favorite monospace fonts
01:35
@Downgoat Wait really? Can you post the initial snippet
@DmitryKudriavtsev is it a linux font?
boolean no = (ch[0] == 'N' && c[1] == 'O') ||
             (ch[0] == 'n' && c[1] == 'o') ||
             (ch[0] == 'N' && c[1] == 'o') ||
             (ch[0] == 'n' && c[1] == 'O');
oh, cool
clearly the book does not understand how to code
01:35
@ConorO'Brien There's a Windows installer
cool, will do!
@Downgoat Ouch, that's like anti-DRY
@Downgoat ch and c?
and she says a ^ 2 is syntax error even though its valid
(you're supposed to do Math.pow(a,2) but it is not syntax error...)
@Downgoat IIRC they do, statically typed languages suck
@Downgoat That's true
01:37
@Downgoat This is xor not power
@quartata WAT
shit now i look like idiot
;_______; i promise i am smart gaot pls
it's okay. we all are idiots, being programmers, but we're the smartest kind of idiot
...just make sure you thoroughly test whatever answer you come up with.
@Downgoat Why is there both ch and c
@Downgoat Is no their variable name?
01:39
@ASCII-only typo when copying from book
@quartata yes
@Downgoat Which one is it
@Downgoat end my suffering
burn that book for a start
01:41
Something like boolean no = ch.toLowerCase() == "no"? You might need a ch.substring(0, 2)/ch.slice(0, 2) or the Java equivalent
@quartata challenge: switch your code editor's font to the tf2 build font and try to make something
@DmitryKudriavtsev Here's the density table, least to greatest:
  .`:'-,;/^"~_|!+?i><vr7t(c)=s*j51}l{IJ23yezoa[f4]Lxu#V0Tn96YFqCb8wSd$AUpkghPZ%EGNOX&mRDKBHQWM@
@ConorO'Brien Which font? Source uses a couple
Is ` really more dense than .
also I use vim
@quartata Terminus
01:44
ok
:O Coda added powerline fonts
@ConorO'Brien @PhiNotPi the density for consolas is in this reply, it makes a bit more sense
@quartata sorry can't, id have to pay huge fine
ok, sorry, didn't see that one
also fireplace is borked atm
01:46
@Downgoat Oh no you need to push a bugfix for your fireplace ASAP
@ConorO'Brien Thanks!!!
my pleasure :)
Who needs a fireplace? Just soak it in gasoline, put it in a metal bin outside and chuck a match in it
If you're feeling ambitious you could try dynamite instead. Bury it with a few sticks on a long fuse
@ConorO'Brien Do you like the font though?
I'd use it, but it doesn't have great unicode support
01:50
@Downgoat Oh wait a second your fireplace == Cheddar?
CMC: golf a>=90?'A':a>=80?'B':a>=70?'C':a>=60?'D':'F'
@ASCII-only ;_;
btw pls use === so my fireplace does not type cast to cheese
@Downgoat which language?
idk, C/C++/Java
i would use array but afaik int[]{} syntax is too long
@Downgoat Oh no too late
01:55
@Downgoat "FFFFFFDCBA"[a/10]?
You need an extra A for 100.
@ASCII-only no werk in java ;_;
You said C was fine.
what font does hastebin use?
a>=60?'A'+9-a/10:'F' doesn't work for 100
01:58
When this question's title appeared in my sidebar, at first I thought it was a heavy metal lyric. — Crashworks 4 hours ago
user image
6
@quartata
oh god
@PhiNotPi I switched it to terminuson my PC
@ConorO'Brien What is that font called?
Woops, a>59 saves a byte
(For science, of course)
02:01
@DJMcMayhem TF2 Build I think
@Downgoat What happens
I got it off the tf2 wiki
@ASCII-only bork
@PhiNotPi For what? Code?
@quartata output number no string
02:01
@Downgoat Bork how
It's what TF2's default HUD uses for item names
@ASCII-only bork meaning full bork (i.e. syntax bork)
this piece looks like c code: vr7t(c)=s*j51}l{IJ23yezoa[f4]Lxu
@Downgoat Output char not number
@Downgoat That's what chars are.
Although it shouldn't promote to int. Oops
Replace 'A' with 65 and cast to char
02:03
@Dennis just the link above, since the character density didn't seem to match the font, although that may be a local setting.
@ConorO'Brien Comic Papyrus please
(char)(a>=60?74-a/10:70) works :D
that's a thing? ಠ_ಠ
@Downgoat a>59
@Downgoat Can you give context/more of the code
You may be able to do char foo=a>59?74-a/10:70
@PhiNotPi The CSS file just says monospace, so it uses your browser's default, whatever that is.
@Downgoat Doesn't work for 100 though.
02:06
nobody cares about 100 anyway :P
i have never had grade of 100 anyway
I think even with a second ternary for that it still would be shorter though
so clearly it is bad test case
You know you'll get an F for golfing your homework right
that was the prompt tho
a>59?a>99?65:74-a/10:70
02:09
@ConorO'Brien ...soo I really just did his homework for him
I've broken the golden rule of SE
Damn.
RIP quartata you're going to be forever exiled from SE now or something
:D tyvm
@quartata I have a quick math question: do my hw
02:11
brb pinging quartata for all future HW assignment
What is with groovy? "Spaceship operator" "Elvis operator"
@ASCII-only Hey, the Elvis operator is great
And spaceship comes from Perl
Works without input, but it gets mad if I add the -i flag.
Also, what are all those non-ASCII characters doing in your source code, @ASCII-only?
2
I'll just leave the wrapper as canonical as possible so you can add CLAs in any way that's needed.
02:29
@Dennis Like what
@ASCII-only origin of the spaceship operator name, as retold by the creator himself: groups.google.com/a/dartlang.org/d/msg/misc/WS5xftItpl4/…
@Dennis What do you mean, that probably means I either broke the encoding or they're part of the AST printer, or syntax because Charcoal uses ASCII almost exclusively for string literals
@Dennis Thanks!
@ASCII-only ¶P×⁸M⁵↓⁺×⁸¶UB
(Source code of the example program, not the interpreter.)
The programs? The same reason, ASCII is used only for strings and multiple directions
02:37
Just a pun on your username. :P
@Dennis Oh, oops, that's a bug - I think I've fixed it, will push once I figure out what the best default charset for compression is
OK, just give me a heads-up when I should pull.
@Dennis Whoops, fixed
@Dennis whoa what's your halloween effect, it look so cool
02:53
Inverted colors and altered hue/saturation.
Hue 140, sat 70 iirc.
My halloween effect is a 360° no-scoped version of my normal avatar.
Fond memories of green monochrome monitors.

« first day (2090 days earlier)      last day (3048 days later) »