<rapha>
question: since we're not supposed to do XML/HTML/etc. and regexs together if at all possible, what's the state-of-the-art way of marking up / enriching / buzzword of the day unstructured text (well, a long, long string with double newlines in it for paragraphs) with XML?
<havenwood>
rapha: It's XML you're parsing? Have an example?
coniptor has quit [Ping timeout: 272 seconds]
centrx has quit [Ping timeout: 264 seconds]
<TomyWork>
neither :: nor ::/0 worked
<havenwood>
TomyWork: Did they work for ipv6?
<havenwood>
TomyWork: Just didn't fall through to ipv4?
<TomyWork>
:: did
centrx_ has quit [Ping timeout: 264 seconds]
<TomyWork>
what do you mean fall through? the system supports both ipv4 and ipv6
<rapha>
havenwood: my current example is a few paragraphs of lorem ipsum. no XML. it's just straight text.
<rapha>
in that case, a long chain of input.gsub(/[a-zA-Z]ipsum/, '<span class="firstthing">\0</span>').gsub(/amet/, '<span class="secondthing">\0</span>') (and so on and so on) would be fine, havenwood?
coniptor has joined #ruby
<havenwood>
TomyWork: With a dual stack setup you can configure it to translate well known addresses. I don't care to follow how CentOS does it but someone else might know.
centrx has joined #ruby
<havenwood>
rapha: I can't think of a better thing offhand. Maybe DRY it up if it's repetitive or think about optimization if it takes a nontrivial amount of time?
Silex has quit [Quit: Connection closed]
centrx has quit [Ping timeout: 264 seconds]
<rapha>
hmm okay
<rapha>
i was just wondering: what if on the n_th go-around it matches something inside one of the pointy braces
<rapha>
but just need to make sure that the patterns are up to snuff then
fercell has joined #ruby
<havenwood>
TomyWork: There are various RFCs about auto translations for well known addresses. It's probably configurable on CentOS, but dunno how.
centrx has joined #ruby
jla has quit [Ping timeout: 256 seconds]
centrx_ has joined #ruby
<havenwood>
rapha: I mean, you could generate the XML snippets. It's hard to say without seeing the paragraphs and substitutions.
<havenwood>
rapha: Generating the XML might be less error prone than interpolating?
<TomyWork>
yeah that's the problem
centrx has quit [Ping timeout: 264 seconds]
<TomyWork>
there's more than one RFC :D
centrx_ has quit [Ping timeout: 264 seconds]
centrx has joined #ruby
<rapha>
havenwood: i just got confused by the whole internet screaming "no regex for xml stuff" at you (which i also know to be true from my apprenticeship days) but at the same time realising: i'm producing xml here, not modifying it. will have to get a feeling for just how many patterns this will end up needing. because even if you want to generate the XML with nokogiri or what not, first you have to use regex's
<rapha>
anyways to find out where the tags should sit.
<rapha>
s/'s/s/
<havenwood>
rapha: usually folk mean no regexp for *parsing* XML
* rapha
nods
centrx has quit [Ping timeout: 264 seconds]
sylario has joined #ruby
fercell has quit [Ping timeout: 272 seconds]
fercell has joined #ruby
dfucci_ has quit [Ping timeout: 264 seconds]
jla has joined #ruby
dfucci has joined #ruby
centrx has joined #ruby
centrx has quit [Ping timeout: 260 seconds]
dfucci has quit [Ping timeout: 272 seconds]
fercell has quit [Quit: WeeChat 3.0]
dfucci has joined #ruby
Xiti` has joined #ruby
FastJack has quit [Ping timeout: 246 seconds]
Xiti has quit [Ping timeout: 272 seconds]
fercell has joined #ruby
FastJack has joined #ruby
jla has quit [Ping timeout: 265 seconds]
jla has joined #ruby
coniptor has quit [Ping timeout: 265 seconds]
<TomyWork>
purists: no regex whatsoever
<TomyWork>
in fact, not even programming languages or anything. hand-weave your bits.
tannakartikey has quit [Remote host closed the connection]
tannakartikey has joined #ruby
<rapha>
sure, let's go back to that. advantages: can send your stuff to space unchanged. disadvantages: might take a wee bit longer to implement that web browser, users might get disgruntled at execution speed, companies might have trouble fitting the hardware into a smartphone enclosure.
fercell has quit [Ping timeout: 265 seconds]
fercell has joined #ruby
cliluw has quit [Read error: Connection reset by peer]
cliluw has joined #ruby
Technodrome has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
cd has joined #ruby
alexherbo2 has quit [Ping timeout: 264 seconds]
tannakartikey has quit [Remote host closed the connection]
linoge has joined #ruby
Technodrome has joined #ruby
coniptor has quit [Ping timeout: 256 seconds]
universa1 has quit [Quit: ZNC 1.6.1+deb1~ubuntu14.04.0 - http://znc.in]
coniptor has joined #ruby
universa1 has joined #ruby
naftilos76 has joined #ruby
akem_ has joined #ruby
akem has quit [Ping timeout: 265 seconds]
techsethi has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
<naftilos76>
Hi i am building a caching system for a MQTT-like server that uses the cache to respond to requests in a few ms rather than in a few seconds as proven with mysql. When the table gets populated with a few million rows the response takes too long so i am making this caching system to improve that latency. There are two methods in the link. The first is the one i am using. After testing inside a loop it can do 100-200k/sec which is fine but every now and
<naftilos76>
then the speed gets down to a few records/sec or a few thousand/sec and then goes up to 100k. The second method is much better in term of speed 300K/sec and there are no sudden decreases in speed in the same degress that the first method does. Can the first method be optimised any further? I have already built the methods to search and delete records for the first method but not the second. I would rather use the first method if it can be improved.
universa1 has quit [Quit: ZNC 1.6.1+deb1~ubuntu14.04.0 - http://znc.in]
universa1 has joined #ruby
tannakartikey has joined #ruby
centrx has joined #ruby
al2o3-cr has joined #ruby
tpanarch1st has joined #ruby
dhollinger has joined #ruby
TomyLobo has joined #ruby
coniptor has quit [Read error: Connection reset by peer]
houhoulis has joined #ruby
coniptor has joined #ruby
centrx has quit [Remote host closed the connection]
naftilos76 has quit [Quit: Leaving]
RougeR has joined #ruby
centrx has joined #ruby
tannakartikey has quit [Remote host closed the connection]
centrx_ has joined #ruby
centrx has quit [Ping timeout: 260 seconds]
centrx_ has quit [Ping timeout: 260 seconds]
prepend has joined #ruby
mangold has joined #ruby
centrx has joined #ruby
jla has joined #ruby
<phaul>
naft.. oh, they left. It feels the hash data structure is overused, when simple object and object attributes could be used hash is used for data representation.
ChmEarl has joined #ruby
<rapha>
w00t?! there's ruby 3.0 and i haven't noticed?!
<rapha>
AAAAAH!!!!
<NL3limin4t0r>
phaul: MySql also has a query cach, so building your own cache should not be nessesary. https://dev.mysql.com/doc/refman/5.7/en/query-cache.html If queries take too long naft.. could also double check their indexes.
tubbo has joined #ruby
mangold has quit [Ping timeout: 264 seconds]
<adam12>
rapha: Merry Christmas!
<rapha>
merry christmas to you too adam12 :P
<adam12>
:P
cthulchu_ has joined #ruby
mangold has joined #ruby
<NL3limin4t0r>
Not that I need it atm, but is there a summery of breaking changes made by 3.0.0 somewhere?
teej has quit [Quit: Connection closed for inactivity]
jla has joined #ruby
iNs has quit [Remote host closed the connection]
iNs has joined #ruby
<NL3limin4t0r>
adam12: Ah, I thought there would be more. I already knew about the named arguments changes. Ty for the link though.
<adam12>
NL3limin4t0r: I think Matz still has PTSD from the 1.8 -> 1.9 transition. His talks always seem to highlight that it was a tough time for Ruby and he doesn't want to repeat it.
<adam12>
In reality, this could of easily been 2.8, but the keyword arguments are 100% breaking.
coniptor has quit [Ping timeout: 240 seconds]
<NL3limin4t0r>
adam12: I disagree, without the keyword argument change it could've been 2.8. Breaking changes should always be included in a new major drop, never in a minor version bumb.
<adam12>
NL3limin4t0r: That's what I meant. There was no way it could of been 2.8 without keyword argument changes, but since they were in that's why it had to be 3.0.
<adam12>
But outside of that, there was very little breaking change.
<NL3limin4t0r>
In contrast of 2.7 which added quite a lot, but didn't add breaking changes.
<NL3limin4t0r>
oh, never mind, I'm trippin. you are specifically talking about breaking changes
coniptor has joined #ruby
vondruch has quit [Quit: vondruch]
vondruch has joined #ruby
DTZUZU__ is now known as DTZUZU
howdoi has joined #ruby
Sina has joined #ruby
mangold has quit [Ping timeout: 256 seconds]
dfucci has quit [Ping timeout: 240 seconds]
dfucci has joined #ruby
mangold has joined #ruby
RougeR has quit [Remote host closed the connection]
dfucci has quit [Ping timeout: 240 seconds]
GodFather has joined #ruby
jla has quit [Ping timeout: 240 seconds]
centrx has quit [Remote host closed the connection]
TomyWork has quit [Remote host closed the connection]
centrx has joined #ruby
dfucci has joined #ruby
centrx has quit [Ping timeout: 260 seconds]
mangold has quit [Ping timeout: 240 seconds]
powerhouse_ has joined #ruby
centrx has joined #ruby
kristian_on_linu has quit [Remote host closed the connection]
mangold has joined #ruby
alexherbo2 has joined #ruby
<rapha>
s/of/have/
tannakartikey has joined #ruby
AndreYuhai has joined #ruby
<AndreYuhai>
I am using devise for authentication on Rails and I am trying to permit users to fill their first name and last name during sign up as well. So I thought I could do that by changing app/controllers/users/registrations_controller.rb however it didn't work and then doing the same thing in app/controllers/application_controller.rb worked. What's the difference between these two approaches or did I do something wrong in
tannakartikey has quit [Ping timeout: 240 seconds]
mangold has joined #ruby
mangold has quit [Client Quit]
neshpion has joined #ruby
vondruch has quit [Read error: Connection reset by peer]
mangold has joined #ruby
coniptor has joined #ruby
iNs has quit [Ping timeout: 268 seconds]
Technodrome has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
iNs has joined #ruby
mangold has quit [Ping timeout: 260 seconds]
junaidnaseer2 has joined #ruby
GodFather has quit [Ping timeout: 240 seconds]
hiroaki has joined #ruby
klaas_ is now known as klaas
eax has joined #ruby
eax has quit [Client Quit]
DaRock has quit [Ping timeout: 265 seconds]
eax has joined #ruby
eax has quit [Client Quit]
eax has joined #ruby
akem_ has quit [Remote host closed the connection]
dfucci has quit [Ping timeout: 240 seconds]
eax has quit [Client Quit]
eax has joined #ruby
Technodrome has joined #ruby
mangold has joined #ruby
NL3limin4t0r is now known as NL3limin4t0r_afk
dfucci has joined #ruby
iNs has quit [Remote host closed the connection]
iNs has joined #ruby
gix has joined #ruby
cnsvc has joined #ruby
teej has joined #ruby
jla has joined #ruby
iNs has quit [Ping timeout: 268 seconds]
Azure has quit [Ping timeout: 264 seconds]
iNs has joined #ruby
s3nd1v0g1us has joined #ruby
iNs has quit [Ping timeout: 268 seconds]
iNs has joined #ruby
mangold has quit [Ping timeout: 260 seconds]
mangold has joined #ruby
Xiti has joined #ruby
centrx has quit [Remote host closed the connection]
Andre has joined #ruby
Andre is now known as Guest2353
Xiti` has quit [Ping timeout: 264 seconds]
AndreYuhai has quit [Ping timeout: 240 seconds]
centrx has joined #ruby
jla has quit [Ping timeout: 240 seconds]
centrx has quit [Ping timeout: 264 seconds]
centrx has joined #ruby
howaboutyes has joined #ruby
howaboutyes1 has joined #ruby
junaidnaseer2 has quit [Remote host closed the connection]
howaboutyes1 has quit [Remote host closed the connection]
howaboutyes has quit [Remote host closed the connection]
Rudd0 has quit [Ping timeout: 264 seconds]
centrx has quit [Ping timeout: 264 seconds]
centrx has joined #ruby
reaVer has quit [Read error: No route to host]
reaVer has joined #ruby
centrx has quit [Ping timeout: 264 seconds]
jenrzzz has joined #ruby
Azure has joined #ruby
coniptor has quit [Ping timeout: 246 seconds]
Azure has quit [Read error: Connection reset by peer]
Azure has joined #ruby
Xiti has quit [Quit: Leaving]
coniptor has joined #ruby
powerhouse_ has quit [Remote host closed the connection]
evil has quit [Quit: Connection closed for inactivity]
Xiti has joined #ruby
mangold has quit [Ping timeout: 240 seconds]
powerhouse_ has joined #ruby
centrx has joined #ruby
TCZ has joined #ruby
dfucci has quit [Ping timeout: 246 seconds]
centrx has quit [Ping timeout: 260 seconds]
dfucci has joined #ruby
mangold has joined #ruby
orbyt_ has joined #ruby
dfucci has quit [Ping timeout: 256 seconds]
dfucci has joined #ruby
cnsvc has quit [Ping timeout: 268 seconds]
cnsvc has joined #ruby
dfucci has quit [Ping timeout: 265 seconds]
centrx has joined #ruby
linoge has quit [Remote host closed the connection]
mangold has quit [Ping timeout: 264 seconds]
centrx has quit [Ping timeout: 264 seconds]
cthulchu_ has quit [Read error: Connection reset by peer]
dfucci has joined #ruby
evil has joined #ruby
clgnt has joined #ruby
centrx has joined #ruby
mangold has joined #ruby
mangold has quit [Client Quit]
powerhouse_ has quit [Remote host closed the connection]
teclator has quit [Read error: Connection reset by peer]
centrx has quit [Ping timeout: 264 seconds]
houhoulis has quit [Remote host closed the connection]
dfucci has quit [Ping timeout: 272 seconds]
centrx has joined #ruby
dfucci has joined #ruby
mangold has joined #ruby
dfucci has quit [Ping timeout: 256 seconds]
goepsilongo has joined #ruby
goepsilongo has quit [Client Quit]
clgnt has quit [Quit: Connection closed]
akem has joined #ruby
dfucci has joined #ruby
dfucci has quit [Ping timeout: 246 seconds]
GodFather has joined #ruby
TCZ has quit [Ping timeout: 240 seconds]
hiroaki has quit [Ping timeout: 260 seconds]
deviantfero has quit [Quit: WeeChat 3.0]
dfucci has joined #ruby
deviantfero has joined #ruby
GodFather has quit [Ping timeout: 256 seconds]
Azure has quit [Read error: Connection reset by peer]
mangold has quit [Ping timeout: 260 seconds]
Azure has joined #ruby
Rudd0 has joined #ruby
mangold has joined #ruby
GodFather has joined #ruby
Guest2353 has quit [Quit: Leaving]
Jonopoly has joined #ruby
thecoffemaker has quit [Ping timeout: 260 seconds]
thecoffemaker has joined #ruby
mangold has quit [Ping timeout: 256 seconds]
GodFather has quit [Ping timeout: 256 seconds]
duckpupp- has quit [Ping timeout: 256 seconds]
duckpuppy has joined #ruby
mangold has joined #ruby
_aeris has joined #ruby
teardown has quit [Ping timeout: 268 seconds]
_aeris_ has quit [Ping timeout: 268 seconds]
_aeris is now known as _aeris_
teardown has joined #ruby
ruby[bot] has quit [Remote host closed the connection]
ruby[bot] has joined #ruby
<Cubixusin[m]>
Hey, im working without rails. I would like rewrite query `db.execute" select * from dateTable where time> = date ('now') "` to models, something like `dataTables.where (" sql query ")`, but all the time i get fail . It is possible do it in simple ruby without rails?
Xiti` has joined #ruby
Xiti has quit [Ping timeout: 246 seconds]
mangold has quit [Ping timeout: 272 seconds]
<teardown>
how do you cause eventmachine to close after a given interval of inactivity within an EM.run{} loop
<havenwood>
teardown: just curious, but working on an existing project already using EM or adding it?
<havenwood>
teardown: (i'd suggest Async unless you're already married to EM)
mangold has joined #ruby
<teardown>
havenwood: i'm already pretty invested in EM for this project, just using faye-websocket for a websocket client
<teardown>
i use thin all the time but havent had to mess with EM itself until now