« first day (1232 days earlier)      last day (2023 days later) » 

2:15 AM
@Cereal But... git pull?
 
 
1 hour later…
3:42 AM
@Mirv I don't alias things, and I've been a few laps around the sun.
@Cereal SourceTree has a mode where it will tell you what underlying git commands it is doing. I like that mode. I hate magic between me and the tool.
 
 
8 hours later…
11:39 AM
i'm always struck by the install times on nodejs being so much shorter than rails
 
12:06 PM
It's because node is JIT compiled
 
12:17 PM
thats pretty cool
i was kind of shocked last year when I heard the nodejs npm package system surpassed all other repos
but it makes some sense
 
 
2 hours later…
2:14 PM
gooood morning
 
Morning
 
Morning
 
2:48 PM
Gutten Morgen!
 
3:10 PM
Guten morgen, mein herr!
 
I'm in on my second read of the rails 5 way & don't know how I missed it - but you can call a template (including other controller's templates from any controller!? What kind of sorcery is this?!
Gutten morgen, gut herr!
 
@Mirv Useful sorcery :)
 
I suppose, since modules are globals...it kind of makes sense they play fast & loose with other scopes
have you ever dynamically written a class in rails? & why?
 
I've done a lot of dynamic things... I'm not sure what dynamically writing a class would be, though. Does creating an anonymous class count?
 
Class.new, define_method and such trickery
 
3:23 PM
Yeah, I've done all that stuff. I couldn't recall specific instances, but I can look through code to find some.
Oh, here's a funny thing I do to create exception hierarchies in a compact manner. This isn't really dynamic.
  module Errors
    Error = Class.new(StandardError)
    Fatal = Class.new(Error)
    SyntaxError = Class.new(Fatal)
    ...
  end
It's just a bit more compact than the more pedestrian 'class Error < StandardError ; end`
define_method I use often. Here's it being used in a monkey patch for an active record connection adapter:
class ActiveRecord::ConnectionAdapters::SQLServerAdapter
  orig_configure_connection = instance_method(:configure_connection)
  define_method(:configure_connection) do
    orig_configure_connection.bind(self).call
    @connection.execute('SET ARITHABORT ON').do
  end
end
This pattern of monkey patch works cleanly with other monkey patches and doesn't clutter up the class's name space as does the more usual method of monkey patching.
define_method is necessary here, instead of plain def, because def creates a scope gate but define_method does not: a scope gate would prevent access to orig_configure_connection
 
4:33 PM
@WayneConrad that's pretty interesting, especially the not using def, I take it the new error & fatal class is basically an extension using implicit supers?
@JanDvorak yea - I'm starting to see that in metaprogramming, but I'm still not sure what good reasons to use it is going to be ....
Oh, i got the link going - I have looked at that book at least 12 times with an eye for buying, but I can't justify the cost when except for monkey patching - I can't come up for a reason to use that code & getting my own board game portal running is beyond my scope currently
(at least with rspec testing & I want to include travisci type continuous integration in my monolith before I go into heavy refactoring & meta...though maybe I save lots of time by going after that sooner rather than later?)
Change of subject - does anyone ever move github wiki's between different repo's or offline for posterity sake?
 
@Mirv I moved a wiki from one wiki engine to gitlab (a github clone); since all the files were markdown to begin with, it was pretty easy.
 
4:49 PM
I'm thinking of just syncing the repo, then pointing a new origin, then forcing an add of the wiki files to a commit
(using my new bash skills - lol)
(since I didn't initially see the wiki files in the windows ui or the webpage github)
i'm really impressed, in the last 2 years, there's like 20 new cloud IDEs....thats like one a month....not sure how good they all are, but it looks like cloud9's open source move paid off
 
Cloud IDE? I didn't know that was even a thing.
Interesting.
 
check cloud9 - it's amazon's little test
niterous went under last year, but there's a ton of other ones - even one sourcekit in google chrome that stores on dropbox instead of database
 
I just took a look. It's not for me, but it looks pretty cool.
I'm pretty strictly old school... Terminal multiplexor, Bash, Emacs. Keyboard driven window manager.
 
I really want a ssh terminal IDE, so I can hit my digital ocean server (which I suck with using) to handle some docker/ci things c9 & heroku can't do
nothing wrong with sticking with your workflow, I'm just not super vested - was using visual studio when learning assembly/c++ in '00, but never went far
 
5:09 PM
IDEs make me cranky. They make me give up 30 years of training in order to get features I don't think I need. I type like a deamon, so I don't need autocomplete. IDE editors don't have the awesome things that Emacs already has. And, the real killer for me, My editor is the exact same editor for every language I use. One set of key bindings to learn. Each IDE is different.
On the other hand, I've seen IDEs do some things that make me jealous. So... it's more about what you know how to use well than it is any objective measure of goodness.
Oh, and I hate using the mouse. Makes me even crankier.
Did I mention that I'm just plain cranky? :D
 
I only use the IDE's that let me vim or carry preloads like emacs etc
 
Right on.
I used the Android Studio (I think that is what it's called) IDE for a bit; it has the charming (no sarcasm meant) quality that it detects when a file is edited by an external editor and reloads it automatically. That meant I could use the stupid IDE and my beloved editor at the same time, so that was nice (or as nice as having to use an IDE can be).
 
I think my 2% error rate is around 80wpm last time I checked, but I bust 120wpm for 8% ...which doesn't help if there's something i have to lookup, but I hope to get solid enough with grep/find & feeding it in to vim type stuff that I can go keyboardless instantly (main reason I haven't is i work from any of 12 different computers at my day job)
that is pretty cool!
 
That's pretty good typing. Good enough to be impressive, and that's the main reason for being able to type fast, right?
But... 12 different computers, wow! How did that come about?
 
LOL, love that guy for xkcd ... found that comic when I was so lonely & hurt, really uplifting to see someone turn their creativeness into a way of making a living
damn emacs
I basically go where needed for the day, no laptop
for awhile they had me on a perm station next to one of the bosses when i did up a key logging, then lost & found database
 
5:35 PM
That can be a really cool way to work, because there's no separation between you and the people who need your work, right?
 
it's interesting, got all sorts of questions about stuff unrelated - their helpdesk guy had a few talks with me on the downlow not to share information with the boss as it made life hard on him to have to always explain - no you can't have the new toys
the main thing that happened is every break was a checkin, asking how it was going & a show & tell for the office like twice a week - which probably like you said did make it easier in the end, never really thought of that
 
The best programming I've ever done is when things were immediate like that. What's better than a formal agile process? The business pointing at the screen and saying, "Can you change this? How hard is it?" And an hour later you can show the change and get feedback on it. That's the ultimate agile.
 
Preach, I have like 5 or 6 projects from ppl on SO who are looking for help - I won't make any comments or code in their repo's on any day they aren't commenting on previous diffs (I explain why to them so they understand)
that's actually the main reason I like cloud9 - you can pair program off it easily
 
That's very cool.
 
5:51 PM
nothing like the other guy seeing your mouse & cursor typing - though I wish they had a built in audio stream for it - but skype client/curse-gaming voice web browser/etc works fine too
plus, you don't have to hide all your other windows or worry about serious OS level security stuff like in other screen sharing utilities
 
 
1 hour later…
7:12 PM
Hello everyone!
 
Hello!
 
@thesecretmaster hwdy?
 
geetings?
 
@thesecretmaster apparently yeah... *howdy
 
Hows life going?
 
7:19 PM
not bad, getting on day by day. you?
 
Good, schools almost over for the year, so I can finally start writing code seriously again.
 
@meagar Howdy.
 
Hi hi
 
I'm writing a script to write scripts. Embrace the meta.
 
Did someone say AI?
 
7:24 PM
AU (Artificial Unintelligence)
 
AS* (Artificial Stoopidity)
 
@thesecretmaster cool!
 
This Ruby script reads the schema, extracts the names of the tables, and then writes a SQL script to add a trigger to each table. It also writes a SQL script to remove those triggers, because when this goes wrong in production, I'll want to be able to remove those triggers very quickly and stop my phone from ringing.
@MulleOne Is this your first visit here? My apologies if you've been here before; my memory is rotten. So either welcome, or welcome back.
 
@WayneConrad hi! Actually not, and your memo ain't rotten apparently, it's coz I changed my name
10Double
I bet you remember
that one
 
That may be true, but my memory is still rotten in general. I do remember that one.
 
7:32 PM
Anyways, so the script you working on, you will be needing volunteers to help and or learn?
newbies for ex trying to work on something more complicated than they've been doing?
*exp.
 
No, I can't do that with this script, but I'd like to help in any other way I can.
Ask questions here and we'll do our best.
Also, I'm experimenting with some OOP design in this script, so not good for newbies anyhow--I don't know if what I'm doing is any good yet.
 
oh okay! I got it.
By the way, something that bothers me a lot.
How does the room view members for example never answer questions, but will be in the room and reading the ongoing conversations, BUT
only write when they have a question.
Is that looked as being unfair / self centered?
*at
 
we could code critique it! I read agile oop from sandi metz once...I'm like an expert now!?! _(ツ)_/¯
 
7:49 PM
@MulleOne It varies from room to room, but in general, that's fine. In this room, it's fine. There is a poorly defined role called "help vampire"; as long as someone doesn't assume that role, there's no problem with lurking and asking questions.
 
@WayneConrad I see, on SO questions for example I try answering those questions I've had personal encounters, so I don't mislead no one. And in this room, I usually read, but most questions are still complicated for me to help, otherwise I'd always love to. So I just wanted to be aware.
 
There are many, many questions I can't help on. Sometimes they're too specialized ("How can I get the Frozbot gem to boobargh the route?"). Sometimes it's just something I don't know. Sometimes language barriers make it difficult to understand.
 
I got it.
 
Sometimes I know the answer but I'm very busy.
 
8:11 PM
That's understandable
 
frozbot does sound pretty awesome
 
Now you have something to create on the weekend.
 
wow
 
I have to spend the weekend with the wife doing outdoor stuff, woe is me :P
 
8:26 PM
<brag>I have to spend the weekend playing videogames, taking naps, and practicing banjo. My SWMBO is out of town.</brag>
 
self.jealous!
 
What kind of outdoor stuff will you be doing?
 
Wouldn't that be self.jealous = true?
 
No, that's Java programmer thinking (they think in attributes that you get and set, which isn't the best way to do OOP). Jared's telling an object about an event ("jealousy is happening!"), and it's up to the object to do whatever it wants.
 
8:44 PM
@WayneConrad Going to go see a concert of Tool up in Bangor then putzing around Bar Harbor
Also it could be an enum and it is forcing the enum emotion: [:meh, :happy, ..., :jealous] to a certain state
 
@Jared That doesn't sound bad at all! Any weekend with music in it is good. With family, even better.
 
I'm just not looking forward to the mass exodus of Bostonians to Maine for the long weekend, but I can't complain as I'm joining them ;)
Speaking of which it is time to start the long weekend
 
Have a great weekend, Jared. Nice chatting with you.
 
9:03 PM
I have a Texts_Controller for text and other attributes, then I have another controller Stats_Controller that should be responsible to calculate the word frequency of all the text in the db: So my intention is that, I'd like to calculate word frequency of the text when it's being saved for the first time, or when edited.
Therefore, upon successfully creating a new Texts_Controller object / instance there should be a call to a method in the Stats_Controller that has to calculated the word frequency on the just saved text and save it to the stats_table (db). Is this approach sound? what approach would be best recommended?
 
I think what you're doing is sound, but I'm not sure it belongs in controllers. Have you considered using service objects? These are little objects you create that do bits of business logic (like computing and storing something, for example). A controller can invoke a service object, as can another service object.
 
I've never used services
 
A service object is just some little class you make. Google will be able to help here. Some of the people describing service objects get very elaborate in their schemes, so if an article about them makes your head hurt, just look for another one. They're not difficult unless someone makes them so.
 
I have just googled something on services.
 
This article looks like it might be good.
 
9:08 PM
Okay! Thanks, I'll right away try to get my head around this.
 
I don't spend much time in chat on the weekends, but if you have questions go ahead and ask and with luck you'll get an answer "soon." :)
 
Is jared in maine?
 
At least for the weekend, it looks like.
 
@MulleOne I was told not to rely on filters like before or after for everything, but in your model you can call or trigger the redirect to the next controller while passing the id as param too
 
@WayneConrad well, I'll try to believe I won't, don't know why I do most coding on weekends ((
 
9:21 PM
Coupling the models to the controllers sounds kind of hinky. I'd do it if I had to, but I'd want to find another way.
 
@WayneConrad Yea - I'm torn, but I went the service object path & it's a cast iron punk to test - where as the DHH method spawning a controller everytime & passing an id with along a redirect to the next controller doesn't require any extra testing
 
@Mirv I got that, but could you give an example of how that could be done
Just knowing how that can be achieved
 
my monolith is a hulking mess of I just learned ruby last fall and only started reading good books about 2 months ago - so there's all sorts of bad things in it too
give me like 5 minutes to dig
 
@Mirv sure, I'll appreciate. I'll try checking too
 
(I read this like 3 weeks ago & it started me using that theory: jeromedalbert.com/how-dhh-organizes-his-rails-controllers)
The short version, is in the controller action, you test success of saving the new activerecord object & then if successful you redirect just like another to the next controller in the process
(I've seen people do the same thing in the models too - but not sure how I feel about that even if it is business logic where once CC is confirmed move to placing order etc) @WayneConrad thoughts?
 
9:31 PM
I like models to deal with persistence and validation. Service objects do things. Controllers just do the HTMLish part of the app, and nothing else. That's my ideal.
Putting the business logic into the models works for a little while, but as the app grows, the models accumulate so much business logic that they stop being maintainable or understandable.
^ Not theory. Been there :)
 
Definitely, the model does the check & hands back to the controller!
 
@Mirv if not for a kind of redirecting I'd go with that option, but the other Controller won't render anything, meaning, I'd have to redirect back to the source Controller to eventually display the successful saving of the object(That is the Text object)
 
Good call on not passing to a controller not displaying, my only comment is that if the logic needs to exist as a distinct step - it may at some point need it's own spot to live.
 
Definitely
 
So you are going to get rid of the statsController then?
 
9:42 PM
No, I agree with your comment, like I would like to fetch and display from the db whatever statistics have been saved, but not upon saving a new instance.
So i don't intend on getting rid of it
 
ah roger
 
Just the saving part is what I would like happening when the other Text instance is being saved or edited
but without displaying the newly stat, maybe just a notice along with the notice of successfully saved Text instance
 
I like flash messages, but hate having to treat them like error handling
 
9:57 PM
What do you mean by "treat them like error handling?" Do you mean how you set them, or do you mean how they are displayed?
 
I was following a guide a few months back, where they talked about the idea of using flash methods through basically a helper object to keep them organized & handing them around along with tracking last few
i think they stashed them in concerns, but different PORO's being called from models would then set the flash option which would be used by the controller to finally display it
 
I worked on one project that had two different kinds of flash messages... one for errors, and one for notices. I like the idea of using a concern or otherwise putting the setting of the messages in one central place. We should have done that.
 
I could see the two different styles being hard - I kind of feel like flash is not for errors except to say, "Check your form errors" or "You done messed up" as they aren't necessarily permanent comments on the state. I would almost rather have java modal type tool tip for informational type things.
(I guess short version is I like flash messages for saying something happened - then explain what happened elsewhere in a better spot)
Oh & the one spot for flashes was a great idea - it was why I was in there - just they tried to do everything. I feel like they could have done a .yml file or such with the errors & just use the single point code object to pass it all around where ever
oh man, I was lightly looking through my code in the test project & found some ungodly bad code
along with an issue i made 3 weeks ago saying, "refactor this later"
 
10:13 PM
ow! After reading through a number of articles, I guess I've settled for services. One quick question:
Will it still be logical, to keep the Stats_Controller, with methods like index & show. but create & update, in the service I'll create?
ensuring that, create will only be called when the Texts instance has been saved and update when an instance of Text has been successfully edited.
 
Are they needed? I often trim away CRUD endpoints that aren't needed.
I'm not sure I've understood you, though. I think Mirv has a better handle on what you're saying.
 
Yes, the index actually, probably only. To just show the stats in a table and nothing more
 
I prefer relatively minimal APIs.
 
Well, let me try it out, and see how it goes.
using services but still keeping the Stats_Controller for display only
 
Sounds good to me.
 
10:28 PM
yeah.
I hope it goes well too!
 
MulleOn, if you plan on having another control handle editing, creating - will they also handle the feedback & confirmation? Index & Show only sound good if the service & other controller has it (like with nested controller/model things)
(I mean as long as you branch in git hub now - it's all good right?)
 
@Mirv yeah, infact there won't even be a create or edit method in the Service
it will just be methods that will be called when the other controller is in either the creating or edit methods
and so yeah, those service methods, will just respond with a boolean value, just to indicate success or not
branch in git hub as in push the project up to git hub, so I show how I've done it?
should I say how I'll do it?
I don't quite fully understand here [ Index & Show only sound good if the service & other controller has it (like with nested controller/model things) ]
 
10:46 PM
I'd use the nil strategy so that you can still rescue & avoid a bunch of if statements
(rather than boolean)
As to the last question - it kind of sounds like you want a nested model/controller with a hidden field almost that can sit in the db & show on the back end, but not to the user - is that fair assessment?
(like an admin feature)
Rescuing NIL or recovery issues in program flow to avoid if statements (or long chains of them) - medium.com/rails-ember-beyond/…
Shorter version - I used this one originally & it did ok for some time - tutorialspoint.com/ruby-on-rails-2.1/… ... I hedged my bets and had a puts 'executing rescue' in the controllers & objects so if there was ever any question - I knew my error handling needed to be revamped
super important you are tail -f log/test.log & another console window tail -f log/development.log with having a rescue statement setup -- will save you lots of grief
Now, on to the github branch - I try to do a new branch any time I'm going with a different strategy or a feature. I just do a local one mostly. Sometimes I drop them and never upload to github.
often I push at the end of the day regardless of my completion status
 
I like only "blessed" (ready for production) commits to be pushed upstream, but I run local backups so that local branches aren't lost if I have a catastrophe.
 
I need to boogie for the night - lady wants to hit fabric shop
 
Take care, @Mirv. Thanks for hanging out.
 
@Mirv Thanks a lot! quite a lot for me to grasp but I'll definitely go through it all
 

« first day (1232 days earlier)      last day (2023 days later) »