Page 1 of 6 | Next »
[20:58:44] lagweezle: Is there an equivalent Ruby-ism to Python's "if thing in collection:" or "if substring in string:" statement/check ?
[21:04:12] lagweezle: Noooow I just have to remember what the hell I was doing that prompted the question. >.<
[20:37:17] lagweezle: Perhaps have a method that does the actual work, and those two entry points merely arrange things enough to make sense so the information can be passed to the method doing the actual work, and everything which is state is instead kept as a variable local to that 'work' method.
[23:37:56] lagweezle: Procs and lambdas can be stored "as a variable" kind of, and assigned to things.
[23:38:35] lagweezle: So what baweaver pointed out, pretty much. Except you can also directly use Proc as well.
[19:27:51] lagweezle: That's ... yeah. It sounds rediculous, but ends up looking relatively elegant.
[20:37:37] lagweezle: I would think that C, some assembly, UNIX, networking, all of those are good things to learn for pentesting and exploits. Cryptography means LOOOOOTS of math.
[20:46:19] lagweezle: Quite true. Assembly is *very* low level, and not necessary for al ot of things.
[20:05:27] lagweezle: Well, possibly. What if you hate chess and never learned anything of depth about the game?
[20:08:51] lagweezle: I know how the pieces move, and that's about it. I don't know how castling works, but I know it's a thing...
[20:30:34] lagweezle: Do tell? Although the feel of the tiles and building the walls is ... oddly enjoyable.
[20:35:34] lagweezle: Oooh. That's the 'solitaire' game that has the same name of the actual game. :/
[20:47:52] lagweezle: Four players, proceeds from one player to the next. Draw tile, try to make 3 of a kind, 4 of a kind, or a run of three (or some more 'interesting' hands), discard a tile. Next person's turn.
[20:49:25] lagweezle: Oh ... and to make it "more fun" there are actually ... I'll say three different mah jjong rules. Chinese, Japanese, and the horrible thing that is American style Mah Jjong.
[20:53:47] lagweezle: Actually, seems like a good explanation of the basics. The video goes a bit slow for my preferences, but I'm familiar with the game so ... it's probably about right for an introduction...
[22:36:50] lagweezle: I was reading the https://ruby-community.com/pages/user_rules trying to figure out what I did.
[22:37:23] lagweezle: I didn't realize the conversation I was adding to ended an hour and a half ago, either. Heh. >.<
[22:42:34] lagweezle: Oh, so, anyways. If you end up actually wanting to get a mah jongg set, https://www.ymimports.com/pages/mahjong-buying-tips will likely prove helpful, if minimal. Alternatively, http://a.co/3k2Lmsp provides a huge amount of information, quite in depth. I *can* recommend that book to learn about the game.
[22:43:05] lagweezle: That's what I ought to have posted instead of just a link for the message. Anyways, back to Ruby things.
[19:21:16] lagweezle: I'm also noting that your call, apeiros, has commas, where as Pierreb|home just has strings following each other.
[16:39:09] lagweezle: My guess is that floats are ... well, the way they are stored in binary causes a lot of interesting issues.
[16:30:54] lagweezle: PaulePanter: Good! I hate Python's use of exceptions as standard flow control mechanisms.
[16:33:46] lagweezle: PaulePanter: I like that the article is saying that the use of exception handling as a flow-control mechanism is bad(-ish), because I dislike the idiom of try/except (or rescue) in place of if-statements, and such.
[16:35:46] lagweezle: They take it a step (or many?) towards worse at work, too, and wrap a ton of lines in the 'try' part, with 'except Exception' at the end of the entire mess... -.-
[16:41:49] lagweezle: ytti: Just to make sure, did you mean they both use them for if-else flow control, or the general "do things that might blow up then rescue when they do blow up" ?
[16:45:07] lagweezle: ytti: Er, https://docs.python.org/2/glossary.html entry for EAFP suggests otherwise.
[16:52:51] lagweezle: ytti: Sadly it seems to be somewhat common practice in Python. It makes my skin crawl.
[16:56:48] lagweezle: I'm with you there. Things like len() being a global, except not really, because you need to implement __len__ for your class ... bleah.
[16:57:08] lagweezle: I'm with you there. Things like len() being a global, except not really, because you need to implement __len__ for your class ... bleah. (meant as reply to ytti)
[16:46:16] lagweezle: yorickpeterse: Not sure if you realize, but that was a reference to Monty Python.
[16:47:42] lagweezle: Monty Python and the Holy Grail; scene where they are trying to prove a person is a witch. I can't say it's a GOOD movie, but it sure is a fun watch if you're into that humor type.
[18:21:27] lagweezle: I was figuring permutations would be the way to go, but that's ... kind of beautiful.
[18:21:50] lagweezle: Dynamic programming ... I could not wrap my head around that very well when reading about it. :(
[18:22:16] lagweezle: Recent interview I had make me think that I'd be good as a Junior / standard Dev, but finding a place that'll give me the time of day is ... challenging.
[18:23:35] lagweezle: Well, more, keep the result about after solving it, in case you need it (or can use it as a sub-solution) later?
[19:05:11] lagweezle: riceandbeans: Equality based on value versus equality based on identity. The question of whether or not something has the same value as something else is very different than if the object referred to by something is the same object referred to by some other variable.
[19:14:40] lagweezle: n_e_o: Don't confuse the value being saved with how it is being formatted for display...
[19:33:25] lagweezle: http://stackoverflow.com/questions/4350127/rails-dates-time-and-fixtures relates some to the question at hand, but I'm not sure where to look yet for a 'time' thing.
[19:35:25] lagweezle: Oh .. interesting. "YAML.dump Time.now.utc" gives me --> "--- 2015-11-10 19:34:57.486786000 Z\n...\n"
[19:43:05] lagweezle: __desmondhume: Well, kind of. I'm wanting to find out what are available, and what 't.time' actually means for n_e_o's code
[19:44:54] lagweezle: __desmondhume: I'm not after the fixtures just yet. I'm just trying to figure out what the heck the options for a model's fields are in Rails. What object types are supported w/o neeidng to do my own work on it.
[19:50:26] lagweezle: __desmondhume: Damned good link ... why it isn't somewhere obvious in Rails docs somewhere O.o
[19:51:38] lagweezle: n_e_o: Actually, FactoryGirl doesn't require a lot of work to get working. Go check out https://github.com/thoughtbot/factory_girl_rails
[00:36:57] lagweezle: platzhirsch: http://stackoverflow.com/questions/8954706/render-an-erb-template-with-values-from-a-hash has good reading.
[00:38:24] lagweezle: http://ruby-doc.org/core-2.2.3/Binding.html beasty IIRC is the one that does the heavy lifting.
[00:41:10] lagweezle: platzhirsch: IIRC you can set up the variables in local scope, then ERB.new(<template>).result(binding()) but again, my memory is VERY foggy on this.
[00:42:16] lagweezle: platzhirsch: OH! I have no idea, then, as I was unaware there was such a thing...
[23:39:18] lagweezle: pedahzur: shevy suggested that it is perhaps because there was no body. darix said 'mechanize' and linked to https://gist.github.com/anonymous/7ce480f68bda301733a0
[23:52:14] lagweezle: pedahzur: Out of curiosity, is this an HTTP URL that redirects to an HTTPS URL?
[22:21:20] lagweezle: simkessy: I suspect you won't have a params outside of a controller handling a request.
[01:23:32] lagweezle: jason4483: There are two answers to your question. Do you need a Ruby solution, or is this to learn basic Computer Science concepts and approaches?
[01:26:35] lagweezle: jason4483: How about starting with an additional restriction to change how you're thinking about this ... You don't get to look at any position in the array except for the one indicated by the variable 'i'.
[01:29:16] lagweezle: jason4483: Change the problem for now; only care about two consecutive numbers. How would you track the values?
[02:41:41] lagweezle: Me being in QA and trying to escape it to full dev land finds it nice to see some support for lowering the bar to entry.
[02:45:21] lagweezle: Radar: If I can find time to breath this weekend, I think I'll use your gist as some practice. Ruby makes me not hate the world after slogging through horrible Python all week.
[17:19:25] lagweezle: I've got a controller within a modeul, with views; how can I use render_to_string from the Rails console? Rails 4.2.3 if it matters.
[17:25:19] lagweezle: smathy: Awesome! That's what I was trying to use yesterday. Now to find out, again, what the errors were... :/
[17:48:10] lagweezle: If I need a model--some class to hold data and operate on the data--that will NOT exist in the database, is it considered bad to have that in the app/models directory structure? Is that likely to muck with autoloading and attempts to interact with the database?
[18:09:30] lagweezle: That, yeah. I've noticed that when I ask questions in *my* afternoon, it's pretty rare to get much response.
[19:59:27] lagweezle: Where would I go to read up on good approaches to showing the user information for error cases and how to structure the views for this?
[20:01:07] lagweezle: Largely I'm after the implementation side, rather than how to make pretty and readable.
[20:17:56] lagweezle: With a polymorphic association to a class with single table inheritance, why is the referring class show a 'type' that is the base class, even though the record it links to is marked and behaves like the proper subclass? https://gist.github.com/ncolton/a2f4d99b953b48b6ce1d if it helps.
[20:40:02] lagweezle: With a polymorphic association to a class with single table inheritance, why is the referring class show a 'type' that is the base class, even though the record it links to is marked and behaves like the proper subclass? Did I do something wrong? https://gist.github.com/ncolton/a2f4d99b953b48b6ce1d if it helps.
[17:07:55] lagweezle: Using a before_filter to call a method which creates and sets @jira_client. In my controller's 'new' method I use the @jira_client. I've got Rspec set to skip the before filter, but how can I set @jira_client for the controller to mock it?
[18:32:38] lagweezle: Is it bad to do something along the lines of "User.find_by uid: params[:id]" in a controller? I'm having trouble finding whether that does 'safe interpolation' and such...
[00:37:38] lagweezle: ... and now, thanks to Ox0dea, I know that there are 3.5 rundlets to a hogshead ...in English wine cask units.
[15:24:27] lagweezle: What about temporarily stupid people? I'm temporarily stupid on occasion, but it goes away fairly quickly.
[15:28:14] lagweezle: Well THERE is an interesting mental conundrum. I read "!mute rooby" as "not mute rooby," or, "don't mute rooby" due to the logic inversion.
[15:38:37] lagweezle: Huh. 'amsterdame' is an amusing combination of words for a name. Amsterdam, dame. I like.
[15:38:58] lagweezle: I may be slghtly weird today due to excruciating levels of pain and heavy use of painkillers. Woo.
[15:41:21] lagweezle: I do actually mean it, though. Things not covered by the rules, but 'bad' are where the ops get to use judgement and act to keep the community (and channel) a nice place to be.
[15:42:42] lagweezle: Related, would a question about modeling and interactions be better suited for here, or the RoR channel?
[17:08:58] lagweezle: quazimodo: Brown, as in, rooibos, or an herbal, or just some form of black tea that has been properly steeped?
[17:11:09] lagweezle: johnflux: Er, so you want <stuff> then literally "apple,bannana" then othe <stuff>, but only want to select the comma-paired fruit names?
[17:11:42] lagweezle: It is fascinating that green, oolong, and black tea are all the same thing, just different levels of oxidation...
[17:12:28] lagweezle: johnflux: So you just want to select a pair (?) of words that are comma-joined?
[17:13:33] lagweezle: Are the specific words important, or you just want whatever words there are, with one or more words, where the case of more than one word has commas between them? Or ...
[17:14:26] lagweezle: Are you after the case where you have a string with 'apple' in it, 'banana' in it, or 'apple,banana' in it, such that any of those three ocurences (sp?) are positive matches, and the specific one of those triggering the match are extracted as the matcher?
[17:15:55] lagweezle: johnflux: Are you thinking along the lines of a recursive regex? Not sure that is actually supported. Alternatively, you can just write a more complex regex...
[17:18:22] lagweezle: johnflux: Is it important that you actually capture the comma, or just wanting to make sure that if you capture more than one word they are paired by being comma seperated?
[17:22:58] lagweezle: Huh. johnflux, "/(apple),(banana)|(apple|banana)/" produces interesting results on http://rubular.com/
[17:24:47] lagweezle: johnflux: Anyways, play around a lot on the site. It may be much simpler to do this without regex.
[19:13:07] lagweezle: I *kind of* understand OAuth, and I'm pretty sure they are completely incompatible.
[19:13:45] lagweezle: Basically, I understand it enough to use it, but not in a way that I would yet trust it for a "secure" system. I'm working with relatively low-risk data.
[19:16:06] lagweezle: dfockler: I'm using it. It doesn't handle the OAuth handshaking and token/secret exchanges, it only, optionally, uses the access token, once acquired, as a means of authentication.
[19:17:04] lagweezle: dfockler: Heh. I greatly appreciate the effort! I'm re-writing our chat bot using a very different approach (REST service with webhook triggers) vs XMPP live connection. While doing so, I'm trying to be smart... Trying.
[19:18:21] lagweezle: That may explain why rubygems.org doesn't list a homepage, and has a really old last update time.
[19:24:29] lagweezle: I'm also having issues making sense of the gem named 'oauth'. Is it part of MRI? External? Based on rubygems.org info, it is 'dead' (last release 0.4.7 in 2012, and no homepage)...
[23:16:52] lagweezle: What's the appropriate way to generate a polymorphic model base class with the rails generator?
[23:21:34] lagweezle: I'm after generating the table for the polymorphic object, not the thing that references the polymorphic object. At least, not there, yet...
[16:51:28] lagweezle: Thank you EVERYONE for helping me be less stupid with my rails-mysql configuration!