« first day (1273 days earlier)      last day (2515 days later) » 

5:15 AM
posted on October 24, 2016

New Cyanide and Happiness Comic

 
 
7 hours later…
12:19 PM
Hi guys ! still looking for some inputs to the issue I posted about yesterday. Would be grateful for any help. Thanks
 
@Ajoo You've failed to meet StackOverflow's and our rules regarding your issue. You don't minimize your issue, don't include a demo in your post, nor do you explain the issue very clearly. There are 3 close votes on your question for those reasons
It seems you have a history of asking poor questions
 
Wes
1:10 PM
morning zach
@Loktar i cried a little :(
 
2:07 PM
 
2:39 PM
Anyone know, without using bootstraps mobile-first / hard-coded column re-ordering, if there is an easy way to have a "pinned" div (using just CSS), that will always be on top of other columns when it goes into collapsed mode? Example: jsfiddle.net/aanders50/2sx0frsx/2
 
does the flex property in make the framework grids obsolete?
 
3:23 PM
Hi Zach ! Thanks for the response. Though I am really surprised when you say that I have not described the problem well. In fact, earlier, after reading the question you messaged saying that there was no runnable code which I have provided thereafter using pastie. I am willing to agree with you if you can show me how could I have asked this question in a simpler manner. Thank you
 
4:22 PM
@JoeSaad what makes you say that?
@Austin flexbox can do that
Grid layout could as well, whenever it's supported. If you can't use either you need JS (or duplicate content like you just did)
 
4:37 PM
Hi zach, I have gone through that link & I feel that I have done most of what is mentioned there. I have described the problem showing minimal code where the problem occurs. The code in the pastie is an almost minimal version. The images are required to create the slider and its Tab. I have removed almost all of the server code. What else can I do?
 
You still have PHP in your code. Include only the relevant, rendered code so that a minimal version of your project with only enough code to recreate the issue is present. Make sure it runs, likely in a snippet or JSFiddle. Then describe exactly where it breaks and what you've done to try and solve the issue, including the research you did into the issue
 
OK I'll make changes and try yet again in a while. Thanks
 
Then edit your question on SO to match
 
5:04 PM
I keep trying to take notes in this algos course but then she goes to slowly so I stop looking then all the sudden she's done with the whole slide and moves on and I miss half the content :/
 
5:41 PM
Hi Zach, I have further reduced the code eliminating php. I have also slightly reduced the css. The following pastie if implemented will reproduce the problem. I have tested it before posting it. http://pastie.org/10949134.js
The images are here http://imgur.com/a/PTSR6 and will be required.
 
> Help me
Are you serious??
Why the heck would you post a file comprised of just document.writes???
1 hour ago, by Zach Saucier
You still have PHP in your code. Include only the relevant, rendered code so that a minimal version of your project with only enough code to recreate the issue is present. Make sure it runs, likely in a snippet or JSFiddle. Then describe exactly where it breaks and what you've done to try and solve the issue, including the research you did into the issue
 
@Wes RIP Walking Dead fans
 
Line 63 of the pastie is a comment which shows how the problem is rectified easily but using a small bit of inline code and removing another bit from the css file.
sorry the pasties has the .js at the end which was also pasted. Here it is again. pastie.org/10949134
 
Please post a live minimal, working version that recreates your issue in a JSFiddle or SO code snippet
I don't know how many times I have to request this before you actually provide it, but I'm frustrated of trying
 
But how do I add the images in jsfiddle ? I have no idea if that is possible in jsfiddle.
 
5:49 PM
The same way you include images in any web page. You link them.
 
ok i'll try it. Thanks
 
6:41 PM
Hello!
 
o/
You've got some long hair
 
I've cut it recently!
 
oh no
 
I have a question, and I'm sure it's been asked in other ways before
 
powerless without it
 
6:45 PM
But I'm kind of a crusty newb about ES6
I set up a little code snip to better frame my.. confusion rather
So far, I've been using the former data type for my objects
I've been learning JS through simulations, physics, animations, and it came to generating thousands if not more such points or particles, basically objects that looked like {x:4, y:3, functions}
A friend of mine working in webdev has noticed that I'm just mocking classes basically and suggested I use the latter
my question is, should I just get used to classes, are they faster or otherwise make up for it through design beauty
and how would I handle multiple constructors
 
meaning multiple classes applied to the same object?
 
I..guess? I put it in there: the simple {} structure can generate me points at given coords AND random points
the class not so much... I could make a separate function to generate points at (randomX, randomY), but that's my question
I see a lot of questions about {} vs function/prototype, but those just seem nasty to me
Am I making any sense here? Or rather, is my question clear?
 
Is this what you're wanting to do? jsfiddle.net/8aaxz4a7/2
I changed lines 28 and 29
 
hm, ok, I see, I thought of that, but what about wildly different kinds of constructors
for example, I made a little colour library that plays with and converts colours in HSV, RGB and HEX
but for convenience's sake, all of the three have constructors that can take all three
so I can make white by
rgb.createRgb(255,255,255);
but also
hsv.createHex("#ffffff");
 
mmhm...
 
6:55 PM
and perhaps even more notably, I have a function that extracts a pixel and registers its colour that doesn't even take finite numbers as an argument:
hex.extract(myContext, x, y);
all of these making objects... is this feasible to do with classes?
as well as functions like .toHsv() which return a converted object
 
I'm not sure what the second part dealing with .extract is supposed to do, but it seems like it
 
I pass in a canvas context and two coords, and it creates an object based on the colour there
but it's still a (weird) constructor
it returns an object, so I'd do
var x = hsv.extract(ctx, 100, 400); -> HSV object
var y = hex.createHex("#FFFFFF").toRgb(); -> HEX object -> RGB object, finally
var z = rgb.createRandom(); -> RGB object
all of them valid, usable objects with various types and methods... it'd seem like a nightmare to do all of this with classes, right?
 
cc @rlemon come help uncrustify this
 
huh
tl;dr?
 
Alex had a question about being new to ES6: should he get used to classes w/ ES6, and something else about handling multiple constructors
 
6:59 PM
tl;dr, I've been using {} objects a lot
should I start using classes
 
what are you creating?
 
his jsfiddle from above
http://jsfiddle.net/8aaxz4a7
 
in my little projects so far I have colour objects with wildly diferent constructors and convertors which return other classes of objects
in this case I was just talking about points as an example
 
@AlexMitan seems manageable to me jsfiddle.net/8aaxz4a7/3
 
oh, so you do new Thing(), and then call a kind of "reconstructor"?
 
7:02 PM
if that's what you want to do :P
 
ok, let me show you a snip of how one of my objects looks
 
you have a default and then you change its properties as needed
 
Get the kids away from the screen, intense noobage will ensue
 
there is something to be said about the non class approach
you don't have to call 'new'
they are both apposing and valid approaches
classes are just invoking a function constructor, which you may or may not need (in this case, you don't really need it)
 
7:04 PM
https://jsfiddle.net/t0gosr6w/2/

this is snippets of my original, and really very useful code
it's hundreds of lines of the questionable stuff, but this is essentially how things work now
 
so it's a color lib? a color mutation lib?
 
yeah
slight typo, corrected
 
-_-
that wasn't a yes/no question
what does this lib do/
 
erm... both? I've been using it to generate colors mathematically (e.g. colour this thing based on its distance from another) and also compare and mutate colours, yes
 
so color utilities?
I would never have it return an instance of itself. make a util library
 
7:07 PM
basically
maybe inefficient, but in several projects I have pipelines like
ctx.fillStyle = hex.createHsv(360, distanceFromThing, 100).str;
 
I have used github.com/davidmerfield/randomColor to generate random colors before. Might be helpful for reference
 
yea, that is creating a lot of overhead so you can chain things in a jQuery type way
there isn't much point to it
in Canvas, assuming you're doing any real animation, performance is going to be crtical.
 
I see, but my initial question was a more general one, as in... can I return or create class-based objects as conversions?
var x = alreadyThereObject.toAnotherType();
 
@ZachSaucier my random colors return `hsl(${Math.floor(Math.random()*360))}, 100%, 50%)`
 
var p = new point(100,100);
var p1 = p.twiceAsMuchPoint();
 
7:10 PM
So you want something of class foo to be a type class bar after a function?
 
the same class or another, maybe I want the same class but with slightly mutated attributes
 
@rlemon that's what I did for simple stuff but I needed some more dividing by scale. The color lib was fast for plug n play
@AlexMitan class p { someMethod() { return new classP2(); } }
var p2Elem = p.someMethod();
 
Oh okay! That's what I was on about!
This is what I was after, thank you very much!
So in general, should I completely give up my {} ways or what would be the criterion? If I'm to work with a LOT of objects, is it "simpler" that they be object literals or should I just work with classes?
 
posted on October 24, 2016 by CommitStrip

 
Here are two fiddles. This one works fine but there is that small bit of inline css code. https://jsfiddle.net/ajoo/4u76Lhxd/.
In this one i moved the inline css into the css file (lines 107 to 110) but the tab gets distorted. https://jsfiddle.net/ajoo/totym83v/1/
For some weird reason - i dont know why - the slide tab does not show in jsfiddle. But the problem still demostrates.
 
7:29 PM
@Wes wait you saw it?
I assumed it would be later for some reason
dude wasn't that CRAZY?!
 
Also, would you guys say that "~~x" is a bad thing to do instead of Math.floor(x) ?
 
@AlexMitan I think in your case it's a matter of preference for {} or classes
What rlemon was saying is that having either is overkill for just creating/converting colors. It'd be simpler to just run a function
@Ajoo the CSS in the CSS panel of those two fiddles is different
 
7:45 PM
yes Zach, The inline css that I removed I put that in the external css (lines 107 - 110). I don't think there could be any other difference.
 
When JS changes an element's style, it changes the style attribute. So when you call .toggle() it does it inline. Since, on the first version, you have display:none, it toggles between none and a blank value (which means it goes to the previously declared one, which is display: block in your stylesheet). On the second one, it toggles between none and inline, which causes the issue
if your demo were an actually minimal one, I bet you would have figured that out yourself
 
Would you please suggest a solution for the same? Thanks.
 
toggle between display: block and display: none...
 
8:02 PM
You mean the solution will have to be in js ? Like I would need to check the property of <a> and if it's block I make it none and vice versa ?
I think it should be id toggle. Sorry if my question is stupid but I have limited knowledge of JS and CSS.
 
Yes, either you have to keep it in the HTML or change the JS a little
 
Thanks Zach. I'll try it out. Hopefully I'll fix it. Else I'll return for your help again ! :-))
 
Please ask a more clear, focused question with a working, minimal example next time.
 
8:43 PM
heh sounds like a threat Else I'll return for your help again !
 
Hi, i need help with an sql statement in asp
can someone help me?
 
@NewPassionnate which part of this room name or description makes you think we focus on SQL?
 
The part that says "HTML"
 
HTML = SQL?? That's new to me
 
Ya
Because they both start with the same letter
But they end with different letters so that could cause some confusion
 
9:21 PM
ugh so annoying when a coworker keeps fighting me over using floats
dude floats EVERYTHING
and I'm like, change it to inline-block, stop it!
 
is there any way to have gradient border for form inputs like dropdown and input field?
 
@Loktar how do you get around the space created by using inline-block? that's what always gets me
 
@joshhunt if I run into that I usually do the negative margin trick
but this dude is FLOATING everything
like something needs to be on the left... jsut float it left! lol
 
:D
 
9:46 PM
Tricky CSS question here. I have 3 sibling elements with varying widths. I need the middle element centered and the other two elements on each side, sort of "floated" next to the centered one. Any ideas?
 
10:13 PM
 
 
1 hour later…
Wes
11:39 PM
@Loktar i saw it
why the ginger :(
best character ever
 

« first day (1273 days earlier)      last day (2515 days later) »