« first day (1921 days earlier)      last day (3083 days later) » 

user114359
10:01 PM
easier to click the button in Chrome than F12 -> copy, paste -> F12 in Firefox though.
 
@Snowman well, with the snippet I gave, it runs constantly every 500ms to fill in editted or deleted content; so you won't have to click a button.
 
10:13 PM
Scenario: Currently storing all the types of a mazeblock in an enum, but then when I add a new "mazeblock", I need to update the enum. I want each mazeblock to contribute to it when its loaded into the system so I don't have tight coupling.

For dynamic, enum-like sets of string values, should they be stored as singletons, static variables, or abstract classes? As singletons and static variables, they are persistent and fairly accessible. As an abstract class, derived classes can be made with the class name representing the enum -- but it would be an empty class with no extra functionality.
 
psr
@durron597 Creation of delight is reserved for customers only. Get back to work creating it and work overtime to repay the time you have stolen. And flag the email as unproductive so the email reader productivity metric forwarding service data can be updated appropriately.
 
Is there a consensus for "dynamic enums", implemented as enum-like collections, on whether they should be singletons, static, or inheritance hierarchies? I think just going static is good here.
 
I'm not really understanding what's "dynamic" about this enum, are you saying you need to update its values at runtime or something?
 
@Ixrec yes, but all at once as the application loads the relevant data.
 
yes I read that post too, I'm asking because it's too vague to give much of an answer too
what you just said sounds to me like the enum is static for the entire duration of the program after some initialization where it has to go look up what the values are, is that right?
also, what language?
 
10:23 PM
@Ixrec Right now, my enum is setup pre-compilation. This is C# and more specifically, XNA.
 
damn, my spidey sense was telling me Java
so, it's a fixed set of values known at compilation time?
 
Yep
 
so what's the dynamic part?
 
I don't want tight coupling. I don't want to add a new type of obstacle in my maze game, then go to a list of enums and update the list. I want to make it as modular as possible. I'd rather update the list from the new class so it's more contained.
 
so you just want to be able to add new values to the enum in the future with a minimal amount of stuff breaking?
 
10:25 PM
Yes, and all of those things will be added at once, and only once, as the program loads.
 
so it's not known at compile time?
actually, better question, why are the values being "loaded" from somewhere rather than simply declared as a typical enum?
 
It is declared as an enum, which leads to tight coupling whenever I create a new object.
So rather than creating a new object and updating the enum, I want to blow up the list and recreate it as something more dynamic. The cost to memory is negligible.
 
user114359
...and it didn't work.
 
I guess a static array of strings would work, though I still feel like I'm missing something important
 
10:36 PM
wait, you have an enum listing all the concrete implementations of your maze block abstract class?
 
user55340
-5
Q: Java - Print A4 image from directory - no margin - 300 DPI

Matan MarcianoHow can i Print JPG image from directory at A4, 300DPI, full page(no-margin) Thanks for help!

 
user55340
What have you tried so far? — Victoria S. Dec 3 at 15:10
 
user55340
A lot of Codes that i saw in internet... — Matan Marciano Dec 3 at 19:33
 
user55340
>_<
 
@Ixrec Say I have a Ladder, a Goal, a Player, and an Enemy. Then my enum is { Ladder, Goal, Player, Enemy }
 
10:38 PM
this raises even more questions; normally the whole point of an abstract class is that the rest of the code uses the base class interface and doesn't care what the concrete type is, and any code that tries to inspect the concrete type is considered an symptom of a design flaw if not an anti-pattern
hmm
 
@Ixrec It's not enough to have an inheritance hierarchy because I need to generate all of these MazeBlock objects when loading from files. The only alternative that comes to mind is using Reflection to get the class names and relying on that to find their types, which is just unforgiveable. That's why I have an enum that parallels the inheritance structure.
 
why does generating the concrete MazeBlocks require the existence of a global enum (or equivalent thereof) listing all concrete types of MazeBlock?
surely only the MazeBlockFactory has to know what all the concrete types are (to do the construction anyway)
 
@Ixrec This project has no design patterns because I wrote it 2 years ago. I have to look up the abstract factory pattern again...
 
tl;dr a factory function takes a bunch of parameters and returns an object satisfying some interface, typically the intent is that it uses the parameters to decide which concrete type should be instantiated, so that nobody outside the factory function has to know what all of the concrete types are
 
user55340
Forget about trying to fit design patterns in. Identify the problem you have. Then look for the tool.
 
10:47 PM
"I need to generate all of these MazeBlock objects when loading from files" sounded like a natural use case for that, the function takes some blob of characters from a file and figures out whether it's a Ladder or an Enemy
 
user55340
If you can't find the problem, the pattern is not something to apply.
 
@MichaelT I knew you couldn't resist saying that. You like to say it a lot, but I already have defined the problem rather explicitly, and am in the searching phase.
@whatsisname I like this stuff. I guess everybody has their cup of tea.
 
abstract factory pattern = whatever you're working on is probably miserable
 
@Ixrec it doesn't mess with your own messages because that breaks the up arrow editing
 
@JimmyHoffa ???
 
10:49 PM
You said it didn't work. Did you mean your own removal wasn't redisplayed?
 
user55340
Specifically- what problem are you trying to solve?
 
@FizzledOut tbh we're still trying to figure out what the problem is; while your question made sense we're missing the full context and as you've seen every piece of context does not so much clarify as raise yet more questions about why things are the way they are; it's likely that the question you originally asked is not even a problem that will need solving if all this other stuff gets cleaned up
@JimmyHoffa are you talking about the bookmarkelet thingy? I've never tried it
 
@MichaelT @Ixrec alright, I see. Hold on and let me try to sort it out for awhile. I know the next big steps I need to do. If I can't figure it out on my own, I'll come back (again). Thanks guys; you've been a big help so far.
 
but to avoid sounding like we just want to torture you with all the faults we can find, a simple array of strings seems like it ought to work for what you originally asked for
 
I'm adamant about trying to tackle these issues the best way I can. I don't get hurt by constructive criticism ;)
 
10:55 PM
and for the record, I'm not worried about you making the "programs are built out of design patterns!" mistake, you've already demonstrated you're thinking harder than that
 
just remember, unless you are building some huge enterprisey monstrosity, go simpler, not more complicated
 
also, since it sounds like you're making a video game, it may help to browse gameprogrammingpatterns.com/contents.html
video games tend to be unique in that they are required to have everything interact with everything else, which initially seems to make modular programming an impossibility, but resources like that helped convince me it's still doable
 
user114359
@JimmyHoffa correct.
 
It only redisplays other peoples the way I did it so it doesn't break your ability to up arrow edit your own
I can make it redisplay yours in the event of removal since there's no editing that
Bookylet
 
11:10 PM
0
Q: Is node.js a safe bet for writting a new CMS that aims to be easily installable/deployable?

Adrian MoisaI am working on a 3D viewer for slideshows that rellies on WebGL to render pages and various graphical simulations and effects. For the front-end I am using Three.js to render graphics and Angular.js to render html pages and content. In between the two, I have created a custom framework that sync...

poor guy put a lot of effort into his question only that it will invariably get closed
 
sadly there are a lot of unanswerable questions that people put a lot of time into
 
user55340
The unanswerable ones people put too much time into, and the answerable ones if people put enough time into. These are the laments of P.SE.
 
javascript:window.setInterval(function(){$.merge($('.message:has(.deleted)'), $('.message').find('.edits').parent()).each(function(){if ($(this).find('.deleted').length < 1 && $(this).parent().parent().hasClass('user-'+window.CHAT.CURRENT_USER_ID)) return; var mid = this.id.split('-')[1]; $(this).find('.history').remove(); $(this).find('.content').remove(); $(this).append('<div class="history"></div>'); $(this).find('.edits').removeClass('edits'); $.get('/messages/'+mid+'/history', function(data){$(data).find('.message:gt(0)').each(function(){$('#message-'+mid).find('.history').append(this)
 
could use better formatting
 
Vossus dees?
 
11:22 PM
^-- will redisplay your own deleted items as well. Doesn't show your own edit log though because it breaks up-arrow editing; shows everyone elses edit logs though.
checks for new edits/removals every 500ms
interestingly now I think It'll be easy to quote people's earlier versions.. hmm
nope it updates
 
what I don't get is that you guys want questions you'd ask while standing at a whiteboard, about design and shit. which are all subjective. then you close everything for being subjective. lol
 
that's like criticizing StackOverflow for closing all the debugging questions
 
@LightnessRacesinOrbit it's about narrowness of scope.. lots of specifics remove the subjectivity to a degree where a distinctly authoritative answer can float to the top
 
it's a matter of degree, we close the questions that are too subjective to be answerable (which sadly is a hell of a lot of them)
 
@Ixrec no it's not because Stack Overflow is not a debugging helpdesk, as previously discussed
 
11:33 PM
@LightnessRacesinOrbit but it is, as previously discussed :)
 
@JimmyHoffa spend a lot of time there do you
 
I'm saying the earlier debate is essentially the same debate as the one you just brought up regarding PSE
 
I know what you're saying and I'm saying you're wrong :D
 
it boils down to who's using which words how broadly or how narrowly
 
anyway I guess there's a wider question of whether Programmers is really fulfilling any useful mandate at the moment
you have your scope, whatever it is, fine. but nobody seems to be asking anything within that scope?
 
11:35 PM
there are a lot of questions within scope
 
yeah but they've all been closed ;)
 
a lot that actually stay open and get answered because they're answerable
 
2
Q: Why do I do less effort with skinny tires?

astabadaEveryone knows (citation needed) that (at fixed rim diameter) tyres with smaller section require less effort to move around (at least on a paved road). TL; DR. Why? A bit of context. I always thought this phenomenon is due to the size of the contact patch between each tyre and the road. Notabl...

 
they are dwarfed by the crap, but so is SO, and probably every other website that anyone cares about
 
I wonder what that OP is like in real life
 
11:36 PM
lol
 
there are many within-scope Q's, just not as many as out of scope perhaps...
 
user114359
8
Q: what type of bike/frame to use when overweight?

blahblaI'm around 230lbs. Since I do enjoy biking, I was looking up old school racing bikes on craigslist. Some of the frames are built with "Tange 1" steel which specify weight limits (180lbs). Is it really possible that I might damage the bike if I choose to ride it? For someone my weight or higher, ...

 
user114359
@LightnessRacesinOrbit We do have plenty of questions within scope: unfortunately, people tend to dump their crap here because they are question-banned at SO or think cross-posting is a good idea.
 
user114359
I think it would be more accurate to say we don't have a lot of interesting questions within scope.
 
you should keep the site title as it is now
 
11:43 PM
2
Q: Is node.js a safe bet for writting a new CMS that aims to be easily installable/deployable?

Adrian MoisaI am working on a 3D viewer for slideshows that rellies on WebGL to render pages and various graphical simulations and effects. For the front-end I am using Three.js to render graphics and Angular.js to render html pages and content. In between the two, I have created a custom framework that sync...

 
the best thing about this close vote experiment is that it actually became possible to find questions worth answering again
there was a long period of time before that when I simply never could, and I kinda stopped using the site (other than hanging out in here)
welp, I've never used .NET, node.js or PHP, so someone else take this
(yay proprietary in-house frameworks!)
 
Well, some things need to be done in a new way, I strongly stand by this decision (in-house framewor). Nothing in the market could have facilitated the tools I need for the exact combination of features on this project. Hopefuly this answer is not offensive.
 
nah, nothing offensive about that
I have heard many people far more experienced than me claim that it is more common to err by reinventing the wheel than err by taking preexisting wheels, that is the most I can say on the matter, without knowing more about your desired wheel specifications
 
"However, I have started looking at node.js (because JavaScript is so beautiful)"
lol who are these people
 
people who think like me
=D
 
11:48 PM
there are no people who think like you
you are unique
Ixrec of Nine
 
then the company I work for is really weird
and none of us are answering this guy's question
 
closed, needs two more downvotes
 
captain phasers are offline
and that last shot took out the torpedo launchers
we're leaking plasma
I can't even think of a sufficiently relevant flippant comment to post on that question :(
Poor guy
 
get some containment on that plasma leak and fire at its neighbor IDE question
 
11:59 PM
I feel obligated to point out that that question was on-topic
 

« first day (1921 days earlier)      last day (3083 days later) »