jhass changed the topic of #crystal-lang to: The Crystal programming language | https://crystal-lang.org | Crystal 0.35.1 | Fund Crystal's development: https://crystal-lang.org/sponsors | GH: https://github.com/crystal-lang/crystal | Docs: https://crystal-lang.org/docs | Gitter: https://gitter.im/crystal-lang/crystal
teardown has quit [Ping timeout: 240 seconds]
chloekek has quit [Ping timeout: 246 seconds]
<raz> oauth is a horrible trainwreck
<raz> the guy who created it regrets it deeply
<raz> "biggest professional disappointment of my career"
deavmi has quit [Ping timeout: 272 seconds]
deavmi has joined #crystal-lang
<FromGitter> <ansh> Hey I am having some difficulty understanding what this Crystal dev wrote
<FromGitter> <ansh> ```code paste, see link``` [https://gitter.im/crystal-lang/crystal?at=5fb090a4c10273610a075673]
<FromGitter> <ansh> If anyone knows how I can recreate the from_rs method to read compressed bytes in JS or Python please let me know
<FromGitter> <ansh> Or if someone can explain this
<FromGitter> <3n-k1> without seeing the rest of the code, i assume it reads the resultset as bytes, exits early if the read method returned nil (python calls it None), and then it decompresses that value using the deflate format, and returns the decompressed data as a string
<FromGitter> <3n-k1> i'm assuming this is used for decompressing data stored in a database
<FromGitter> <Blacksmoke16> given the name of the module id say yes
<FromGitter> <ansh> Yes it is
<FromGitter> <ansh> I am trying to figure out how to write the from_rs method in Python or JavaScript
<FromGitter> <ansh> Do you guys know how I will be able to do that? @Blacksmoke16 @3n-k1 I tried reading the BYTEA column from the Database but when I try to decompress it, it gives me some random strings
<FromGitter> <Blacksmoke16> in relation to a db? Or like just create a string from an array of bytes?
<FromGitter> <ansh> Just create a string from an array of bytes
<FromGitter> <ansh> Connecting to the DB is the easy part
<FromGitter> <Blacksmoke16> are you sure the bytes in the db were compressed?
<FromGitter> <ansh> Here is a GIST with all the Crystal Ccode
<FromGitter> <3n-k1> `.decode()`
<FromGitter> <ansh> I used decode() in python
<FromGitter> <3n-k1> is the data compressed, or just a normal bytestring?
<FromGitter> <ansh> I get invalid start byte error
<FromGitter> <ansh> This is the python code used https://gist.github.com/ansh/feb7147c9935b0986fa1e2e3111c53a8
<FromGitter> <3n-k1> oh. yeah, the content is compressed, you need to decompress it first
<FromGitter> <ansh> How can I decompress is? What algorithm is it compressed using?
<FromGitter> <ansh> Which line from https://gist.github.com/ansh/e5d21a6de7e7139e1068cdde05e90147 compresses it?
<FromGitter> <Blacksmoke16> ```code paste, see link``` [https://gitter.im/crystal-lang/crystal?at=5fb098b974152347c2356f62]
<FromGitter> <3n-k1> it's using the deflate format
<FromGitter> <Blacksmoke16> https://en.wikipedia.org/wiki/DEFLATE
<FromGitter> <ansh> How can I use the Deflate format in Python or Node?
<FromGitter> <Blacksmoke16> just google it, im sure there are libs for it
<FromGitter> <3n-k1> zlib is part of the python stdlib
<FromGitter> <ansh> I have tried Googling, stuck on this for 5 hours now
<FromGitter> <Blacksmoke16> 😬
<FromGitter> <ansh> I am getting Incorrect Header Check
<FromGitter> <Blacksmoke16> and to be clear, you have the crystal example working,but you're trying to port that to python?
<FromGitter> <ansh> Yes that is correct @Blacksmoke16
<FromGitter> <Blacksmoke16> gotcha
<FromGitter> <ansh> I had a Crystal Dev on my team who wrote the whole backend in Crystal but then dipped
<FromGitter> <ansh> Now I'm stuck here, a frontend dev, trying to fix everything
<FromGitter> <Blacksmoke16> feels bad man, porting to python is a downgrade 😉
<FromGitter> <ansh> Followed that, works with `zlib.decompress(compressed_content, -zlib.MAX_WBITS)` @3n-k1 , Thanks so much!!!
<FromGitter> <ansh> I really appreciate it both of you @Blacksmoke16 @3n-k1
<FromGitter> <ansh> I would try to learn Crystal properly but its just so intimidating
<FromGitter> <Blacksmoke16> prob not too much harder than python
<FromGitter> <ansh> Dont know where to start tbh
<FromGitter> <Blacksmoke16> just have to deal with the types
<FromGitter> <Blacksmoke16> https://crystal-lang.org/reference/
<FromGitter> <3n-k1> types, stay away from compile-time stuff until you get a handle on it]
<FromGitter> <3n-k1> fortunately crystal is forgiving enough that you can basically treat it like a completely dynamic language most of the time
<FromGitter> <Blacksmoke16> but crystal would be more performant/less bug prone (due to the static typing and compiled nature)
<FromGitter> <Blacksmoke16> and given it already exists prob less work :p
<FromGitter> <3n-k1> oh for sure
<FromGitter> <3n-k1> honestly learning crystal would probably be much less time and work than porting
<FromGitter> <ansh> Where would I start on learning Crystal?
<FromGitter> <3n-k1> the references link above
<FromGitter> <Blacksmoke16> read thru the reference docs, and imo lookup ruby tutorials
<FromGitter> <Blacksmoke16> once you got a grasp of how ruby works, switch to crystal reference/api docs and get a handle on how types work
<FromGitter> <ansh> The Backend is written Crystal mostly using the Kemal framework
<FromGitter> <Blacksmoke16> should port it to Athena 😉 /s
<FromGitter> <3n-k1> hmmm you might be a bit biased ;p
<FromGitter> <ansh> I feel like its just super hard cuz I am mostly a frontend dev with some Node experience but I really dont know how to do backend stuff
<FromGitter> <ansh> And then to learn Crystal I first need to understand backend programming, then ruby, then Crystal
<FromGitter> <3n-k1> backend stuff is gonna be difficult in any language then, imho
<FromGitter> <Blacksmoke16> imo what id do here is learn enough of crystal/ruby to at least have a rough idea of whats going on
<FromGitter> <Blacksmoke16> is it a big code base?
f1reflyylmao has joined #crystal-lang
f1refly has quit [Ping timeout: 264 seconds]
<FromGitter> <ansh> Its not super large. There are a few endpoints for login/register/forgot password. There are a few endpoints to get questions using topic/id/subtopic (its an ed-tech website). There are a few scripts to load and edit the database at mass. And there is an admin portal that users can log onto and change the questions.
<FromGitter> <Blacksmoke16> gotcha
<FromGitter> <Blacksmoke16> yea id just leave it alone, learn enough to know whats going on. Then if/when needed you can port things to a lang you're more familiar with
<FromGitter> <Blacksmoke16> and possibly do new dev in that more familar lang
<FromGitter> <Blacksmoke16> its essentially tech debt now, doesn't *need* to be resolved all at once, but could be done part by part as it relates to new dev etc
<FromGitter> <3n-k1> honestly? i would set up unit tests if you don't have any, and don't touch things unless you need to. when you do start refactoring/porting, you'll have tests to go off of to make sure you don't break anything
<FromGitter> <Blacksmoke16> sadly because its kemal prob easier said than done
<FromGitter> <Blacksmoke16> if anything would prob setup like e2e/integration tests with a `test_` db
<FromGitter> <3n-k1> my experience with kemal wasn't that bad, is it really hard to do tdd with?
<FromGitter> <Blacksmoke16> its simple yes, but i doubt this app was developed with SOLID principles in mind
<FromGitter> <Blacksmoke16> that would make testing it easier
Creatornator has joined #crystal-lang
Creatornator is now known as MatteSilver
<FromGitter> <Blacksmoke16> might be easier to write some e2e tests in cypress
<FromGitter> <ansh> I would show you guys the codebase but its a private repo
<FromGitter> <Blacksmoke16> :shrug: hard to say w/o seeing it
<FromGitter> <Blacksmoke16> yea np
<FromGitter> <ansh> I could probably send a screen recording
<FromGitter> <Blacksmoke16> naw its fine
<FromGitter> <ansh> Also if any of you are looking for some part time work or a job
<FromGitter> <ansh> I could refer
<FromGitter> <ansh> lol
<FromGitter> <Blacksmoke16> :p
<FromGitter> <Blacksmoke16> are you like the only dev now?
<FromGitter> <Blacksmoke16> or was that guy the only backend dev?
<FromGitter> <ansh> There is me + a ML guy
<FromGitter> <ansh> but yeah thats it
<FromGitter> <Blacksmoke16> welp, time to brush up on REST :P
<FromGitter> <Blacksmoke16> backend sounds pretty small/straight forward
<FromGitter> <Blacksmoke16> db scripts are prob the only more complex part
<FromGitter> <ansh> hardest part of the backend is probably a Glicko2 implementation
<FromGitter> <ansh> But we had a Python version of that luckily
<FromGitter> <Blacksmoke16> ah nice, that helps
<FromGitter> <Blacksmoke16> career move, become full stack and ask for a raise :p
<FromGitter> <Blacksmoke16> full stack dev*
MatteSilver has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
<FromGitter> <ansh> Hahhaha, big brain move
<FromGitter> <ansh> Will try that ;)
chachasmooth has quit [Ping timeout: 265 seconds]
chachasmooth has joined #crystal-lang
avane has quit [Quit: ZNC - https://znc.in]
<FromGitter> <grkek> Career move don't use web technologies
avane has joined #crystal-lang
<FromGitter> <3n-k1> all the money's in web rn
<FromGitter> <grkek> allt he moneys in my pocket rn
<FromGitter> <grkek> ay
<FromGitter> <grkek> yuh
<FromGitter> <grkek> i flex on you
avane has quit [Ping timeout: 260 seconds]
avane has joined #crystal-lang
<FromGitter> <3n-k1> all 5 dollars, huh? /s
<FromGitter> <Blacksmoke16> tree fiddy
<FromGitter> <grkek> !ban @3n-k1
<FromGitter> <3n-k1> plz no
<FromGitter> <grkek> jk haha i aint bannin you
<FromGitter> <grkek> broke fella
<FromGitter> <3n-k1> i sure am xd
<FromGitter> <grkek> i flex on you
<FromGitter> <grkek> this is what I do
<FromGitter> <grkek> Btw, are you a webdev ?
<FromGitter> <grkek> webde🤢
<FromGitter> <grkek> webde🤢🤢🤢
<FromGitter> <grkek> webdev🤮🤮🤮
<FromGitter> <3n-k1> i am. got hired on as a fullstack contractor for a startup and uhhhh what they didn't tell me was that i was going to be the only employee aside from the two execs, and they also know nothing about technology
<FromGitter> <grkek> Very nice
<FromGitter> <grkek> seems likw the future is bright for you man
<FromGitter> <3n-k1> so my job description was "fullstack dev", and my actual job is "fullstack dev, cto, technical consultant, and project lead"
<FromGitter> <Blacksmoke16> sound stressful
<FromGitter> <grkek> Do they pay you enough?
<FromGitter> <3n-k1> it isssssss lol. they didn't give me requirements for 3 months ⏎ $15/hour
<FromGitter> <3n-k1> so nop
<FromGitter> <Blacksmoke16> f
<FromGitter> <grkek> Yeah 15$ for a fullstack is smol pp
<FromGitter> <Blacksmoke16> id look for a new opportunity
<FromGitter> <3n-k1> first job tho. i'll take anything to get me into the industry
<FromGitter> <Blacksmoke16> ah, fair enough
<FromGitter> <Blacksmoke16> thats kinda even more concerning tho
<FromGitter> <grkek> I work on backend and I get 15€/h still not enough
<FromGitter> <Blacksmoke16> "lets throw this new dev at making our entire stack"
<FromGitter> <3n-k1> they literally have no idea what goes into it
<FromGitter> <Blacksmoke16> (not downing your abilities but you see where im coming from)
<FromGitter> <Blacksmoke16> question is do you? :P
<FromGitter> <3n-k1> like i literally had to explain to them that a sysadmin does more than click a button to start the server
<FromGitter> <Blacksmoke16> xD
<FromGitter> <grkek> I hate people like that
<FromGitter> <grkek> I hate them so much they anger me
<FromGitter> <grkek> They piss me the fuck off instantly
<FromGitter> <3n-k1> i don't know much sysadmin stuff, but i've just about finished most of the general functionality. very rough around the edges, i'm sure a lot could've been done better, but considering that i literally built it from the ground up, i think i did pretty well lol
<FromGitter> <Blacksmoke16> you'll look back in like 6 months and be like "who tf wrote this, its terrible...oh wait"
<FromGitter> <Blacksmoke16> happens to me all the time :S
<FromGitter> <3n-k1> they were explicitly looking for a student, so i'm like 99% sure i'm the only person in the state that fits all their requirements lol
<FromGitter> <grkek> You could use Grip it literally writes itself, no need to write code you can just type in pure english what you want and it spits out the code
<FromGitter> <3n-k1> oh yeah. as soon as i can, i'm going for as much test coverage as i can and refactoring everything
<FromGitter> <Blacksmoke16> good plan
<FromGitter> <Blacksmoke16> using any frameworks? :P
<FromGitter> <3n-k1> django
<FromGitter> <Blacksmoke16> ah so not crystal
<FromGitter> <Blacksmoke16> boo
<FromGitter> <grkek> Don't use that
<FromGitter> <3n-k1> i'd love to use crystal, but i have no experience with crystal frameworks
<FromGitter> <grkek> It is horrible and skow
<FromGitter> <grkek> slow*
<FromGitter> <3n-k1> that and the lack of a 1.0 release at the time would've been concerning
<FromGitter> <3n-k1> i mean, django really isn't that slow, it's used in a lot of huge companies for public-facing applications
<FromGitter> <grkek> Nooooshush
<FromGitter> <Blacksmoke16> its more about the lack of type safety tbh
<FromGitter> <grkek> django is very slow
<FromGitter> <grkek> and sad
<FromGitter> <3n-k1> using mypy
<FromGitter> <grkek> oh okay
<FromGitter> <grkek> its all good now
<FromGitter> <grkek> haha
<FromGitter> <3n-k1> i've got a bunch of contributions to django-stubs because of it haha
<FromGitter> <3n-k1> honestly at this point i would almost refuse to touch a non-trivial python app without static typing
<FromGitter> <grkek> have you ever wrote anything open $ource?
<FromGitter> <3n-k1> nothing big, most of it is abandoned or gone
<FromGitter> <3n-k1> bunch of contributions tho
<FromGitter> <grkek> Oh ripperoni
<FromGitter> <3n-k1> you're the only other person i've met that says ripperoni!
<FromGitter> <grkek> heh
<FromGitter> <grkek> I have been spying on you ;)
<FromGitter> <3n-k1> 👀
<FromGitter> <grkek> I know your talking tactics and manners
<FromGitter> <grkek> 👀👀👀
<FromGitter> <grkek> I have made something rather interesting in crystal
<FromGitter> <grkek> but I am still waiting for an issue to get resolved by one of the shards authors which I use
<FromGitter> <Blacksmoke16> oh?
<FromGitter> <grkek> The layout
<FromGitter> <Blacksmoke16> ah
<FromGitter> <grkek> It is pretty good at its state but the codebase needs refactoring
<FromGitter> <grkek> Have you seen it what it can do?
<FromGitter> <grkek> Its like React Native but for desktop
DTZUZU has quit [Read error: Connection reset by peer]
DTZUZU has joined #crystal-lang
_whitelogger has joined #crystal-lang
_whitelogger has joined #crystal-lang
_whitelogger has joined #crystal-lang
deavmi has quit [Quit: Eish! Load shedding.]
deavmi has joined #crystal-lang
ua has quit [Ping timeout: 256 seconds]
chloekek has joined #crystal-lang
ua has joined #crystal-lang
<FromGitter> <j8r> @3n-k1 I guess you're in a "startup"?
<FromGitter> <kingsleyh> can anyone give me a pointer on how to use JSON::Serializable to write a converter for Array(Hash(String, Float)) to Array(Hash(String,BigDecimal) - see here: https://play.crystal-lang.org/#/r/9yji
<FromGitter> <kingsleyh> if it's not possible right now with JSON::Serializable I will go with a custom implementation of from_json doing it by hand
<FromGitter> <HertzDevil> crystal-lang/crystal#9898
<FromGitter> <Blacksmoke16> you'd want to `require "big/json"` as well
<FromGitter> <Blacksmoke16> then could prob just take the code from his PR for now
<FromGitter> <Blacksmoke16> and remove it next release
<FromGitter> <kingsleyh> oh
<FromGitter> <j8r> @Blacksmoke16 thx, I didn't read the whole discussion. I was right :)
<FromGitter> <Blacksmoke16> 👍 np
<FromGitter> <j8r> combining several jobs in one is typically on small businesses
<FromGitter> <3n-k1> i'd be much more fine with the workload and small pay if i had known about it up front haha. i know for next time though, ask in the interview if they have a concrete set of requirements and any other employees
<yxhuvud> yeah, having collegues that are doing the same thing is really nice to have
<yxhuvud> The upside is you will learn a whole lot :)
<FromGitter> <3n-k1> i've learned a bit, but i think the best experience i've gotten from it is contributing to all the dependencies i use haha. back before they gave me requirements, they gave me permission to charge them for time spent contributing to projects we relied on, so that was cool
<yxhuvud> that is more than I ever have gotten :<
<FromGitter> <3n-k1> yeah. i got *ridiculously* lucky with this position
<FromGitter> <tenebrousedge> sup peeps
<FromGitter> <Blacksmoke16> o/
<FromGitter> <tenebrousedge> hey you 😁 how's it been?
<FromGitter> <Blacksmoke16> not too bad
<FromGitter> <tenebrousedge> working on anything fun these days?
<FromGitter> <Blacksmoke16> not really, been playing a lot of factorio lately :p
<FromGitter> <tenebrousedge> I'm not sure if I can allow myself to play that game. I might get lost in it 😆
<FromGitter> <Blacksmoke16> xD, yea im playing with some mods, didnt even scratch the surface
<oprypin> wtf factorio with mods 🙀
<FromGitter> <tenebrousedge> cool cool. Any recommendations for Crystal projects that need help?
<FromGitter> <Blacksmoke16> oprypin ha yea. Krastorio 2 and space exploration
<FromGitter> <Blacksmoke16> oh and LTN
<FromGitter> <Blacksmoke16> @tenebrousedge prob a lot :p
erdnaxeli has quit [Ping timeout: 260 seconds]
erdnaxeli has joined #crystal-lang
avane has quit [Ping timeout: 264 seconds]
<FromGitter> <j8r> I'd say, crystal-lang/crystal crystal-lang/shards :P
<FromGitter> <j8r> when I see games where we have to "program", more or less, I'm just saying to myself: "Huuu, let's rather program instead" haha
<FromGitter> <ImAHopelessDev_gitlab> Hi
<FromGitter> <3n-k1> is there any centralized place for reporting vulnerabilities in crystal packages (other than cve)? thinking about building something to integrate with shards to report vulnerabilities if it doesn't already exist
<FromGitter> <j8r> no, just create an issue in the repo in question
<FromGitter> <j8r> Also about talking security, too bad https://github.com/crystal-lang/shards/issues/242 is till open :(
<FromGitter> <j8r> but maybe it is now? Not sure
<FromGitter> <j8r> no, nvm.
<FromGitter> <tenebrousedge> @j8r any low hanging fruit? stuff that needs more time than deep internal knowledge?
<FromGitter> <RespiteSage> You could document some of `::Math`.
<FromGitter> <RespiteSage> ```code paste, see link``` ⏎ ⏎ ^ isn't very helpful. [https://gitter.im/crystal-lang/crystal?at=5fb1a2ed2a35440715295465]
<FromGitter> <RespiteSage> I know it's based on existing math libraries, but I shouldn't have to go searching other docs for the method name to figure out what a method does.
<FromGitter> <tenebrousedge> I had noticed that stuff, and I was just as clueless as to what it might be
<FromGitter> <RespiteSage> Ah, well. One day someone will know enough and have time to write the docs. :P
<FromGitter> <tenebrousedge> did you change your handle?
<FromGitter> <RespiteSage> I did. I used the old one ("kinxer") since my childhood days of Neopets, but I was tired of people assuming its meaning.
<FromGitter> <tenebrousedge> ah!
<FromGitter> <tenebrousedge> yeah mine is still from when I was 14
<FromGitter> <RespiteSage> Why change if you can avoid it? :P
<FromGitter> <tenebrousedge> I mean I do have an alt that I could / should probably use
<FromGitter> <RespiteSage> Ah, gotcha. It's nice to have a persistent name, though, and it's hard to give up a name you've grown attached to.
<FromGitter> <tenebrousedge> yeah and it's been the same on Github for ten years now
<FromGitter> <tenebrousedge> I dunno
avane has joined #crystal-lang
<FromGitter> <tenebrousedge> k
<FromGitter> <tenebrousedge> wasn't sure what that tag meant
<FromGitter> <tenebrousedge> thanks
<FromGitter> <j8r> sorry, not sure that's a good idea anyway
<FromGitter> <j8r> because PRs are stacking :/
<FromGitter> <j8r> Maybe contributing to shards?
<FromGitter> <j8r> That's not that great to have our PRs stalled, as a contributor. This will likely be your case, so much to review :/
<FromGitter> <j8r> I don't know if SQL is your thing, there are some issues in https://github.com/crystal-lang/crystal-sqlite3/issues and https://github.com/crystal-lang/crystal-mysql/issues too
<FromGitter> <tenebrousedge> could be fun
<FromGitter> <j8r> Also, "without coding", something people tend to skip, we can help reviewing these 200 PRs https://github.com/crystal-lang/crystal/pulls haha
<FromGitter> <j8r> sometimes old issues/PRs are no longer relevant also, and can be closed
<FromGitter> <tenebrousedge> I haven't really contributed much to crystal. Am I allowed to review PRs?
<FromGitter> <j8r> of course, but if you put "review required" or "approved", it will only be informative ("non-blocking")
<FromGitter> <j8r> basically, we can just comment, suggest improvements - which is quite enough :)
<FromGitter> <tenebrousedge> kay :plus1:
<raz> TIL about generated columns in postgres. so useful.
yukai has joined #crystal-lang
<FromGitter> <christopherzimmerman> @tenebrousedge are you interested in scientific computing? https://github.com/crystal-data/num.cr is always looking for contributors.
<FromGitter> <tenebrousedge> as interested as I am in anything else. I'm not sure what relevant experience I might have with scientific computing. The sqlite issues seem manageable
<FromGitter> <Blacksmoke16> doc updates to API docs and/or book are always 💯 too