« first day (3432 days earlier)      last day (1738 days later) » 

V.7
V.7
01:14
@Jincowboy Yeah, as @JBis says ... the right words would be encode and decode.
01:34
@ZahidSaeed jsx, or a single createElement and then that element.innerHTML = [rest of html]
V.7
V.7
Base64 is just a simple byte manipulation when any byte array stays as per 6bit(2^6) each in 24bit group. So for example, we have 123(3 bytes) so they are in ASCII 0x31, 0x32 and 0x33 in HEX and 00110001, 00110010 and 00110011 in binary.

This set just is made "connected" as 001100010011001000110011 and divided by 6 bits, i.e.: 001100, 010011, 001000 and 110011 so: 12, 19, 8 and 51 in DEC which are numbers of characters in BASE64 alphabet, and are equal to "M", "T", "I" and "z". The result we have: 123(ASCII) = MTIz(BASE64). Decoding is the same process, but reversed and it is worth to ment
02:38
@V.7 is that really the entire algo?
lol cool
V.7
V.7
@JBis yup, so easy, but helps a lot
Oh, a little typo: + ["0-9" and "+"] symbols exist in BASE64 alphabet
 
4 hours later…
06:57
thnaks @JBis and @V.7
07:25
@ZahidSaeed CreateElement is certain one way to go, and you can bet it will be forward compatible. In the past I've found that it is often quicker to built an html string and use insertAdjacentHtml, when there are lots of elements to create (thousands and up).
@V.7 Use flow to make the image auto-expand, but set max-width and max-height to 100vw and 100vh.
@Jincowboy If the file does not contain non-ascii data, you can use atob to convert from base64 to ascii text, and btoa to do the reverse. If that is not the case, you need to find a library somewhere.
08:06
@Sheepy probably not ideal way of going about it otherwise
08:26
@V.7 ironically, Base64 uses 65 characters to represent the data
09:04
that last one is a signal for calling a special processing function
such malicious opportunities
speaking of which, I never got how pdfs or jpegs were capable of executing code
pdf runs on js
in my mind, pdf is just a glorified image
09:37
pffty
09:48
I thought pdf was a sort of pseudo language based on instructions that printers receive
10:10
Morning
10:52
Had to look up atob
@V.7 Takes me back to comp sci days
And on mdn, they've got a polyfill for the atob
Tay
Tay
11:18
@Neil Your.... making that up right??
@alex atob and btoa are kinda useless in the sense that: Base64 just increases byte sizes, its not really useful for anything particular.

However, if you use toDataURL from a fileReader constructor, then its very useful
@Tay it's not that weird, as PostScript (.ps files) is basically just that
and PostScript highly influenced pdf
If y'all haven't rolled out samesite cookies yet, I'd highly recommend doing it ASAP.
Tay
Tay
base64 used to be useful, really only for small cases. But its sortof just a nuisance.

Nowadays, when I meet a kid online claiming to be a programmer/hacker, I always show em a base64 string that says "hello world" or something, and I ask em what it is.

Any basic webdev or programmer should know a LOT about base64 if they havent lived under a rock the last few years
Its a stupidly simple little way to trick fakesters and attention-bots, but its mildly useless
what answer are you expecting? that they know it's base64 or what the actual decoded thing would be?
Seen base64 used to bundle images w/ script files
11:23
@Tay There are many applications where it's extremely useful, don't say it's useless because you haven't found an application for it yet.
Tay
Tay
Ok, fair enough
For example, binary data
Tay
Tay
out of experience in WEBDEV; I dont find it "useful" atm
Now, ive seen binary data just as you mention in base sets inside of Executables and Images
but other than that, Ive never seen it
Mostly storing binary data in a reproducible format
One way we use it is storing differently encoded data, such as UTF characters in a Latin1 table.
Tay
Tay
about that: why are there different ASCII encodings? Most systems need different encoding, I mean ffs you have to setup a custom encoded text file just to edit JSON/Metadata for java games on MacOS.
if each system uses ASCII, why are there like 20 million different encoding (metaphor).
11:30
historic reasons, mostly
Yeah, most of it boils down to legacy crap
Most modern systems support UTF though now
Tay
Tay
.-. Typical.. people dont want to update systems because there are too many systems using another system, causing compatibility errors.

And rather than finding a solution, they let it sit for decades.
iirc first ASCII standard used 7-bit characters, whereas the original only used characters used in the english language
Tay
Tay
Same thing with programming languages and browser support
Welcome to the real world
11:32
so other countries needed to implement their own standard
the UTF standard came fairly quickly after they realized that ASCII was introducing problems
someone just had a good idea
Tay
Tay
@BenFortune Thats the thing, people say things like THAT when people like me mention what I said above.

its dodging the problem, Ive actually noticed experts and experience individuals actually using the "issue" as some kind of "karma-experience" showing younger or inexperienced or amateurs that they know best, and that ignoring the issue is a good thing.
Oh wells
lets all just follow the issue as it stacks up errors until one day it falls over and everything crumbles to pieces :D
oh, so you're still an optimist
hold on to that as long as it lasts
@Tay Nothing is perfect, you'll always be writing loopholes to get around legacy and incompatibility issues. There isn't a system or application in the world that is 100% perfect, that's what I'm trying to tell you.
Tay
Tay
More like Im half between: no empathy, tons of empathy, happy, kinda ticked off, and chaotic.

IE: I love nice people like best friends, rude people should burn eternally, and I love watching the world burn in the corner, while people act like dummies on internet videos
While, yeah, ben, thats the point, Im making fun of this inefficient system. Because we cant fix it.
we simply cant XD
11:37
no, I get it, but sometimes there are no easy or feasible solutions, sometimes it's simply not in the companies best interest to adopt new standards (and not every project is a programmers love child he cares about)
You're in your own little ignorant bubble. You ask why something is like it is, then dismissing all the information we give you.
Tay
Tay
information?
Theres only one thing to be known here: Sure the system works, its just got flaws that wont be fixed
and its fine an all
Im just mentioning how strange it is.
I don't see ASCII encodings as a huge problem nowadays though
some of these flags are being fixed
lol, the UTF standard is one of them
the problem is just the level of complexity
Tay
Tay
yeah, things are fixed.

But, theres always that issue: "Oh no! out of the 1 billion people who use this, lets add this bad practice solution for the 1000 people left using the ancient method thats going to hurt everyone else!"
11:39
try to do this: forget UTF existed. And have a solution that incorporates all standards in one solution that are backwards compatible
it's just that UTF is a clever found solution
3 things I hate, encodings, dates/times and Google making changes that will inherently fuck up your entire website and make you lose tens of thousands of monies
Tay
Tay
Karel, that would be nice.
But people would never do that, because some minority wouldnt upgrade
that's not correct because many scientists were trying to find solutions to that problem
Tay
Tay
thats always the issue though. People care a lot for the minority, and unintentionally hurt the majority because of it.
until someone had a good idea adn managed to develop a standard that is backward compatible as well.
11:40
@Tay If those 1000 people are bringing in money, why not?
I recommend you to read the history of the standards
and how UTF got founded
it's kinda interesting (for me tho)
Tay
Tay
@BenFortune but if 1000 people are bringing in money from an ancient system thats hurting the other 999,998,000 people using the system 1/1000000 basically.

Those other 0.9 billion people arent bringing in as much money
is that efficient?
0.999 billion = ~1 billion
Tay
Tay
And no, im not talking about the standards of ASCII or endocidng
|| shrug
11:42
¯\_(ツ)_/¯
it's all relative
Tay
Tay
Eh thats my opinion, I dont really care if the minority of internet users have issues.

I know thats rude
but hey, lets kill 1000 people so 1 can survive XD
what is this about now?
Tay
Tay
Nothing, itll cause you loss of brain cells, id recommend not scrolling up
sigh, Its a monday though
I like causing drama on mondays
but I wanna go home and play satisfactory... school is killer
I got satisfactory for my b-day on saturday, its more enjoyable then like... any game ive ever played, its equal to Breath of the Wild!!!!
Morning y'all o/
Tay
Tay
11:51
Morning
Hey Im going to try out what yall mentioned a couple days back
learning to make an interpreter by looking at the insides of an markdown interpreter
Ill check it out
see what I can come up with
my problem is finding a good source to begin with
Have a look at tokenization
Tay
Tay
yes yall said that before, but I have a hard time understanding, so i was told to check out a markdown interpreter
so Im looking for a markdown interpreter, not tokenisation research
@Tay Ben's advise is justified tho. (and solid)
Tay
Tay
im not sure where to start
AST/tokenization is a good start
Have a look how something like Acorn works
Tay
Tay
11:59
Thats not what I mean... I need something to work off of.
-.-
you should still attend your college tho
Tay
Tay
I just dont get it alright?
Im a freshman, lets be patient.
Though I am 15 now
well, he is giving you some pointers you can use
I would have said the same lol.
Tay
Tay
I know, Im not saying hes doing anything wrong
there is also a regex based approach but it's shown that it's not fast and too complex than the AST / tokenizer approach to handle markdown
Tay
Tay
12:01
just everything Ive read is vague, and maybe Im just slow, but I simply dont get how to magically convert words to code with something I dont know how to write
That's why you look at the methods to do it
Tay
Tay
@KarelG I made a regex method yesterday, and semi functional, and got scolded here for it
that's why you need to do research on tokenizer. That's a basic step you can use to comprehend the parser
you cannot build a house without having a good and solid foundation
look at teh codz
12:03
Had a quick scan of that article, looks decent
(in a markdown parser lib)
@BenFortune if he reads it completely
Tay
Tay
im reading it completely
IQR: 1372.

Im fine
my experiences with you tells the otherwise 😕
(and what's IQR, intequartile range? )
Tay
Tay
no
Im not sure, teachers called it Influency
(reading level)
appanrelt 1400 is senior highschool avg reading level
12:11
the high school based education system in USA is a joke towards those in Europe. So please allow my to laugh at that "quality"
it does not matter what your reading level is. Just read the whole document at your own time and try to comprehend it
@KarelG lolz
if you don't comprehend a part, try to research further on that
or ask it
12:40
my reading level is 42
but I stopped spending mastery points on it since I was 3
Tay
Tay
wut
in the Georgia influency scale, 42 would be less than 100, which is basically the reading level of 3 year olds
but im in NC now, idk their scale
I've evolved into selective reading
Tay
Tay
I dont read books
I just read news articles about non-boring stuff nowadays
like science discoveries, new experimental data
etc
ok
Tay
Tay
I like watching those videos of scientific experiments with chemicals that would probably burn your skin off
For such dangerous chemicals, they have cool looking reactions
Though, id never want to touch em
12:47
I wanna haz the touchy
no shit
Tay
Tay
I wanna touch plutonium though
Glowy Bluey Rody thingy... Me touchy burny skin offy
You should read books though, you might actually learn something for once
Tay
Tay
gety radiationy
Aww thats rude
guys , Hello

I've a massive Nested JSON object, I need to update part of it.
what is the best way to do it?

I saw this multiple methods that loops thro the whole thing until it finds what I'm looking for and from there i can dowhatever i want. but it does look like a very messy job to do.
Tay
Tay
12:48
I read chapter books by the age of 7
i read too much
63
Q: Find by key deep in a nested array

HarryLet's say I have an object: [ { 'title': "some title" 'channel_id':'123we' 'options': [ { 'channel_id':'abc' 'image':'http://asdasd.com/all-inclusive-block-img.jpg' 'title':'All-Inclusive' ...

Tay
Tay
I was that cringey kid who was like "ima be an ASTRONAUT when I grow up!!"
cuz I read too many kid books about bees and animals and science
when I was 10 I binged the science channel
those are the answers i found but not sure if there is a better way to tackle this problem.
Tay
Tay
then I hit puberty... and I was like "fuck everything, im gonna program and game all day"
Thinking about buying a go pro hero 8. Anyone have one? How do you like it?
12:50
@diamond Not unless you know each specific index of what you want to update
hej guys, I have a question regarding a soap integration... I wonder if anyone of you knows a tool that can generate a wsdl file from an object, or JSON
@diamond if you have a messy massive nested json object, expect a messy massive nested solution
oh no soap
although, the nested search solution is not that messy, just dynamic, which you should try to avoid at all cost... except when you have a massive nested json object
How could I best detect the legacy IE?
12:52
If nothing works, your prob on legacy IE
Yes but my customers don't know that ...
I would like to redirect them to download the evergreen one
|| mdn User agent string
@KamilSolecki alright, thanks anyway...
Ye I looked at that and it detects edge
but any edge
I only want to support 75+
Tay
Tay
12:53
im the only one with a profile picture cuz google isnt blocked... lonely
Tay
Tay
yall need some gravatar or google pfps
how about IE 6?
Use ^ to find the type and version of browser
@BenFortune
 lets say that this is the data I have
 {{'name':'n1','age':'20'},'name':'n2','age':'50','children':['name':'n3','age':'50','children':[ ...... n50]}}
Tay
Tay
12:55
blocks inside blocks inside blocks inside blocks :)
what is the best way to organize and tackle in this case?

@Wietlol @JBis
1, find your thing in the root object
2, if not found, try the same for each child
3, if not found, throw error
thanks
so looping ?
recursive looping, yes
12:57
I guess I have no choice i guess
Or a loop because fuck recursion
throwing the error should probably be done on a wrapper function tho
@JBis in that case, good luck
I'm worried about similar names though so i will I'm thinking about adding a unique id for each
Tay
Tay
plato..
im forced to be tortured with plato
@diamond yeah that's not a valid object
Tay
Tay
12:58
Fucking plato... cant even fix their FUCKING DRAG AND DROP... REEEEE
Excuse language
crappy school programs ticking my timer
@BenFortune yeah , i made a mistake there , but it's an example
Tay
Tay
in many bad bad ways lol
laughs in angular
Tay
Tay
:(
The developers of plato got so damn lazy they actually added a "reload" button that refreshes the page, because they were too damn lazy to add a drag and drop feature.


You can drag and drop stuff to the box, but if you get it wrong, you cant undo it.

you have to manually reset if you get it wrong
sigh
le sigh
amirite lole
13:05
@BenFortune :P
it only works if you know where to look for tho
anyways, back to my complex problem
@Tay sort of curious about this take, the whole point of base64 is to be able to safely transfer binary data over strings; and it does its job
Tay
Tay
Eh, Im a webdeveloper
I wouldnt understand
but in my eyes, it has no point to me
you've been using it with your canvas to image stuff
I mean, lets say you need to send some binary data; f.ex. sending a small image through a query string while redirecting to another page or smth; its all the more useful for that
@Ikari I got you, but that's surely a bad practice.
(trying to prevent someone having ideas with it)
13:17
I mean yeah :P I never told to do that ;)
I was trying to think of use cases of binary files and sending data through strings :B
those strings are useful if you store images in a db instead of having it physically on your server
that's how image hosts usually work
something like storing canvas stuff a user has drawn in localStorage or cookies, as a draft save option for example works as well
that's a valid use case as well
Tay
Tay
DataURLs are very useful
its a file as a word.
but base64 on its own
Very little usage anywhere
for what I do atleast
uhhh we just mentioned some of the use cases for base64
Tay
Tay
13:20
> for what I do atleast
:)
Java has no usecase
for what I do
you see?
@Tay fair enough
Tay
Tay
i never said its bad, nor did I say I want it to be GONE. cuz that would make me sad, my fake file database that stores windows files as dataurls wouldnt work anymore
and I use that method of file storage in like 4 different large projets
I just dont like the look of random base64 where it isnt needed
did you just say you have no usecase for it, while you use it in 4 large projects?
welcome to our world here GNi33
13:26
:)
I'm sure that some of the regulars here are having gray hairs with him.
Tay
Tay
yes
Im the annoying one
whos trying to not be annoying
but it isnt working apparently...
well, there has always been at least one. why stop now
@GNi33 ofc it has
you just dont know them yet
same for base64 for Tay
you do realise I wasn't exactly serious there, right?
Tay
Tay
13:29
but what I mentioned: I dont like base64, but I like base64 urls, it just so happens base64 urls contain base64...

So its sortof a stalemate product
@GNi33 when your not serious, type (sarcasm) or /s
So people will know
I will not
Tay
Tay
Hard to see emotion through ascii
You're very smart /s
@Wietlol he-was-not-serious
@Tay whatyamean? :-)
Tay
Tay
@BenFortune And I appreciate your help /s
13:30
This has to be the most active room on SO
hmm debateable
Tay
Tay
it usually is
except C#
C# also gets large visitors, but only in intervals
sometimes its empty for a whole day
I dare not enter the C# room
Tay
Tay
next day, its bustling..
@Alex why?
@Alex be careful if youre there. They're sharp with C.
13:32
@KarelG get out
Tay
Tay
I used to be a regular at C#, but we had some personal issues, and Im not good at C#, well, atleast Im not as good at writing C# than I am at writing JS
Umm... let's say things used to get rather testy in that room
@Tay That seems like a you problem, not a them
^ ^
13:32
Drive-by's. "Give me an answer now or else"
@KarelG Hah
@Alex That's an issue that's plagued this entire site since its existence, along with people not willing to help themselves
@KarelG I noticed
room 7 just has a different mentality
7
7 he says
I dare you to join room 1
13:35
@BenFortune Yup. "Google is our friend" is lost on them
@Tay have you done any backend dev?
The real shitshow is meta though
we're less friendly to noobs than JS room, at least used to be back in the day
I don't visit SO anymore
@KamilSolecki yet here you are
Don't blame folks
13:37
@Ikari imma expose u on discord
We have drive by's in mvc but I help anyway
13:58
@NIKHILCHANDRAROY Please don't post unformatted code - hit Ctrl+K before sending, use up-arrow to edit messages, and see the faq. You have 25 seconds to edit and format your message properly before it will be removed. Please separate code blocks from your actual question. Put your question in 1 message and then your code in a 2nd and format it.
For posting large code blocks, use a paste site like like gist.github.com, hastebin.com, pastie.org or a demo site like jsbin.com
1 message moved to Trash can

« first day (3432 days earlier)      last day (1738 days later) »