ivanoats has quit [Read error: Connection reset by peer]
ivanoats has joined #ruby-lang
ivanoats has quit [Read error: Connection reset by peer]
ivanoats has joined #ruby-lang
ivanoats has joined #ruby-lang
ivanoats has quit [Changing host]
ivanoats has quit [Ping timeout: 265 seconds]
Weems has joined #ruby-lang
Weems has quit [Changing host]
Weems has joined #ruby-lang
drbrain has joined #ruby-lang
tdy has joined #ruby-lang
wyhaines has quit [Remote host closed the connection]
Nisstyre has joined #ruby-lang
drbrain has quit [Ping timeout: 255 seconds]
jbsan has joined #ruby-lang
sepp2k has quit [Quit: Leaving.]
mistym has quit [Remote host closed the connection]
jonahR has joined #ruby-lang
mjio has joined #ruby-lang
jackhammer2022 has joined #ruby-lang
sailias has joined #ruby-lang
cirwin is now known as cmoeck
ryanf is now known as ryanm_
ryanm_ is now known as ryanf
cmoeck is now known as cirwin
Rarrikins has quit [Ping timeout: 252 seconds]
davpoind2 has quit [Quit: Be back later]
blahwoop has joined #ruby-lang
bombgigazord has joined #ruby-lang
drbrain has joined #ruby-lang
wyhaines has joined #ruby-lang
drbrain has quit [Ping timeout: 264 seconds]
cirwin has quit [Quit: Leaving.]
swav has quit [Remote host closed the connection]
ghanima has joined #ruby-lang
blahwoop has quit [Ping timeout: 276 seconds]
<ghanima>
hello all I am trying to parse a json object and was wondering the best way to go about it. I have dealt with simple json objects before but this is very multidimensional and very nested and not sure how to approach. I have posted the json example here http://privatepaste.com/2bca63c51c
<ghanima>
data['gomez_data']['monitor']['test'][0] Then I just want to grab the first 3 elements
<ghanima>
but everytime i try to traverse deeper than that the object that is returned to nil
<ghanima>
any thoughts
madish has quit [Quit: ChatZilla 0.9.89 [Firefox 16.0.1/20121026125834]]
blahwoop has joined #ruby-lang
rsl has quit [Quit: Computer has gone to sleep.]
toretore has quit [Quit: Leaving]
atadesk has joined #ruby-lang
drbrain has joined #ruby-lang
davidbalber|away is now known as davidbalbert
havenn has quit [Remote host closed the connection]
gix has quit [Ping timeout: 240 seconds]
drbrain has quit [Ping timeout: 255 seconds]
gix has joined #ruby-lang
atadesk has quit [Quit: Leaving.]
guns has joined #ruby-lang
swav has joined #ruby-lang
<arooni-mobile>
how would i match anything up until the question mark in this string: "href="/profile/welen?cf=regular" .. so far i have: /profile\/(^[\?])*/ but it doesnt seem to be working
<yfeldblum>
arooni-mobile, because ^ matches start-of-line
<arooni-mobile>
im trying to do the inverse or negative matching
<yfeldblum>
arooni-mobile, then use [^...] instead of ^[...]
<arooni-mobile>
ah ha
<arooni-mobile>
yup thats it
<yfeldblum>
arooni-mobile, hmmm i wonder if you need that \? inside the character class, rather than just ?
<arooni-mobile>
i was trying to escape the normal use of ?
<yfeldblum>
arooni-mobile, there is no normal use of ? inside a character class; it's only a valid operator outside a character class
<arooni-mobile>
ah
ramonmaruko has quit [Remote host closed the connection]
havenn has joined #ruby-lang
ramonmaruko has joined #ruby-lang
jxie has quit [Quit: leaving]
mercwithamouth has quit [Ping timeout: 260 seconds]
jbsan has quit [Quit: jbsan]
wallerdev has joined #ruby-lang
jbsan has joined #ruby-lang
ryanf_ has joined #ruby-lang
JoelMcCracken has quit [Ping timeout: 245 seconds]
drbrain has joined #ruby-lang
dafalcon` has quit [Ping timeout: 260 seconds]
drbrain has quit [Ping timeout: 244 seconds]
dafalcon` has joined #ruby-lang
Weems|test has joined #ruby-lang
Weems|test has joined #ruby-lang
Weems|test has quit [Changing host]
Weems|test has quit [Remote host closed the connection]
Weems|test has joined #ruby-lang
Weems|test has joined #ruby-lang
Weems|test has quit [Changing host]
Weems|test has quit [Remote host closed the connection]
<Sinestro>
Ruby is flipping around between "syntax error, unexpected $end, expecting keyword_end" and "syntax error, unexpected keyword_end, expecting $end"
<whitequark>
>The IE6 network drivers must be installed upon first boot, or an activation loop will prevent subsequent logins forever. If this happens, restoring to the clean snapshot will reset the activation lock.
<whitequark>
lolwhat
<yorickpeterse>
Fuck IE6
<yorickpeterse>
All we care for is IE9
<yorickpeterse>
Hm shit, I don't have my server's root password here
<whitequark>
also, since when MS packages their software to .rar archives?
<yorickpeterse>
cbf installing Mosh from source
<whitequark>
it's a proprietary format from a russian company. I don't get it...
richardburton has quit [Quit: Leaving.]
<yorickpeterse>
When did MS ever make sense?
<whitequark>
true too.
kogent has quit [Quit: kogent]
kogent has joined #ruby-lang
drbrain has joined #ruby-lang
znake has joined #ruby-lang
znake has quit [Client Quit]
karasawa has quit [Remote host closed the connection]
<whitequark>
yorickpeterse: haha check 1.8.4 on page 10 in that article
aedorn has quit [Quit: Leaving]
<yorickpeterse>
"Proc.new, when called with no normal arguments and no block argument, will return
<yorickpeterse>
a reference to the block, if any.
<yorickpeterse>
"
<yorickpeterse>
what the fuck
Rarrikins_m has joined #ruby-lang
<ryanf>
haha wtf
<ryanf>
that's insane
Rarrikins has quit [Read error: Connection reset by peer]
<yorickpeterse>
Hm, I reckon that's a nice feature to add to my linter: yell at people when they use yield/Proc.new without a block
<rolfb>
yorickpeterse: which block?
<rolfb>
the surrounding block?
<rolfb>
o_O
<yorickpeterse>
eh no, the block passed to a method call
<whitequark>
yorickpeterse: it is also incorrect
drbrain has quit [Ping timeout: 260 seconds]
<yorickpeterse>
oh?
<whitequark>
because Proc.new will raise if there's no block given
<yorickpeterse>
Hm correct
<yorickpeterse>
Might've changed recently
<whitequark>
also: it has some really weird semantics wrt/ warnings
<whitequark>
still easier to understand than the one of ruby_parser.
<yorickpeterse>
I'll quote myself: "Oh, I wonder how Ruby parses X. I'll take a look at parse.y!" - No one, ever
<yorickpeterse>
I really need to start indexing my IRC logs
<yorickpeterse>
`find ~/.weechat/logs/archive/ -name '*ruby-lang*' -exec ack -i 'yorickpeterse.+parse\.y' {} \;` doesn't work very well for searching (takes too long)
setmeaway has joined #ruby-lang
rcvalle has joined #ruby-lang
setmeaway has quit [Read error: Connection reset by peer]
<yorickpeterse>
Though I have to say monospace looks exceptionally shit on this Xubuntu box
<whitequark>
as per linux font rendering. Disable subpixel AA. Enable full grayscale AA. If your DPI is <100, enable full hinting.
<whitequark>
these three simple steps make fonts awesome.
<whitequark>
applicable to any OS, in fact
fushi has joined #ruby-lang
<injekt>
anyone here ever used the Prompt app on an iPhone?
<yorickpeterse>
I have it set to slight hinting since I have trouble focusing when using full hinting
<heftig>
i'm running with subpixel hinting
<heftig>
without that, the hinter rapes recent microsoft fonts
<whitequark>
yorickpeterse, heftig: there's bytecode hinting and automatic hinting
<whitequark>
and some patent bullshit is involved
<whitequark>
what I know is that decent free fonts like DejaVu family are hinted properly
<heftig>
"slight" hinting always uses the autohinter
<whitequark>
heftig: then the microsoft fonts probably rape themselves
<yorickpeterse>
I quite like the DejaVu family
<yorickpeterse>
Especially the monospace one is quite nice
<heftig>
whitequark: they depend on microsoft's cleartype implementation
<heftig>
whitequark: the subpixel hinting added in the latest freetype is an attempt to follow that
<whitequark>
heftig: ah, sure. subpixel rendering is the worst thing which happened to fonts since windows, anyway.
cultureulterior_ has joined #ruby-lang
<heftig>
whitequark: well, hopefully it will be unnecessary in the near future
<heftig>
all the hinting, i mean
<whitequark>
heftig: yeah, together with hinting
<whitequark>
yes
<whitequark>
yorickpeterse: that article is from the author of Laser (judging from illustrations with its namespace)
<whitequark>
I always wondered how that critter works
<yorickpeterse>
I have no fucking clue
<yorickpeterse>
I looked at it and I just wat'd
<whitequark>
it is not terribly complex from inside, if you are already familiar with SSA and CFG and DFA
<whitequark>
not very well-written, through
wallerdev has quit [Quit: wallerdev]
<whitequark>
what I don't like about these papers is that 80% of algorithms with long pathetic names is actually the most trivial thing possible
leopard_me has joined #ruby-lang
<whitequark>
but since someone had to inflate the number of citations, you now need to sit and decipher all that stuff
drbrain has joined #ruby-lang
<yorickpeterse>
I don't really bother with the theoratical aspects of brogramming until I really have to
<yorickpeterse>
Most of the time it's the process of banging my head against a wall until I get to a point where I'm satisfied
<whitequark>
yorickpeterse: academic papers have produced a few awesome things like LLVM for us
<whitequark>
but most of them is simply not worth time spent reading
<yorickpeterse>
Sure, but even so they first wrote the thing and then the paper
<whitequark>
given that these people are writing papers often precisely because they can't write code good enough to run in production, reading the paper is often far easier
<whitequark>
LLVM is a very rare exception here
io_syl has quit [Quit: Computer has gone to sleep.]
rolfb has quit [Quit: Leaving...]
drbrain has quit [Ping timeout: 265 seconds]
Rarrikins_m has quit [Remote host closed the connection]
Rarrikins_m has joined #ruby-lang
<yorickpeterse>
I haven't really heard any bad things about LLVM
<whitequark>
it is very good
karasawa has joined #ruby-lang
postmodern has quit [Quit: Leaving]
pythonsnake has joined #ruby-lang
<pythonsnake>
why double chan
gaveen has quit [Remote host closed the connection]
krz has quit [Quit: krz]
mfn has quit [Ping timeout: 260 seconds]
<yorickpeterse>
That reminds me, I need to play around with Emmen at some poin t
<yorickpeterse>
* point
<whitequark>
yorickpeterse: Emmen?
<yorickpeterse>
eeh not sure if it was called that way. That LLVM thing that compiles C to JS
<yorickpeterse>
The name was something along those lines I believe
<yorickpeterse>
What I meant was that you'd have your own code (Lua, Ruby, etc) that would just evaluate JS and translate that to X
<yorickpeterse>
During runtime
<yorickpeterse>
So effectively it would be the equilivant of ``
<whitequark>
not with emscripten.
<whitequark>
well, you technically could hack wrappers all around and get something like that
<whitequark>
but you'll shoot yourself trying to debug it if it ever breaks. and it will.
<yorickpeterse>
Oh certainly, I just think that would truly make it more useful
<yorickpeterse>
Then again I'd much rather see an actual implementation
<yorickpeterse>
One that does not translate X into JS
<yorickpeterse>
heh, that's a good joke to tell in bars: something other than JS in browsers
solars has joined #ruby-lang
<whitequark>
NaCl
Future[Chimp] has joined #ruby-lang
<yorickpeterse>
wat
<yorickpeterse>
I'm not salty :<
<rue>
Not yet!
<whitequark>
yorickpeterse: Native Client
<yorickpeterse>
Well, native client is Chrome only
<whitequark>
there probably won't ever be anything in IE
<whitequark>
AX is removed in Win8, or that's what I heard
<yorickpeterse>
And knowing Mozilla and M$ they'll just laugh it off and instead spend time doing mundane things such as fucking up their developer tools
tbuehlmann has quit [Quit: Yaaic - Yet another Android IRC client - http://www.yaaic.org]
<whitequark>
yorickpeterse: I've read the laser paper. Nothing really interesting, i.e. what you couldn't figure out yourself. Might want to skim across it, through.
<whitequark>
it is quite basic, unfortunately
<yorickpeterse>
I think I read it a while ago
<yorickpeterse>
when I first stumbled on the guy's blog post about Laser
Future[Chimp] has quit [Quit: Leaving]
<charliesome>
native client stole the nacl acronym from network applied communications laboratory
<whitequark>
charliesome: there's also a cryptography lib with the same name
<whitequark>
and not a bad one, for that matter
<charliesome>
them bastards
<charliesome>
also fwiw i think nacl is a bad idea
<charliesome>
it's a bad direction to go in
<whitequark>
charliesome: yeah, it's surely better to waste millions of cycles on nun boxing
<charliesome>
i don't see how it's different to activex
<whitequark>
quite simple: it has a sandbox which works
<charliesome>
in ten years people will have to deal with old web apps that Work Best Viewed With Chrome 23.123456 At 1920x1080
dhruvasagar has quit [Ping timeout: 245 seconds]
<whitequark>
[works not significantly worse than the browser's javascript sandbox itself]
<whitequark>
charliesome: you know what's the problem with JS engines?
<charliesome>
they're slow?
<whitequark>
they are either resource hungry because they're stupid, or resource hungry because they're clever
Future[Chimp] has joined #ruby-lang
<charliesome>
ok well my response is stop doing stupid shit in the browser
<whitequark>
not necessarily slow. processors are fast. also, processors eat battery.
m3nd3s has joined #ruby-lang
<whitequark>
on the other hand, memory eats battery either, and unlike processors, memory does that even while the device sleeps
dhruvasagar has joined #ruby-lang
<whitequark>
and memory eats quite a lot of battery. this is why you won't see smartphones with 10G of RAM any time before a fundamentally new battery technology is invented
<whitequark>
continually refreshing billions of capacitors at room temperature requires quite a lot of power.
mfn has joined #ruby-lang
<whitequark>
it's a lose-lose choice to js
<whitequark>
also note that by 2020, Moore's law (the part of it which is due to transistor shrinkage) most certainly halts
<whitequark>
so, yeah, stop doing stupid shit in the browser.
<matti>
CA PA CI TO R
<matti>
;d
glebm has quit [Quit: Computer has gone to sleep.]
<whitequark>
matti: what's with it?
<matti>
whitequark: My biggest worry in the world of Eve Online.
<matti>
;p
vesan has quit [Read error: Connection reset by peer]
vesan has joined #ruby-lang
<heftig>
what's the neatest next-gen memory technology?
<matti>
heftig: Clay tablets.
<whitequark>
heftig: memristors
<heftig>
they're non-volatile, yes?
<whitequark>
exactly
<heftig>
so they wouldn't need refreshing
<whitequark>
also very fast to switch
<whitequark>
and even smaller than 2-transistor DRAM cells, AFAIK
drbrain has joined #ruby-lang
<whitequark>
there's also Fe-RAM
<whitequark>
which is basically core memory on nanoscale
vlad_starkov has quit [Remote host closed the connection]
<whitequark>
(and it's quite funny by itself)
<whitequark>
but it costs so much now it isn't really used anywhere near mass production
kke has quit [Ping timeout: 256 seconds]
<whitequark>
>In April 2010, HP labs announced that they had practical memristors working at 1 ns (~1 GHz) switching times and 3 nm by 3 nm sizes, with electron/hole mobility of 1 m/s,[36] which bodes well for the future of the technology.[37] At these densities it could easily rival the current sub-25 nm flash memory technology.
<whitequark>
1 GHz means that it could easily rival the current DRAM technology.
<whitequark>
and flash as well, of course
shemerey has quit [Quit: Leaving...]
<whitequark>
if only they could build more than a few dozen of them.
<matti>
whitequark: With all the $$$ indested in DRAM et al production lines / technologies.
<matti>
whitequark: Memristor will not be on the market for quite some time, I guess.
<heftig>
will we first see devices that 'partition' a single MR memory device into 'RAM' and 'disk' for compatibility?
megharsh has quit [Ping timeout: 244 seconds]
<matti>
whitequark: As usual, business will hinder progress.
<whitequark>
matti: I won't be so sure about that, but your concern is quite valid.
<matti>
whitequark: I've see this pattern in the industry far too many times.
<matti>
whitequark: Its depressing.
<whitequark>
heftig: probably no. all OSes have ramdisks.
kke has joined #ruby-lang
<heftig>
ah, right.
<whitequark>
and it's far too expensive to dedicate circuitry or even pins for that bullshit
<whitequark>
when you can do it in software
<charliesome>
whitequark: not my os!
<whitequark>
charliesome: then throw it out and get a real one
<charliesome>
:(
drbrain has quit [Ping timeout: 276 seconds]
<matti>
whitequark: DRAM is getting to the point where the faster it is, the more errors during RAS/CAS cycles it produces.
<whitequark>
matti: are you saying that modern commercial DRAM should be ECC'd in order to be reliable in any way?
<whitequark>
that is interesting. source? I'd like to learn more about it
<matti>
whitequark: There is a reason why servers have buffered and ECC DRAM ;p
<whitequark>
matti: that reason is called "cosmic rays"
<matti>
whitequark: Aside of marketing bollocks.
<matti>
whitequark: And unicorns ;p
<whitequark>
or, to be more serious, ionizing radiation
<matti>
I know.
<matti>
Most modern industry grade data centres are semi-shielded, don't they?
<matti>
I've been into few cages build as Farady cages.
<whitequark>
matti: the most problematic part is radiation sources inherent in materials
<whitequark>
Si is very finely refined so it doesn't have much radioactive inclusions
<whitequark>
but for example plasic for chip cases isn't that good
<matti>
Hm.
<matti>
Never thought about this that way.
<whitequark>
(it is specifically refined to remove C14 and such)
<whitequark>
much less everything else
<matti>
I wonder what will this look like in the fture.
<matti>
When mankind will embark on traveling through space.
<matti>
Technology would have to change, I guess.
<whitequark>
there is already plenty of space-grade components ;)
<matti>
Haha
<whitequark>
the tech is well-tested
<matti>
Since '70s ;p
<matti>
I guess ;p
<whitequark>
yea
<heftig>
the buffering is to prevent the memory controller from melting, yes? :p
<whitequark>
there are space-grade FPGAs even
vlad_starkov has joined #ruby-lang
<whitequark>
which is kinda impressive, given the number of possibilities for thyristor latchup
<matti>
I am curious what SpaceX is using.
jbsan has quit [Quit: jbsan]
<matti>
I am huge fan of theirs.
mytrile has joined #ruby-lang
<whitequark>
matti: yeah, SpaceX is most certainly what will matter in near future
<whitequark>
iirc they use Ethernet for all communications on Dragon
<whitequark>
an unusual choice
<matti>
Oh.
<matti>
How do they shield PHY then?
<matti>
803 is so prone to cross-talks and so forth.
madish has joined #ruby-lang
<whitequark>
no clue
<matti>
I can imagine that in space it is even worse.
<matti>
I remember reading of some crazy DoD project involving replacing wired cabling on an Apache helicopter with fiber to avoid a lot of EM warfare things, and make it more resistant to ionizing radiation.
<matti>
I wonder why SpaceX would not go a similar route.
richardburton has quit [Ping timeout: 255 seconds]
shemerey has quit [Client Quit]
serhart has quit [Read error: Connection reset by peer]
shemerey has joined #ruby-lang
serhart has joined #ruby-lang
serhart has quit [Read error: Connection reset by peer]
serhart has joined #ruby-lang
shemerey has left #ruby-lang [#ruby-lang]
serhart has quit [Read error: Connection reset by peer]
serhart has joined #ruby-lang
<yorickpeterse>
"Starting Windows" it was a sad day
adambeynon has joined #ruby-lang
drbrain has joined #ruby-lang
serhart has quit [Read error: Connection reset by peer]
dhruvasagar has quit [Ping timeout: 244 seconds]
serhart has joined #ruby-lang
vlad_starkov has joined #ruby-lang
drbrain has quit [Ping timeout: 264 seconds]
Rarrikins_m has quit [Remote host closed the connection]
Rarrikins_m has joined #ruby-lang
vlad_starkov has quit [Remote host closed the connection]
kurko_ has joined #ruby-lang
serhart has quit [Read error: Connection timed out]
serhart has joined #ruby-lang
goshakkk has quit [Quit: Computer has gone to sleep.]
<hackeron>
hey, I'm trying to send a POST request to Rails listening on a unix socket - I'm trying to do http = Net::HTTP.new("unix:///tmp/XanAgent.sock") but that throws: /usr/local/Cellar/ruby/1.9.3-p327/lib/ruby/1.9.1/net/http.rb:762:in `initialize': getaddrinfo: nodename nor servname provided, or not known (SocketError) -- any ideas?
<hackeron>
heh, it does - any suggestions to clean up?
<matti>
hackeron: Why do you need to use Unix socket over TCP on lo?
<hackeron>
matti: on lo?
<matti>
hackeron: HTTP will be perfectly fine talking to 127.0.0.1
<matti>
hackeron: lo == localhost
<matti>
Unix sockets can be a pain.
<lianj>
matti: i use thin to listen on unix sockets too. nginx -> unixsocket -> thin
<matti>
Why?
nevill has joined #ruby-lang
<matti>
We are no longer in '70s ;p
<lianj>
no local ports, finer/easier permissions, and i like to think it faster (maybe naivly)
<hackeron>
matti: yeh, same as lianj except I use nginx -> unixsocket -> puma -- the documentation says it's 15% faster
<matti>
Hm.
<hackeron>
https://github.com/puma/puma < oh, sorry, 5 to 10%, heh < "Want to use UNIX Sockets instead of TCP (which can provide a 5-10% performance boost)? No problem!"
<matti>
I am not sold on this perfoemance boost.
n0b0dy has joined #ruby-lang
<matti>
performance*
<hackeron>
also it allows me to call my applications by name - I have a whole bunch of running applications and /var/run/my-app-name.sock is far more descriptive than netstat -Nnapl | grep LISTEN and looking through port numbers :)
<lianj>
hackeron: funny hack to connect to it. i had was going to build a simple tcp -> unixsocket proxy with em. but yours is more simple
<lianj>
hackeron: right, and file permissions are a nice extra too
<hackeron>
lianj: yeh, I like to build a request - the last bit looks a bit messy, but it's not too bad :)
arooni-mobile has joined #ruby-lang
<hackeron>
lianj: yeh and permissions :)
<matti>
hackeron: LOL, I am not sure if this is a valid reason -- calling applications by name.
<matti>
Neither I am sold on usefulness of Unix socket file permission ;p
<lianj>
matti: just, why not? what are the problems with unix instead of local tcp sockets?
<hackeron>
matti: well, I have 100 or so applications running, just seems wrong to have to hardcore a port number for each and checking it doesn't conflict with anything else
<hackeron>
hard code*
<matti>
hackeron: Fair enough.
<lianj>
matti: unless you do some iptables foo, any local user can acces your local tcp sockets. not so with socket file permissions
<yorickpeterse>
hackeron: Net::HTTP expects a hostname, from what I understand it is now able to connect via sockets
<yorickpeterse>
Though I could be wrong
<yorickpeterse>
* not
<lianj>
matti: its just a nice little extra
<lianj>
yorickpeterse: prolly because of the .exec usage
<hackeron>
matti: check this out: http://monitor.xanview.com - so the subhostname "monitor" that's the application name, normally it is "company-name" or whatever the client decides on - so the logs, the sockets and everything else is called after that - as well as the init scripts /etc/init/company-name_portal.conf - stuff like that
<hackeron>
yorickpeterse: hmm, it is?
<yorickpeterse>
As in, Net::HTTP.new('unix://blabla') is not going to work
x0F has quit [Disconnected by services]
x0F_ has joined #ruby-lang
arooni-mobile has quit [Remote host closed the connection]
<yorickpeterse>
Try looking at others, maybe httpclient or httparty can do it
x0F_ is now known as x0F
<lianj>
yorickpeterse: look at his second paste
<hackeron>
yorickpeterse: oh, I didn't see the * not :) - I have this solved now
<matti>
lianj, hackeron: In general, I am not sold on the performance thing... but other points are valid; so I state corrected on the subject :)
<lianj>
matti: \o/ yay ;)
rsl has joined #ruby-lang
emocakes has quit [Quit: emocakes]
<hackeron>
heh :)
<matti>
lianj, hackeron: The only problem I see with this (which is heavy bounded to the underlying implementation) is moving it to TCP when you want to move some services to a separate servers -- you'd have to change the code (unless done cleverly).
<lianj>
matti: why. as for thin, you dont have to change any code
<hackeron>
matti: how is it bounded? - this is just for local stuff - everything connects to /var/run/application-name.sock - the HTTP and remote access just happens by going to app-name.domain.com:80 -- that way the hostname is used to route to the app instead of hundreds of port numbers
<yorickpeterse>
dominikh: not related to #ruby-lang but Cinchy in #ramaze keeps posting Tweets multiple times (e.g. 4 times). Can you take a look at this when you have some time?
headius has joined #ruby-lang
<judofyr>
zzak: do you know much about GCC's optimizing capabilities?
<judofyr>
or maybe whitequark can help
larrylv has joined #ruby-lang
<judofyr>
I have a big function that I like to refactor into several small ones. but there's a bunch of local variables (~ 7) used all over the function.
<zzak>
judofyr: i dont, sorry
<judofyr>
ah
<judofyr>
I really wish I knew more about assembly and C
tdy has quit [Quit: WeeChat 0.3.9.2]
<judofyr>
and how to profile a single C function :/
anachronistic has joined #ruby-lang
tdy_ has left #ruby-lang [#ruby-lang]
tdy has joined #ruby-lang
<heftig>
judofyr: if you split out parts of the function into new static functions (that are only called once), gcc at -O2 should inline them and generate the same code
<heftig>
if you define them as "inline", they'll be considered for inlining even if called more than once
kgrz has joined #ruby-lang
larrylv has quit [Ping timeout: 240 seconds]
<judofyr>
heftig: ah. thanks! I'll give it a try later.
<judofyr>
yorickpeterse: I think valgrind is kinda broken in OS X ML
<yorickpeterse>
Oh, you're on OS X
<yorickpeterse>
Yeah...good luck with that
<yorickpeterse>
Valgrind itself should work, I however never got the UI to work
<yorickpeterse>
Could try perftools instead
<yorickpeterse>
It's quite different but better than nothing
<judofyr>
yorickpeterse: well, right now, everything is in one function. so it's not really useful to know that 100% of the time is spent in leo_insert
<judofyr>
yorickpeterse: or, there's main() that calls leo_insert() in a loop
<yorickpeterse>
pastie or gtfo
meatballhat has quit [Ping timeout: 255 seconds]
<pythonsnake>
thx
mytrile has quit [Remote host closed the connection]
<judofyr>
yorickpeterse: not sure if you're able to extract anything out from that :/
* yorickpeterse
puts on his rubber glove
io_syl has joined #ruby-lang
<yorickpeterse>
dat #defne
<yorickpeterse>
* #define
emocakes_ has joined #ruby-lang
<judofyr>
yorickpeterse: which of them? :)
<yorickpeterse>
Oh, I see what you were talking about
<yorickpeterse>
lets see
<judofyr>
yorickpeterse: it's a dictionary implementation. kinda similar to LevelDB: everything is stored in levels. so leo_insert either inserts the item in the lowest level, or merges it with the two lowest levels into a third one
<judofyr>
yorickpeterse: oh, and it's generic, so it's kinda funky
<zzak>
judofyr: me too
<yorickpeterse>
Well, I'd start with creating functions for basically every if statement that's more than 3-5 lines where possible
<yorickpeterse>
This however gets a bit annoying in C
<yorickpeterse>
For example, line 112-118 could be a function
zmack has joined #ruby-lang
zmack has quit [Remote host closed the connection]
<yorickpeterse>
Same goes for 139-147
<yorickpeterse>
and 149-163
<yorickpeterse>
168-176 as well
<judofyr>
yorickpeterse: yeah, I think I should just massively refactor everything into small functions. but then: how should I deal with the state?
<yorickpeterse>
Having said that, you should create some structs to contain/pass around data instead of random variables
drbrain has joined #ruby-lang
<yorickpeterse>
That way you don't end up with functions that have 1200 parameters
emocakes has quit [Ping timeout: 265 seconds]
<judofyr>
yorickpeterse: so I do: struct foo bar = { .left_current = …, .right_current = … }; and then pass &bar to the functions?
<yorickpeterse>
I'd also keep the amount of macros down to a minimum, they're a cunt to debug
<judofyr>
well, there's hardly any "real" macros there now. most of them are only there because I want it to be generic.
<yorickpeterse>
If it helps, write it in Ruby first and then try to translate it to C. C is of course very different but it should make things a bit easier to create a prototype/skeleton for things
goshakkk has quit [Quit: Computer has gone to sleep.]
<yorickpeterse>
I have to catch my train (they are quite elusive around here), I'll be back in a bit
<judofyr>
yorickpeterse: thanks for the help!
drbrain has quit [Ping timeout: 260 seconds]
karasawa has quit [Ping timeout: 245 seconds]
Rarrikins_u has quit [Remote host closed the connection]
rue has quit [Remote host closed the connection]
stardiviner has joined #ruby-lang
daro_ has joined #ruby-lang
daro_ has quit [Remote host closed the connection]
sush24 has quit [Ping timeout: 244 seconds]
judofyr has quit [Remote host closed the connection]
nyuszika7h has quit [Remote host closed the connection]
dan_ has joined #ruby-lang
dankest has quit [Read error: Connection reset by peer]
nyuszika7h has joined #ruby-lang
karasawa has joined #ruby-lang
goshakkk has joined #ruby-lang
goshakkk has quit [Excess Flood]
goshakkk has joined #ruby-lang
goshakkk has quit [Excess Flood]
sn0wb1rd has quit [Quit: sn0wb1rd]
goshakkk has joined #ruby-lang
mercwithamouth has quit [Ping timeout: 240 seconds]
mistym has quit [Remote host closed the connection]
<unsymbol>
this will probably sound stupid... BUT is there a way to access instance methods within the included hook of a module without adding the module include at the end of the class?
blahwoop has quit [Ping timeout: 245 seconds]
<pythonsnake>
unsymbol: sounds stupid
<unsymbol>
pythonsnake: oh, i know it's stupid.
<pythonsnake>
what are you really trying to do
atadesk has joined #ruby-lang
atadesk has quit [Client Quit]
karasawa has quit [Ping timeout: 240 seconds]
<injekt>
unsymbol: why would you even want that?
<unsymbol>
pythonsnake injekt: because i'm down a rabbit hole of manipulating ast at runtime for fun and pleasure.
<rking>
It should Thread.new { sleep 3; klass.new.scream }
m3nd3s has quit [Remote host closed the connection]
<rking>
(Assuming the goal is totally inexplicable behavior)
havenn has joined #ruby-lang
<injekt>
yuck
<unsymbol>
rking: well, a significant portion of it will be wtf but i had to tame the boredom over the past few days.
<rking>
Or maybe do a remove_method after 3 seconds
<rking>
class ImpatientObject
stiang has joined #ruby-lang
<rking>
class MementoAsInTheGuyPearceMovie
telemachus has left #ruby-lang [#ruby-lang]
richardburton has joined #ruby-lang
ivanoats has joined #ruby-lang
ivanoats has joined #ruby-lang
ivanoats has quit [Changing host]
headius has quit [Quit: headius]
methods has left #ruby-lang [#ruby-lang]
sustainableweb has joined #ruby-lang
richardburton has quit [Client Quit]
kain has joined #ruby-lang
ivanoats has quit [Ping timeout: 272 seconds]
havenn has quit [Ping timeout: 272 seconds]
ryanf has quit [Read error: Connection reset by peer]
ryanf has joined #ruby-lang
ryanf has quit [Read error: Connection reset by peer]
ryanf has joined #ruby-lang
havenn has joined #ruby-lang
melter has quit [Remote host closed the connection]
melter has joined #ruby-lang
<whitequark>
yorickpeterse: 60000-61000, yes
<whitequark>
and what's with encoding? converting everything to UTF-8 is the only sane option in 2013
<shachaf>
UCS-2.625 forever
stevechiagozie has joined #ruby-lang
peterhellberg has joined #ruby-lang
<whitequark>
well, s,UTF-8,Unicode,
karasawa has joined #ruby-lang
glebm has joined #ruby-lang
Axsuul has joined #ruby-lang
sustainableweb has quit [Remote host closed the connection]
karasawa has quit [Ping timeout: 256 seconds]
cirenyc has joined #ruby-lang
dominikh has quit [Ping timeout: 244 seconds]
<yorickpeterse>
whitequark: except when everything is set to UTF8 and it still believes this isn't the case. I had to pass --server="LANG=$LANG most-server" to the command to make it work
<whitequark>
yorickpeterse: do you have LANG set at all?
jacktrick has joined #ruby-lang
jacktrick is now known as Guest32427
<yorickpeterse>
LANG=en_US.UTF-8
<yorickpeterse>
So yes
<yorickpeterse>
Both on the client and server, settings are identical actually
Rarrikins_c has joined #ruby-lang
Rarrikins has quit [Ping timeout: 252 seconds]
serhart has quit [Quit: Leaving.]
<whitequark>
weird, it works perfectly for me λ
Guest32427 has left #ruby-lang [#ruby-lang]
<yorickpeterse>
tbh Unicode works fine for me as it is anyway
jacktrick has joined #ruby-lang
<chris2>
gosh, i need to fork 6x13 one day with that look for a λ
dominikh has joined #ruby-lang
havenn has quit [Remote host closed the connection]