« first day (1044 days earlier)      last day (3897 days later) » 

12:00 AM
base64 makes it longer
 
In, not into.
 
user1804599
@CatPlusPlus It's horrible.
 
@StackedCrooked Really? :O
 
Okay, so the collision probability for two arbitrary strings, hashed in something good and truncated to 10 characters of Base64, is… 1 in 72057594037927940.
 
@StackedCrooked You can strip padding off.
 
12:00 AM
Oh, padding
 
If I didn’t make a bad math mistake.
 
Base64 doesn't change number base.
 
user1804599
Auto-increment. Easy, short, guaranteed unique.
 
So what’s the birthday attack on that
@not-rightfold Again, this is the best way
 
@minitech But are the strings really arbitrary? These could be programs written with only 1 character's difference.
 
user1804599
12:01 AM
Format in base 62 ([a-zA-Z0-9]) and woop.
 
Guaranteed unique unless not.
 
md5 is base 16. So I can convert it numerically to base62.
 
Base 64. +- & /_
@StackedCrooked MD5 is not base anything. It’s one number.
@ThePhD Avalanche effect. It’s way more likely for the two colliding programs to be totally distinct.
 
@minitech Ok right.
 
Except in specifically-crafted strings for broken algorithms… like MD5.
 
12:02 AM
I mean that my md5sum utility returns it as base16.
 
Well, don’t use shell to do it
 
This conversion changes 32 to 22 bytes.
 
Truncate it to 10!
Actually, use auto-increment!
But 10 is pretty good!
 
user1804599
You can use base 91, actually. ASCII 33-127 sans &, ? and #.
 
10 is terribruuu.
@not-rightfold But can those be typed out by someone?
 
12:06 AM
@ThePhD Why?
Like I said… two arbitrary strings are 1 in 72057594037927940
 
E.g. if I send it to an interviewer VIA my resume,
@minitech Because that one chance. THAT ONE CHANCE.
 
user1804599
@ThePhD Yes.
 
@not-rightfold What's the set of characters look like?
 
user1804599
> ASCII 33-127 sans &, ? and #.
 
@ThePhD So auto-increment. Sheesh.
@not-rightfold Not even sans ?
 
12:07 AM
@minitech But... but but fast lookup. :c
 
user1804599
@minitech query string.
 
@ThePhD Auto-increment doesn’t mean you can’t hash
 
Truncate to 10 bytes results in duplicates though. coliru.stacked-crooked.com/…
 
Although unique columns are better, sheesh
 
user1804599
@ThePhD !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|‌​}~
 
12:08 AM
@minitech Haaah, seeee? Duplicates, duplicates!!
 
@StackedCrooked That’s not base-64, for one
 
@minitech Those are the current ids.
 
@StackedCrooked Change ’em
Or use auto-increment
Which is the best solution by far
 
user1804599
Use auto-increment, format as base 91.
 
Yes.
 
12:09 AM
 
Auto-increment is really fun to implement in bash.
 
user1804599
Or just base 62 really.
 
Wow I made an error.
 
user1804599
@CatPlusPlus Use PostgreSQL.
 
@StackedCrooked That’s not what I meant
 
user1804599
12:10 AM
Or write an atomic auto-increment server and communicate through netcat. Trivial in Erlang.
 
Yes. Why is this being implemented in bash.
 
:lol:
 
@not-rightfold I did that!
 
@StackedCrooked That’s reducing the key space, you have to decode it from hex first
 
user1804599
12:10 AM
@StackedCrooked In Erlang?
 
Right. Well, use it.
 
In the end they all managed to get a unique id.
Cat didn't seem to like it :)
 
Probably not, it’s icky
 
It's very simple. Grabbing an id results in mkdir $id which fails if the dir already exists.
 
12:12 AM
Use Postgres! And a language that’s fun to use!
 
user1804599
@StackedCrooked In Erlang. Persistence and the TCP interface are left an exercise to the reader.
 
Meow
 
user1804599
(Both are trivial.)
 
user1804599
@minitech PL/pgSQL?
 
user1804599
PL/Python!
 
12:15 AM
^ Probability of collision of 10-character base64 truncation of a perfect hash across 1M inputs
Approximately
 
user1804599
inb4 only collisions
 
What?
Also, use one of the SHA-2 algos. I don’t think safe truncation is a guaranteed property of MD5.
But wait, why am I still going on about this, auto-increment works better anyways
 
Hm.
Or, you could just
keep using shortest unique prefix.
And just let it scale from 0 to [hash size] after doing Base62/64 encoding.
 
Why
Auto-incrementing has zero collision risk and is shorter
 
Because, why not!
 
12:21 AM
It is guaranteed to be the shortest possible, in fact
 
Can you auto-increment using the file system?
CAN YOU EVEN LIFT?
 
Yes, as that bash code has helpfully demonstrated
 
What if two things are submitted in the same millisecond
 
Then I have a collision.
 
12:26 AM
Psst… auto-increment
It doesn’t even matter how you do it
+[<[-]>+]
 
I don't really care.
I just like to play with the ideas.
If I seriously wanted short urls I would have implemented something way back.
But I'll put it on my TODO list though.
Muahaha.
I'm more worried about storage.
The archive is a flat directory structure and SVN keeps taking longer to commit new entries.
That can become a problem.
Btw, incrementing ids never was a problem because I could just lock a mutex during id generation.
In the ruby webserver code I mean.
 
Yes, but you get the “unique” thing automatically with a database… seems attractive.
 
Ruby weberver? FAIL!
 
Yes, but now I use my Google SVN repository as the database so I don't have to worry about backups etc.
 
Yeah, you should use Node.js
It’s closer to the metal
 
12:38 AM
If I use my own DB then I need to worry about not losing the data.
 
 
The entire archive is here
 
That seems somehow like an abuse of SVN
 
It does seem so. But technically it's code that I'm comitting.
However, it's something I want to change.
 
Fuck Node.js. If it's closer to the metal, the metal is Osmium.
 
12:39 AM
“Code” is not the committing criterion :)
@MartinJames Whoa there, you’re making me angry
 
BTW, I'm slaughtered, so take anything I say with a pinch of Whiskey.
 
That's one thing we have in common!
Sup sup.
 
@MartinJames Fair enough, I will edit the period in for you.
 
Fuck node.js regardless.
 
I don't know what Node.js is for
 
12:46 AM
Wanking.
 
It’s for doing things that would normally be done in another language in JavaScript.
I use it a lot, because JavaScript is pretty good
 
@minitech For sure, JavaScript is the best language known to man.
 
:laffo:
 
stupid steam
 
Somebody needs to port Steam to JavaScript
 
user1804599
12:49 AM
@minitech JavaScript is not pretty good.
 
user1804599
JavaScript is actually pretty bad.
 
It's ugly good.
 
What the hell man.
 
Lol
 
Nobody likes you.
 
12:49 AM
Get trolled, son
 
Are there any good ones among the languages that compile to JS?
 
C#.
Or Haskell.
 
I didn't know C# and Haskell compiled to JavaScript.
 
They don't seem as readily usable as CoffeeScript though.
 
user1804599
@ThePhD For writing programs that suck at I/O.
 
12:50 AM
Sure they do, why wouldn't they?
 
user1804599
@Rapptz EMSCRIPTEN
 
Does C++ compile to Javascript?
 
12:51 AM
Yes.
 
user1804599
@ThePhD EMSCRIPTEN
 
OKAY THANK YOU <3
 
With clang no prob.
 
@R.MartinhoFernandes heh
 
@ThePhD Please don't...
 
user1804599
@MartinJames inb4 cowboy_cast.js.
 
Is there an LLVM Virtual Machine?
 
UHC has JS backend for Haskell.
 
> The JavaScript problem is two-fold and can be described thus: 1. JavaScript sucks. 2. We need JavaScript.
 
@Rapptz oh yeah ive had that happen before, no clue what that is.
 
12:52 AM
lol
 
Anyone used Dart?
 
Yes, it’s horrible
Worse than JavaScript by a long shot
 
> The depths to which JavaScript sucks is well-documented and well-understood.
lol
 
Compiles to more bloated JavaScript than Emscripten
 
@R.MartinhoFernandes Yeah, but how did we let that happen?
 
12:53 AM
The steam browser is fucking up on me.
 
The design choices for Dart make it look very lame. They don't allow cool features.
 
user1804599
@R.MartinhoFernandes Fay?
 
JavaScript is pretty good
 
user1804599
Oh, yes, Fay. I remembered those words. :P
 
What does Javascript specialize in?
 
12:53 AM
Sucking.
 
Nothing
 
@ThePhD web
 
Like, why is it used so much?
oh, the web.
 
Because.
 
It’s the web language
 
12:54 AM
Because there's no alternative
 
JavaScript is like the most specialized mainstream language.
 
Is there a statically compiled league for the web?
 
No, it’s the least specialized
 
haha, league
*language
 
NPAPI plugins, but nobody likes them.
Native Client, but nobody uses it.
 
12:54 AM
@minitech Today it's being deployed everywhere yeah.
 
Web is a horrible cesspit of shitty technologies, basically.
 
Hey. I like the web.
 
I wonder what that says about you.
:P
 
Yet it reaches the most people.
 
It is pretty bad.
 
12:55 AM
It's only slightly better than mobile.
 
That's really a sad conundrum. =[
 
user1804599
It is pretty terrible.
 
HTTP is pretty terrible tho
 
user1804599
Server is best.
 
@StackedCrooked How do I make the acronym 'shit' from 'specialized mainstream language'?
 
12:56 AM
@MartinJames JShit.
 
@MartinJames shit
 
JavaScript has the potential to be so beautifully boring
 
lol
 
Specialised, Horrible, Irritating Technology
 
@MartinJames SpeHcIalized mainsTream language.
 
12:57 AM
Fix == and undefined and it would be so boring
Oh, and objects
And ASI
 
And everything else, too.
 
@Rapptz At least it agrees with you.
 
And automatic conversions
Give JavaScript Python’s type system
 
Basically if JS wasn't JS.
 
@R.MartinhoFernandes OK, it's a stretch, but it'll do :)
 
12:57 AM
It would be better.
 
And it would be so boring and I would use it all the time
Boring is good
Surprises are bad
Special cases are bad
 
@MartinJames Well, if SCARY iterators (Seemingly erroneous (appearing Constrained by conflicting generic parameters), but Actually work with the Right implementation (unconstrained bY the conflict due to minimized dependencies)) are fair game, so is this.
 
user1804599
@minitech Conclusion: JavaScript is bad.
 
@R.MartinhoFernandes Pressing "Ok" and opening it again made it work.
 
So....
 
12:59 AM
@not-rightfold Is JavaScript a surprise or are you mentioning a random message
 
user1804599
The latter two.
 
Is there a language that web users have that does... not suck?
 
user1804599
Seriously why the fuck is arguments not an array.
 
user1804599
It's surprising and bad.
 
Also, I was surprised at how horribly memory-inefficient Haskell seems to be, what’s up with that @not-rightfold
 
12:59 AM
3009 unread items
 
user1804599
MEMORY
 
@not-rightfold If you change stuff in it, the actual arguments change, that’s worse
 
user1804599
WE ONLY HAVE 200kB OF MEMORY
 
Actually, that was more or less my situation, so
 
What's memory?
 

« first day (1044 days earlier)      last day (3897 days later) »