« first day (1260 days earlier)      last day (1995 days later) » 

user5870134
12:29 AM
I've got an early day tomorrow, so watch a quick movie before I sleep :)
 
user5870134
Good night and stay safe everyone!
 
6:47 AM
Morning GUys
Its a beautiful day to get frustrated with front end coding.....
 
@JanDvorak Yuuuup , im at that point where i cant ignore UI any more ...
 
If it's just for yourself, or for non-dinosaurs, flexbox everything :-D
 
Unfortunately, that wont do.. w3layouts it is... I know bootstrap BUT doesnt change the fact that i hate front end... i would rather engineer the core functionalities
On another note... My RubyMine evaluation ends in 7 days , damn it,why dont they have a community version
 
Any affiliation to w3schools? I'd rather stay away because I'd guess there is.
 
7:02 AM
@JanDvorak Well i guess they have an affiliation or they both got their name from w3c
 
hint: w3schools has nothing to do with w3c
 
Then its possible they both used that W3 thing
 
That would be a PR suicide
 
Not really,
THat W3 tag carries alot of trust with it...
 
nope.
 
7:08 AM
well it is the standards body for web soooo....
 
Also that crappy tutorial site that pretends to be them...
If one of them is going to be selling basic templates for ridiculous prices, it's going to be the latter.
 
So my name is about to change to Ndeto..... I was going with thageekboy in my early campus days when i joined Stackoverflow
 
W3schools don't disclose non-affiliation. W3layouts don't disclose non-affiliation. W3schools have a history of rebranded clones to try to restart the waning wave of undeserved trust. Now they're getting into the template industry. So, let's tear down their "home agents" demo layout if you don't mind me?
1) Why does every image frame have a different class?
2) Why is only the image clickable, not the whole frame?
3) Do they really sell just the front page, not a decent part of the website???
4) Why do they have a chunk of commented out code there? Moreover, with the ancient jQuery.bind?
5) Why do they use the unminified version of jQuery in their website? That thing is huge.
6) The indentation of their HTML is just inexcusable
7) $("body")
8) oh, and - inline scripts of substantial size
9) Google Analytics in the template they give to everyone? REALLY???
10) div.wrap > div.wrapper. Also, div#wrapper inside div.wrapper. Also, div#carousel inside div#c-carousel. Great for bugs.
11) Wait, did they just toss in two extra divs just to get a margin and a drop shadow???
12) I'm gonna wager a guess that the comma after "2520 sq.ft" comes from the fact that "more info" is a list, and they do .map(+",").join instead of .join(",").
13) Using an empty div with an ID as a clearfix.
14) hidden off-screen footer just to give themselves credits and probably to rack up SEO. Not that it works anyways.
15) they let you pay big money just to remove that backlink. What if you remove it yourself - do they chase you all over USA with guns in their hands? What if you don't live in USA?
@thageekboy still here? The list above should be enough for now :-D
verdict: It wasn't just made using w3schools as a reference. It was literally made by w3schools.
 
8:12 AM
@JanDvorak So yeah, Its Ndeto now :D
Hahaha Damn those are quite some reasons, but i have a simplistic approach, eg... 15 They just use those GREAT templates to market the people they have on their team and build up client trust, i would say they are doing a pretty good job at it
And i dont see whats so bad with w3layouts being affiliated with w3schools..
 
...wat
 
 
3 hours later…
11:53 AM
Hi guys!
 
Hello
 
how's that unending hate of the wc3school going?
 
not successfully enough. Note the message I've wated.
 
12:32 PM
I wated too :) ...probably wanted? ... I see both ends of it - they are kind of crap, but somehow they rise to the top (money will do the top)
 
w3schools is the reason I've installed a "block certain sites from Google" addon
 
:)
 
Hi All.
Can someone please help me out to this question?
https://stackoverflow.com/q/44716297/2945616
 
12:59 PM
@JanDvorak That's dedication
 
that addon is dedicated to blocking w3schools, yeah :-D
 
@AtulKhanduri I took a peak in there ... someone gave you the answer in the comments - your validation checks are wrong because you're not thinking like a computer...the computer is comparing those fields to each other in ways you don't expect. You are going to need to write a better validation check if you're allowing letters in your quantity field!
 
1:26 PM
@AtulKhanduri ... you question is actually a duplicate ... it was answered here ... stackoverflow.com/questions/10700800/…
 
@Mirv I want to show validation error if user tries to use alphanumeric in the quantity field. Now while updating, if `to_i` of new value is same as the previous value then the no validation error is raised and, if `to_i` of new value differs from old, then it shows the validation error, as expected.

For instance, if old value is "4" and new value is "4a" (`to_i` value is same) then the object considered as valid although it should show some error and if new value is "5a" (`to_i` value is different) then it shows validation error as expected.
@Mirv Let me check that.
@Mirv I do not want to allow letters in quantity field. I hope above comment explain you what I need.
 
I don't believe using to_i should be necessary - there's something wrong with it (codesmell) - and likely you are opening the door to new & weirder issues if you get unexpected things there ... if someone fills weird unicode in there & one of them gets close to a real number, you to_i is useless
Yes @AtulKhanduri ... that link I provided shows how to properly check for integers only & then do a range as an extra option
(I couldn't find an example using the format you had that worked in my own test of the code)
 
@Mirv I'm not manually casting that to integer (to_i). Probably assign_attributes is doing so.
@Mirv I'll take a look over that question and get back to you.
 
I might be around :)
 
1:42 PM
Thanks.
 
2:19 PM
@JanDvorak WHat did W3Schools do to you hahaha
 
2:31 PM
They gave him faulty outdated info when he needed a good answer most likely :P
 
they ate his wheaties...that would mess anyone up for life...
 
2:51 PM
:D hehe Those must have been his last wheaties, he literally came up with 15 reasons
 
While acknowledging redirects are part of good behavior and user confirmation of their input saving - ARGH! It's a pita working in rails magic
omg
i'm genius sometimes...been staring at this for like 10 minutes, realized his controller#destroy was redirecting to the specific entry he had just deleted ... I'm writing the test as I expected, but then was starting to change the test to match his code - until I realized what an aweful path that would be!
It really takes practice to contort my brain into the Rails way & combine it with TDD/BDD!!
 
3:11 PM
From @JanDvorak's list of reasons, it appears to me like w3schools engages in unethical behavior. Giving people templates with tracking stuff in them? Yeah, no.
 
Oh, I disprove of them too - but while you can be critical of them - you can't not acknowledge they excelled in their chosen field. It's nothing google/facebook/microsoft don't do times 100
(I have major beef with $300-900 smart phones that cost more than computers & act as active tracking for the company that makes the OS, the company that makes the hardware, the company that provides the cell service)
(but I suppose we're getting dangerously close to a discussion of ethics & politics here)
 
I support Lord Buckethead
 
Then again, someone is always free to start their UI from scratch. Its a small price to pay
 
and Vermin Supreme
 
All hail Lord BucketHead!!
 
3:19 PM
What did w3s excel at?
Starting from scratch is probably better in the short run even than starting with a w3schools template, even if we ignore the tracking crush without paying them to do so.
 
@JanDvorak Personally, im not a big fan of front end, i prefer using a template. I can get rid of the tracking info if i need to.. or kindly make a donation to remove the backlinks. Its a good business model.
 
W3schools are not worth donating to...
 
a "good business model" is not equivalent to "engaging in behavior that is beneficial to their customers."
 
That, too
 
3:34 PM
Jan ... are going deny to me they are often a top hit in a wide topic range of searches? (i'm not supporting them or you - just making my point)
 
I think Jan uses a plugin that blocks w3school search results.
 
@Mirv good seo != good. Google tells you what you want to hear, which isn't correlated to truth
 
I've been saying that all along Wayne & Jan, "credit where credit is due", it's like they are in a business world making decisions based on money
I am not limiting my statement to google
it's all meh anyways to me
(i get you're mad, but you're basically trying to convince me to agree to a point i've already made in different words)
 
Me? Not mad at you. At @Ndeto likely , but not at you.
 
I'm not angry with anyone.
I'm kind of mad at myself for the bug I caused yesterday, a bug that will take considerable time to fix.
 
3:40 PM
Rails 4 way of allowing mass_assigning of attributes is to create strong params in the controller... but what if its a controllerless model?
 
Its fine, i was just expressing my views as to why i dont think they are that bad. Its cool
@Jared How does it recieve the params?
 
It makes generates itself from an external API call. Which is triggered from another model.
 
@Jared you use nested model like cocoon gem - accepts_attributes_for, validation on model in question, then list it nested attribute of the controller to the parent model
 
I have
 
Ok... not yet really mad either, just stumped at how can someone like w3schools in spite of today's 15.
 
3:45 PM
@JanDvorak Haha well to answer that is despite todays 15 i still loathe creating UI's i have the skill but i hate coming up with design, and nothing i come up with can be as good. and not to mention its time consuming, i prefer taking that time to do my backend
 
i've used them before - especially their sandbox back before there were so many others - they break things down into extremely simple examples ... finding good blogs is STILL difficult after 9 months of exp in rails/sinatra etc....just the other day Wayne saw my link about DHH the maker of rails had a post from a year ago....info is hard to find due to noise (wc3schools is probably noise too)
 
Ah no... its a little different than that. I have a scheduled job that runs every so often and picks up N amount of Devices. Then i have a ProcessJob.new(devices: devices) and once its created it goes off and does stuff, one of those being that API post. I'm just trying to parse and store some of the key fields as part of the reponse with an update(job_id: response.body['job_id'], errors: response.body['errors'])
 
rails 5 jared?
 
4
 
I feel like .permit(@whatever) is still a thing for mass assignment but its been 4 months since I was really deep in the github for stron params
 
3:49 PM
Yes, but this ProcessJob doesn't have a controller to put that strong params code into.
 
You could turn off strong_params or use .fetch for the parameters which ignores require etc
 
Yeah, what about fetch?
 
what kind of error again Jared?
 
For JavaScript/html/css, use Mozilla developer network
 
@JanDvorak I dn't think ndeto saw that rails light weight front end frame work - i saved it to wordpress & can't recall the name ....which one was that again?
 
3:51 PM
Its the cannot mass_assign error which doing the params.permit(:job_id, :errors) would work, but I'm not actually accepting a form =\
 
They also point to w3c in case you want the dirty details
 
@Jared config.active_record.whitelist_attributes to false maybe? stackoverflow.com/questions/30207207/…
 
@Jared so i think the way foward is to first check how the params/data is passed into that model?
*are
 
its passed through me parsing a Faraday::Response object. But I just want to do foo.update(list_of_reponse_attributes) instead of foo.a = response['a']; foo.b = response['b']
 
Okay i get you now
 
4:01 PM
I mean i have workaround, but I just like the cleanliness of a singleline update :P
 
Haha yes i can see that :D
I understand that feeling
 
from what I see they are relying on calling the model & skipping the controllers - so most of my ideas besides toggling the whitelisting go out the window....maybe a callback hook?
 
Time to think about this over some tacos
 
I see two problems, first is getting each param from the Faraday Response

2nd is bypassing the strong params in rails

I havent used Faraday::Response object before, but if you check documentation,
 
I'll let you know if they come up with anything
 
4:04 PM
Is the first problem solved? does rails have a way of working with Faraday Objects?
To get each param from one object
If you can then use
.permit!
 
4:33 PM
@Jared is there a chance that you have this on git repo (not gist) that we can see to catchup?
I'm seeing stuff for faraday in guides like, response = conn.get('search', type: 'artist', q: 'tycho') & not sure if you're using this already ... twilio.com/blog/2015/10/…
 
5:14 PM
Hey guys, I'm a mod on Computer Science Educators now. Just in case anyone wanted to know.
 
Congrats!
 
Congrats
 
Thanks! I just had my first experience with binding votes. They're...interesting. I really don't feel like I deserve to single-handedly close/reopen a question.
 
nice!
 
Most mods don't
 
5:17 PM
who's in the sci educator's thing again?
(i still haven't gotten my permissions to even see it)
 
@JanDvorak Yeah, I'm going to have to avoid reviewing close votes for a while (unless they already have 4 CVs)
 
So to summarize yesterday....stuff in the rails layout directory is the file that has the map & yields, while the stuff i the shared directory is the component _partials being called by the layouts?
 
@Mirv Do you need special permission? I think I've been able to see it.
 
I might have followed a link for the mods...I have an email pending supposedly
at current location my gmail is blocked so will have to investigate another day
 
What is the sci educators thing? If you mean CS Educators, we're public now.
 
5:21 PM
ah
cool
 
coolies! ty
 
5:49 PM
oh lord, i wanted to make a partial of the content navigation for the <list>, but there's an <active> tag in there & i'm not sure how it will react...hate blind testing this stuff
 
user5870134
Good evening, guys.
 
user5870134
After playing around with purecss.io for the day I've finally decided to stop using Bootstrap for my future projects.
 
user5870134
Pure is smaller, simpler and has a better grid system than Bootstrap. Also it doesn't have any of that bloat components that Bootstrap comes with.
 
user5870134
I'm going to go take a quick nap. Goodbye & stay safe!
 
6:15 PM
nice...they have collapsing menus & way more than I expected to be honest ...purecss.io/menus
 
6:38 PM
I'm buried in layouts now...api.rubyonrails.org/classes/ActionView/Layouts.html holy smokes...I wanted to get to generators by next week since basic testing is done, but layouts have to be done before in order to encapsulate them in generator ...so cool I can feed in the layout to use dynamically so I don't have to have all those silly checks for user_logged_in etc in the helper/view files (just verifying in model/controller before preforming actions etc)
should I craft some jquery to move the <active> tag around on my list item menu or a helper to read the :title variable and put the active html tag on the right one when it's generating? Or is there a better way to handle the tab menu if I use a universal menu system? All the tutorials i'm seeing are just hardcoding the whole menu & i feel like that's a waste...but am open to reasons to hardcode the entire menu everytime into each of 32 view pages
 
6:58 PM
Found a decent walk through...railsguides.net/rails-nested-layouts/...i'm still looking for the order it loads this stuff thru as I'm not confident of my grasp of yield despite reading the documentation (prehaps less so after)
 
7:39 PM
@Mirv Do you want to talk about yield and blocks?
 
i think i got most of it now - was thinking originally they called in reverse order - but it looks like from tutorials I read that it's actually controller kicking off the name of the matching layout (unless specified at header or in action) then traveling down the main layout until yielding as many times as needed....oh & the application.html is default incase nothing else is called before specific views that match controller
true?
 
I don't know about all that Rails jazz ;) I can tell you how yield and blocks work in quite a lot of detail, but Rails... dunno.
 
7:55 PM
Ok, that's really useful too ... I take it a file executes until the yield, then resumes after & it ... and that there's no preloading of vars in blocks for it?
 
In basic Ruby, there are no files involved. Yield is how a method calls a block that was passed to the method.
def foo
  yield
end
foo { puts "the method called the block" }
{...} defines a block that is passed to foo. yield within that method runs the code inside the block.
do...end is the other syntax for defining a block.
 
yep, onboard with that
How about more specific ... I just found a random issue with this code chunk ...navigation_data.each{ |x,y| astring == x ? puts "Good" : puts "#{x} holding #{y}" } where naviation_data is a hash...the whole thing works when i skip the ternary operator & write out the if else statement
I think the issue is the == & ?...probably needs paratheses?
 
I don't know. Write it without the ternary operator; it'll be easier to read and easier to debug.
 
got it navigation_data.each { |x,y| (astring == x) ? (puts "Good") : (puts "#{x} holding #{y}") }
 
...naviation_data.each do |x, y|
  if astring == x
    puts "Good"
  else
    puts "#{x} holding #{y}"
  end
end
 
8:09 PM
it didn't like my format #{} in the double quotes
dang, you format pretty quickly wayne!
actually, amend that - the puts " whatever " is the issue
I'll have to write a method to hold the if statement i think
def call_n(astring)
navigation_data.each { |x,y| test_active_string(x, y, astring) }
end

def test_active_string(x, y, astring)
(astring == x) ? (puts "Good") : (puts "#{x} holding #{y}")
end

Thinking in this case the if then else end will be what I end up with for the second method..
 
Why don't you like the ternary?
 
I think an if broken out onto separate lines is clearer in this case.
I'm OK with ternary when used for simple expressions. When used to condense an if onto a single line, then no. I don't understand why a dense single line is preferable to more diffuse multiple lines.
 
This doesn't seem as dense to me once you factor out the puts.
 
from an objective standpoint?
 
I'm pretty subjective about this. I don't know how to be objective about code style.
But I do want to learn about your subjective experience.
 
8:24 PM
I like compact
 
One advantage of compact code is that more of it fits in your edit buffer, allowing you to quickly scan more of it just by moving your eye. Eyes move faster than arrow keys.
 
I'm not sure the best way to go about a dynamic navigation list menu ... I don't want every controller's index being loaded - so I won't be pulling the controllers list programmaticaly. Basically, if I do a partial with a helper to decide which list item to set as active - I save like 200+ lines of code for the nav menus spread across 32 controllers
Though, this link looked pretty good - just add if params[:controller] == 'controller1' ... stackoverflow.com/questions/9879169/…
...think I could do if params[:controller] == params[:controller].to_s & make it a .each loop?
 
9:17 PM
does anyone use a navigation gem?
(will I get fired for it or not get interviews if I use one?)
 
What does a navigation gem do?
 
All the crap I hate...like toggle links on/off based on conditional statements, detection of user privileges to show buttons related to admin stuff, manage hierarchies of a controller actions related, provides the hooks needed that all the themes use
that code I was doing earlier was basically setup for a decorator for menus, but I'm pouring over these gems & like...boy, no need for me to go all bob the builder
 
I don't know why using a gem for that would be automatically bad.
 
9:33 PM
I've never heard of it before today so :)
 

« first day (1260 days earlier)      last day (1995 days later) »