« first day (2069 days earlier)      last day (2767 days later) » 

3:09 AM
@Downgoat How do I make a custom syntax highlighter for Gitbook?
 
:O C9 has Vim mode
@Qwerp-Derp simply write gitbook plugin adding highlightjs plugin
(or just find a language which highlights close enoguh)
 
So I just make a separate file with the highlight.js code?
How do I put the highlighting in MD then?
@Downgoat Halp pls
@PhiNotPi That's because Mars is 'uuuuuuggggggeeee.
 
Oreo's shake seems to be pretty healthy: imgur.com/a/mVgHZ
3
 
@JonathanAllan Don't delay, sun walking supplies are running out!
 
3:22 AM
:)
 
@mınxomaτ crustaceans!?
 
I know right. how
 
@mınxomaτ i.e. water for americans :P
 
@mınxomaτ Those crunchy bits ain't cookies
 
I mean that's almost one litre of pure diabetes.
 
3:26 AM
@mınxomaτ nah, 2600 calories is barely a single days worth :P
 
dumb question: how to login as root without sudo command?
 
su
 
wtf
root password is not wokring
 
@Downgoat Huh what do you mean? Open a login shell and login with username: root.
 
shit root user is locked after too many incorrect tries
halp what do i do
to unlock root user I need root perms
this is fucking stupid
 
3:29 AM
What? What system locks the root user?
 
^
 
apparently centos does
@mınxomaτ I've disabled root access over ssh
I have a terminal from DO
but that logs in as my normal vihan account
 
Use sudo -i then. But re-enable SSH root and disable login with password.
 
Long story short: I messed up /usr/bin perms so I can't use sudo
now I can't do anything to fix it without root perms
 
Reinstall.
You have been doing many, many things wrong to get to this point.
 
3:32 AM
like?
@mınxomaτ that's not exactly possible :/ this is the server running entire vihan.org and some other stuff
 
This may balm your Su/Sudo wounds @Downgoat
 
@Downgoat ...wow
is this a server you have physical access to?
If so, a live cd might work
 
@Downgoat Well if you didn't backup your server, that's your fault.
@Maltysen It's a DO VPS
4 mins ago, by Downgoat
I have a terminal from DO
 
Wanna know how I got here? NPM wasn't installing packages in correct dir so without thinking I did what an SO answer proposed and did chown vihan:vihan /usr/bin
or something like that
 
@mınxomaτ Do they let you boot from a recovery partition?
 
3:34 AM
yes
 
try that and editing back /usr/bin
 
ok ill try
@mınxomaτ I did do backup
but i relized a bit late and backup is messed up too
I think I should probably copy /www folder and try on new VPS
 
Why a new one? Backup, reinstall.
 
yeah but the thing is server is still able to correctly serve content and all so I don't want to shut it off rn
ok I've got into a recovery partion
but it doesn't have a /usr/bin folder
 
no, you mount the orginal partition
and work on the /usr/bin on that
 
3:40 AM
?
 
Mount the partition. Your /.
 
the recovery partition is like a completly different hard drive than your original one
you need to fix the original one
 
well yeah i know that much
am I not copying /usr/bin from recovery partion to original?
 
E.g. if / was on /dev/sda2, then mount /dev/sda2 /mnt and work there.
 
thats what i do when i bork my mac
 
3:41 AM
@Downgoat Well, you have to mount a partition before you can read it.
 
:| how do I find where mount is kept
they are like 100 stuffs in dev
 
@Downgoat Post the output of df -h here.
 
> df: invalid option -- 'h'
 
Just df then
 
3:45 AM
Uhm, what hard drives do you see in /dev ?
@Downgoat That means your main partitions aren't mounted yet. Now we need to find them.
 
can't exactly show all here because the list is getting truncated
 
Make a screenshot of ls /dev/s*
@Downgoat Yeah, probably not. You'd have to have hundreds of drives for that list to be trunced.
 
no sda stuff
 
@Downgoat Hm. Do ls /dev/v*
 
3:48 AM
Mount vda1
mount /dev/vda1 /mnt
 
do i need to mkdir /mnt?
 
Yes.
Damn, CentOS is weird.
 
:D ok my file system is in /mnt now
 
Are your files there?
 
yup
though if I chown here, I'm not sure which kernel's root it will use
 
3:51 AM
....I just wrote four ternary conditionals in JS as A : B ? C... >_<
 
@Downgoat you can chroot first
 
@Downgoat Also, DO offers an advanced recovery shell that's extremely easy to use (e.g. to reset SSH root): digitalocean.com/community/tutorials/…
 
I am surely doing something completely wrong
 
Your shell is restricted. Probably a busybox.
 
yes it is
 
3:56 AM
Can you manually run /mnt/usr/bin/bash?
 
oh that's a smart idea
 
If you can't, please follow the DO guide I posted above. (They'll give you a real bash)
 
...how does JavaScript not have a built-in, sensible rounding function that returns a number rounded to any precision you like...?
 
crap can't load an object file
@El'endiaStarman ... yes it does
 
@El'endiaStarman toFixed
 
3:57 AM
@Maltysen Returns a string. That's the thing.
 
@El'endiaStarman just *1
3.5673.toFixed(2)*1
 
Where's the sense in requiring JS developers to cast back to a number after rounding?
This seems like a terribly simple thing to fix in the source code, and yet...
 
well toFixed does to string in purpose
it adds trailing 0's as needed
 
^
it'll also scientific notation if needed which needs string
 
Hmm, point. So really, the solution is to make Math.round accept a second argument.
 
4:00 AM
wait, what senario are you in, in which being 0.00001 makes big difference
are you making pioneer probe?
 
Anything that requires precision is probably not a good application for JavaScript.
 
^ trye
 
@Downgoat yeah NASA is using avocadOS now
 
I don't want high precision. I want convenience and sensibility. Rounding a number to a given precision and getting a number back seems like such a no-brainer function to have. Instead we get rounding to an integer and rounding to a given precision which returns a string.
 
function roundToPrescision(num, prec) {
    var a = Math.pow(10, prec);
    return Math.round(10 * a) / a;
}
@El'endiaStarman ^
i can golf if needed
though JavaScript is weakly typed
the way it's so weakly typed is the reason it has it's crazy string/number coersion
if it returns a string just treat it as a number and it'll conform
or if you really want to have it be a number just add a + in front of it
 
4:06 AM
I went ahead and used the +(x).toFixed(y) method. I'm just saying it should be built-in.
jQuery doesn't even have it, I don't think.
 
@Dennis I can't work out how, but what about a logical or with the truthy indexes of the lowercase O indexes instead of the not application at indexes?
 
@El'endiaStarman why parens around x?
 
(*of the truthy indexes of the bits of the lowercase O...)
 
@Downgoat I dunno. I guess I don't need them.
Anyway, mobile users! Try this out! play.starmaninnovations.com/mobileTilt
 
@JonathanAllan That would be at least two bytes (turn indices into Booleans, OR). The conditional application is also two bytes.
I tried generating the higher 3 and lower 5 bits of each octet separately, but it was 4 bytes longer...
 
4:16 AM
So we can't avoid a ¤ or other chain separation?
oh well
 
We can use the one that's already there, but I think it would still be 33 bytes.
 
yeah
I still confuse myself about how to get the right tacit approach
often I write code with a number of links and then try a bunch of stuff, rather than work it out ahead of time.
 
so apparently
pepe the frog is now associated with hate groups
why? :(
 
Wat
:(
 
@JonathanAllan I think I got something. The current version seems to have an error though.
 
4:31 AM
@Dennis preemptive congratulations on reaching 100K!!
my update or your current version?
 
Should be the same.
 
oh, so my update (by your current version, I meant your working solution, rather than posted)
 
Nevermind. I shouldn't try testing things from my phone.
 
it's possible I got the base 250 or chars wrong since I have to do it by hand char by char using copy and paste form a list of the codepage from notepad
like if I do a compess I get the unicode for a bunch of characters and then convert them using to ord in Jelly then c+v them to make the string... kind of painstaking
 
But the idea I had doesn't work since it would require padding the array of truth values. (I wanted to replace ¬^...Ṭ¤ with =...Ṭ¤.)
 
4:35 AM
oh and convert to int(x,16) inn python of course :p
 
Gotta get up early tomorrow. I'll call it a night.
 
oh, yeah and doing it in reverse would still cost a byte
OK tc
 
The sad life of Jelly coder. Pasting characters one by one, constantly consulting the arity lookup table, ...
 
@feersum well I should be able to do it all from my cmd line - but I cant get it to display
so it's the sad life of a Jelly coder lacking basic Windows skill.
 
Huh? To do what?
 
4:38 AM
Compressing strings or numbers
 
I don't know what that's about but it doesn't seem to affect the activities in my list.
 
oh and typing Jelly is possible if you set up a keyboard layout, which I also have not done, but c+v for an 11 byte solution is not much overhead :p
 
I mean, you have to do those things even if you aren't compressing stirngs or numbbers.
 
you could also type it in hex and then convert
 
lol
 
4:40 AM
two characters per byte
 
urgh.
I've got a problem. How can I keep my JS script executing after window.location change
 
@AshwinGupta It is possible to do that but if you do something is probably wrong with the way you're approaching the problem
what are you trying to do?
 
4:56 AM
@Downgoat I'm trying to use this site mp3juices.cc to download any song I want using the simple function call download(song_name, song_artist).
My aproach is to use DOM to put the strings for name + artist in the search bar
 
so why are you using window.location for that?
 
then download the first one.
 
oh
you can't do that for basic security
 
@Downgoat getting there. The end goal is to download my spotify playlist songs automatically from a big list of music
 
imagine if I had website which window.locationed to your facebook and posted whatever
 
4:57 AM
@Downgoat hm. Well that would be not good.
 
you should try to find whatever endpoint the search button or whatever is using or maybe even page stripping
 
lol, so what should I do?
Ok, I've been looking through the source code of the site for the hour, I'll keep tracing.
Its getting complex and I don't get some of the stuff like ajax and all since I don't do web programming.
 
ok well basically the website has to communicate with the server which does the downlaoding somehow
if oyu can reproduce that you can fake its behavior
 
@Downgoat yup, I've gotten to that code. Thats my plan.
thanks, I think I'll focus on that route.
 
ok well the first problem is how this uses it's own search and all
 
5:01 AM
btw, the original aproach was like this:
 
why not just find youtube API
 
document.getElementById("input").value = name+" " + artist;
	document.getElementById("button").click();
	document.getElementsByClassName("link_preview 1")[0].click();
	document.getElementsByClassName("link_download 1")[0].click();
@Downgoat youtube api won't let you download videos/audio at all. Against terms of service. Do you mean one of those third party ones?
 
you can stream the video and write the audio to a file
I'm not familiar with youtube API though
 
@Downgoat wouldn't this require my program to "watch" the entire video before it has the full audio file to use
 
Youtube allows you to buffer, meaning it'll send you the video regardless of playback
 
5:04 AM
@Downgoat right, thats true. So do you think I should give up on the DOM approach and tracing the code from the website and write my own thing instead?
 
yeah
though there is probably some website using something that'll be easy to scrape
Web scraping (web harvesting or web data extraction) is a computer software technique of extracting information from websites. This is accomplished by either directly implementing the Hypertext Transfer Protocol (on which the Web is based), or embedding a web browser. Web scraping is closely related to web indexing, which indexes information on the web using a bot or web crawler and is a universal technique adopted by most search engines. In contrast, web scraping focuses more on the transformation of unstructured data on the web, typically in HTML format, into structured data that can be stored...
 
yeah thats true also.
@Downgoat christ. I didn't know this was a thing.
 
Call PETA! People are scraping webs!
 
;_; y dey do dis to spoders
 
@AshwinGupta I have an API for that: github.com/turbo/YTM
 
5:17 AM
:O is that even legal
 
TIL Randall's wife survived cancer
 
Hello
@Downgoat How do I install highlight.js
 
gitbooks has it already
 
Wot
So how do I do custom highlightings
Just normal JS?
But how am I meant to link it hten
@Downgoat?
 
5:31 AM
just write a custom highlightjs language
see highlightjs docs
 
In a separate javascript file?
 
in "languages" in book.json?
@Downgoat (sorry if I'm asking too many questions, I'm just stupid around this)
 
... CS textbook has list of common errors but doesn't include dreaded nullpointerexception
@Qwerp-Derp um lemme see im not sure >_> haven't done this in a whole
 
Just like
post a screenshot of where I'm meant to put it
@Downgoat Are you there?
 
5:43 AM
@mınxomaτ Hey thanks! I'll check that out. I'm gonna try writing the program in a couple ways to learn different approaches.
 
Feq @Downgoat where are you
 
@Downgoat thanks for the advice btw. I think I've finally figured out how this guys code works.
 
@AshwinGupta Which code?
Just curious
 
5:45 AM
Basically its like this:
1) Enter data (song title)
2) Send data through weird black magic php/ajax stuff I don't get but can use anyway
3) Retrieve code that has an id code for the download
4) Take ID code and call checkVideo() function
5) retrieve an object with a server id and hash for the video link
6) use the formatting function to get a download link
Anyways. I'm tired. My brain is fried. I've got school tomorrow. Good night, happy coding to you all.
 
Ah
GN, @AshwinGupta!
 
Currently, YT has a vulnerability that is basically an "open secret". This way, a URL can be generated to fetch the raw video from Google's internal CDN before it reaches YT.
I know that some of the downloaders/leechers use that. Let's see how long this will work.
 
Anonymous
No phone call from Google today :(
 
6:01 AM
:(
 
^ & ^^
 
@Downgoat Where are you???
 
@AshwinGupta im at school, good morning! :P
 
6:49 AM
@PhiNotPi @Geobits still here?
I implemented my blur in C++
and now it's true purpose can be shown
 
Halp
I want to make a golfing language
I know how to
But i don't know what to
 
do you see this image?
of miniature houses?
 
Ye
 
well, those aren't miniature houses!
it's what my program does with it
 
i knew it i saw picture like that
 
7:32 AM
@orlp That's called "Tilt Shift" filter. Not really a simple blur, more a process.
At least it's put under "Filters/Effects" in most graphics processing software, rather than blurs.
 
@mınxomaτ yes I know
I implemented it :)
 
@Sherlock9, oooh, I got the Necromancer badge thanks to your efforts!
 
7:47 AM
0
A: Sandbox for Proposed Challenges

MegoKeyed Sorting Given a list of indices and zero or more lists of integers, output the lists of integers, sorted in ascending order, with the key priority from the first input. Example Let the keys input be [1, 0, 2], and the lists input be [[5, 3, 4], [6, 2, 1], [5, 2, 1]]. Those lists need to ...

 
7:59 AM
Interesting google link: redirector.googlevideo.com/report_mapping . As far as I can tell, it gives you the ID of the internet exchange for your IP slash.
 
8:50 AM
monrngi
i love how heavily downvoted questions have a lot of answers on PPCG
 
I'd answer and downvote a too easy question.
 
9:35 AM
@TùxCräftîñg Did you even read this meta post?. I come to chat and 2 of your 3 messages are removed.
12
and the third one isn't even meaningful
 
@TùxCräftîñg If a test isn't suitable for TNB, it can be posted in the sandbox. If it is suitable for TNB, it shouldn't be deleted as this causes confusion and frustration for other chatters.
@betseg if another chatter makes yours irrelevant by deleting their message, please don't delete yours in response, as this only makes the problem worse and may lead to you being seen as part of the problem too, as most people cannot read the content of deleted messages.
@Fatalize Thanks for highlighting the problem. If I had been in the room at the time, @TùxCräftîñg would have been kicked for that.
As it is, a 1 minute kick is meaningless when the user is not in the room, but I'm applying it anyway so that the next kick today will then be 5 minutes instead of 1. @TùxCräftîñg please take this as a friendly warning and avoid the need for anything more drastic.
5
 
So a class assignment just challenged me to golf something in Python
 
9:51 AM
Plz halp (C) i have an int array like {8,3,0} halp me print 83rd ascii character
 
I need to golf a naive interpretation (476 bytes) into a one-liner < 80 bytes. All of the time I've spent here is preparation for this.
 
@StevenH. A class assignment that don't require overly verbose code? I would have love to have them
 
@StevenH. How many classmates are you competing with...?
 
It's not an official competition, unfortunately. The professor simply included the bytecount of his solution in the problem parameters.
 
Ah OK. So the point is to make the implementation less naive, not necessarily to golf it?
 
9:57 AM
That's the primary goal, seeing as this is neural nets and properly golfing something this complicated is doomed to be buggy.
Not to mention we're using numpy which is not usually known for its golfiness.
 
power is back!
 
? indeed
 
10:19 AM
I think I might work on a turing completeness proof for Turtlèd
I think it only needs 3 types of grid symbols to be TC
 
to prove TC for turtled you can compile bf to turtled or implement a tag-system or the 2-state 3-symbol TM
or rule 110
 
A TERMITE ATE MY HAMMOCK (In a roguelike)
 
which roguelike? :3
 
10:35 AM
All of the roguelikes.
 
@zyabin101 Alphaman
 
Okai :3
 
I'm being attacked my mr potato head
ded
fucking lotuses
I had so many berries, but the lotus made me trippy so I couldn't heal with them
;_;
 
11:27 AM
Plz halp (C) i have an int array like {8,3,0} halp me print 83rd ascii character
 
char c = arr[0] * 10 + arr[1];
 
@betseg Closed as duplicate of
2 hours ago, by betseg
Plz halp (C) i have an int array like {8,3,0} halp me print 83rd ascii character
:P
More seriously, is this homework or does it need to be golfy too?
 
@TùxCräftîñg yup. true.
@trichoplax nope, a new lang's interpreter
 
Ah, real work. I see
 
@TùxCräftîñg what if it's {1,0,4}
ill need ASCII 104
 
11:31 AM
char c = arr[0] * 100 + arr[1] * 10 + arr[2];
 
@TùxCräftîñg you say put an if(arr[2] == 0). i see
 
a array like {0,8,3} for 83 and {1,0,4} for 104 is better
cuz now char c = arr[0] * 100 + arr[1] * 10 + arr[2]; work for the two
 
But input won't work
Something like c80p and c104p and c110p
Wateva
c080p it is
 
(arr[0] * 10 + arr[1]) * (arr[2] ? 10 : 1) + arr[2]
I think that should work but I haven't played with C in a while
 
110 will be 11
ill just use 080 etc
 
11:46 AM
You should pad it during interpretation/compiling though
so you don't have to write that part out
and you can use 80 instead
 
if(strlen(arr)==2)
Ye makes sense
Include the p in the array too
 
12:08 PM
What functions should a golfing language have?
 
Depends on your language
 
4K celebration ヽ( ͡⎚ ͜つ ͡⎚)ノ
 
0
A: Sandbox for Proposed Challenges

FatalizeInterleave your code with the input Given an input string, interleave this string with the source code of your solution. For example, if your code is abcd and the input is 1234, then your program must output 1a2b3c4d. If your code is shorter than the input, then it must loop back to the beginn...

0
A: Sandbox for Proposed Challenges

Erik the GolferJust add two numbers. code-golfarithmetic I am so embarassed we just don't have simple addition yet. Rules: Positive, zero or negative integers must be supported, if they can be. Standard Loopholes are forbidden. You can use a program or a function, but not a snippet. You can output as: A ...

 
@Dennis I got a badge for that. o_O
 
12:43 PM
@orlp I happen to like this effect: codegolf.stackexchange.com/q/26317/14215
 
Can I post a non-competing Imagemagick answer to the question and make it CW?
 
@betseg Why the CW?
 
Because it uses disallowed things?
 
CW isn't an excuse for "breaks the rules" though.
 
k den
 
Anonymous
12:54 PM
21
A: How should Community Wikis be used?

DennisCommunity wiki is not a rep waiver I've mentioned that from time to time in the past. Community wiki doesn't just mean that you cannot earn rep from a post. Yes, it does have that side effect, but the community wiki option is for posts that can be edited by anyone without worrying about post ow...

 

« first day (2069 days earlier)      last day (2767 days later) »