lucasb has quit [Quit: Connection closed for inactivity]
gdonald has quit [Read error: Connection reset by peer]
gdonald has joined #ruby
Swyper has quit [Remote host closed the connection]
gdonald has quit [Read error: Connection reset by peer]
gdonald has joined #ruby
gdonald has quit [Read error: Connection reset by peer]
gdonald has joined #ruby
Axy has quit [Quit: Leaving]
evdubs_ is now known as evdubs
hiroaki has quit [Ping timeout: 260 seconds]
prion has joined #ruby
gdonald has quit [Read error: Connection reset by peer]
gdonald has joined #ruby
orbyt_ has joined #ruby
gdonald has quit [Read error: Connection reset by peer]
aremaref has quit [Ping timeout: 268 seconds]
gdonald has joined #ruby
TomyLobo has quit [Read error: Connection reset by peer]
gdonald has quit [Read error: Connection reset by peer]
drincruz has joined #ruby
dfucci has joined #ruby
gdonald has joined #ruby
gdonald has quit [Read error: Connection reset by peer]
dfucci has quit [Ping timeout: 240 seconds]
drincruz has quit [Ping timeout: 264 seconds]
gdonald has joined #ruby
gdonald has quit [Read error: Connection reset by peer]
aremaref has joined #ruby
gdonald has joined #ruby
aremaref has quit [Ping timeout: 256 seconds]
bsdbandit-01 has joined #ruby
bsdbandit-01 has quit [Read error: Connection reset by peer]
gix has quit [Ping timeout: 268 seconds]
CrazyEdd has quit [Remote host closed the connection]
gdonald has quit [Read error: Connection reset by peer]
gdonald has joined #ruby
also_uplime has quit [Quit: quit]
uplime has joined #ruby
akem has quit [Remote host closed the connection]
akem has joined #ruby
prion has quit [Ping timeout: 268 seconds]
bsdbandit-01 has joined #ruby
cliluw has quit [Ping timeout: 268 seconds]
Iarfen has quit [Remote host closed the connection]
gdonald has quit [Read error: Connection reset by peer]
gdonald has joined #ruby
ramfjord has quit [Ping timeout: 260 seconds]
duderonomy has joined #ruby
teardown has quit [Ping timeout: 240 seconds]
bsdbandit-01 has quit [Read error: Connection reset by peer]
gdonald has quit [Read error: Connection reset by peer]
gdonald has joined #ruby
mnathani has joined #ruby
teardown has joined #ruby
Rakko has joined #ruby
gdonald has quit [Read error: Connection reset by peer]
gdonald has joined #ruby
gdonald has quit [Read error: Connection reset by peer]
gdonald has joined #ruby
ur5us has quit [Ping timeout: 260 seconds]
ChmEarl has quit [Quit: Leaving]
learner has joined #ruby
CrazyEdd has joined #ruby
<learner>
hi, i need help mapping a floor plan with ascii into colorized floor plan. I have a very rudimentary idea of how to do it, but I'm sure there are much more elegant ways of doing it, hence why i'm asking for help
<havenwood>
learner: how are you currently doing it? shareable code?
gdonald has quit [Read error: Connection reset by peer]
<learner>
my idea is to do a for each with index loop over rows and columns and then check to see if i'm in a room or i'm a wall, or a door way
<learner>
not finished code, just starting, but sure, how do i share here? can i use pastebin?
bsdbandit-01 has quit [Read error: Connection reset by peer]
<learner>
i understand that it would be really nice and more of a ruby way, if i could do a sort of map, reduce, or a filter that I apply to the floor_map
<learner>
i just need some help figuring it out how to do that
<havenwood>
learner: Show an example of using Colorize?
<learner>
ok
<havenwood>
learner: I assume just #colorize_rooms is called from the outside?
gdonald has quit [Read error: Connection reset by peer]
<learner>
havenmood: yes, i'm going to call it with an array of strings, i think
<learner>
like the only way to know that you're a doorway, vertically, it seems that you need to check if your left and right are rooms already
Swyper has quit [Remote host closed the connection]
<learner>
but that's only in one row
<learner>
this requires 2d awareness
<havenwood>
learner: How about #each_cons(3)
<havenwood>
learner: mark doors horizontally then vertically, maybe?
<learner>
but that's less efficient than a single pass
<learner>
what i think needs to happen is that we need to move a 2x2 or 3x3 box around
<learner>
evaluate what's at the center
<learner>
sorry, 2x2, 2x3, or 3x3
<learner>
or have a 3x3 box, that at edge cases has null in some corners
<learner>
that center's identity depends on the situation going on in its neighbors
<learner>
or a better optimized look, we need a 1x2, 1x3, or 2x3
<learner>
which could be a 2x3
<learner>
we need to know what's on the previous row
gdonald has quit [Read error: Connection reset by peer]
<learner>
if above the current element is a #, it's either a doorway or a room
gdonald has joined #ruby
<learner>
that is if the current element isn't itself a #
bsdbandit-01 has joined #ruby
<learner>
now if the row above is both rooms on the left and right, meaning the above right and above left are room elements, then it's going to be a door way
gdonald has quit [Read error: Connection reset by peer]
gdonald has joined #ruby
<learner>
that counts openings
<havenwood>
learner: I guess you'd need to check for three empties in a row intersecting from the opposite?
<havenwood>
learner: What's an opening example?
<learner>
you see the first room?
<havenwood>
learner: upper left?
<learner>
yes
<havenwood>
yes
<learner>
you see the door way for it
<havenwood>
yup
<havenwood>
one wide, open above and blow
<learner>
so that's a horizontal opening what gives a doorway
<learner>
yes
<learner>
what i'm not sure about is that maybe the doorway could be more than 1 opening
<havenwood>
learner: Yeah, I was thinking take the resulting indexes above ^ and then check horizontals and see if you have any that are [' ', ' ', ' '] at the same coords.
<learner>
what if just like vertical door ways, as soon as you have a wall coming, you count that as a doorway?
<havenwood>
learner: is there an example in this map or that's just another possible thing?
<learner>
no actually scratch that, the blue room is a contradiction
bsdbandit-01 has quit [Read error: Connection reset by peer]
bsdbandit-01 has joined #ruby
bsdbandit-01 has quit [Excess Flood]
bsdbandit-01 has joined #ruby
bsdbandit-01 has quit [Excess Flood]
bsdbandit-01 has joined #ruby
gdonald has quit [Read error: Connection reset by peer]
gdonald has quit [Read error: Connection reset by peer]
<havenwood>
learner: Many ways to solve this one, it seems.
Swyper has joined #ruby
gdonald has joined #ruby
<havenwood>
learner: My first inclination is to lean towards detecting doors to pair with walls for boundaries.
Swyper has quit [Ping timeout: 272 seconds]
meinside has joined #ruby
bsdbandit-01 has quit [Read error: Connection reset by peer]
gdonald has quit [Read error: Connection reset by peer]
<learner>
yeah i understand that, i just am confused how the vertical one would work if the door for vertical can be longer than 1 opening
gdonald has joined #ruby
<learner>
cause with horizontal that works just fine, but for vertical the only way it would work it seems is to colorize the previous line first, and then determine based on that
<learner>
it seems that it needs awareness of the previous line's decision of what it is, before it can determine what it is itself
<learner>
btw your code doesn't seem to work correctly for the second line string
<learner>
havenwood: it outputs: {5=>:possible_passageway, 8=>:possible_doorway} it misses 2
gdonald has quit [Read error: Connection reset by peer]
gdonald has joined #ruby
gdonald has quit [Read error: Connection reset by peer]
gdonald has joined #ruby
gdonald has quit [Read error: Connection reset by peer]
<havenwood>
learner: since you got ride of index use looks like you can ditch some more code too :)
<havenwood>
learner: great to just keep refactoring until it's super concise and clear
Swyper has joined #ruby
Swyper has quit [Remote host closed the connection]
<havenwood>
learner: those two ^ do the same thing, right?
fanta1 has joined #ruby
<havenwood>
learner: from your dpaste, looks like you can then ditch line 21, the `, _2` on line 22, then remove the `, index` on line 6, to be rid of that vestigial index.
<havenwood>
learner: 26 can be: floor_map.map(&:chars)
<havenwood>
learner: #grapheme_clusters is like #chars but works with emoji
<havenwood>
learner: i'd use one or the other, depending on whether you want to support multi-codepoint characters like emoji
<havenwood>
learner: seems like the #filter_map on line 22 can just be a #map now.
<havenwood>
learner: fun problem, with options to choose rooms or walls first.
naftilos76 has joined #ruby
<learner>
thanks!
<learner>
wow it's slowly becoming like good ruby code
<havenwood>
learner: Next I'd think about switching the constants maybe to a single constant Hash?
gdonald has quit [Read error: Connection reset by peer]
clemens3_ has quit [Ping timeout: 260 seconds]
<Learner>
the issue is that i need a specific pattern burgenstrand
<burgestrand>
Learner isn't the issue that your pattern isn't working and you don't know why?
<Learner>
this is for the project that i'm doing to colorize the floor map
blackmesa1 has quit [Quit: WeeChat 3.0]
gdonald has joined #ruby
<tempate>
Is there a better way of doing something like: file.readlines.map(&:chomp).map{ |expression| expression.chars.select{ |char| char != ' '} } ?
<Learner>
yes, i need to find exactly a pattern where it starts with one or many #'s and ends with one or many #s and in between has exactly the same character repeated
hiroaki has joined #ruby
<burgestrand>
Learner the pattern you provided has a problem that you can learn about in the link I sent you
clemens3_ has joined #ruby
<Learner>
"#aa# #".scan("/(#+)[a-p]+(#+)/")
<Learner>
same problem persists
<Learner>
"#aa# #".scan("/#+[a-p]+#+/")
<Learner>
this way too
<burgestrand>
Learner indeed, the first match starts at your first # — the second one starts at your second #?
gdonald has quit [Read error: Connection reset by peer]
<Learner>
the pattern is this: starts with 1 or more #, then there's a character between a and p, which may repeat, and then there's 1 or more #s at the end
gdonald has joined #ruby
<burgestrand>
Learner when you give quotes to scan I believe it's interpreted literally, i.e. "/#+a#+/" doesn't look for a pattern, it looks for the string provided
<burgestrand>
Learner drop the quotes :)
Technodrome has joined #ruby
<Learner>
ahh thanks
gdonald has quit [Read error: Connection reset by peer]
gdonald has joined #ruby
<burgestrand>
tempate what's the problem with it?
<tempate>
burgestrand: well, I thought there may be some more concise way
<burgestrand>
tempate could replace `.select …` with `.grep(/[^ ]/)` I guess — also if the file is large you might want to not load it all into memory with #readlines
<burgestrand>
tempate I'm guessing the latter really isn't a problem :)
<burgestrand>
tempate not sure what the purpose of &:chomp is — there's some possible overlap with the `chars.grep`?
<tempate>
Yeah, I don't think that's a problem either
<tempate>
I understand that chomp is used to remove the '\n' characters?
<burgestrand>
tempate yeah, it feels that's roughly the same as `file.readlines.map { |expression| expression.chars.grep(/[^ \n]/) }`? (not exactly equivalent, though)
<burgestrand>
… or, well, depending on what you _actually_ want perhaps you want to remove *all* space characters?
<arne_>
i mean a[1] won't be the same after the first part of the assignment
fippy has joined #ruby
BenDover has joined #ruby
burgestrand has joined #ruby
Technodrome has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
Swyper has joined #ruby
Swyper has quit [Ping timeout: 272 seconds]
hiroaki has quit [Ping timeout: 256 seconds]
olc52 has joined #ruby
Swyper has joined #ruby
<leah2>
it happens in parallel
Swyper has quit [Remote host closed the connection]
pen has joined #ruby
pen has quit []
hiroaki has joined #ruby
meinside has quit [Quit: Connection closed for inactivity]
pencilcheck has joined #ruby
dfucci has quit [Read error: Connection reset by peer]
dfucci has joined #ruby
prion has joined #ruby
pencilcheck has quit [Ping timeout: 256 seconds]
bsdbandit-01 has quit [Read error: Connection reset by peer]
cliluw has quit [Ping timeout: 256 seconds]
cliluw has joined #ruby
bsdbandit-01 has joined #ruby
bsdbandit-01 has quit [Excess Flood]
pen has joined #ruby
bsdbandit-01 has joined #ruby
bsdbandit-01 has quit [Excess Flood]
Swyper has joined #ruby
Swyper has quit [Remote host closed the connection]
Swyper has joined #ruby
Swyper has quit [Remote host closed the connection]
bsdbandit-01 has joined #ruby
bsdbandit-01 has quit [Excess Flood]
va5c0 has quit [Ping timeout: 268 seconds]
bsdbandit-01 has joined #ruby
blackmesa has joined #ruby
pencilcheck has joined #ruby
va5c0 has joined #ruby
Swyper has joined #ruby
Rudd0 has quit [Ping timeout: 240 seconds]
pen has quit [Ping timeout: 265 seconds]
Swyper has quit [Remote host closed the connection]
hiroaki has quit [Ping timeout: 260 seconds]
Swyper has joined #ruby
blackmesa has quit [Ping timeout: 258 seconds]
blackmesa has joined #ruby
bsdbandit-01 has quit [Ping timeout: 240 seconds]
bsdbandit-01 has joined #ruby
burgestrand has quit [Quit: burgestrand]
hiroaki has joined #ruby
braincrash has quit [Read error: Connection reset by peer]
shaman42 has quit [Ping timeout: 240 seconds]
shaman42 has joined #ruby
braincrash has joined #ruby
al2o3-cr has quit [Ping timeout: 256 seconds]
plant_enjoyer has joined #ruby
bsdbandit-01 has quit [Read error: Connection reset by peer]
AndreYuhai has joined #ruby
AndreYuhai has quit [Client Quit]
cybcypha_ has joined #ruby
<cybcypha_>
Hey there anyone good with stripe pay? got some questions
burgestrand has joined #ruby
naftilos76 has quit [Ping timeout: 256 seconds]
bsdbandit-01 has joined #ruby
BenDover has quit [Quit: BenDover]
olc52 has quit [Ping timeout: 245 seconds]
znz_jp has joined #ruby
plant_enjoyer has quit [Quit: Leaving]
bsdbandit-01 has quit [Read error: Connection reset by peer]
bsdbandit-01 has joined #ruby
bsdbandit-01 has quit [Read error: Connection reset by peer]
bsdbandit-01 has joined #ruby
AndreYuhai has joined #ruby
AndreYuhai has quit [Client Quit]
bsdbandit-01 has quit [Read error: Connection reset by peer]
<adam12>
havenwood: had a chance to use steep + steep-vscode and it worked great.
<adam12>
I think it's still got some way to go but very usable this early.
<adam12>
cybcypha_: Might be better off in #stripe but what's your questions?
<cybcypha_>
I've got stripe set up on operations site
<cybcypha_>
however its working more like subscription based setup
<cybcypha_>
where an opeartions derives a charge$ of some sort
<cybcypha_>
I have to 2 type of users and want to provide a segment where payments can made across the 2 types users?
<cybcypha_>
so client(A) being able to make payments to client(B)
<cybcypha_>
I just wanted to find out if any had similar experience and how they did go over it
bsdbandit-01 has joined #ruby
bsdbandit-01 has quit [Read error: Connection reset by peer]
<cybcypha_>
what details or requirement will I need?
<adam12>
cybcypha_: It sounds like a marketplace, where you have buyers and sellers?
<cybcypha_>
precisely
<cybcypha_>
what requirements will I need from each user to enable successful transaction usingt the API?
<adam12>
cybcypha_: Well, this question borders on how long is a piece of string. It's going to come down to "it depends".
SeepingN has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
<adam12>
cybcypha_: But if you have buyers and sellers, no hybrids (people who buy and sell on the same account), the simplest is using Stripe Connect and the regular Stripe payment API.
<cybcypha_>
will they both need to enter credit card during subsribing
<adam12>
cybcypha_: If you have hybrids, it would probably be simpler to use some sort of ledger that tracks debits and credits across accounts. The people from Envato had a library that used to do this that you could go look at.
<cybcypha_>
okay, I check it out
<adam12>
No; for the usual Stripe Connect offering, the seller only needs to provide Know Your Customer details.
<adam12>
Depending on your client base, Square offers _similar_ competing products. If your sellers already use Square it might be a better integration point.
<cybcypha_>
so what customer details precisely, in terms of fields
<cybcypha_>
name bankaccount cvr
<adam12>
cybcypha_: I don't know. You'd be better off asking Stripe that.
SeepingN has joined #ruby
<cybcypha_>
but how does the transaction know which account to hit
<cybcypha_>
wih
<cybcypha_>
without entering details of bank card details during subscription
<adam12>
cybcypha_: When you integrate with Stripe Connect, you go through the OAuth2 3-legged auth flow. When the seller returns to your site, you use the OAuth2 token to retrieve a Stripe API token. Then on your side, it's something like Stripe::Charge.create({ amount: 10_00 }, your_customers_api_token).
<adam12>
cybcypha_: You're customer signs up through Stripe, and Stripe collects bank account information.
<cybcypha_>
so here in denmark we use something known as konto number in doing payout
<adam12>
cybcypha_: Your buyer doesn't see Stripe; they would just see a credit card form for what they are buying.
<cybcypha_>
which is linked to bank details
bsdbandit-01 has joined #ruby
<cybcypha_>
however I'm wondering if that is enough for make payments
bsdbandit-01 has quit [Read error: Connection reset by peer]
<cybcypha_>
since I'm presuming its not integrated with stripe
<adam12>
cybcypha_: This is a Stripe question. I'm in North America so I have no idea. You will have to probably do SCA.
<cybcypha_>
okay so you just confirmed what I was thinking
<cybcypha_>
when user subscribes they would have to enter credit card form just like to the other users
<cybcypha_>
to enable transactions back and forth
<cybcypha_>
So I'm guessing I will have to fields for the forms for the independent users in ensuring transactions
oddp has joined #ruby
m27frogy has joined #ruby
Iarfen has joined #ruby
bsdbandit-01 has joined #ruby
somazero has quit [Quit: Leaving]
naftilos76 has joined #ruby
gdonald has quit [Ping timeout: 256 seconds]
TCZ has joined #ruby
prion has quit [Ping timeout: 265 seconds]
qbklinm81 has joined #ruby
qbklinm81 has left #ruby [#ruby]
Rudd0 has joined #ruby
burgestrand has quit [Quit: burgestrand]
gdonald has joined #ruby
va5c0 has quit [Ping timeout: 272 seconds]
cloud69 has joined #ruby
va5c0 has joined #ruby
royo25 has quit [Quit: Bye]
phage has joined #ruby
lanky_leguan has joined #ruby
bsdbandit-01 has quit [Read error: Connection reset by peer]
Hien has quit [Remote host closed the connection]
GGMethos has quit [Remote host closed the connection]
<lanky_leguan>
was Kernel::sprintf for earlier ruby versions more lenient with regards to '%s %' % [v]? 2.5.7 is "incomplete format specifier", but I'm looking at old foreign code that has it
Hien has joined #ruby
bsdbandit-01 has joined #ruby
<lanky_leguan>
yeah, just checked, at least 1.9.1 did allow it