<riceandbeans>
if I have a mysql object and I have a prepared statement and I'm doing the execute and it looks like this....
monsieurp has left #ruby [#ruby]
<riceandbeans>
statement.execute(foo, bar, baz, foobar, foobaz) is it possible to make that span multiple lines without breaking?
B1n4r10 has joined #ruby
dfinninger has joined #ruby
s00pcan_ has joined #ruby
Phage is now known as Eru
Eru is now known as Phage
kfpratt has joined #ruby
djbkd_ has quit [Ping timeout: 240 seconds]
graffix222 has joined #ruby
vikas027 has left #ruby [#ruby]
solocshaw has quit [Ping timeout: 260 seconds]
krobzaur has quit [Ping timeout: 246 seconds]
dfinninger has quit [Ping timeout: 265 seconds]
wolffles has joined #ruby
B1n4r10 has quit [Ping timeout: 260 seconds]
jobewan has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
B1n4r10 has joined #ruby
Renich has quit [Quit: leaving]
houhoulis has joined #ruby
TheNet has joined #ruby
celly has joined #ruby
sanguisdex has quit [Ping timeout: 260 seconds]
hxegon is now known as hxegon_AFK
rvchangue has quit [Ping timeout: 276 seconds]
spider-mario has quit [Remote host closed the connection]
celly has quit [Ping timeout: 240 seconds]
nug has quit [Ping timeout: 276 seconds]
B1n4r10 has quit [Ping timeout: 246 seconds]
rvchangue has joined #ruby
B1n4r10 has joined #ruby
kfpratt has quit [Remote host closed the connection]
nug- has joined #ruby
<shevy>
would it be sensible to subclass from class String?
snockerton has quit [Ping timeout: 265 seconds]
jnj has joined #ruby
trwyth has joined #ruby
<jnj>
What are some things I should be aware of when deciding to implement data structures and algorithms in ruby? I've used enumerable for my linked list, are there other things I should be aware of that is like that?
mary5030 has joined #ruby
wolffles has left #ruby [#ruby]
wolffles has joined #ruby
<jnj>
i.e., what are some things I should know to implement dsa the "ruby way"
tvw has quit [Remote host closed the connection]
kies^ has joined #ruby
Channel6 has joined #ruby
chouhoulis has quit [Remote host closed the connection]
sgambino has joined #ruby
dotix has joined #ruby
baweaver has joined #ruby
s00pcan_ has quit [Ping timeout: 245 seconds]
DLSteve has joined #ruby
s00pcan_ has joined #ruby
dotix has quit [Ping timeout: 260 seconds]
baweaver has quit [Ping timeout: 240 seconds]
Gnut has quit [Ping timeout: 245 seconds]
<Phage>
What regex type should I choose for ruby? Python, PHP or JS?
selfflow has joined #ruby
<bougyman>
perlish
<bougyman>
pcre-ish, anyway
<Phage>
Alright, thanks!
Channel6 has quit [Quit: Leaving]
wolffles has left #ruby [#ruby]
jnj has quit [Quit: Leaving]
selfflow has left #ruby [#ruby]
wolffles has joined #ruby
juddey has quit [Read error: Connection reset by peer]
mary5030 has quit [Remote host closed the connection]
hxegon_AFK is now known as hxegon
<hxegon>
how does this http data translate to ruby? product_property[property_name]=size
<hxegon>
is that { product_property => { property_name => 'size' } }?
devoldmx has joined #ruby
duckpuppy has joined #ruby
Melpaws has quit [Quit: Leaving.]
devoldmx has quit [Ping timeout: 250 seconds]
s00pcan_ has quit [Ping timeout: 260 seconds]
duckpuppy has quit [Ping timeout: 260 seconds]
Melpaws has joined #ruby
<wolffles>
test.
<wolffles>
yay i can talk again
RegulationD has quit [Remote host closed the connection]
<havenwood>
wolffles: hellooo
jwinder has joined #ruby
pneuma has joined #ruby
colegatron has quit [Ping timeout: 265 seconds]
<shevy>
hxegon the problem is that this is using the method call [] and you can define [] everywhere
<shevy>
hxegon however, the most natural would be to assume a hash, where you just store a key->value entry
<shevy>
it also depends on what the variable size would be
<shevy>
if it is a string, then it would be 'size' but it could be any other object too
lucid_ has joined #ruby
<hxegon>
size would be a string in this case
<hxegon>
really hate ambiguous docs.
<shevy>
hmm what is property_name? in your above code it also must be a variable, or a method call
djbkd_ has joined #ruby
<hxegon>
that's quoted from the example in my docs for the spree api
<shevy>
hehehe
terminalrecluse has joined #ruby
wolfflez has joined #ruby
paradisaeidae has joined #ruby
wolffles has quit [Ping timeout: 250 seconds]
moeabdol has joined #ruby
Ishido has quit [Ping timeout: 245 seconds]
gluec has joined #ruby
dfinninger has joined #ruby
djbkd_ has quit [Ping timeout: 265 seconds]
wolfflez has left #ruby [#ruby]
robh71 has joined #ruby
marr has quit [Ping timeout: 255 seconds]
yfeldblum has quit [Remote host closed the connection]
DLSteve has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
<gluec>
hey all. I have a hash where all values are just strings. I want to eliminate the keys where value is nil. I know I can .select{|n,v| v} , but I feel like I'm missing a useful keyword that does it cleaner. Is there one?
<havenwood>
hxegon: Well delete returns the value and you've provided the key so don't you have both parts already? Mmm.
<havenwood>
stevenxl: That String looks suspiciously like HTML.
<hxegon>
I feel a zalgo moment coming along
<stevenxl>
havenwood: it is.
<hxegon>
stevenxl and your trying to parse it with regex
<stevenxl>
I can't insert that string directly because it is escaped, etc, so I just need to get the information out of it.
TheNet has joined #ruby
<stevenxl>
hxegon: Yea I tried getting the first part of what I need (the url starting with https) with regex.
<stevenxl>
I cant' get the result of that to stop in the correct place
<hxegon>
stevenxl learn this lesson now: if you try to use regex on html, your asking the devil to come in and have tea.
<bougyman>
only if you don't know your data well.
<bougyman>
if you know your data, regex is a viable option for a simple match/extract
<hxegon>
bougyman true, but for *very* limited cases that are extremely stable.
<stevenxl>
hxegon: I believe you, but what are my options in that case?
<bougyman>
agree, hxegon
<bougyman>
and that's the other case... sometimes regex is the only option.
<hxegon>
stevenxl nokogiri is great
<havenwood>
stevenxl: What's the return value you're looking for? A single String? An Array of Strings?
<bougyman>
malformed html and such.
<havenwood>
stevenxl: Are you familiar with Nokogiri or Oga?
<stevenxl>
havenwood: it's a single string. I have a view that uses a view helper called gravatar_image. I pass in a user and it automagically inserts that string in my view.
<havenwood>
stevenxl: I mean what do you want out of it.
<havenwood>
stevenxl: That's the input, what output do you want.
<stevenxl>
But now, I need to take that information and return it as a JSON. So I use that helper (with Active Model Serializer) to get the string, and now i need to break it upt because the JSON is escaped and scary.
<stevenxl>
havenwood: I need the src, width, height
<stevenxl>
just those 3 things
B1n4r10 has quit [Quit: leaving]
<stevenxl>
Then I'm just going to re-create that string from the JSON object in a Handlebars template.
<pabs>
stevenxl: use nokogiri or soemthing comparable to parse the html fragment and extract the relevant attributes, then reserialize the result as json
TheNet has quit [Ping timeout: 250 seconds]
<stevenxl>
pabs: OK. You're the 2nd to mention that so I'll give that a try.
<Phage>
havenwood: I need to catch the "TIL (...)" until the next "TIL" starts.
Guest38 has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
s1kx has quit [Quit: bai]
seitensei has joined #ruby
skade has joined #ruby
seitensei has quit [Ping timeout: 255 seconds]
skade has quit [Client Quit]
pawnbox has joined #ruby
<stevenxl>
guys
<stevenxl>
I still don't know to use nokogiri well, but it's definitely working
<hxegon>
stevenxl :)
<stevenxl>
just need to read the docs to figure out how to traverse the tree
shakes has joined #ruby
<wolffles>
would anyone be interested in helping a brother out by showing me how to do this with ruby methods instead of logically. https://eval.in/494508
<hxegon>
stevenxl I think it uses css selectors
RegulationD has joined #ruby
FernandoBasso has quit [Remote host closed the connection]
cashnguns has quit [Remote host closed the connection]
<hxegon>
wolffles I'll take a crack @ it
<wolffles>
:D tanks
pawnbox has quit [Ping timeout: 240 seconds]
colegatron has joined #ruby
axisys has joined #ruby
c355e3b has quit [Quit: Connection closed for inactivity]
shakes has quit [Quit: Leaving]
RegulationD has quit [Ping timeout: 240 seconds]
s00pcan_ has quit [Ping timeout: 276 seconds]
djbkd_ has joined #ruby
<shevy>
tasty waffles...
<stevenxl>
hxegon: yea I was able to use css selectors, then use the attr method, then the value method to get to the actual value of the attribute I wanted
<stevenxl>
Intuitive once you get the general concept
<kevinquinnyo1>
dangit NickServ, i thought i authenticated as kevinquinnyo
blackgoat has quit [Quit: WeeChat 1.3]
<hxegon>
kevinquinnyo1 what are the possible values of row['Processed'] ?
dotix has joined #ruby
<hxegon>
kevinquinnyo1 also, if you are using a stdlib CSV::Table, then you can just say row['Processed'] and it will figure it out BTW
charliesome has joined #ruby
<hxegon>
if your in fact dealing with a CSV table
arescorpio has joined #ruby
joneshf-laptop has quit [Ping timeout: 240 seconds]
<kevinquinnyo1>
hxegon: it's a value in a google spreadsheet right now, (using google_drive gem) -- it's kind of a proof of concept app at this point, but i wanted to validate that the 'Processed' value was actually processed, and since when I update it, I put in a valid Time, I figured the best way to 'validate' that it has been processed is to check if Time.parse() doesn't throw an exception
<hxegon>
kevinquinnyo1 I'm guessing that if it isn't processed, then the row doesn't exist?
unreal_ has joined #ruby
dotix has quit [Ping timeout: 260 seconds]
gambl0re has joined #ruby
djbkd has quit [Quit: Leaving...]
<hxegon>
!value.nil? would be good if referencing a non-existant row returns nil
yqt has quit [Ping timeout: 240 seconds]
<kevinquinnyo1>
hxegon: well it exists, but it's empty, but if you manaually delete the value in google docs, something is left behind, maybe a '/r/n' or something. That's what led to me wanting to validate it in a way that's slightly better than using empty?
unreal has quit [Ping timeout: 260 seconds]
yqt has joined #ruby
<kevinquinnyo1>
are there any problems using 'rescue' the way i did there, that i should be aware of?
<hxegon>
it could cause weird behavior pretty easily
andywojo has joined #ruby
<hxegon>
I would try #inspect on one of those empty rows and find out what it's leaving behind.
tomchapin has joined #ruby
<hxegon>
but #empty would be the best way in my opinion.
joneshf-laptop has joined #ruby
<hxegon>
kevinquinnyo1 also, I would double check to see if you can reference a column header name with that gem. Using indexes for named columns can be a huge headache.
hahuang61 has quit [Read error: Connection reset by peer]
jackjackdripper has joined #ruby
<kevinquinnyo1>
hxegon: thanks, i will try inspect -- i forgot about inspect. And yes, if i can handle managing the column header names with the gem, it might make my code simple (i have a subroutine / function that handles it for now)
ElFerna has quit [Ping timeout: 260 seconds]
<kevinquinnyo1>
hxegon: basically, instead of building an app, i just leveraged google forms + spreadsheets for a prototype
<kevinquinnyo1>
because it was easy
<kevinquinnyo1>
if you're wondering why i did that
pwnd_nsfw has quit [Ping timeout: 264 seconds]
robh71 has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
hahuang65 has joined #ruby
sgambino has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
<shevy>
you were young and needed the money
<shevy>
wolffles aaaah that's always associated with my nick even though it had nothing to do with a chevy!
juddey has joined #ruby
<wolffles>
:3
idefine has joined #ruby
jetblack has joined #ruby
duckpuppy has joined #ruby
hxegon has quit [Ping timeout: 272 seconds]
tomchapin has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
idefine has quit [Ping timeout: 250 seconds]
<wolffles>
ah hxegon left already
hectortrope has quit [Read error: Connection reset by peer]
moeabdol has joined #ruby
s00pcan_ has joined #ruby
hectortrope has joined #ruby
<wolffles>
i did it finally it only took me 40 mins :/
houhoulis has quit [Remote host closed the connection]
<norc>
I just mean the fact that the only hint that this has anything to do with a x.succ() method only comes from the code hint in the japanese comment.
dotix has quit [Ping timeout: 260 seconds]
<norc>
Just gives me plain headaches.
Cohedrin has joined #ruby
al2o3-cr has quit [Ping timeout: 240 seconds]
<norc>
Maybe Im just ranting because I spent too much time debugging a random seg fault I had yesterday through dozens of magical functions I had absolutely no clue what they did or why they are needed..
ss_much has quit [Quit: Connection closed for inactivity]
nerium has joined #ruby
<Ox0dea>
Ruby is old and large. I'm not sure what you were expecting to find.
<norc>
Dragons.
<Paedo>
Ox0dea: you expect to find booty
<Ox0dea>
Frozen string debug info gets stashed in secret ivars. :<
yes`r has quit [Read error: Connection reset by peer]
<dionysus69>
I know so thats why I start from 0 :D
djbkd has quit [Quit: Leaving...]
<shevy>
go with c++
<norc>
dionysus69: If you really want to do it yourself, I recommend you start with something simplistic. Say a chess simulator. :-)
krz has joined #ruby
Anderson69s_Deb has joined #ruby
<norc>
shevy: And have him study C++ for the next 12 months? Im unsure how that is productive.
solocshaw has quit [Ping timeout: 250 seconds]
symm- has quit [Ping timeout: 250 seconds]
<Paedo>
shevy: so what if we're tag-teaming it's better that you stay out of it
AlphaAtom has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
solocshaw has joined #ruby
<dionysus69>
norc I am familiar with c++ so I could be learning on the wat
<dionysus69>
way
<dionysus69>
I dont know ruby well either
<norc>
dionysus69: Dont pick a game then.
<dionysus69>
then ? :D
yfeldblum has quit [Ping timeout: 256 seconds]
<norc>
Learn the language first perhaps?
<norc>
Then you can maybe get started with some OpenGL, which by itself gives you between months and years just to get comfortable with.
dfinninger has joined #ruby
<shevy>
you are so negative norc
<dionysus69>
hmm so which one, lets say I go and become a ruby pro, would I be hindered too much in performance if I use opengl libraries (if I can at all)
<norc>
dionysus69: There is OpenGL bindings for Ruby.
<TheBrayn>
I have heard good things about löve, maybe there are some good tutorials for that
<norc>
dionysus69: Let me teach you a first lesson about programming then.
<norc>
dionysus69: Write code that works. Write tests for that code. Profile your code. Optimize your code. In that order.
<dionysus69>
yes and ?
<norc>
dionysus69: Where does your question about "performance" fall in there? ;-)
<norc>
If you don't even know these questions, its probably not relevnat to you
yes`r has joined #ruby
mdw has joined #ruby
lucid_ has quit [Ping timeout: 245 seconds]
pawnbox has quit [Ping timeout: 255 seconds]
underplank has quit [Quit: underplank]
bkxd has joined #ruby
webus has joined #ruby
<dionysus69>
for example civ 5 performance sucks
<Paedo>
and remember that if your code sucks it's because you might be homo
<dionysus69>
I am not really aiming to make something like civ 5 in the first shot but I would want to start something that scales later
vdamewood has joined #ruby
timonv has joined #ruby
<dionysus69>
so imagine civ 5 is written in ruby using opengl, would it be playable?
<Paedo>
no
<Paedo>
ruby sucks too much for taht
<Paedo>
no optimized code
<Paedo>
civ 5 must be written in assembly and c++
blackms has joined #ruby
<Ox0dea>
>> RubyVM::INSTRUCTION_NAMES.grep /opt/
<ruboto>
Ox0dea # => ["opt_str_freeze", "opt_send_without_block", "opt_case_dispatch", "opt_plus", "opt_minus", "opt_mult ...check link for more (https://eval.in/494618)
hectortrope has quit [Remote host closed the connection]
tomphp has joined #ruby
skcin7 has joined #ruby
roshanavand has quit [Ping timeout: 240 seconds]
tvw has joined #ruby
roshanavand has joined #ruby
<dionysus69>
can I make GUI with QT and bind it to ruby?
DoubleMalt has quit [Remote host closed the connection]
<adaedra>
There are Qt bindings, you can look into that
solocshaw has quit [Ping timeout: 240 seconds]
BSaboia has joined #ruby
hectortrope has joined #ruby
startupality has quit [Quit: startupality]
hectortrope has quit [Client Quit]
startupality has joined #ruby
kobain has joined #ruby
krz has quit [Quit: WeeChat 1.2]
<norc>
dionysus69: I looked into it, it is not worth the hassle unless you really must.
<dionysus69>
norc: so what is best( meaning easiest/most feature) approach for gui making ? do you make gui apps yourself?
<norc>
Not in Ruby.
<dionysus69>
ok I guess ) in java ? :D
<adaedra>
If you do things in Qt, C++ ?
jondot has joined #ruby
kobain has quit [Max SendQ exceeded]
<adaedra>
Also, it may be possible if you do things well to create a library that implements your GUI parts in C++ and expose a C API your Ruby code could use.
<adaedra>
Not the most straightforward, but could be done, I guess.
<dionysus69>
I guess, actually not doing QT, just downloaded QT maker and it looked good. I have done only one GUI app so far in java/netbeans which is good enough I just wondered if its worth learning in ruby
<adaedra>
It's Qt, not QT.
<dionysus69>
haha ok xD
<norc>
adaedra: Considering how Qt works with events, I would consider this to be a really nasty business, unless you use some middleware like CORBA
<dionysus69>
ok nevermind I am not a guy who would implement all that by myself :D
Begi has quit [Ping timeout: 264 seconds]
<adaedra>
I tried GUIing in Ruby, it was not the nicest experience.
<norc>
Same.
<dionysus69>
same lol
skade has quit [Quit: Computer has gone to sleep.]
<adaedra>
I go back to plain C++/Qt when I have to do GUI.
<norc>
Best we have done was a seperate GUI application that talked with the application core through CORBA.
startupality has quit [Ping timeout: 272 seconds]
<norc>
That was pretty easy. :)
<norc>
(With the GUI being developed in Qt/C++)
<dionysus69>
^.^ not that I have to make gui apps, just wondered if I wanted to at some point
<dionysus69>
i am agitated to learn something and I dont know where to start from
<dionysus69>
life is too short
<dionysus69>
fucking primates
<dionysus69>
apologies for my censor breaking outburst, aghm
hectortrope has joined #ruby
pandaant has joined #ruby
dwfait has joined #ruby
kobain has joined #ruby
kobain has quit [Max SendQ exceeded]
kobain has joined #ruby
Contigi has quit [Read error: Connection reset by peer]
al2o3-cr has quit [Ping timeout: 264 seconds]
Contigi has joined #ruby
dwfait has quit [Client Quit]
al2o3-cr has joined #ruby
JoshL has quit [Ping timeout: 240 seconds]
KervyN has quit [Ping timeout: 256 seconds]
hakat has quit [Ping timeout: 246 seconds]
dukedave has quit [Ping timeout: 240 seconds]
mostlybadfly has joined #ruby
Begi has joined #ruby
<phredus>
Hello all, I am new to Ruby and programming, Could someone please tell me which versions of Ruby I should have installed on my system please
dukedave has joined #ruby
<Ishido>
I would say... The latest you can have ?
prestorium has joined #ruby
weemsledeux has joined #ruby
felltir has joined #ruby
KervyN has joined #ruby
tomphp has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
<phredus>
yes, nut I've heard that for compatability you should have a couple of the past versions, but I dont know if that is true and best is why I'm asking.
tomphp has joined #ruby
<phredus>
*but
<Ishido>
Oh, I see.
JoshL has joined #ruby
roshanavand has quit [Remote host closed the connection]
[k- has joined #ruby
roshanavand has joined #ruby
<Ishido>
Sorry, I don't know. I suppose someone else could answer your question.
<phredus>
So does anyone have the real life truth
[k- has quit [Client Quit]
andywojo has joined #ruby
<phredus>
Ishido: thank you I will keep asking till I find someone who knows
<Ishido>
No problem.
kedare has joined #ruby
underplank has joined #ruby
senayar has quit [Remote host closed the connection]
<Jamo>
phredus: usually everyone keeps on using the latest ruby, so install other/older versions only when you end up in a situtation when you really need it
roshanavand has quit [Ping timeout: 240 seconds]
mdw has joined #ruby
<norc>
phredus: Latest is enough. You can install additional rubies when some project has a hard dependency for some reason.
andywojo has quit [Ping timeout: 276 seconds]
hakat has joined #ruby
<norc>
So go and enjoy our brand new 2.3. :-)
dlitvak has joined #ruby
yes`r has quit [Read error: Connection reset by peer]
bkxd has quit [Ping timeout: 246 seconds]
kotk_ has quit [Quit: Leaving...]
sundhell has joined #ruby
seitensei has joined #ruby
sdothum has joined #ruby
gagrio has quit [Remote host closed the connection]
ajb has joined #ruby
ajb has quit [Changing host]
ajb has joined #ruby
underplank has quit [Quit: underplank]
toretore has joined #ruby
bkxd has joined #ruby
svkurowski has quit [Ping timeout: 260 seconds]
dlitvak has quit [Read error: Connection reset by peer]
seitensei has quit [Ping timeout: 260 seconds]
svkurowski has joined #ruby
dlitvak has joined #ruby
dlitvak_ has joined #ruby
ElFerna has quit [Ping timeout: 245 seconds]
hectortrope has quit [Quit: WeeChat 0.4.2]
roshanavand has joined #ruby
rodfersou has quit [Quit: leaving]
roshanavand has quit [Remote host closed the connection]
yfeldblum has quit [Remote host closed the connection]
dlitvak_ has quit [Remote host closed the connection]
roshanavand has joined #ruby
dlitvak has quit [Ping timeout: 265 seconds]
whiteline has joined #ruby
<apeiros>
norc: it happens that I'm around now. what's up?
Jardayn has joined #ruby
ledestin has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
bkxd has quit [Ping timeout: 255 seconds]
<norc>
apeiros: I have a rake task that reads an ASCII-8BIT string representing UTF8 to our Oracle database (with NLS_LANG set to English_Germany.WE8MSWIN1252). Now AR blindly assumes the source encoding to be windows-1252, causing a double encoding error.
<norc>
*it reads and then writes to the oracle database
<apeiros>
oy, not sure I'm awake enough for this kind of question :D
skade has joined #ruby
<norc>
Heh.
<apeiros>
iirc oracle client and server have an independent encoding setting
<apeiros>
and if they differ, they'll translate
<apeiros>
on top of that sits AR which I don't know how much transcoding it does, but I'd assume it will translate from String#encoding to client's encoding
jondot has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
<norc>
Thats the thing, the source encoding is ASCII-8BIT - so just based on this it seems a bit bizarre, it would simply force encode this to windows-1252
<apeiros>
so now my question is: do you want the ascii-8bit translated, so it's correctly in the database (in win1252), or do you want the string as-is in the same binary code as it is, making it "incorrect" in the sense of characters in the db?
redeeem has joined #ruby
redeeem has quit [Client Quit]
<norc>
Well, the fix was easy (I just force encode the input to UTF-8 before passing it to Oracle).
<norc>
But that seems more like a hotfix than anything.
shanemcd has joined #ruby
<apeiros>
not quite sure what AR makes with binary, don't think I've ever tested that. but I think the assumption would be that it force-encodes to either oracle client's encoding, or to Encoding.default_internal
<apeiros>
hm, no, if the data is indeed utf-8, then that's the correct thing to do
<apeiros>
best is of course to already read the data with the correct encoding set
<norc>
Is there such a thing as "base64 with utf8 inside" encoding ?
underplank has joined #ruby
<norc>
apeiros: And yeah, based on my observation the oracle enhanced adapter seems to force-encode to the clients encoding, because Encoding.default_internal is UTF-8.
<apeiros>
sure. you can put whatever into base64
DoubleMalt has joined #ruby
<norc>
apeiros: Ah! Mail is indeed the culprit then. The mail contains 'Content-Type: text/plain; charset="utf-8"' - so mail.body.decode should assume that to be the encoding, rather than just returning a binary string.
<apeiros>
agreed.
sigurding has quit [Quit: sigurding]
<norc>
Thanks for your feedback, I shall patch it and submit a pull request. :)
anisha_ has joined #ruby
ruid has quit [Ping timeout: 250 seconds]
anisha_ has quit [Client Quit]
AlphaAtom has joined #ruby
celly has joined #ruby
RegulationD has joined #ruby
morfin60 is now known as morfin
lacrosse has quit [Quit: Connection closed for inactivity]
celly has quit [Ping timeout: 245 seconds]
blackgoat has quit [Quit: WeeChat 1.3]
Guest32 has joined #ruby
Begi has quit [Ping timeout: 276 seconds]
RegulationD has quit [Ping timeout: 260 seconds]
underplank has quit [Quit: underplank]
duckpuppy has joined #ruby
anisha_ has joined #ruby
dwfait has joined #ruby
scripore has joined #ruby
anisha_ has quit [Client Quit]
tomphp has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
duckpuppy has quit [Ping timeout: 260 seconds]
synthroid has joined #ruby
underplank has joined #ruby
tomphp has joined #ruby
deuterium has joined #ruby
dotix has quit [Remote host closed the connection]
yes`r has joined #ruby
sigurding has joined #ruby
skade has quit [Ping timeout: 250 seconds]
Jackneill has joined #ruby
underplank has quit [Quit: underplank]
krobzaur has joined #ruby
devoldmx has joined #ruby
ruid has joined #ruby
ruid has quit [Changing host]
ruid has joined #ruby
dorei has joined #ruby
Rinalds has quit []
nfk|laptop has joined #ruby
devoldmx has quit [Ping timeout: 276 seconds]
krobzaur has quit [Ping timeout: 256 seconds]
slugabed has quit [Read error: Connection reset by peer]
webus has quit [Ping timeout: 255 seconds]
dstarh has joined #ruby
sgambino has joined #ruby
anisha_ has joined #ruby
Guest32 has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
anisha_ has quit [Client Quit]
sp1rs has joined #ruby
ElFerna has joined #ruby
krz has joined #ruby
ceej has quit [Ping timeout: 240 seconds]
constantinexvi has quit [Ping timeout: 240 seconds]
<aep>
i'm scared of asking buuut... how do you do opencv stuff on ruby with the GIL? :/
bMalum has quit [Quit: bMalum]
<aep>
like, everything's so CPU intensive
weemsledeux has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
<aep>
do people just shove the cpu parts into c++ or something?
Apocalypse has quit [Ping timeout: 272 seconds]
demophoon has quit [Ping timeout: 240 seconds]
cout has quit [Ping timeout: 256 seconds]
GGMethos has quit [Ping timeout: 260 seconds]
cschneid has quit [Ping timeout: 250 seconds]
rideh has quit [Ping timeout: 250 seconds]
blackms_ has joined #ruby
ruid has quit [Ping timeout: 256 seconds]
AustinMatherne has quit [Ping timeout: 255 seconds]
blackms has quit [Disconnected by services]
bradland has quit [Ping timeout: 265 seconds]
dotix has joined #ruby
Kamilion has quit [Ping timeout: 260 seconds]
epochwolf has quit [Ping timeout: 260 seconds]
blackms_ has quit [Remote host closed the connection]
blackms has joined #ruby
dotix has quit [Remote host closed the connection]
dotix has joined #ruby
FooMunki has joined #ruby
roshanav_ has joined #ruby
roshanavand has quit [Read error: Connection reset by peer]
Begi has joined #ruby
weemsledeux has joined #ruby
sankaber has joined #ruby
dotix has quit [Remote host closed the connection]
haraigoshi has joined #ruby
dlitvak has joined #ruby
anisha_ has joined #ruby
ESpiney has joined #ruby
krobzaur has joined #ruby
TomyLobo has joined #ruby
tomphp has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
haraigoshi has quit [Ping timeout: 245 seconds]
ruid has joined #ruby
tomphp has joined #ruby
colegatron has quit [Ping timeout: 240 seconds]
treehug88 has joined #ruby
AustinMatherne has joined #ruby
<jhass>
pretty much
cout has joined #ruby
sp1rs has quit [Ping timeout: 264 seconds]
ElFerna has quit [Ping timeout: 260 seconds]
constantinexvi has joined #ruby
rideh has joined #ruby
cschneid has joined #ruby
epochwolf has joined #ruby
blaxter has quit [Quit: foo]
GGMethos has joined #ruby
ceej has joined #ruby
demophoon has joined #ruby
sankaber has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
ElFerna has joined #ruby
GinoManWorks has quit [Read error: Connection reset by peer]
underplank has joined #ruby
[k- has joined #ruby
anisha_ has quit [Quit: This computer has gone to sleep]
aegis3121 has joined #ruby
survili has joined #ruby
bradland has joined #ruby
anisha_ has joined #ruby
Jackneill has quit [Read error: Connection reset by peer]
anisha_ has quit [Client Quit]
ElFerna has quit [Read error: Connection reset by peer]
Jackneill has joined #ruby
underplank has quit [Client Quit]
<survili>
Hi all, sometimes when I install a gem, besides being able to use it's classes/api using require, sometimes the gem comes with a binary that I can use from command line. Example when installing rails gem, we also get rails command line executable. I was wondering, when installing some gem how can I know if it also installed some executable I can use ?
Apocalypse has joined #ruby
mary5030 has joined #ruby
Kamilion has joined #ruby
anisha_ has joined #ruby
<apeiros>
survili: good question. sadly the best answer I'm aware of is "look at the gem contents". not very user friendly :-|
<apeiros>
maybe there's a better way
ElFerna has joined #ruby
anisha_ has quit [Client Quit]
duckpuppy has joined #ruby
<survili>
apeiros: when you say to take a look in gem's content, you mean to read the sources or in gemspec it is specified ?
GinoManWorks has joined #ruby
constantinexvi has quit [Ping timeout: 250 seconds]
rideh has quit [Ping timeout: 250 seconds]
<apeiros>
survili: sources, take a look at the 'bin' dir. gemspec often only contains a glob.
<apeiros>
and while `gem specification X` exists, that looks rather unreadable.
<survili>
apeiros: thank you, I will ask this question on SO as well
colegatron has joined #ruby
arup_r has quit [Remote host closed the connection]
Apocalypse has quit [Ping timeout: 260 seconds]
<apeiros>
and while `gem specification X` exists, that looks rather unreadable. in case of rails it doesn't even list `rails` under executables
<havenwood>
survili: You could guess that the executable is in the idiomatic bin/ dir: gem contents gem_name_here | grep /bin/
<apeiros>
aha, because the executable comes via railties gem
TomPeed has joined #ruby
rideh has joined #ruby
constantinexvi has joined #ruby
AustinMatherne has quit [Ping timeout: 246 seconds]
<havenwood>
I dunno what the heck bundler is up to these days with exe/ dir... >.>
<apeiros>
oh dear, yes, fuck bundler for that.
<apeiros>
iirc their reasoning was something along "because we fucked up and used bin differently"
zotherstupidguy has joined #ruby
<adaedra>
because bundler, that's why.
AustinMatherne has joined #ruby
duckpuppy has quit [Ping timeout: 256 seconds]
<apeiros>
toppling over conventions can be healthy. but "we did it wrong so we fix it by doing wrong more" is stupid IMO.
pandaant has quit [Remote host closed the connection]
Apocalypse has joined #ruby
weemsledeux has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
axsuul has joined #ruby
toretore has quit [Ping timeout: 240 seconds]
ElFerna has quit [Ping timeout: 240 seconds]
<havenwood>
a fairy dies every time someone prepends ./bin to PATH
ElFerna has joined #ruby
dwfait has quit [Quit: dwfait]
bgresham has joined #ruby
demophoon has quit [Quit: :wqall!]
<havenwood>
I wish they'd stop with that nonsense.
ceej has quit [Ping timeout: 276 seconds]
<havenwood>
Not okay!
bgresham has quit [Excess Flood]
<adaedra>
path+=(./bin)
<adaedra>
:p
FooMunki has quit [Quit: FooMunki]
<havenwood>
nooooo
demophoon has joined #ruby
AlphaAtom has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
<apeiros>
reminds me that I wanted to think about direnv…
rodfersou has joined #ruby
FooMunki has joined #ruby
<adaedra>
I really like zsh's $path.
<apeiros>
gut says "oh dear god, no", but then again, I use rvm which does about the same.
<havenwood>
adaedra: I really like zsh's preexec function.
<adgtl>
e.g. [30, 45, 20, 20, 30, 50, 60, 45] and you have to find out best fit of numbers whose total is/near 200
domgetter has joined #ruby
<adgtl>
Ox0dea: it doesnt need to be exactly same.. but total should be near (but less than) or equal to 200
<Ox0dea>
adgtl: You want #combination and some effort.
shanemcd has joined #ruby
aryaching has joined #ruby
banister has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
idefine has joined #ruby
loren321 has quit [Quit: Leaving]
ElFerna has quit [Ping timeout: 260 seconds]
felltir has joined #ruby
kirun has joined #ruby
kies^ has joined #ruby
felltir has quit [Client Quit]
demophoon has quit [Quit: :wqall!]
blaxter has quit [Quit: foo]
rkazak_ has quit [Quit: Sleep.....ing....]
demophoon has joined #ruby
stannard has quit [Remote host closed the connection]
rippa has joined #ruby
skcin7_ has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
AlphaAtom has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
duckpuppy has joined #ruby
baweaver has quit [Remote host closed the connection]
dn` has quit [Quit: dn`]
<havenwood>
adgtl: So maybe iterate from one up to the list size and flat map to a combo of the list of that size, selecting combos where sums are between the goal minus the tolerance and the goal plus the tolerance. Then limit it to the unique ones if you want to not have the same combos due to repeated numbers in a list.
camillo has joined #ruby
<adgtl>
havenwood: exactly
<adgtl>
havenwood: let me implement it and paste it here
andywojo has joined #ruby
duckpuppy has quit [Ping timeout: 250 seconds]
<havenwood>
adgtl: sounds good
<Ox0dea>
havenwood: Why not #group_by the absolute difference with the target and take the min?
<havenwood>
Ox0dea: mmm
sol_ has quit [Ping timeout: 240 seconds]
camillo is now known as sol_
banister has joined #ruby
pawnbox_ has quit [Remote host closed the connection]
<Ox0dea>
I suspect you're not allowed to go over the goal, so absolute difference isn't sufficient, but that's left as an exercise.
celly has joined #ruby
pen has joined #ruby
pen has quit [Remote host closed the connection]
PsionTheory has quit [Remote host closed the connection]
davedev24 has joined #ruby
rkazak_ has joined #ruby
<Ox0dea>
As payment for services rendered, please add !~ to ruby-operators and call it the bangarang.
seitensei has joined #ruby
yxby- has joined #ruby
baroquebobcat has quit [Quit: baroquebobcat]
moeabdol1 has quit [Ping timeout: 255 seconds]
bMalum has joined #ruby
<Ox0dea>
Oh, the #uniq really ought to go right after the #flat_map.
celly has quit [Ping timeout: 260 seconds]
AlphaAtom has joined #ruby
<isomorphismes>
I'm still using ruby v1.9.3p0 (Ubuntu's package version). Just trying to make a quickie Sinatra site. Do I need to switch up to v2 ?
<isomorphismes>
And if so -- what's a "safe" way to do that?
CloCkWeRX has quit [Quit: Leaving.]
SenpaiSilver has joined #ruby
seitensei has quit [Ping timeout: 265 seconds]
yxby- has left #ruby [#ruby]
<havenwood>
isomorphismes: Usually Brightbox maintains up-to-date Ruby packages for Ubuntu but they're on Christmas break so no 2.3 yet: https://www.brightbox.com/docs/ruby/ubuntu/
idefine has quit [Read error: Connection reset by peer]
<havenwood>
isomorphismes: But they do have 2.2.4 and will have 2.3.0 soon.
<isomorphismes>
havenwood: Thanks. How important is it to get off v1.9.3p0 ?
idefine has joined #ruby
banister has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
davedev24 has quit [Ping timeout: 250 seconds]
<havenwood>
isomorphismes: I think it's worth switching to a stable, supported Ruby.
dopie has quit [Quit: Lost terminal]
yxby has joined #ruby
<havenwood>
isomorphismes: 2.1.8, 2.2.4 or 2.3.0
<havenwood>
(2.0.0-p648 is on its last legs)
arup_r has quit [Remote host closed the connection]
<havenwood>
(End-of-life in Feb)
davedev24 has joined #ruby
BSaboia has quit [Read error: Connection reset by peer]
BSaboia has joined #ruby
Wsewolod has joined #ruby
bMalum has quit [Quit: bMalum]
<isomorphismes>
havenwood: Thanks. Do I need to learn new commands> Last time I touched ruby was 2-3 yrs ago
<isomorphismes>
Why is a routing tree better than Sinatra's way?
<havenwood>
isomorphismes: There are a handful of new methods and some nice changes under the hood but you should be good.
cajone is now known as cajone_afk
yxby has quit [Remote host closed the connection]
dopie has joined #ruby
yxby has joined #ruby
skcin7 has joined #ruby
yxby has quit [Remote host closed the connection]
bMalum has joined #ruby
<havenwood>
isomorphismes: Sinatra runs a Regexp against each route so if you say have thousands it slows down substantially since it has to check each one every time. Typically it doesn't matter but it gives you flexibility.
Begi2 has quit [Ping timeout: 246 seconds]
shanemcd has quit [Remote host closed the connection]
<shevy>
mallu try Time.parse "08/11/2015" or another parse method; also use valid ruby syntax
<mallu>
shevy: ok let me try that
baweaver has joined #ruby
<havenwood>
isomorphismes: If you want to use RVM definitely uninstall the system package and install from master: \curl -sSL https://get.rvm.io | bash
<isomorphismes>
Is there a way to get offline docs / man pages for ruby?
<havenwood>
isomorphismes: Yeah, Ruby ships with rdoc and ri.
roshanavand has quit [Ping timeout: 260 seconds]
<isomorphismes>
havenwood: what about rvm head && rvm smile? That was what an SO answer said.
<isomorphismes>
havenwood: thanks
Begi has joined #ruby
<havenwood>
isomorphismes: If you're using RVM to install: rvm docs generate
<Ox0dea>
mallu: Milliseconds since the Unix epoch, you mean?
lucid_ has quit [Ping timeout: 260 seconds]
<mallu>
Ox0dea: yes
idefine has quit [Read error: Connection reset by peer]
<hxegon>
that feeling when after getting fed up with no reply from support your halfway through rolling your own API client and they email you back 2 weeks into it and say "The option to do that only appears for us."
<havenwood>
isomorphismes: Kill it with fire. Restart your computer and wash your hands. Then reinstall RVM (from master not stable): \curl -sSL https://get.rvm.io | bash
<isomorphismes>
Well, it can't seem to find either now.
centrx has joined #ruby
dopie has quit [Quit: Lost terminal]
<isomorphismes>
I have the git clone in /opt, I can ust run it from there?
<isomorphismes>
so I need to do \curl -L https://get.rvm.io | bash -s master --ruby --autolibs=enable --auto-dotfiles ?
<Ox0dea>
Please don't.
<isomorphismes>
I've never heard of \curl
<Ox0dea>
It's to circumvent aliases.
<centrx>
Yeah I'm looking for the best one of all time. I have no idea what qualities
<havenwood>
isomorphismes: It's just curl. Backslash to avoid aliases.
<centrx>
jhass, What project management tool(s) do you use?
<jhass>
centrx: mostly Github
<centrx>
hmm there's an idea
ChameleonSix has joined #ruby
<jhass>
some redmine
kaleido has joined #ruby
<havenwood>
isomorphismes: I believe --autolibs=enable and --auto-dotfiles are defaults. I usually install Ruby as a second step rather than all-in-one command.
<jhass>
trello looks pretty neat for some usecases
dopie has quit [Client Quit]
<ChameleonSix>
havenwood
<centrx>
Trello was really basic and simple when I tried it
<ChameleonSix>
my brother
<ChameleonSix>
Im going through koans right now
<hxegon>
?question
<ruboto>
I don't know anything about question
dopie has joined #ruby
renderfu_ has quit [Read error: Connection reset by peer]
<hxegon>
someone help me out here
dopie has quit [Client Quit]
<ChameleonSix>
no questions
baweaver has quit [Remote host closed the connection]
renderfu_ has joined #ruby
<ChameleonSix>
why is ruboto on android different than irb on pc
<ChameleonSix>
?
<mallu>
Ox0dea: thanks
<Ox0dea>
Sure thing.
<nietzschette>
when I feed a string literal into my gosu app, it draws just fine. when I read from $stdin, the app draws each character as seperate entries in an array. anybody know what's going on here?
<isomorphismes>
18:56 < Ox0dea> Please don't. 19:04 < Ox0dea> NO! <---- Was that directed at me getting bash -s master ?
<hxegon>
ChameleonSix can you be more specific?
Cohedrin has joined #ruby
ec^ is now known as ELLIOTTCABLE
<ChameleonSix>
try it for yourself
<ChameleonSix>
and you will see
dopie has joined #ruby
<Ox0dea>
isomorphismes: More RVM in general, but I'll stop.
<shevy>
ChameleonSix don't be so mean
<ChameleonSix>
idk how to explain
<ChameleonSix>
...
haraigoshi has joined #ruby
roshanavand has quit [Ping timeout: 260 seconds]
idefine has joined #ruby
<hxegon>
ChameleonSix I *can't* help you if the only thing I know is that your trying to see a difference between either ruboto the irc bot or the android framework and irb on pc, and it's 'gets.chomp'
dopie has quit [Client Quit]
<ChameleonSix>
it doesnt work on ruboto
<ChameleonSix>
idk why
puria has quit [Ping timeout: 276 seconds]
<Ox0dea>
ChameleonSix: Why are you even using Ruboto?
<Ox0dea>
nietzschette: You're using #getch, which reads one character at a time.
<isomorphismes>
0x0dea: So what's wrong with RVM?
<adaedra>
nietzschette: change the file extension to .rb and get syntax colors!
<adaedra>
isomorphismes: it's bloat.
<nietzschette>
the problem remains
<havenwood>
isomorphismes: It's over ten thousand lines of shell scripting.
<adaedra>
hxegon: I'm only watching.
shanemcd has joined #ruby
<isomorphismes>
0x0dea: I'm just trying to do something pretty quick. My only decision criterion is will it work pretty much immediately with as close to 0 as possible effort/research
<hxegon>
ChameleonSix I found a super nice link that can explain it all http://goo.gl/MSVUKo
<Ox0dea>
isomorphismes: That's a troubling mindset, but okay.
<ChameleonSix>
tnx anyway
<hxegon>
:|
<nietzschette>
that is pretty, thank you dom
<isomorphismes>
0x0dea: I'm not a ruby programmer
haraigoshi has quit [Ping timeout: 250 seconds]
<domgetter>
nietzschette: but yea, use gets.chomp
<domgetter>
not getch
<Ox0dea>
domgetter: That's obviously not what they want to do.
<nietzschette>
gets.chomp does not print anything at all
<Ox0dea>
This is for a game, where uncooked input is to be desired.
<domgetter>
oooh
<domgetter>
hmm
<Ox0dea>
nietzschette: Could you link the declaration of this BottomFeeder class?
tildes has joined #ruby
cinch has joined #ruby
<havenwood>
isomorphismes: The simplest way is the 2.2.4 Brightbox package. The next simplest would probably be `ruby-install --latest --system ruby` for a /usr/local install.
<havenwood>
isomorphismes: Do you need more than one Ruby?
dopie has joined #ruby
<havenwood>
isomorphismes: If you don't need more than one Ruby you don't need a switcher.
<isomorphismes>
havenwood: I don't think so. Just wanted to check that v1.9.3p0 isn't so horribly out of date that it's actually broken.
<domgetter>
nietzschette: how about this: until you read a newline character from getch, keep storing the input into a string, and then shove the resulting word into @words
<havenwood>
isomorphismes: It's past End-of-Life but the sky won't fall.
Cohedrin has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
rideh has quit [Ping timeout: 260 seconds]
<domgetter>
wait, what the heck is getch?
<havenwood>
isomorphismes: I'd say Brightbox package and be done with it.
<hxegon>
havenwood is it possible to make a fact that takes a google search query and makes a shortened lmgtfy link?
jondot has joined #ruby
<havenwood>
domgetter: Press a key, capture it.
<isomorphismes>
havenwood: I already have it with rvm. Should I get rid of that now?
<nietzschette>
the bottomfeeder class works fine when I test it using a string litteral "like this". but when I feed it input '["l", "i", "k", "e", " ", "t" , "h" ,"i", "s"]'
<domgetter>
NoMethodError: undefined method `getch' for #<IO:<STDIN>>
baweaver has joined #ruby
<adaedra>
hxegon: not a fact, a command, but see with apeiros.
<nietzschette>
you have to require 'io/console'
aegis3121 has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
cinch has quit [Remote host closed the connection]
<domgetter>
oh
<havenwood>
hxegon: what adaedra said - not as a fact but such a command could be added to ruboto
cinch has joined #ruby
<hxegon>
thanks adaedra, havenwood
<havenwood>
isomorphismes: As long as you have 2.2 or 2.3 you're good.
<havenwood>
isomorphismes: There is more than one way to do it!
<havenwood>
isomorphismes: you're welcome
<adaedra>
do you even indent?
stannard has joined #ruby
c0m0 has quit [Ping timeout: 276 seconds]
<nietzschette>
sorry, i don't usually indent, no
beagles has quit [Ping timeout: 260 seconds]
<adaedra>
õ_o
Hounddog has quit [Remote host closed the connection]
<Ox0dea>
I can't even tell if that's sadism, masochism, or both.
<havenwood>
The humanity!
<nietzschette>
I'll leave extra newlines sometimes. But i am a bit of both so ..
baweaver has quit [Ping timeout: 256 seconds]
<Ox0dea>
In any case, `@words.in` starts life as a String and becomes an Array, but that can't happen if you're only ever shoveling (<<) into it, so the problem is elsewhere.
<adaedra>
indent helps so much with readability
<Ox0dea>
Prove it.
<nietzschette>
it doesn't help me read it. i'm usually the only one reading it . .
cinch has quit [Remote host closed the connection]
<isomorphismes>
Now do I need to sudo gem update ?
<adaedra>
?sudo
<ruboto>
I don't know anything about sudo
<adaedra>
?root
<ruboto>
general advice in system administration: do not and that means never use sudo or root to "fix" things. Only use it if you exactly know why it would work and why it wouldn't work under any circumstances as normal user. Or if you're told to do it.
<domgetter>
Ox0dea: huh? in never becomes an array
<domgetter>
havenwood: okay now lazily. and with transducers
bradleyprice has quit [Remote host closed the connection]
<havenwood>
domgetter: ;D
tectonic has quit []
Lucky__ has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
hahuang65 has quit [Quit: WeeChat 1.3]
bradleyprice has joined #ruby
marius1234 has joined #ruby
<bodgix>
I can't figure out the syntax to end the exception handling: begin block without ending the code block nested within it. Is that even possible? https://gist.github.com/bodgix/0dfa6308d9747248b5ef
jondot has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
curses has quit []
andywojo has joined #ruby
ElFerna has joined #ruby
<nietzschette>
you can nest exception blocks just fine
<domgetter>
bodgix: Is there a reason you don't want ldap.search in the begin block?
tectonic has joined #ruby
<domgetter>
It's not like it's harmful
synthroid has joined #ruby
<bodgix>
domgetter: I realized it makes sense to keep it there. But in general would it be possible to leave it out?
<jhass>
bodgix: are you sure .search throws the same exception as the one open throws that you want to handle?
shanemcd has quit [Remote host closed the connection]
hahuang65 has joined #ruby
bradleyprice has quit [Ping timeout: 260 seconds]
<bodgix>
I believe open doesn't create the actual connection so it shouldn't throw anything
<jhass>
then just move the begin inside the block?
<bodgix>
but in general, putting LDAP example aside, is it possible to do this?
<jhass>
no
c355e3b has joined #ruby
<jhass>
you can set a flag and reraise depending on it, but meh
<nietzschette>
the LDAP object be destroyed after the do block |ldap| ends?
hxegon is now known as hxegon_AFK
<bodgix>
domgetter: afaik it doesn't. It's funny how diffferently an ldap handle behaves when constructed with new or when open is used with a block
<domgetter>
nietzschette: if it's anything like passing a block to File.open, then the file is closed after the block is finished
<nietzschette>
not in dom's example
shanemcd has joined #ruby
<bodgix>
if you use ldap = Net::LDAP.new then it creates a new connection for every search/ add etc. If you use Net::LDAP.open { |ldap| …} it creates a single session for the duration of the whole block
pawnbox has quit [Ping timeout: 256 seconds]
gluec has quit [Ping timeout: 260 seconds]
<domgetter>
then I would say you want what new does, since you don't want the features of a block
<bodgix>
it's in the docs but it's easy to get bitten by it imo anyway
Cohedrin has joined #ruby
<bodgix>
but I don't want the "reconnect and bind" behavior
<domgetter>
but you want to use the ldap in a new lexical context
colegatron has quit [Ping timeout: 264 seconds]
kmckelvin has joined #ruby
shanemcd has quit [Remote host closed the connection]
<bodgix>
actually I'm fine with the begin block spanning across the whole lifetime of LDAP. it makes sense here. However, this example made me wonder if it was possible to end the begin block in the middle of another block. I thought it wasn't possible since it would require a label or sth but thought I'd ask
shanemcd has joined #ruby
kadoppe has quit [Ping timeout: 264 seconds]
gluec has joined #ruby
<nietzschette>
no, but you can begin a new exception handler inside the block
harai has joined #ruby
dopie has quit [Quit: Lost terminal]
<bodgix>
nietzschette: thanks that's very interesting
dopie has joined #ruby
<bodgix>
it doesn't override the outer block I giess?
<nietzschette>
no, it prevents the outer block from recieving the exception
kadoppe has joined #ruby
shanemcd has quit [Remote host closed the connection]
<bodgix>
ok got you. this is definitely a way to achieve this kind of fine-grained exception handling
chouhoulis has quit [Ping timeout: 256 seconds]
ur5us has joined #ruby
kmckelvin has quit [Ping timeout: 245 seconds]
chouhoulis has joined #ruby
moeabdol1 has joined #ruby
<domgetter>
Of course, you can re-raise the exception so that it can bubble up
tectonic has quit []
<domgetter>
but I don't know how "best practice" that is
chouhoulis has quit [Remote host closed the connection]
ni291187 has joined #ruby
chouhoulis has joined #ruby
ni291187 has left #ruby [#ruby]
roshanavand has joined #ruby
devbug has joined #ruby
tvw has quit [Remote host closed the connection]
yes`r has quit [Ping timeout: 265 seconds]
ur5us has quit [Ping timeout: 246 seconds]
ur5us has joined #ruby
<bodgix>
Since rubocop warns to use raise to re-raise and fail in other situations iirc, it looks like re-raising is a valid technique. exception handlers nesting is what I was looking for. great suggestions, thanks everyone :)
volty has joined #ruby
RobertBirnie has joined #ruby
dopie has quit [Quit: Lost terminal]
roshanavand has quit [Ping timeout: 276 seconds]
idefine has quit [Read error: Connection reset by peer]
Wompy has quit [Read error: Connection reset by peer]
centrx has quit [Quit: If you meet the Buddha on the road, kill him.]
cdg has quit [Remote host closed the connection]
Wompy has joined #ruby
<shevy>
what ways do we have to check if a variable consists of only numbers? one obvious is to apply regex... another one may be to use .to_i and compare to non 0 value, but do we have anything such as .is_numeric? or similar? like "033".is_numeric? should in this case yield true, if we are to assume that 033 are valid numbers, aka 0-9 even if it is a String
lucid_ has quit [Ping timeout: 260 seconds]
shakes has quit [Ping timeout: 245 seconds]
<Papierkorb>
shevy: Well you could do Integer(the_string), which raises if it did not only consist of numbers
yfeldblum has joined #ruby
dotix has joined #ruby
<Ox0dea>
Rather, if Ruby couldn't parse it as a number.
davejlong has quit [Remote host closed the connection]
freerobby has joined #ruby
<Ox0dea>
nietzschette: Not when I'm around. ^_^
<nietzschette>
ha!
snarkanoid has joined #ruby
pawnbox has quit [Ping timeout: 246 seconds]
shanemcd has joined #ruby
nickjj_ has quit [Ping timeout: 256 seconds]
ChameleonSix has quit [Quit: Page closed]
tildes has quit [Ping timeout: 276 seconds]
<nietzschette>
okay, i fixed my own problem. it now works. when testing the gosu app I was incrementing through a string litteral, but when I started reading from stdin it SOMEHOW exposed a flaw in my method of appending the display list. I don't understand why the former wouldn't expose the same flaw as the latter, though
nickjj has joined #ruby
ferr has quit [Quit: WeeChat 1.3]
adgtl has quit [Remote host closed the connection]
synthroid has quit [Remote host closed the connection]
<RobertBirnie>
is there a way to get the epoch time for the current minute (not second)? Time.now.to_i / 10 * 10
<adaedra>
Ox0dea: still have your no-letter todo app?
<kaleido>
i prefer cuba but its very similar to roda
dstarh has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
<isomorphismes>
kaleido: thanks, that seems close but then /usr/local/lib/ruby/gems/2.3.0/gems/rack-1.6.4/lib/rack/builder.rb:146:in `to_app': missing run or map statement (RuntimeError)
hagabaka has quit [Ping timeout: 246 seconds]
<adaedra>
kaleido: rackup and friends look for config.ru by default. No need to write it.
bkxd has joined #ruby
<adaedra>
isomorphismes: did you make a config.ru?
gizless has joined #ruby
<isomorphismes>
adaedra: Yep, I just pasted the example to config.ru and then changed the secret
gizmore|2 has joined #ruby
<adaedra>
That's weird there's no run.
<isomorphismes>
.ru is short for .rackup ?
<adaedra>
yeah.
<isomorphismes>
adaedra: well, I just upgraded from stable ruby v1.9.3p0 to 2.3.0
<adaedra>
try adding `run App` at the end of the config.ru
rgrmatt has joined #ruby
dotix has joined #ruby
dotix has quit [Client Quit]
nietzschette has quit [Quit: Nettalk6 - www.ntalk.de]
<isomorphismes>
perfect, thanks adaedra !
gizmore has quit [Ping timeout: 260 seconds]
<adaedra>
yw
gizmore has joined #ruby
atomical has joined #ruby
Azure has joined #ruby
gizless has quit [Ping timeout: 276 seconds]
<isomorphismes>
In Sinatra it seems you can specify layout and formatting at the bottom with @@ layout, @@ style, etc. Is this true in Cuba / Roda?
<adaedra>
I'm not sure cuba and roda are much alike, are they?
<kaleido>
isomorphismes, i am not sure
gizmore|2 has quit [Ping timeout: 250 seconds]
gizless has joined #ruby
<kaleido>
adaedra, theyre similar mostly in how simple they are
<kaleido>
not that sinatra is complicated
<isomorphismes>
But it does seem Sinatra is no longer being supported as much (last relase mid 2014, and 3 different versions of documentation)
build22 has joined #ruby
<adaedra>
an eraser and a pen are both simple objects but with very different behaviors.
<adaedra>
kaleido: I didn't look into Cuba or Roda. I tried Rails, I tried Sinatra, then I decided to roll my own on top of Rack :p
aegis3121 has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
<kaleido>
cuba just assumes the location of your layouts, etc, unless you specify differently
<kaleido>
adaedra, the 3 are pretty similar in my opinion. i dont recall why i landed on cuba.
<isomorphismes>
adaedra: right, Rack seems like somehow "the simplest" solution (barest bones)
<adaedra>
It is.
<adaedra>
And it's awesome to base yourself on.
build22 has left #ruby [#ruby]
firstdayonthejob has quit [Quit: WeeChat 1.4-dev]
<adaedra>
But if you want to develop apps on top of it, having a generic layer is a good idea.
gizmore|2 has joined #ruby
gizmore has quit [Ping timeout: 264 seconds]
firstdayonthejob has joined #ruby
niceperl has joined #ruby
kiloreux has joined #ruby
FooMunki has quit [Quit: FooMunki]
bkxd has quit [Ping timeout: 264 seconds]
gizmore has joined #ruby
idefine has quit [Remote host closed the connection]
scripore has quit [Quit: This computer has gone to sleep]
pawnbox has joined #ruby
hagabaka has joined #ruby
gizmore|3 has joined #ruby
gizless has quit [Ping timeout: 260 seconds]
icarus has joined #ruby
gizless has joined #ruby
aegis3121 has joined #ruby
gizmore|2 has quit [Ping timeout: 240 seconds]
last_staff has quit [Quit: last_staff]
gizmore has quit [Ping timeout: 256 seconds]
TomPeed has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
<aegis3121>
This seems like an error with the API/request you're making.
atomical has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
dionysus69 has quit [Ping timeout: 255 seconds]
<mallu>
aegis3121: hmm.. ok
<aegis3121>
Not sure, though
roshanavand has quit [Remote host closed the connection]
atomical has joined #ruby
n_blownapart has joined #ruby
Mckomo has joined #ruby
pwnd_nsfw has quit [Ping timeout: 260 seconds]
celly has quit [Ping timeout: 240 seconds]
scripore has joined #ruby
davedev2_ has joined #ruby
aegis3121 has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
davedev24 has quit [Ping timeout: 250 seconds]
aegis3121 has joined #ruby
Wompy has quit [Remote host closed the connection]
akaiiro has quit [Quit: Leaving]
trwyth has joined #ruby
prestorium has quit [Quit: Leaving]
freerobby has quit [Quit: Leaving.]
kiloreux has quit [Quit: Ex-Chat]
freerobby has joined #ruby
freerobby has quit [Client Quit]
djbkd has quit [Quit: Leaving...]
duckpuppy has joined #ruby
hinbody has quit [Quit: leaving]
duckpuppy has quit [Ping timeout: 246 seconds]
nfk|laptop has joined #ruby
lucid_ has quit [Quit: leaving]
Jackneill has quit [Ping timeout: 240 seconds]
pwnd_nsfw has joined #ruby
dhollinger has quit [Quit: WeeChat 1.3]
senayar has joined #ruby
senayar has quit [Changing host]
senayar has joined #ruby
neanderslob_ has joined #ruby
neanderslob_ has quit [Remote host closed the connection]
atomical_ has joined #ruby
neanderslob has joined #ruby
rippa has quit [Quit: {#`%${%&`+'${`%&NO CARRIER]
davejlong has joined #ruby
atomical has quit [Ping timeout: 240 seconds]
vikas027 has joined #ruby
atomical has joined #ruby
vikas027 has quit [Client Quit]
atomical_ has quit [Ping timeout: 240 seconds]
ICantCook has joined #ruby
ruid has joined #ruby
ruid has joined #ruby
ohaibbq_ has joined #ruby
renderf__ has joined #ruby
steffkes has quit [Ping timeout: 260 seconds]
renderfu_ has quit [Ping timeout: 240 seconds]
shanemcd has joined #ruby
yxby has quit [Remote host closed the connection]
jpfuentes2 has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
shanemcd has quit [Ping timeout: 245 seconds]
idefine has quit [Read error: Connection reset by peer]
davejlong has quit [Remote host closed the connection]
scripore has quit [Quit: This computer has gone to sleep]
renderfu_ has joined #ruby
idefine has joined #ruby
Ishido has quit [Quit: Roads? Where We're Going We Don't Need Roads.]
polishdub has quit [Quit: Leaving]
_orangejuice has quit [Quit: Connection closed for inactivity]
davedev2_ has quit [Ping timeout: 260 seconds]
harai has quit [Ping timeout: 272 seconds]
kmckelvin has joined #ruby
yfeldblum has joined #ruby
renderf__ has quit [Ping timeout: 260 seconds]
davejlong has joined #ruby
snockerton has quit [Quit: Leaving.]
idefine has quit [Read error: Connection reset by peer]
davedev24 has joined #ruby
zenlot4 has joined #ruby
colegatron has quit [Ping timeout: 246 seconds]
zquad has joined #ruby
<zquad>
I am pulling lots of social media mentions from twitter, facebook etc data and I need to store it locally to analyze and display it, any recommendation on an open source database?
Begi2 has joined #ruby
sdothum has quit [Quit: ZNC - 1.6.0 - http://znc.in]
zenlot3 has quit [Ping timeout: 255 seconds]
zquad has quit [Client Quit]
davejlong has quit [Ping timeout: 260 seconds]
neanderslob has quit [Read error: Connection reset by peer]