The web in a box - a next generation web framework for the Perl programming language

IRC log for #mojo, 2016-03-31

| Channels | #mojo index | Today | | Search | Google Search | Plain-Text | summary

All times shown according to UTC.

Time Nick Message
00:00 jberger Plus static export that i need to brush up one of these days
00:00 jberger I only seem to work on it when I'm writing a new talk
00:01 bpmedley jberger++
00:15 sri wait, what?! :o http://blog.dustinkirkland.com/2016/03/ubuntu-on-windows.html
00:16 sri it mentions linux perl working Oo
00:17 saki \o/
00:17 jberger I'm just watching the talk
00:18 jberger http://www.theverge.com/2016/3/30/11331014/microsoft-windows-linux-ubuntu-bash
00:18 jberger ELF binaries
00:18 jberger gcc
00:19 jberger Cats and dogs lying together :p
00:19 saki hah
00:19 sri how does fork work?
00:20 jberger That's what I'm waiting for too
00:21 jberger Is there a ruby server called mina?
00:21 jberger Is it preforking?
00:21 jberger apt-get install
00:26 preaction it's reverse wine
00:26 preaction eniw?
00:27 preaction wait. that means all the perl packaging problems are done. simply bundling everything together will work
00:27 preaction even if you don't have a windows machine
00:28 lluad It's a proprietary windows extension that emulates the linux kernel api, and a big chunk of ubuntu user-space binaries distributed unchanged. Seems like an excellent thing. Apparently TTY emulation is still a bit broken, but most everything else works.
00:29 lluad Rumors that Stallman now wants people to refer to the OS as "GNU/Windows" seem to be unfounded.
00:31 jberger A slide listed syscalls and one of the words was fork
00:31 sri indeed, this might be the end of windows portability problems and activeperl/strawberry
00:32 sri fork :O
00:32 jberger He said it
00:32 lluad I wonder if you can get to the win32 api from an elf binary?
00:33 jberger "If you're inside the subsystem we have fork"
00:36 sri that puts windows close to osx for dev work :o
00:37 vytas joined #mojo
00:38 sri suddenly that razer laptop looks interesting again :o
00:39 jberger I'm stunned
00:39 sri actually better than os x maybe
00:39 sri since they got apt-get
00:39 jberger Yeah
00:39 Adurah Hmm, GNU/NT...
00:43 bpmedley Wow.. double-clicking in Activity Manager shows open files and ports in OS X..
00:44 lluad If you look in the View... menu there's stuff for profiling and tracing processes too.
00:52 sri jberger: got a link for the talk?
00:52 jberger It's in that one i posted earlier
00:52 jberger Video at the top
00:52 jberger http://www.theverge.com/2016/3/30/11331014/microsoft-windows-linux-ubuntu-bash
00:52 sri \o/
00:52 jberger Actually quite an impressive demo
01:05 genio yes, it is.  I do like the walking T-Rex too :)
02:10 asarch joined #mojo
02:45 noganex joined #mojo
02:48 tchaves joined #mojo
02:50 mcsnolte joined #mojo
02:52 jberger There's some really funny stuff on r/programming
02:52 jberger https://www.reddit.com/r/programming/comments/4clk26/microsoft_is_bringing_the_bash_shell_to_windows_10/
02:56 sri perfect timing really, with apple becoming more and more of a fashion brand, i might give it a try
02:59 jberger I did see a few comments, and i agree, that this might just be a reaction to going to any developer conference or group
02:59 jberger And only seeing macs
03:00 sri umm, it's very much in their interest, considering how much money they make from azure
03:00 sri just like sql server on linux
03:01 sri i wouldn't be surprised if they announce their exit from the phone os market soon
03:01 sri satya nadella is smart
03:02 sri they also just recently bought xamarin, for ios and android apps in c#
03:02 sri microsoft is going all in with cross platform
03:05 sri the choice of good windows laptops is still pretty poor though
03:09 mattp_ nice direction I guess
03:09 mattp_ youre still inside a closed source shim
03:11 sri no different than os x
03:13 mattp_ sort of. os x is native, not abi emulation
03:13 mattp_ but regardless of that, I dont feel much differently about osx
03:13 jberger They really have always been an afterthought in the mobile market
03:13 genio and you're not locked into crappy cmd.exe in os x
03:14 jberger I wonder if you can copy/ paste in it yet
03:15 mattp_ frankly, the proliferation of people who live their development lives in increasingly higher layers of 'abstraction' only means good things for my job prospects so I cant complain too much
03:18 mattp_ sri: http://computers.woot.com/offers/lenovo-thinkpad-x61-12-1-intel-dual-core-laptop theres always this :)
03:19 sri ;p
03:20 sri oh my, limit 3 per customer
03:20 genio no backgrounding, I haven't seen them run anything outside of the bash app.  so, it doesn't look like I can compile an app and just run it in Windows without invoking it from cmd -> bash -> ./my_app
03:21 mattp_ genio: wasnt the dude running a rails app in that video?
03:21 sri don't think i do that on os x either
03:22 genio mattp_: He left the bash shell up.  You can't close cmd.exe
03:22 sri but since you can fork, i don't see why it should prevent you from daemonizing
03:30 sri it's a syscall translation layer, emulating setsid shouldn't be hard
03:46 inokenty-w joined #mojo
04:06 sri lots of microsoft people also mention IoT regarding ubuntu support
04:07 sri in addition to web apps
06:01 trone joined #mojo
06:10 ivi joined #mojo
06:20 salva joined #mojo
06:36 dod joined #mojo
06:45 Vandal joined #mojo
06:52 dod joined #mojo
06:56 dod joined #mojo
07:20 AndrewIsh joined #mojo
07:23 caeles joined #mojo
07:44 osfabibisi joined #mojo
08:06 sugar joined #mojo
08:07 meshl joined #mojo
10:12 jontaylor joined #mojo
10:16 Guest-quest joined #mojo
10:18 nic perl -Mojo -E'a("/dyn/:name" => {name => "World", inline => q{%= $name}}); a("/" => {inline => q{%== url_for("dynname", name => Mojo::Util::url_escape("strange/ness"))}})->start' get /
10:19 nic I'm doing that wrong: delivers "/dyn/strange/ness" -- how do I get "/dyn/strange%2Fness"?
10:21 nic Goal: the token after 'dyn' has no '/' when it goes through the router, but the controller is able to unescape it back to 'strange/ness'
10:22 nic It needs to use url_for, but does not need to use url_escape -- pretty much anything that hides the '/' from the router
11:00 kes joined #mojo
11:04 dvinciguerra__ joined #mojo
11:07 tchaves joined #mojo
11:17 atom123 joined #mojo
11:18 asarch joined #mojo
11:22 jwang joined #mojo
11:30 sebbe joined #mojo
11:39 jberger nic: are you going to need /dyn/:name/:something as another route?
11:39 nic no, but it needs to be one placeholder, not two
11:39 jberger If not then use *name rather than :name
11:40 jberger Relaxed placeholders
11:40 nic I can't
11:40 jberger Why?
11:40 nic there are many other routes of the pattern /dyn/..../....
11:40 jberger That's what i just asked
11:40 nic no, you sayd ":something"
11:41 jberger Pseudocode man
11:41 nic don't use placeholder syntax for that then
11:41 jberger The name was supposed to give or
11:41 nic I'm guessing I need to swap all '/' for something else, eg snowman
11:41 nic but was hoping there's a more mainstream approach
11:42 nic (tbh my first guess is I was using url_escape incorrectly)
11:44 jberger No idea then, sorry
11:45 nic np
11:45 nic I'll work on manual escaping
11:46 nic The patterns in this app have been working beautifully for years.  And then Oracle
11:47 jontaylor joined #mojo
11:50 nic hmmm, one solution may be simply to double-escape params to url_for that may be problematic
11:51 nic and then the controller unescapes that stash value
11:54 kaare joined #mojo
11:55 nic yay, that worked fine
13:04 McA2 joined #mojo
13:05 marty joined #mojo
13:36 batman can't i add dynamic routes anymore "after Improved url_for performance significantly." ...?
13:37 batman sri: ^
13:47 mcsnolte joined #mojo
13:58 tencendur joined #mojo
14:03 sri what are dynamic routes?
14:06 batman routes added after the app is started
14:07 sri you never could do that
14:07 sri how did you get that idea?
14:07 batman sure i could. i'm doing that in 6.11
14:07 nic Couldn't you do that in your 'startup'?
14:07 batman i'm adding routes in a before_dispatch hook
14:07 sri http://mojolicious.org/perldoc/Mojolicious/Guides/Routing#Rearranging-routes
14:08 nic I thought you could do it until the first hit
14:08 perlpilot batman: Are you "deadboy" in http://stackoverflow.com/questions/5898637/dynamic-routes-in-mojolicious  ?
14:08 nic phew
14:08 batman perlpilot: no
14:09 pink_mist perlpilot: batman is one of the core devs, so he asking questions on SO about mojolicious seems a bit silly :P
14:09 perlpilot stranger things have happened :)
14:09 pink_mist though, him not knowing you can't do that seems also a bit silly :P
14:09 batman anyway... the think i did was a giant awful hack. glad it doesn't work anymore
14:11 batman i think that speedup introduced in eac8210de94e904c41918fa8cd522e4c94efb6ba is what "disables" my hack
14:11 batman just wanted to be sure i didn't miss out on something
14:13 good_news_everyon joined #mojo
14:13 good_news_everyon [mojo] kraih pushed 1 new commit to master: https://git.io/vVGSB
14:13 good_news_everyon mojo/master 68d434c Sebastian Riedel: be a little more specific in routing guide
14:13 good_news_everyon left #mojo
14:13 sri you were just lucky, there were already a dozen or so edge cases where it wouldn't have
14:14 batman not from my point of view: all of my cases was realted to /adding/ a new route, meaning $self->{reverse}{whatever} did not exist so it could be added later on
14:14 nic I'm guessing it would work to 'stage' your new routes (eg in the db) and then trigger a hot restart [assuming hypnotoad of course]
14:15 nicomen couldn't you have a subroute?
14:15 sri batman: you have no idea what other caches there are
14:15 batman $self = Mojolicious::Routes
14:16 batman nicomen: all routes in an app have unique names
14:16 batman sri: right... it worked surprisingly well though.
14:16 batman but let's just drop it. i don't want anything to change :)
14:16 batman want/suggest/whatever/... just curious if i missed out on anything
14:17 sri you're the one making all the noise ;p
14:17 batman yeah... felt like i had to defend myself from pink_mist :/
14:18 * batman hides in the shadows
14:21 nicomen batman: you could have a catch-all route that instantiates a new route, and do the parsing et al there?
14:22 batman nicomen: not anymore
14:22 batman that's what i did
14:22 nicomen ah
14:22 nicomen ok
14:31 pink_mist batman: sorry, I was just calling you silly because you did a silly thing :P I meant it as a joke ^^
14:31 batman pink_mist: no worries. i screwed up.
14:31 batman thanks
14:37 jberger one of these days I still want to attempt to use the router outside of the app's router, just to see if it is possible
14:37 jberger I really want to do like websocket subrouting
14:39 jberger ye gods I love postgres upsert
14:53 lluad joined #mojo
14:54 Atog joined #mojo
14:56 dvinciguerra__ joined #mojo
15:16 jontaylor joined #mojo
15:34 mitya joined #mojo
15:37 disputin joined #mojo
15:49 dod joined #mojo
15:57 PryMar56 joined #mojo
16:29 orev joined #mojo
16:46 jicege joined #mojo
16:52 janus joined #mojo
16:55 umask001 joined #mojo
17:06 dod joined #mojo
17:07 batman https://twitter.com/jhthorsen/status/715582472621330433 # sorry for the spam
17:10 jnbek joined #mojo
17:10 disputin joined #mojo
17:11 human39_ joined #mojo
17:39 jicege hi somebody
17:40 preaction i'm somebody!
17:40 batman I'm batman
17:41 jicege im newbee and searching for some help on the "getting startd" install part  of mojolicious
17:41 preaction okay. what's the trouble?
17:41 batman jicege: have you tried the one liner on the mojo webpage
17:41 batman ?
17:43 jicege i had installed mojolicious on my own id (not root) and il trying to launch $ morbo hello.pl
17:43 batman jicege: are you on linux?
17:43 jicege what is "morbo" ?
17:43 jicege yes
17:44 batman "morbo" is an executable.
17:44 batman do you have $HOME/perl5/ ?
17:45 jicege yes, but mojolicious does not come with this own perl installaione ?
17:45 batman i don't understand the question.
17:45 batman but i think the reason why you can't run morbo is because the $PATH shell variable is missing some information.
17:45 jicege never mind
17:46 batman are you familiar with the $PATH and $PERL5LIB environment variables?
17:46 jicege i have perl => This is perl 5, version 18, subversion 4 (v5.18.4) built for x86_64-linux-thread-multi
17:46 jicege yes a little bit :)
17:46 batman it kind of explains how to set them up here: https://metacpan.org/pod/local::lib#SYNOPSIS
17:46 batman but try this:
17:47 batman PATH="$HOME/perl5/bin:$PATH" morbo
17:47 batman or... try this:
17:47 batman PATH="$HOME/perl5/bin:$PATH" mojo version
17:47 jicege ok i'll try tis
17:48 batman does it give you a different error message?
17:48 jicege yes
17:48 jicege Can't locate Mojolicious/Command.pm
17:48 batman then try this:
17:49 batman PERL5LIB="$HOME/perl5/lib/perl5" PATH="$HOME/perl5/bin:$PATH" mojo version
17:49 jicege ok
17:50 jicege sounds better :)
17:50 batman cool :)
17:50 batman so what i would do to make it simpler is to edit your $HOME/.bashrc file and add those two environment variables to the bottom for the file
17:51 jicege ok thanks, i ll try the next line on my own, thx a lot
17:51 batman and then log out/in (or just run "exec bash" afterwards)
17:51 jicege ok
17:51 batman you're welcome
17:52 batman after the environment variables have gotten "exported" to the shell, you can run morbo, mojo, ... as you expected
17:55 s1037989 batman++
17:56 jicege °°
18:11 dvinciguerra joined #mojo
18:11 disputin joined #mojo
18:29 Kripton joined #mojo
18:54 lluad joined #mojo
19:38 umask001 I've got a question re: http://bit.ly/1q6sqKq I would like to run this under hypnotoad, but each new fork tries to open the inet socket on udp/67 which fails since it's already open.  Is there a good way to do this with Mojo?  I imagine I would need to put the INET part into it's own daemon and have it handle requests without forking, but that would defeat the purpose of using hypnotoad.  It may be that you
19:38 umask001 just can't scale this via a fork model.
19:51 Phil21 umask001: curious what you're building, as we have something similar
19:51 Phil21 don't have too many folks writing DHCP perl code :)
19:53 preaction umask001: open the socket before forking, then they all share the same socket. but really why are you trying to do this in your web app?
19:55 Mikey joined #mojo
19:56 umask001 preaction: It's so that a web server can ask a dhcp server what mac address belongs to what IP address
19:57 dvinciguerra joined #mojo
19:59 pink_mist sounds like a problem best served by a separate daemon to my ears
19:59 pink_mist s/served/solved/
19:59 umask001 Phil21: the querier is pretty much all I'm building.  It's talking to an ISC dhcpd backend
20:00 umask001 pink_mist: it is a separate daemon.. just one using mojolicious as it's interface.
20:02 Phil21 umask001: should local port be set in Socket::INET?
20:02 Phil21 isn't that port ephemeral and should change each request?
20:02 Phil21 (I haven't touched UDP socket::inet in years, so take with grain of salt.. I was wondering why you were getting socket in use making *remote* connections)
20:02 umask001 Phil21: I think it has to be.  I've tested it with ephemeral ports and dhcpd doesn't respond
20:02 Phil21 hrm
20:02 preaction umask001: a separate daemon just for the DHCP stuff. otherwise, like Phil21 said, you're going to have to find a way for the dhcp server to respond on whatever port you want it to
20:03 Phil21 now I'm going to a burn an hour on this :)
20:03 preaction umask001: you could even make that separate daemon using mojolicious, and then use websockets to talk from your app running under hypnotoad to the standalone daemon that talks to the dhcp server
20:04 Phil21 umask001: huh weird, looking at some older code and LocalPort isn't set
20:04 human39_ joined #mojo
20:04 Phil21 damnit, now I really will burn time on this :)
20:05 umask001 Phil21: I'm going to try it agian.. it's been a while since I've tested that bit :)
20:06 Phil21 preaction: afaik we're overcomplicating this... you're just making an outbound udp packet (and listening for reply) every submit on the webapp side
20:06 Phil21 should be pretty trivial
20:06 Phil21 think how you'd do a useragent request, same thing more or less, just udp
20:07 Phil21 like I know I've done similar in cgi.pm writing router looking glasses/etc.
20:07 preaction except if all the forked children share the same socket, there's no way to know whose request is being responded to unless they share some knowledge
20:08 preaction because udp don't care about frivolous things like order or completeness
20:12 umask001 Phil21: it looks like if you make the request on an ephemeral port, the reply comes back on 67.  Were you doing DHCPLEASEQUERY or a different type of request with your older code?
20:12 Phil21 nothing to do with dhcp at all
20:12 Phil21 I just find that surprising, weird
20:12 Phil21 like I said, now I need to futz around with it since my understanding is wrong
20:13 preaction i suspect they weren't anticipating anyone would need multiple concurrent requests from multiple processes, otherwise one might've used a tcp socket
20:13 Phil21 (dns in this example, where ephemeral ports do indeed work as expected)
20:13 thowe joined #mojo
20:13 Phil21 no, udp is the proper protocol for dhcp
20:13 Phil21 stateless
20:13 thowe haven't worked on these Mojo projects in so long I've forgetten how to Mojo!
20:13 jberger thowe: go get your mojo back!
20:14 umask001 ok, it's probably nothing to worry about.. just an idiosyncracy of dhcp.  They could have allowed ephemeral ports for some queries, but they implemented it using the same bits they use for the normal requests
20:14 thowe help me, jberger, you're my only hope
20:14 preaction sure, for the proper dhcp stuff. but an administrative api via tcp wouldn't be a terrible idea
20:15 Phil21 umask001: it's certainly an interesting problem that appears trivial on the surface but apparently is not :)
20:15 thowe jberger, actually you've already been helping me; I've been scrolling through Galileo code.
20:15 umask001 they do have an administrative api via tcp.  It's OMAPI, and it's terrible.. :)  Actually.. they're rewriting all of dhcpd into a new version called kea which is going to have a clear api
20:15 thowe I do have a question that may just be one of style...  gotta find the example again
20:15 jberger thowe: I'm glad, though do take that code with a grain of salt, it has been a long time since I wrote that
20:16 thowe jberger, OK.  It did help me get my head straight about why one of my efforts to eliminate some boiler plate was blowing up in my face...  I had to look at your helpers
20:16 * jberger knows to steer clear of the phrase "is going to" until it does
20:17 * pink_mist hardly ever uses that phrase either
20:17 pink_mist too often it never comes to pass
20:18 thowe I tend to just use "return' when I want my controllers to render at that point, but I find you calling render directly in places I looked, is that preferred?
20:19 thowe I guess I'm not sure if there is a good reason why you sometimes call $self->render and other times just return.
20:19 thowe I tend to just return, but maybe that's because I'm not doing something that you are.
20:21 Phil21 umask001: if you want to get drunk and bitch about ISC-dhcpd I'm totally game
20:21 Phil21 might even fly to you for that opportunity
20:21 Phil21 been fighting with it and broken-ass dhcp clients now for months :)
20:21 umask001 Phil21: rofl.. yeah
20:21 Phil21 can't wait for kea to finally be usable
20:22 Phil21 basically I gave up trying to get the info out of isc-dhcpd I needed (very similar to what you're doing, only I need option82 and other data for just DHCPREQUESTS that are not yet assigned a lease)
20:22 jberger thowe: usually if I render inside a helper I then return 0
20:22 Phil21 and just use Net::DHCP::Packet and libpcap to parse the packets off the wire
20:22 Phil21 er, DHCPDISCOVER
20:22 jberger so that I can do like return unless $c->check_authorized
20:23 jberger or whatever
20:23 thowe jberger, this was just in, like, Galileo::Page::show and edit, I think
20:23 jberger thowe: paste a link and we can discuss
20:23 Phil21 umask001: among the other dhcp bugs I've found... if you are planning on using grub2 for pxe booting (UEFI) make sure if you are using relaying your gateway is the same IP of the relay server :)
20:23 Phil21 awesome bug still there, we still need to submit a patch upstream
20:23 thowe https://github.com/jberger/Galileo/blob/master/lib/Galileo/Page.pm#L12
20:24 Phil21 (only found that one working around another JunOS dhcp bug... sigh.)
20:24 Phil21 and DHCP::Packet also blows up with malformed dhcp packets - which you'd be surprised what sends them
20:24 jberger oh thowe you are just talking about automatic rendering?
20:24 jberger I just don't personally like implicit things when I can be explicit
20:24 thowe yeah, I think so
20:24 Phil21 as in... just line noise in option fields due to lack of null padding some clients that violate RFC do (in particular, dell idrac is horrible at this)
20:24 jberger but that's just a matter of style
20:25 * Phil21 stops ranting about dhcp
20:25 Mikey ++explicit ++jberger
20:25 jberger automatic rendering is nice in quick prototypes in Lite apps
20:26 jberger but in big apps, I like a nice fat render method call
20:26 Mikey implcit requires understanding too much.  understanding too much cuts into rocket league time
20:26 thowe I thought so.  I was about to start adopting that style, as it is generally my habit to adopt the style of people who know what they are doing...
20:28 thowe I need to come up with a better way to handle my authorization boiler plate.
20:29 thowe every little function has different allowed groups and different failure behavior...
20:30 thowe jberger, are you going to YAPC?  For some reason I seem to recall you saying no, but maybe that was ribasushi(?)
20:32 jberger thowe: no I'm not going to be there :(
20:32 jberger it conflicts with my vacation
20:32 jberger which is really unfortunate because it didn't have to
20:33 jberger but it took them so rediculously long to announce the date
20:33 thowe Huh, it will /be/ my vacation if I go.  I should probably go talk to my boss about coughing up for it a second time.
20:42 gryphon joined #mojo
20:43 thowe I see they did YAPC at the same place in 2014, was it good?
20:47 jberger I wasn't there then either actually
20:47 jberger but it seemed like people enjoyed themselves
20:47 jberger I was working at the Bank then and I was working in Python then so they didn't feel it worth sending me
20:47 jberger just one of the reasons I left (one of the many reason(
20:48 jberger s
20:48 jberger )
20:48 jberger )
20:48 thowe glad you got that last paren matched, it would have bugged me ;)
20:49 jberger indeed
21:00 asarch joined #mojo
21:14 thowe_work when naming controllers, I seem to recall there is an expected pattern...  Is it underscore seperated if it has two words in it, or just camel case?
21:15 jberger pro-tip, you can use the CamelCase name even in the ->to('CamelCase#action')
21:15 jberger otherwise it would be ->to('camel_case#action')
21:15 thowe_work yeah, but what should I actually name the libe and file?
21:16 thowe_work er lib
21:16 tchaves joined #mojo
21:16 thowe_work I need one for "Regulatory_Report.pm" or RegulatoryReport.pm
21:16 jberger lib/MyApp/Controller/CamelCaseName.pm
21:16 Grinnz_ camel case is the convention
21:16 jberger RegulatoryReport.pm
21:17 thowe_work perfect..  Isn't there some kind of built in helper for normalizing the names?
21:17 Grinnz_ normalizing how?
21:17 jberger there are Mojo::Util functions
21:17 jberger camelize and decamelize
21:17 jberger but that doesn't really help you mich
21:17 jberger much
21:17 thowe_work I thought it had the word camel in it, but the page I am on was coming up nothing
21:17 Grinnz_ .oO(Mojo::Util::caramelize is much more helpful)
21:18 jberger http://mojolicious.org/perldoc/Mojo/Util#camelize
21:18 jberger Grinnz_++  mmmmmmm
21:18 thowe_work I run that against my onions
21:25 trone joined #mojo
21:35 haarg joined #mojo
21:37 jontaylor joined #mojo
21:38 haarg joined #mojo
22:30 punter joined #mojo
22:34 disputin joined #mojo
22:45 dvinciguerra_ joined #mojo
22:55 dvinciguerra__ joined #mojo

| Channels | #mojo index | Today | | Search | Google Search | Plain-Text | summary