<anekant>
how come I can do "java -version" from a DOS terminal and it works, but from irb: irb(main):001:0> IO.popen("java -version") gives irb(main):002:0> Failed reading value of registry key: [...]
<jmontross>
`java —version`
<jmontross>
back ticks are where it's at
<jmontross>
for running shell.. maybe it doesnt work on windows
<anekant>
irb(main):003:0> IO.popen(`java -version`) still gives Failed reading value of registry key: [...]
<rue>
anekant: See Kernel#` for what jmontross is talking about. Looks like an environment problem, perhaps?
<anekant>
irb(main):001:0> `java -version` gives Failed reading value of registry key:
<anekant>
it's weird because i use java from IO.popen in other programs with the same version of ruby and java
<anekant>
well this other program is setting a lot of environment vars
ryanf joined #ruby-lang
<anekant>
hm i can run "%JAVA_HOME%\bin\java.exe - version" from the command line, but `%JAVA_HOME%\\bin\\java.exe -version` gives Errno::ENOENT: No such file or directory - %JAVA_HOME%\bin\java.exe -version
<anekant>
oh man, the problem is that %JAVA_HOME% has a "\n" at the end of it
<anekant>
what a pain :)
Weems2 joined #ruby-lang
srbaker joined #ruby-lang
looopy joined #ruby-lang
jjore joined #ruby-lang
<anekant>
how do I read from stderr using IO.popen
curtism joined #ruby-lang
<anekant>
in other words if the process opened by IO.popen writes to stderr, can I read that?
<anekant>
yeah "'io' is not recognized as an internal or external command, ..."
<lianj>
huh
yfeldblum joined #ruby-lang
media-948 joined #ruby-lang
woollyams joined #ruby-lang
JosephRuby joined #ruby-lang
<lianj>
but yea, 2>&1 prolly doesnt work on windows
media-584 joined #ruby-lang
WillMarshall joined #ruby-lang
<tylergillies>
can i get variables in main scope inside my method scope? foo = "bar"; def baz; puts foo; end
<tylergillies>
or is that best to use a lambda?
<lianj>
lambda works. wouldnt call it best though
<tylergillies>
so what other way would i do it?
<tylergillies>
im inside an interator where i have widgets.each do |widget| def calculate_value; widget.value + x_factor; end; end
<lianj>
pass it as an argument, or uses a klass instead of main scope
<tylergillies>
what is a klass?
<lianj>
class
<lianj>
sorry
wmoxam joined #ruby-lang
wmoxam joined #ruby-lang
<anekant>
okay i guess I can just ignore the stderr :) thx folx
arooni-mobile joined #ruby-lang
wyhaines joined #ruby-lang
jimmy1980 joined #ruby-lang
srbaker joined #ruby-lang
srbaker joined #ruby-lang
bougyman joined #ruby-lang
media-498 joined #ruby-lang
ryanf_ joined #ruby-lang
kitallis joined #ruby-lang
Defusal joined #ruby-lang
Defusal joined #ruby-lang
aroop joined #ruby-lang
ryanf_ joined #ruby-lang
nofxx joined #ruby-lang
rippa joined #ruby-lang
artOfWar joined #ruby-lang
RomyEatsDrupal joined #ruby-lang
heppy joined #ruby-lang
bougyman joined #ruby-lang
bougyman joined #ruby-lang
amerine joined #ruby-lang
twittard joined #ruby-lang
JosephRuby joined #ruby-lang
banisterfiend joined #ruby-lang
alim joined #ruby-lang
yxhuvud joined #ruby-lang
Rikkie joined #ruby-lang
Rikkie joined #ruby-lang
udzinari joined #ruby-lang
bjensen joined #ruby-lang
<Rikkie>
is it okay to ask for help here?
bougyman joined #ruby-lang
<rue>
NO!
bougyman joined #ruby-lang
<rue>
Rikkie: (Actually, yes)
<Rikkie>
okay, great :)
<Rikkie>
I'm a newcomer working on my first gem, but don't understand how I can work on a gem locally, without building and installing it..
<rue>
When you're actually trying it out, it *is* best to install it. You can install a local gem when you need to
<rue>
Normal unit testing happens outside the gem paradigm though, usually
<banisterfiend>
rue: hey rue
<rue>
Hidy ho
<Rikkie>
I understand, but what if you wanted to alter the code of a gem?
<rue>
Rikkie: Alter or augment some other gem?
<Rikkie>
alter
<rue>
The operative term was “other”, really :)
<Rikkie>
sorry, I've had a long day ;-)
<Rikkie>
I meant altering the code of the gem I'm working on
<rue>
By and large, it's probably not great to alter another gem (as opposed to augmenting it with a plugin), but there shouldn't be a problem with that if you DO
<rue>
Rikkie: Ah, yours
<rue>
If you've installed it already, you'd need to rebuild and reinstall (since you're not bumping the version presumably)
<rue>
But normally you'd do the development just in your working directory, so to speak
<rue>
You've got your specs/tests to check behaviour, and if you need to e.g. try something out interactively, you can just require the necessary files
lenilson_dias joined #ruby-lang
<Rikkie>
Okay, that makes sense. Thanks!
michael_mbp joined #ruby-lang
RomD`` joined #ruby-lang
tallship joined #ruby-lang
jasox joined #ruby-lang
spap joined #ruby-lang
AlHafoudh joined #ruby-lang
ged joined #ruby-lang
jxie joined #ruby-lang
workmad3 joined #ruby-lang
xhx joined #ruby-lang
jasox joined #ruby-lang
tbuehlmann joined #ruby-lang
srbartlett joined #ruby-lang
Manhose joined #ruby-lang
wyhaines joined #ruby-lang
fridim_ joined #ruby-lang
Manhose joined #ruby-lang
jimmy1980 joined #ruby-lang
setmeaway joined #ruby-lang
workmad3 joined #ruby-lang
benanne joined #ruby-lang
solars joined #ruby-lang
<bnagy>
NotImplementedError: unsupported array field type: STRING field_for_type at c:/jruby-1.6.5/lib/ruby/site_ruby/shared/ffi/struct_layout_b
<WhiteHorse>
i dont need an IDE with a dropdown list of methods anymore
<WhiteHorse>
:D
<shevy>
most IDEs get into the way
<shevy>
though a ruby IDE in ruby would be nice
<WhiteHorse>
so you can use the shell as an editor basically and then store what u write to a file
<shevy>
hmm
<shevy>
somewhat
<shevy>
I think that works not perfectly well. You could use ncurses... the old ruby shell (rush, not the newer RuSH) had that dropdown box listing in ncurses
<shevy>
red+blue and you jumped with your cursor to select the method you wanted
<shevy>
that project died though :(
<manveru>
you let it die
<shevy>
manveru what happened to your ruby-editor?
<WhiteHorse>
as beginner all i need is a dropdown method list with a brief description of what the method does.. just like netbeans does with java methods
<shevy>
yeah WhiteHorse I can see that
<bnagy>
just open another window and use ri Obj#methodname
<shevy>
though lately, I am praising the new online docu of ruby
<shevy>
soon enough, most of the methods your brain will know without having to look at it. though that does not solve the problem with projects with crappy documentation...
<WhiteHorse>
i think thats the fastest way of learning a language.. because switching to a browser every second to read the doc is kinda a slow process
<shevy>
can be
<shevy>
I <3 the WWW though
<shevy>
and with beautiful examples!
<shevy>
a.concat(33)
<shevy>
interesting
<shevy>
never seen an integer to .concat before
<WhiteHorse>
so thats the new doc page?
<shevy>
more or less
<shevy>
at least compared to ~2 years ago
<shevy>
I can't find the old rdoc interface
<WhiteHorse>
would be nice to have user annotations just like php docs have
<shevy>
yup
burgestrand joined #ruby-lang
<manveru>
hehe
<shevy>
but I think that exists somewhere there
<shevy>
not sure where I saw it though
<manveru>
that's been said by newcomers since at least 2005
<shevy>
:)
<shevy>
manveru is damn old ...
<manveru>
the ruby-doc page has comments now, i think
<shevy>
10 years ago he wrote in PHP
<manveru>
at the bottom of the page
<shevy>
indeed
<WhiteHorse>
lol
<shevy>
WhiteHorse, search or jump to "Add New Comment" at the bottom
<manveru>
not that that's very helpful, but hey :)
<shevy>
though probably not many used it yet :/
<shevy>
yeah
<shevy>
but at least we have that feature hehe
<WhiteHorse>
the left column is too wide, what a waste of space
hebz0rl joined #ruby-lang
<shevy>
yeah
<shevy>
wonder where that could be reported
<shevy>
on github this is beautiful, just jump to "Issues" and file it
<manveru>
you can wait until james comes around
<manveru>
whoah, gmail added new crap
<shevy>
yeah
<shevy>
google is in a feature berzerk mode right now
<shevy>
youtube redesign, gmail redesign
<manveru>
now you can filter mails by circle
<shevy>
hmm
<shevy>
the other search engines should ally up against google
<shevy>
oh dear
<shevy>
I just tried yahoo. Awful ...
<shevy>
WhiteHorse yahoo also seems to have a left column that is way too wide
<WhiteHorse>
I would get rid of the "visual container" at the left and let just the plain text tree... because using visual containers force you to use margins and padding more than you should
<burgestrand>
or rather, different definitions of the types for different platforms
shevy [shevy!~shevy@178-191-59-3.adsl.highway.telekom.at] has joined #ruby-lang
<imperator>
looks like clock_t is defined though burgestrand
<imperator>
as a long
<burgestrand>
imperator: not sure if that might really be the correct place to look at though, anyhow you could define the type yourself and possibly file a bug on FFI
<burgestrand>
typedef :actual_type, :clock_t
dr0id [dr0id!~andy@unaffiliated/dr0id] has quit [#ruby-lang]
io_syl [io_syl!~io_syl@unaffiliated/steph021] has joined #ruby-lang
Manhose_ [Manhose_!~Manhose@bl18-45-1.dsl.telepac.pt] has joined #ruby-lang
<imperator>
burgestrand, there a way to do that conditionally? i.e. how do i check if it's already typedef'd?
<burgestrand>
imperator: you can do typedef :actual_type, :clock_t unless find_type(:clock_t) I guess
<burgestrand>
hm, maybe not, find_type raises an error if it cannot find the type
<burgestrand>
I wonder if there’s an equivalent
<imperator>
i could always rescue
tbuehlmann [tbuehlmann!Tobias@unaffiliated/tovias] has joined #ruby-lang
<burgestrand>
Yeah, looks like there’s no find_type that does not raise
<imperator>
ok, thank you
<burgestrand>
I’d probably make the conditional based on a platform check though; otherwise you could get really unexpected bugs if you define the type to be something that it’s not on a certain platform :p
<imperator>
i've got a bunch of vm's, shouldn't be hard to verify
dejongge [dejongge!~jonke@pD9E0DB5E.dip0.t-ipconnect.de] has joined #ruby-lang
<burgestrand>
shevy: buy their device and SDK and make it happen :D (like $500)
<burgestrand>
huh, actually, $299
<burgestrand>
Or maybe that’s just for consumers not developers
<burgestrand>
Ah yes, $500 for developer edition
<shevy>
hmmmmmmmmmmm
<burgestrand>
or a kinect and make it type a space when you jump
<burgestrand>
and write out all letters with your arms to type
<burgestrand>
YMCA-style
<burgestrand>
would love to see the curly brackets
spuk [spuk!~spuk@189.61.116.247] has joined #ruby-lang
<imperator>
yorickpeterse, silly man, don't use GOTO
andrewhl [andrewhl!~andrew@24-246-15-43.cable.teksavvy.com] has joined #ruby-lang
wmoxam_ [wmoxam_!~wmoxam@69-165-163-154.dsl.teksavvy.com] has joined #ruby-lang
<yorickpeterse>
What?
steeljav [steeljav!~b@69.197.102.2] has joined #ruby-lang
<imperator>
what is your goto move...
<imperator>
get it? haha. yeah. i'll get my coat
<yorickpeterse>
right
<yorickpeterse>
Yeah, I don't think the goto operator works that well in real life
Spooner [Spooner!~Miranda@host-92-23-158-179.as13285.net] has joined #ruby-lang
<shevy>
goto jail
gix [gix!~gix@e180008139.adsl.alicedsl.de] has joined #ruby-lang
Sailias [Sailias!~jonathan@CPE0018f85e576d-CM001bd7aaaf96.cpe.net.cable.rogers.com] has joined #ruby-lang
RomD [RomD!~Roman@nrbg-d932340b.pool.mediaWays.net] has joined #ruby-lang
burgestrand [burgestrand!~burgestra@h-163-174.a155.priv.bahnhof.se] has joined #ruby-lang
<andrewvos>
Man oh-my-zsh has made my life considerably better on the terminal
jimmy1980 [jimmy1980!~jimmy@112.224.3.42] has joined #ruby-lang
spuk [spuk!~spuk@189.61.116.247] has joined #ruby-lang
<shevy>
it has?
<shevy>
I kinda settled for bash
<lianj>
no wonder, you still use 1.8 too :P
<imperator>
i would try zsh, but then i realized i don't give a shit
<andrewvos>
shevy, imperator seriously... just try it out. The completions for git/svn/mercurial are awesome enough to switch
<andrewvos>
But the prompts you get are truly helpful
<lianj>
ack
<shevy>
lianj what kind of argument is that?
<lianj>
shevy: it just makes sense :)
<shevy>
aha
<shevy>
yeah andrewvos I'd love to have RPROMPT in bash
jxie [jxie!~jxie@115.197.87.221] has joined #ruby-lang
<imperator>
i don't suppose oreilly has a zsh book out?
<shevy>
andrewvos how do the git-completions in zsh work?
benanne [benanne!~rijdier@133.82-241-81.adsl-dyn.isp.belgacom.be] has joined #ruby-lang
<lianj>
on a shell without zsh, i always begin to think that commandline kinda sucks, after just a couple of minutes :P
<shevy>
lianj use aliases :>
<Mon_Ouie>
Get used to cmd.exe, and you will find any other shell great
<shevy>
indeed
<lianj>
Mon_Ouie: haha
<andrewvos>
Mon_Ouie: A inanimate carbon rod is a better shell than cmd.exe
<andrewvos>
Anyone know how I can :task => :task_with_params in rake?
zmack [zmack!~zmack@78.97.129.175] has joined #ruby-lang
<shevy>
rake is like a big mystery to most everyone
<Mon_Ouie>
Invoke the dependency task manually at the beginning of the task?
<Mon_Ouie>
Or define a rule if that task with parameter is supposed to generate a file
<andrewvos>
Mon_Ouie: fair enough
<andrewvos>
Mon_Ouie: What I did was just to remove the parameters. In this case it was ok
<chris2>
corundum: seen aria
<corundum>
Aria was last seen 65 days, 12 hours, 57 minutes and 51 seconds ago, leaving #ruby-lang
<imperator>
dammit, respond_to? fails on private methods internally even
<imperator>
well, this has me flummoxed
<shevy>
hehe
<imperator>
i don't want my ffi functions public
<shevy>
when something fails, imperator demands a human live sacrifice
<imperator>
i guess there's not such thing as a protected class method
<shevy>
google taught us
<shevy>
every data is public
<shevy>
privacy is no option
Ki4n [Ki4n!~Ki4n@91-115-68-219.adsl.highway.telekom.at] has joined #ruby-lang
<Mon_Ouie>
imperator: That's why it has a second argument
<imperator>
ooh! forgot
jkyle [jkyle!~krunk-@unaffiliated/krunk-] has joined #ruby-lang
lonny [lonny!~lonny@122.177.184.183] has joined #ruby-lang
<shevy>
Mon_Ouie is like a living ruby library
<imperator>
Mon_Ouie, thanks!
<shevy>
he knows everything
<imperator>
i'm not sure if i've ever used the 2nd arg before
michael_mbp [michael_mbp!~Marin@112.134.199.43] has joined #ruby-lang
gix [gix!~gix@e180015045.adsl.alicedsl.de] has joined #ruby-lang
wyhaines [wyhaines!~wyhaines@65.39.118.15] has joined #ruby-lang
thone_ [thone_!~thone@g226049152.adsl.alicedsl.de] has joined #ruby-lang
darkf [darkf!~darkf_dix@unaffiliated/darkf] has joined #ruby-lang
slackstation [slackstation!~eman@174-127-33-234.static-ip.telepacific.net] has joined #ruby-lang
wmoxam [wmoxam!~wmoxam@75-119-229-148.dsl.teksavvy.com] has joined #ruby-lang
wmoxam [wmoxam!~wmoxam@pdpc/supporter/active/wmoxam] has joined #ruby-lang
headius [headius!~headius@71-210-151-185.mpls.qwest.net] has joined #ruby-lang
mnoble [mnoble!~Adium@c-174-63-53-203.hsd1.ma.comcast.net] has joined #ruby-lang
mnoble [mnoble!~Adium@c-174-63-53-203.hsd1.ma.comcast.net] has quit [#ruby-lang]
workmad3 [workmad3!~workmad3@cpc1-bagu10-2-0-cust81.1-3.cable.virginmedia.com] has joined #ruby-lang
jondot [jondot!~jondot@bzq-82-80-168-136.red.bezeqint.net] has joined #ruby-lang
<jondot>
when you come to write a polling worker of sorts (database, web, etc). what route do you take? do you write a while(true) worker, use a library (if so which?) or write a script that can be cron'd ?
uniqanomaly [uniqanomaly!~ua@dynamic-78-8-216-104.ssp.dialog.net.pl] has joined #ruby-lang
<manveru>
jondot: i'd go with the loopy one, kept alive by runit
<jondot>
just to be fair. i'd go for cron -> library -> loopy.
<manveru>
:)
<jondot>
reason for cron - is that if i can allow it, i prefer to throw away the process every time to avoid leaks and other diseases..
<manveru>
well, cron works if you know it terminates within time
<jondot>
manveru: yes, good point.
<manveru>
not sure what you mean by library
Pip [Pip!~Pip@unaffiliated/pip] has joined #ruby-lang
<jondot>
well, just like there is Resque, delayed_job for background workers, i believe there should be one for pollers. i haven't found such yet though
wmoxam [wmoxam!~wmoxam@pdpc/supporter/active/wmoxam] has joined #ruby-lang
<jondot>
of course it should be easy implementing a poller library by building on top of Resque - just push to queue every interval of time.
Pip [Pip!~Pip@unaffiliated/pip] has joined #ruby-lang
taf2 [taf2!~taf2@pool-173-67-31-242.bltmmd.fios.verizon.net] has joined #ruby-lang
<shevy>
I cant stand the crontab syntax
Manhose [Manhose!~Manhose@bl18-45-1.dsl.telepac.pt] has joined #ruby-lang
Phrogz [Phrogz!~phrogz@pdpc/supporter/professional/phrogz] has joined #ruby-lang
perryh [perryh!~root@unaffiliated/perry753] has joined #ruby-lang
slackstation_ [slackstation_!~eman@174-127-33-234.static-ip.telepacific.net] has joined #ruby-lang
slackstation_ [slackstation_!~eman@174-127-33-234.static-ip.telepacific.net] has joined #ruby-lang
nuclearsandwich [nuclearsandwich!~nuclearsa@74-93-3-241-SFBA.hfc.comcastbusiness.net] has joined #ruby-lang
brainopia [brainopia!~brainopia@203.78.122.4] has joined #ruby-lang
dRbiG [dRbiG!drbig@unhallowed.pl] has joined #ruby-lang
<andrewvos>
Come here for arguments about REST, end up learning new ascii men :|
Indian_ [Indian_!~Indian@unaffiliated/londonmet050] has joined #ruby-lang
<shevy>
:)
<shevy>
here, let me help you
<shevy>
REST sucks
looopy [looopy!~looopy@c-68-34-92-100.hsd1.md.comcast.net] has joined #ruby-lang
<andrewvos>
Seriously though. Do people agree with adding api version in Accept header vs. /v1/ /v2/ ???
<andrewvos>
shevy: You just like using WCF
<brainopia>
chris2: oh, i see so \G is kinda like \A only it has relative position, like '0010'.gsub /\G0/, '1' # => '1110', right?
<chris2>
yep
<brainopia>
thanks a lot
roha [roha!~phelot@84-75-49-50.dclient.hispeed.ch] has joined #ruby-lang
ilyam [ilyam!~ilyam@c-67-188-113-128.hsd1.ca.comcast.net] has joined #ruby-lang
Pip [Pip!~Pip@unaffiliated/pip] has joined #ruby-lang
artOfWar [artOfWar!~artofwar@108-205-201-30.lightspeed.sntcca.sbcglobal.net] has joined #ruby-lang
pbjorklund [pbjorklund!~pbjorklun@c-b9dbe655.026-155-626f721.cust.bredbandsbolaget.se] has joined #ruby-lang
<rue>
andrewvos: It's not adding it to the Accept header, it's defining a versioned media (representation) type
<rue>
If you must
Roujo [Roujo!~Roujo@modemcable186.146-70-69.static.videotron.ca] has joined #ruby-lang
<rue>
Nukumi :D
<rue>
andrewvos: If you have “versions” of resources that aren't merely alternate representations, they're not the same resource
adambeynon [adambeynon!~adambeyno@82-69-1-211.dsl.in-addr.zen.co.uk] has joined #ruby-lang
Mon_Ouie [Mon_Ouie!~Mon_Ouie@subtle/user/MonOuie] has joined #ruby-lang
slackstation [slackstation!~eman@174-127-33-234.static-ip.telepacific.net] has joined #ruby-lang
aaronfeng2 [aaronfeng2!~Adium@c-69-141-132-52.hsd1.nj.comcast.net] has joined #ruby-lang
Silowyi [Silowyi!~silowyi_d@99-26-202-35.lightspeed.snantx.sbcglobal.net] has joined #ruby-lang
niklasb [niklasb!~codeslay0@p5B311048.dip0.t-ipconnect.de] has joined #ruby-lang
<aaronfeng2>
I'm using PTY module to fire up an interactive bash session, I noticed the PTY terminal column width is only 80. Is there a way to change that?
zzak [zzak!a6f801f2@sinatra/zzak] has joined #ruby-lang
RomyEatsDrupal [RomyEatsDrupal!~stickycak@pool-209-2-54-196.ac2.jjay.cuny.edu] has joined #ruby-lang
<samuelkadolph>
aaronfeng2: ruby 1.9.3?
Silowyi [Silowyi!~silowyi_d@99-26-202-35.lightspeed.snantx.sbcglobal.net] has joined #ruby-lang
<aaronfeng2>
samuelkadolph: no, I'm actually on 1.9.2
<samuelkadolph>
It's super easy with 1.9.3
<samuelkadolph>
Otherwise you need the winsize gem to get IO#winsize=
<erikh>
hey I know there's a few cmake users in here, can anyone point me at a good tutorial?
adambeynon [adambeynon!~adambeyno@82-69-1-211.dsl.in-addr.zen.co.uk] has joined #ruby-lang
wmoxam [wmoxam!~wmoxam@pdpc/supporter/active/wmoxam] has joined #ruby-lang
imperator [imperator!~Daniel@63-225-247-192.hlrn.qwest.net] has joined #ruby-lang
ppl [ppl!~ppl@222.236.30.217] has joined #ruby-lang
nuclearsandwich [nuclearsandwich!~nuclearsa@74-93-3-241-SFBA.hfc.comcastbusiness.net] has joined #ruby-lang
igotnolegs [igotnolegs!~igotnoleg@174-27-220-21.slkc.qwest.net] has joined #ruby-lang
jkyle [jkyle!~krunk-@unaffiliated/krunk-] has joined #ruby-lang
ppl [ppl!~ppl@222.236.30.217] has joined #ruby-lang
ppl [ppl!~ppl@222.236.30.217] has joined #ruby-lang
<aaronfeng>
samuelkadolph: awesome, winsize gem worked great! thx
<imperator>
winsize?
heppy [heppy!~heppy@75-101-31-55.dsl.dynamic.sonic.net] has joined #ruby-lang
<imperator>
ah, see it
<erikh>
env + sigwinch
* imperator
prefers barwinch
<erikh>
I'm not a big fan of manwinch
<imperator>
alright, sys-uptime now ffi-ified
<erikh>
neat
<imperator>
so you jruby types can use it
<erikh>
ah, I was about to ask why
<imperator>
although, i noticed some interesting on solaris
<imperator>
about the uptime command i mean
<imperator>
might be other platforms, but it seems to vary
<imperator>
i've got a bunch of virtual machines using vmware
<erikh>
oh, I'll bet you know; I'm trying to hunt down a canned portable implementation of pidof
<imperator>
some platforms the uptime command shows time since boot
<erikh>
any ideas where to look?
<imperator>
others it only shows the actual time the OS has been running
<imperator>
pidof?
* imperator
has to look it up
<erikh>
oh interesting, so it's counting ticks?
<imperator>
yep
<erikh>
pidof unicorn # -> process id of unicorn process
<erikh>
no worries, I've got a few impls here (it's all kernelspace stuff) to sort through, just hoping I don't have to do the work myself, heh
<imperator>
so, if i boot an OS, suspend it 30 days, some will show an uptime of 30 days when i unsuspend the vm, others will only show the time running
<imperator>
erikh, sys-proctable not an option?
<erikh>
C and lua
<erikh>
and scanning the proctable is not what I really want to do
<erikh>
but might if using kvm, sysctl, etc aren't reasonable to maintain
<imperator>
how does pidof do it then?
<erikh>
uses /proc on linux (and solaris, best I can tell), kvm on freebsd (kernel access, not the vm system) and sysctl on os x
<imperator>
that's what sys-proctable does :)
<erikh>
orly
<erikh>
can I, uh, assimilate the code into my project?
<imperator>
got separate source code for every platform
<erikh>
shit dude, you are the man!
<imperator>
kvm is problematic on bsd, though, you'll need proper perms
<drbrain>
erikh: didn't you know that imperator has always been the man?
<erikh>
it's for an init replacement so that probably won't be an issue
<erikh>
drbrain: I had an idea, but needed empirical evidence
<imperator>
imperical evidence!
<erikh>
heh
<erikh>
so yeah, maybe I can show this to one or both of you guys soon and get some feedback
<erikh>
because I could really use it, heh
<imperator>
unfortunately, i must be going to a little gaming get together
<erikh>
oh not today
<imperator>
send me an email if you have any questions
<imperator>
ok
<erikh>
maybe a month from now or something like that.
steph021 [steph021!~steph021@unaffiliated/steph021] has joined #ruby-lang
pbjorklund [pbjorklund!~pbjorklun@c-b9dbe655.026-155-626f721.cust.bredbandsbolaget.se] has joined #ruby-lang
workmad3 [workmad3!~workmad3@84.45.226.85] has joined #ruby-lang
ppl2 [ppl2!~ppl@222.236.30.217] has joined #ruby-lang
<aaronfeng>
after PTY interactive session ends, I noticed the terminal is no longer echo'ing what I'm typing. before creation of PTY I did a `stty raw -echo`. I assume I need to change the tty back to the original value?
<drbrain>
aaronfeng: io/console has you covered there too
<samuelkadolph>
aaronfeng: Yes or use 1.9.3
<samuelkadolph>
drbrain: lol
<drbrain>
IO#raw and IO#echo
<aaronfeng>
samuelkadolph: haha… thx dudes..
<drbrain>
they take a block
jasox [jasox!~jxx@178.239.26.139] has joined #ruby-lang
<drbrain>
$stdin.raw do $stdin.noecho do … end end
ppl [ppl!~ppl@222.236.30.217] has joined #ruby-lang
workmad3 [workmad3!~workmad3@84.45.226.85] has joined #ruby-lang
apeiros_ [apeiros_!~apeiros@77-58-115-24.dclient.hispeed.ch] has joined #ruby-lang
heppy [heppy!~heppy@75-101-31-55.dsl.dynamic.sonic.net] has joined #ruby-lang
<matled>
is it possible to create strings of a certain encoding without using str = "foobar"; str.force_encoding "UTF-8"? (it's only US-ASCII/ASCII-8BIT/UTF-8 in this case, no real conversion happening)
<drbrain>
matled: the default string encoding comes from the encoding comment at the top of the file
<samuelkadolph>
Or the LANG env variable
<drbrain>
the default is US-ASCII
<matled>
I know but I'd prefer not to change it in this case
<drbrain>
the -K option changes the default file encoding, but changing it can break libraries (so please don't do that)
<matled>
or: if I change it and yield an error message in ascii-8bit, might it not cause problems when it is later used somewhere where the encoding is utf-8?
<matled>
for example a regexp trying to match the error message
<erikh>
imperator: thank you for pointing me in this direction -- this is great code and really what I needed to find
<drbrain>
matled: US-ASCII and UTF-8 string are compatible, so the US-ASCII string can be upgraded
<drbrain>
matled: correct
<drbrain>
(upgrading is automatic)
<erikh>
I probably won't be using it directly (it accomplishes a different thing than what I need) but I'll definitely be using the techniques
<matled>
I create strings using .unpack("C*") (ASCII-8BIT) and want to compare them or use a regexp
<drbrain>
where do the packed strings come from?
<drbrain>
if you know the source encoding, force that encoding
<erikh>
if it happens with I/O you should be able to force at that time too, shouldn't you?
<drbrain>
erikh: unpack "C*" might be special
<erikh>
gotcha
<rue>
What about unpacking it as UTF-8?
ppl2 [ppl2!~ppl@222.236.30.217] has joined #ruby-lang
hagabaka [hagabaka!~hagabaka@cblmdm24-53-178-92.buckeyecom.net] has joined #ruby-lang
hagabaka [hagabaka!~hagabaka@unaffiliated/hagabaka] has joined #ruby-lang
<matled>
it might not be utf-8, but in my comparisons I'm using strings which contain ascii characters only
<drbrain>
matled: US-ASCII (7-bit)?
<drbrain>
… all input is 7-bit?
<matled>
the input may contain 8-bit bytes, but in the source my regexps/comparison strings will only contain 7-bit
<dreinull>
I locally ran a rack app with thin. now a crash caused me to log out and I can't go back to my original app port because it's busy. Is there a way to clear the port?
<drbrain>
ah, ok
<drbrain>
matled: I would do all-binary then (ASCII-8BIT)
<matled>
drbrain: so you would set the source encoding to ascii-8bit?
<rue>
dreinull: Are the processes killed?
<drbrain>
I think a US-ASCII regexp will match a BINARY string, checking
<drbrain>
matled: that's the easy way
<dreinull>
rue: don't know, let me check
<matled>
I'm quite new to using ruby 1.9 and I'm not to sure how all this plays together
<matled>
drbrain: ah, you're right, US-ASCII matches an ASCII-8BIT string even if the ASCII-8BIT string contains 8-bit characters, that should work then
<dreinull>
rue: oh, my tmux session was still running. awesome.
<dreinull>
I assumed it had crashed as well
<aaronfeng>
drbrain: good call on io-console, and the usage. there isn't any doc on the gem itself.
<drbrain>
aaronfeng: it appends to IO… I added some to io.c, I guess I should move it into ext/io/console/console.c
<drbrain>
(there's no IO::Console, so it's a bit weird)
<aaronfeng>
drbrain: yeah, it worked nicely thx!
RomyEatsDrupal [RomyEatsDrupal!~stickycak@pool-209-2-54-196.ac2.jjay.cuny.edu] has joined #ruby-lang
nofxx [nofxx!~nofxx@unaffiliated/nofxx] has joined #ruby-lang
srbaker [srbaker!~srbaker@184.66.82.213] has joined #ruby-lang
adambeynon [adambeynon!~adambeyno@82-69-1-211.dsl.in-addr.zen.co.uk] has joined #ruby-lang
perryh [perryh!~root@unaffiliated/perry753] has joined #ruby-lang
looopy [looopy!~looopy@pool-141-156-48-174.washdc.btas.verizon.net] has joined #ruby-lang
workmad3 [workmad3!~workmad3@84.45.226.85] has joined #ruby-lang
slackstation_ [slackstation_!~eman@174-127-33-234.static-ip.telepacific.net] has joined #ruby-lang
petercooper [petercooper!~petercoop@82.144.254.2] has joined #ruby-lang
jasox [jasox!~jxx@178.239.26.139] has joined #ruby-lang
judofyr [judofyr!~judofyr@176.80-202-81.nextgentel.com] has joined #ruby-lang
lsegal [lsegal!jinx@modemcable249.109-177-173.mc.videotron.ca] has joined #ruby-lang
looopy [looopy!~looopy@pool-141-156-48-174.washdc.btas.verizon.net] has joined #ruby-lang
Pip [Pip!~Pip@unaffiliated/pip] has joined #ruby-lang
spinagon [spinagon!~rippa@87-253-30-87.pppoe.yaroslavl.ru] has joined #ruby-lang
ppl [ppl!~ppl@203.226.221.89] has joined #ruby-lang
woollyams [woollyams!~woollyams@124-168-81-150.dyn.iinet.net.au] has joined #ruby-lang
looopy_ [looopy_!~looopy@c-68-34-92-100.hsd1.md.comcast.net] has joined #ruby-lang
woollyams [woollyams!~woollyams@124-168-81-150.dyn.iinet.net.au] has joined #ruby-lang
andrewhl [andrewhl!~andrew@24-246-15-43.cable.teksavvy.com] has joined #ruby-lang
looopy [looopy!~looopy@pool-141-156-48-174.washdc.btas.verizon.net] has joined #ruby-lang
looopy_ [looopy_!~looopy@c-68-34-92-100.hsd1.md.comcast.net] has joined #ruby-lang
nofxx [nofxx!~nofxx@unaffiliated/nofxx] has joined #ruby-lang
oilpastels [oilpastels!~rafael@177.98.13.73] has joined #ruby-lang
Pip [Pip!~Pip@unaffiliated/pip] has joined #ruby-lang
wmoxam [wmoxam!~wmoxam@76-10-155-204.dsl.teksavvy.com] has joined #ruby-lang
wmoxam [wmoxam!~wmoxam@pdpc/supporter/active/wmoxam] has joined #ruby-lang
nuclearsandwich [nuclearsandwich!~nuclearsa@64-79-127-126.static.wiline.com] has joined #ruby-lang
woollyams [woollyams!~woollyams@124-168-81-150.dyn.iinet.net.au] has joined #ruby-lang
jimmy1980 [jimmy1980!~jimmy@112.224.2.116] has joined #ruby-lang
sodani [sodani!~shig@user-387hpcb.cable.mindspring.com] has joined #ruby-lang
<sodani>
got a git question. do most people typically work on branches or on the master?
<lianj>
master is also just a branch
<sodani>
okay, but how much time do people typically spend on the master branch vs other branches?
<apeiros_>
sodani: if something is more than a couple of small changes, I usually make a new branch
<sodani>
so is the idea of a new branch that if you screw something up, you can just scrap that branch and revert to what you had at the base of that branch?
<sodani>
or at the start of that branch?
<apeiros_>
for company stuff, it's also the idea that we have a branch always in 'releasable' state
<sodani>
I see. thank you
Alt-255 [Alt-255!~blah@178.239.26.139] has joined #ruby-lang
nofxx [nofxx!~nofxx@unaffiliated/nofxx] has joined #ruby-lang
kain [kain!~kain@151.64.209.184] has joined #ruby-lang
looopy_ [looopy_!~looopy@c-68-34-92-100.hsd1.md.comcast.net] has joined #ruby-lang
judofyr [judofyr!~judofyr@176.80-202-81.nextgentel.com] has quit [#ruby-lang]
Newbs [Newbs!~textual@host-2-98-240-209.as13285.net] has joined #ruby-lang
Natch| [Natch|!~natch@178.73.217.15] has joined #ruby-lang
Indian [Indian!~Indian@unaffiliated/londonmet050] has joined #ruby-lang
looopy_ [looopy_!~looopy@c-68-34-92-100.hsd1.md.comcast.net] has joined #ruby-lang
Axsuul [Axsuul!~Axsuul@75-140-75-52.dhcp.mtpk.ca.charter.com] has joined #ruby-lang
alim [alim!~alim@109.99.128.78] has joined #ruby-lang
oilpastels_ [oilpastels_!~rafael@177.98.13.32] has joined #ruby-lang
anekant [anekant!83bf5306@gateway/web/freenode/ip.131.191.83.6] has joined #ruby-lang