Darmani

Activity Graph

Page 1 of 19 | Next »

2019-03-02

[00:01:54] Darmani: https://gist.github.com/mfifth/46fb313965ab679409dedf1765232e52
[00:01:54] Darmani: Okay I think I got it
[00:02:05] Darmani: I mean it seems to work when I try it in irb
[00:05:46] Darmani: You tried.
[00:07:26] Darmani: leftylink: https://repl.it/repls/DoubleMediumorchidSystemadministrator
[00:10:33] Darmani: yeah maybe
[00:12:51] Darmani: this is better
[00:12:52] Darmani: https://gist.github.com/mfifth/46fb313965ab679409dedf1765232e52
[00:13:38] Darmani: Is it implied? Okay
[00:13:45] Darmani: I just like to be thorough.
[00:15:06] Darmani: Still not correct though. It thinks the "a-" is greater than an "a".
[00:15:12] Darmani: And I don't think it works like that.
[00:18:25] Darmani: On line 4?
[00:18:35] Darmani: Comparable isn't included??
[00:24:20] Darmani: I mean why not use them?
[00:27:18] Darmani: makes sense
[00:33:49] Darmani: https://gist.github.com/mfifth/46fb313965ab679409dedf1765232e52
[00:38:09] Darmani: hmmm you're right
[00:39:11] Darmani: What is that?
[00:49:34] Darmani: So we have to combine the two? And check that way?
[01:04:09] Darmani: Okay so I thought this would work and it did if I only gave it one grade
[01:04:11] Darmani: https://gist.github.com/mfifth/46fb313965ab679409dedf1765232e52
[01:04:20] Darmani: But if I give it two grades then it messes up for some reason.
[01:04:54] Darmani: nvm I'm just confused
[01:30:48] Darmani: Yes I see that.
[02:24:14] Darmani: Okay so this isn't correct but I don't know what is
[02:24:15] Darmani: https://gist.github.com/mfifth/46fb313965ab679409dedf1765232e52
[02:24:34] Darmani: How do you tell the operator how to judge to values at the same time? Or am I supposed to lookup one value and then the other value.
[02:24:38] Darmani: Separate them somehow?
[02:26:02] Darmani: Obviously it should check the letter and then the symbol but I don't know how I would write it.
[06:26:29] Darmani: Ping timeout: 256 seconds
[15:58:13] Darmani: has joined #ruby
[15:59:18] Darmani: Hi everyone! I'm trying to write a comparable method for my object class but I'm not really sure how to go about it.
[15:59:19] Darmani: https://gist.github.com/mfifth/46fb313965ab679409dedf1765232e52
[15:59:37] Darmani: I need to compare each object by their letter grade and symbol.
[16:26:04] Darmani: a12o3-cr: What if the grades has symbols?
[16:26:10] Darmani: Like + or - ?
[16:26:13] Darmani: Would that still work?
[16:27:06] Darmani: It wouldn't I think it looks too simple.
[16:28:01] Darmani: Well yeah in the test case you provided
[16:28:30] Darmani: It's not as simple as other.grade <=> @grade though. Also that filters them backwards.
[16:28:42] Darmani: I think it's supposed to be @grade <=> other.grade if anything.
[16:30:34] Darmani: https://repl.it/repls/PitifulCalculatingFormats <- So when I try this with multiple grades that have letters it puts the "A-" grade first, then "A+", then "A".
[16:30:46] Darmani: So I don't see how that works at all.
[16:32:26] Darmani: I'm about to give up though. This shit is starting to irritate me.
[16:33:21] Darmani: All good. I thought that was the solution too to begin with.
[16:36:34] Darmani: This kind of works as long as you keep all the grades the same letter.
[16:36:36] Darmani: https://gist.github.com/mfifth/46fb313965ab679409dedf1765232e52
[16:46:29] Darmani: No not even close
[16:46:41] Darmani: It's just what I have so far.
[16:49:07] Darmani: A b- would be greater than a C that's correct.
[16:59:14] Darmani: canton7: I came to the same conclusion but I'm still missing something.
[16:59:15] Darmani: https://gist.github.com/mfifth/46fb313965ab679409dedf1765232e52
[17:00:19] Darmani: That's not parsing out the letter it's parsing out the symbol.
[17:00:29] Darmani: canton7: Then it compares the letter to see if they match.
[17:01:20] Darmani: Unless I'm confused which I might be.
[17:02:47] Darmani: canton7: If it was as simple as "do this" I obviously would have done that by now.
[17:02:58] Darmani: If I knew what you were talking about
[17:03:01] Darmani: I might actually do it.
[17:03:06] Darmani: I appreciate the advice though.
[17:03:44] Darmani: The same conclusion to compare the letters and then compare the symbols?
[17:03:49] Darmani: That's pretty easy to understand.
[17:06:28] Darmani: canton7: And then apply -1, 1, 0 accordingly?
[17:08:26] Darmani: canton7: okay that seems pretty straightforward.
[17:22:05] Darmani: canton7: Dude
[17:22:12] Darmani: I will literally give you money for helping me solve this
[17:22:14] Darmani: where do I donate lol
[17:22:49] Darmani: Also here's the finished product, it could probably be cleaned up a little more but it works
[17:22:50] Darmani: https://gist.github.com/mfifth/46fb313965ab679409dedf1765232e52
[17:32:22] Darmani: Very clean.
[17:34:29] Darmani: Thanks man :)
[17:56:14] Darmani: canton7: What about finding the longest substring in a string? Is there any good articles for that sort of thing?
[17:57:36] Darmani: canton7: Is there an elegant solution?
[17:57:42] Darmani: Because most of the ones I see look like shit
[17:58:44] Darmani: implement an algorithm that when given a string, returns the longest repeating substring found in the input. E.g., in the string "phenomenal", the longest repeating substring is "en".
[17:59:07] Darmani: Not too complicated but I've never solved this problem before so I don't know where to start.
[18:00:03] Darmani: yeah this is a pretty basic one I think
[18:01:46] Darmani: Well I've never done this before but I have an idea on how it would be solved...
[18:02:46] Darmani: With a pencil and paper? What do you mean?
[18:03:27] Darmani: What do I do with those things? lmao I think I know what a substring is
[18:03:59] Darmani: Well I guess starting from the beginning couldn't hurt
[18:04:03] Darmani: Thanks ^_^
[18:05:18] Darmani: I usually just stare at my computer until my eyes hurt
[18:05:21] Darmani: works every time
[18:14:17] Darmani: canton7: So you count the characters which show up at least twice in a string and then you examine the characters next to them and so on and so forth until you have your string?
[18:15:24] Darmani: Seeing as this is my first time solving this problem I'd like to just figure it out before I get creative.
[18:27:12] Darmani: canton7: Did you go to school for this?
[18:28:48] Darmani: I feel like such a fake sometimes
[18:29:40] Darmani: Yeah I guess.
[19:25:18] Darmani: canton7: okay I gave up
[19:25:21] Darmani: pls dont hate me
[19:28:52] Darmani: I think so.
[19:29:01] Darmani: I can try to explain it.
[19:33:34] Darmani: canton7: https://gist.github.com/mfifth/70a7e77ba2da16412d473000bca1f18f
[19:33:41] Darmani: That's my understanding of it.
[19:33:47] Darmani: A poor man's understanding of it probably
[19:43:23] Darmani: canton7: yeah that's exactly what I was thinking!!
[20:12:41] Darmani: Ping timeout: 256 seconds

2019-03-01

[23:23:18] Darmani: has joined #ruby
[23:25:37] Darmani: Hi everyone! I'm trying to write a comparison operator for my object class that compares the grade it holds to another grade. It's supposed to account for the "+" and "-" in the string.
[23:25:39] Darmani: https://gist.github.com/mfifth/46fb313965ab679409dedf1765232e52
[23:26:02] Darmani: I'm not sure I know what I'm doing because I keep getting an argument error saying I'm providing an argument but I don't know what that means.
[23:27:15] Darmani: Man it's been a while since I've been here.
[23:27:28] Darmani: baweaver: yeah I know I just wasn't sure what the correct method was.
[23:27:36] Darmani: Just trying to write it out in pseudocode if you will.
[23:28:13] Darmani: baweaver: Well I know what I'm trying to do just need to get the syntax right.
[23:28:44] Darmani: Grade is just a ruby object class. It holds a string that you can read.
[23:29:18] Darmani: Well the goal here is so that if you had an array of "Grades" you could call sort on the array and it would properly sort them by the string it contains.
[23:29:37] Darmani: I guess we could call it value. I just called it string.
[23:30:23] Darmani: Well you could put in a string and it would output an Object with that "grade" in it.
[23:31:04] Darmani: "A", "B-", "C"
[23:31:42] Darmani: yeah I think so. And by the + or -
[23:31:49] Darmani: So that's why I thought scan.
[23:32:22] Darmani: Wait why do I want two
[23:33:36] Darmani: Well I do have a property available so wouldn't it be sort_by?
[23:33:46] Darmani: Line 5 right?
[23:34:27] Darmani: So how do we give priority to the +?
[23:34:57] Darmani: A regex I would assume.
[23:36:33] Darmani: I guess I'm not sure how to include a way for the Array.sort method to be included in my class. Line 12 obviously isn't the way to do it.
[23:37:35] Darmani: So I mutate the array twice
[23:37:41] Darmani: One for letters and then again for symbols.
[23:38:16] Darmani: So it is sort_by I knew it.
[23:38:21] Darmani: okay let me play with it a bit.
[23:38:36] Darmani: leftylink: thanks ^_^
[23:39:52] Darmani: I need to look at the sort_by documentation.
[23:42:15] Darmani: Bear with me guys
[23:42:21] Darmani: What's the correct way to write line 12?
[23:45:20] Darmani: leftylink: It's not a requirement. I've just never done this before.

2017-08-01

[04:07:31] Darmani: has joined #RubyOnRails
[04:07:38] Darmani: Radar: Hello o.o
[04:31:54] Darmani: Quit: Page closed

2017-07-31

[20:57:58] Darmani: has joined #RubyOnRails
[20:58:06] Darmani: Radar: You around?
[22:00:40] Darmani: Quit: Page closed

2017-05-17

[17:59:27] Darmani: has joined #RubyOnRails
[17:59:39] Darmani: How do I center this red div inside this blue div?
[17:59:40] Darmani: https://jsfiddle.net/tnf1d7mm/
[18:02:56] Darmani: tbuehlmann: Sorry I thought this was css
[18:02:59] Darmani: I always do this lol
[18:03:03] Darmani: thank you though.
[18:16:44] Darmani: has left #RubyOnRails: ()

2017-05-12

[00:46:39] Darmani: has joined #RubyOnRails
[00:46:50] Darmani: Are there any event listeners for changes to the DOM?
[00:47:03] Darmani: Like if I rendered a partial through ajax?
[01:42:57] Darmani: Quit: Page closed

2017-04-26

[00:17:08] Darmani: has joined #RubyOnRails
[00:17:24] Darmani: Does anyone know the correct configuration for DelayedJob on Heroku?
[00:17:37] Darmani: My workers keep getting locked by the SIGTERM that Heroku throws out :[
[00:41:33] Darmani: Quit: Page closed

2017-04-13

[18:23:49] Darmani: has joined #RubyOnRails
[18:26:13] Darmani: Hey guys, so I have this form that dynamically loads a partial onto my page. But I need to add an event listener to an element on that partial.
[18:26:14] Darmani: https://gist.github.com/mfifth/72e7bd82607c6ecb3b64dd44ca2029a3
[18:27:11] Darmani: oh this is ruby on rails
[18:27:17] Darmani: I thought I was in jquery lmao
[20:09:49] Darmani: Ping timeout: 260 seconds

2017-04-07

[22:26:00] Darmani: has joined #RubyOnRails
[22:26:37] Darmani: Hi everyone! This transaction fails and gives no error for some reason. I'm trying to create an object with a dropzone form.
[22:26:39] Darmani: https://gist.github.com/mfifth/60602fa513777f7cdc61816b3b803a01
[22:36:21] Darmani: Quit: Page closed

2017-04-04

[01:48:34] Darmani: Ping timeout: 260 seconds

2017-04-03

[18:24:32] Darmani: has joined #RubyOnRails
[18:25:09] Darmani: If I have to pass an api key or a token of some sort through an HTTP request where do I put it?
[18:27:01] Darmani: cnk: as a param?
[18:28:29] Darmani: cnk: If I'm passing an api key so I need to specifically name the param to that?
[18:30:01] Darmani: Cool, thanks man ^^
[18:46:27] Darmani: https://gist.github.com/mfifth/8621b1ab5d636b6622731cb15e0d011d
[18:46:27] Darmani: I feel like this should work but I keep getting the 402 error code :[
[19:04:41] Darmani: cnk: My bad I meant 401
[19:05:08] Darmani: I'm trying to use Net::HTTP.get_response to access Shopify's "close" endpoint.
[19:05:25] Darmani: But it keeps saying I'm missing an api or an access token.
[19:07:28] Darmani: It's a Post actually
[19:07:30] Darmani: just realized that
[19:08:11] Darmani: Yeah it does seem get that's my bad.
[19:09:28] Darmani: cnk: it looks like there is only a post_form option for a post request though.
[21:25:25] Darmani: Radar: bruh
[22:41:22] Darmani: Radar: hey
[22:41:32] Darmani: Is it a bad idea to work for a start up?
[22:48:03] Darmani: amperry: lol
[22:51:10] Darmani: amperry: Have you ever worked for a start up?
[22:55:24] Darmani: Radar: It looks like I might have the opportunity to work for one.
[23:08:30] Darmani: you don't like startups lol
[23:09:39] Darmani: May I show you the ad?
[23:15:20] Darmani: No worries.

2017-03-30

[00:28:05] Darmani: has joined #RubyOnRails
[00:29:04] Darmani: Hi everyone! My flash messages are persisting across pages for some reason. I suspect it has something to do with Turbolinks but I'm not sure.
[00:29:05] Darmani: https://gist.github.com/mfifth/1fa38196fc5d89955c99134d0dcf11b2
[00:31:11] Darmani: Radar: Long time no see ^.^
[00:31:50] Darmani: Radar: https://gist.github.com/mfifth/1fa38196fc5d89955c99134d0dcf11b2#file-order_products_controller-rb
[00:33:41] Darmani: Could it possibly be because of this? https://gist.github.com/mfifth/1fa38196fc5d89955c99134d0dcf11b2#file-app-html-erb-L4
[01:28:19] Darmani: Quit: Page closed

2017-03-18

[01:18:07] Darmani: has joined #RubyOnRails
[01:18:17] Darmani: Does anyone here program from a Windows 10 OS?
[01:25:10] Darmani: havenwood: That's awesome! That's what I'm in the process of doing. I already have the subsystem installed.
[01:26:00] Darmani: havenwood: I'm having trouble with the Linux Shell though. None of the files I'm creating from the Shell can be seen from the Windows File Explorer...
[04:23:08] Darmani: Quit: Page closed

2017-03-17

[02:43:00] Darmani: Ping timeout: 260 seconds

2017-03-16

[23:42:55] Darmani: has joined #RubyOnRails

2016-07-31

[03:34:22] Darmani: has joined #RubyOnRails
[03:35:48] Darmani: Hello everyone ^^
[03:54:41] Darmani: Hey guys! I keep getting this error msg and I'm my RSpec test and I'm not sure why.
[03:54:43] Darmani: https://gist.github.com/mfifth/7098d265423f495c9f6dc8f1e9aa3377#file-error-msg
[03:55:06] Darmani: It works when I enter the application and do it manually but I get an error when I run this test :[
[06:19:24] Darmani: capitainIsh: no xP
[06:20:15] Darmani: capitainIsh: Haha welcome friend ^^
[06:21:34] Darmani: capitainIsh: It depends really. Most of the Americans are asleep by now, the rest of the channel chimes in when they feel like it.
[06:22:47] Darmani: capitainIsh: yep that's true as well!
[06:23:24] Darmani: The slack chat for Rails is more reliable in my opinion. If you have a question that needs to be answered I'd recommend asking there if no one is here.
[06:25:32] Darmani: capitainIsh: Anyway welcome ^^
[06:35:58] Darmani: Ping timeout: 250 seconds
[16:17:14] Darmani: has joined #RubyOnRails
[17:38:35] Darmani: Radar: You around?
[18:52:56] Darmani: capin: could be lol
[18:54:57] Darmani: Does anyone know where I should apply for junior developer positions? I want to start applying for jobs I'm just not sure where to get started.
[18:57:03] Darmani: capin: hahaha ain't that the truth.
[21:43:18] Darmani: Hey guys, if I wanted to define a single member route, like an "about us" page or something, do I have to create a new controller to direct the request?