« first day (1694 days earlier)      last day (3299 days later) » 

12:46 AM
Questions seeking algorithmic ideas belong on programmers.stackexchange.comwallyk 25 secs ago
Hardly. Compare programmers.stackexchange.com/help/on-topic with stackoverflow.com/help/on-topic. One specifically mentions algorithms, the other calls anything implementation-related off-topic. Programmers is for general software methodology and process stuff. OP is on-topic. — BadZen 24 secs ago
 
user55340
1:14 AM
Tupper's self-referential formula is a formula defined by Jeff Tupper that, when graphed in two dimensions at a very specific location in the plane, can be “programmed” to visually reproduce the formula itself. It is used in various math and computer science courses as an exercise in graphing formulae. Although it is colloquially known as a “self-referential formula”, this is actually a misnomer, because the image does not encode the constant K which is external data, and Tupper himself did not describe his formula that way. The formula was first published in his 2001 SIGGRAPH paper that discusses...
 
user20683
 
user20683
Not sold on the soundtrack but the rest is most impressive.
 
1:47 AM
Maybe this is better suited to programmers.se? — Almo 13 secs ago
 
Alright then. No, there's no pattern for this, because you don't need any tokens. Modal dialogs are built in such a way that they block further execution until the dialog is dismissed. You don't need any tokens to accomplish this; all you need is a blocking method call. — Robert Harvey 2 mins ago
And therein lies the problem with these kinds of questions. Most of them don't have an answer, because the original premise is invalid. There are a nearly infinite number of ways to ask "is there an established software pattern for this thingy," but only a finite (and relatively small) number of actual patterns to match to that infinite space. Most of the time, the pattern is "write some code." — Robert Harvey 55 secs ago
 
user20683
@RobertHarvey Have you considered writing books on system design or some such for O'Reilly or someone?
 
user15026
2:07 AM
Dear Amazon, why do you make it so hard for me to put Kindle downloads on my Sony Reader? :(
 
You don't have a Kindle app?
@WorldEngineer I'm not exactly an expert. I know a few things.
 
@RobertHarvey I'm taking another look at that question, and seeing if there might be another question I should be asking other than a request for identifying a design pattern.
I'm going to draft version 2 of the question up on a google doc. Would you mind taking a look once it's done, to advise whether it's more suitable for Programmers?
 
Sure.
 
user15026
@RobertHarvey I have the desktop app but it doesn't recognize my Sony reader so I have to download the file, find where Kindle hides it (as they have seemingly stopped giving things logical filenames), convert it to EPUB and then put it on my reader with Calibre. The hardest part of this is finding the file once it is downloaded, as they have gibberish filenames.
 
Thanks, much appreciated.
 
2:11 AM
Or you could, yknow, just ask your question in here. The standards are somewhat lower in here.
 
user20683
or on Meta
 
user20683
"can I ask a question about x?"
 
user20683
or "how can I make this question on topic? Or narrow or whatever"
 
@WorldEngineer i get that, but it might be faster iterating out the XY-ness here, and super clunky on meta. I'm pretty sure what I'm asking for is appropriate for programmers.
 
user20683
@doppelgreener just handing out options :)
 
2:14 AM
@WorldEngineer that could work. I'll finish writing this google doc, then let y'all point me to meta if you think it should definitely be there.
 
@WorldEngineer I'd love to write some kind of book, if I could only figure out where the industry is going, where I could make some meaningful contribution that somebody hasn't already done.
 
user20683
@RobertHarvey government contracting for software engineers?
 
A lot of what's going on in system design seems to be parroting other people's ideas, even if those ideas are marginal ones or not completely fleshed out.
 
@RobertHarvey I suppose I'll try that: trying to distill it down to its basic parts.... I have a component that turns on/off. Imagine a lightbulb. Previously, other things would turn it on when they needed it and off when they didn't any longer. But then they could turn the light out right after something else turned it on, and while something still needs it on.
So then the code turned into carefully avoiding turning off that light in situations where other things might still need it on. That is ugly.
 
Immutable designs don't have that problem.
 
2:17 AM
Rather, I want to refactor it so that everything says politely whether it needs the light on. And, then, whether the light is on or off is handled by something else, that simply turns it on whenever at least one person needs it.
 
What is the light, exactly?
 
A UI blocker. Like the kind that shows up behind this live demo modal.
 
@WorldEngineer I know very little about that, other than the three-ring circus I went through.
 
user20683
@RobertHarvey ah
 
@doppelgreener But that's just a modal dialog.
 
2:19 AM
@RobertHarvey Yes, but while it's open, the rest of the page has a semitransparent black layer appear over it. That's a UI bocker.
 
If you look at it carefully, it doesn't really block anything. It puts a shadow behind the modal, but if you click on the shadow, it simply closes the dialog.
 
Exactly.
 
@YannisRizos collect the set and buy a unicorn with them?
 
So, I'm in a situation where there's several menus on the page, and when any one of those menus are open, that shadow needs to be present behind them.
 
user15026
2:21 AM
@JimmyHoffa Oh, is that what they are for?
 
@AshleyNunn you'd think so based on the way some value them
 
I'm having to invent from the ground up how to have them each politely signal that they still need the shadow present, and how to have a single controller that removes the shadow when nothing needs it any longer. However, this is surely something someone has had to deal with before, and I want to benefit from what peoples have learned before me, and avoid reinventing the wheel.
 
maybe we're the suckers for being unbelievers...one day Jon Skeet's going to cash in for a horde of unicorns (bird - flock, horse - herd, unicorn - horde), and England will never be the same
 
user55340
@RobertHarvey You forget Eric's "A variable is a pattern" - you could use that.
 
@doppelgreener just skimmed your question and what I'm hearing is you have a problem with shared state: one UI blocker being shared by many controls. Why don't you have a blocker for each control? As each modal is dismissed, it's blocker is dismissed, but that doesn't dismiss any other menus blockers...
 
2:29 AM
@JimmyHoffa They're each semitransparent, so they layer over each other, and the page gets darker or brighter depending on how many blockers are present, which is undesirable.
 
You only need one layer.
 
Indeed, I need one layer and one blocker.
 
@RobertHarvey bah this is being shared if you do that.
 
layer.visible = menu.isOpen || dialog.isOpen || whatever.isOpen
 
@doppelgreener new blocker { alphaValue = app.blockers.count > 0 ? 0 : 0.3 }
When a modal creates a blocker, have it add to a list of them (you want to keep references to them in case you need to ever execute a "KillAllBlockers" method because you have 6 menus up but one of them trumps all others (like the quit menu)
when a new blocker is created, only give it a darkness value if there are no blockers in the blockers list already
 
2:32 AM
@RobertHarvey I'd like to do that, but this blocker is going to be used by other stuff in the future. That will become a large and complex series of ORs in the next few months. So I was going to instead make it more or less: menuToken.active || dialogToken.active || whatever.active - or, rather, a loop through each known token to see if any are active.
 
every modal creates a blocker - adds it to the blockers list, and holds a reference to it. When it closes (it's onClose) it removes it from the list and destroys it.
on construction of each blocker, it checks the list of other blockers to decide on it's alpha value.
 
@JimmyHoffa that... actually could work really well. CSS will let me apply transparency to only one blocker.
 
See how easy that was?
A lot easier than asking for a design pattern that doesn't exist.
 
Yes.
@Robert Well, yeah, but I didn't know I could ask about that in this chat.
 
user15026
Heck, they let me ask about my career and I am not even a programmer~ there are good people in here that will answer stuff :)
 
2:37 AM
sure, and I'm used to RPG general chat, where we spend most of our time talking about anything but RPGs.
 
new Blocker(MyWholeApp) where Blocker = new function(app) { alphaValue = app.Blockers.Count > 0 ? 0 : 0.5; app.Blockers.Push(this); var myRegisteredIndex = app.Blockers.count - 1; OnExit = function() { /* remove from app.Blockers myRegisteredIndex */ } } then modals just create a new one, hold a reference, and call blocker.OnExit() when it closes.
 
but in that chat, we also tend to point people with good questions to the site, so that they can ask, get good answers, and have that knowledge preserved. usually works pretty well. guess that didn't work so well here.
 
(that code is totally bad - just concept code, correct to actually work as necessary)
 
@JimmyHoffa this is CSS/JS/HTML, so it will look a bit different anyway. :)
 
It's not clear to me why your question was deleted? Asking for solutions to design problems is perfectly up our alley. Is it because you were looknig for a "pattern" ?
 
2:40 AM
To be fair, I was being told my premise was invalid, and @Robert you might not have intended it but I was feeling pretty condescended to in that comment exchange. I understand programming is a profession full of people who don't really understand what they're doing, and Programmers and SO folk see more of that than decent professionals who know what they're doing, but I'm in the latter category.
That said I very much appreciate how y'all have behaved in here.
 
If you take nothing else from this place, remember this: Design patterns don't solve problems; designs do. Work out designs that make sense for the problem. Design patterns are just templates; you use a template to start creating a program but the template doesn't actually do any of the programs work.
 
I understand. I didn't think asking for a design would be a reasonable course of action, until I started redrafting it at the beginning of this chat conversation, when I realised it would probably make a perfectly viable question.
 
Patterns are like that, you can use repositories and factories where they make sense, but they aren't solutions.
 
@JimmyHoffa They are, however, full of good stuff: they're often an elegant way to approach a particular solution, and they're often accompanied by things I need to do or avoid that I might not have thought of.
Like, if I know I'm using the flyweight pattern, I can look up how to do that in my particular language, find out about potential gotchas, etc.
 
@doppelgreener pfleh pfleh pfleh. You would be served well by forgetting design patterns entirely. And I'm not actually joking about that. I only trust someone to work with design patterns when they don't attribute much value to them; those who do end up creating messes. They're really of minimal use.
 
2:45 AM
@JimmyHoffa I do almost always forget about them entirely.
 
good, next time you stop forgetting have a drink. I can encourage black grouse, it's quite delicious
 
I just woke up this morning with the thought on my mind: "Maybe a design pattern?". I had the sense I'd actually read one once upon a time with the exact purpose of what I was doing. Hence me continuing down that train of thought, and coming here with it.
Did not think to approach it from the perspective of "what's a good approach for this solution? what stuff do I need to bear in mind?" etc until I was confronted and reached a point of needing to redraft completely.
 
aye. Actually looking at the history to your Q it's not clear to me why it was deleted, perhaps a heated comment exchange? shrug Anyway, hope it works out for you. And your pic thingy is weird and creepy BTW.
 
@JimmyHoffa Also re: the question being deleted, I could complete the redraft, and undelete the question, to better follow the simple: "I have this problem, I'm thinking of solving it this way, what would work well here?" sorta format I probably should've stuck to in the beginning. I'm not a programmers regular, so I may not be a good judge of what works well here: should I see to doing that?
 
@doppelgreener Sure, it's a good Q. Somebody will probably give you a better solution than mine, that was just the first thing that came to mind.
 
2:52 AM
@JimmyHoffa No, there's no heated comment exchange, if you can view the deleted question everything's there. Just: I have a couple of possible solutions here. That question was being challenged, and particularly, I had fallen into the SO pit where I am perceived as someone who doesn't really understand what I'm doing and now I must prove that, yes, I do, this isn't XY, please answer the question, etc, and did not really feel like dealing with that.
Turns out it was XY. I still don't like having to confront that atmosphere of "you don't know what you're doing" I sometimes get met with on here and SO, most of the time because I will get met by it no matter what I say or do.
 
Software patterns are mostly workarounds for less expressive programming languages. Most, if not all, of the patterns in the GOF book are Java workarounds for things that already exist natively in more expressive languages.
 
Sure. I'm relatively new to the professional area of the industry, so I missed the professional dialog around design patterns: it had been and gone before I entered.
 
@RobertHarvey true. It's like a time machine, really cool if you can't travel through time all on your own, totally useless to everyone else...just saying...
 
I just found out today that Singleton doesn't even exist in Javascript. In Javascript, you just make an object. That's it.
 
(I'm just shy of 25, been a software & UX developer consultant in a large company for a couple of years, done a whole lot of study and apparently I'm pretty solid on the technical side according to my managers.)
 
2:55 AM
@RobertHarvey doesn't in C# either. You just make a static. Singleton was actually a C++ thing
I think Java you can just make a static member and be done with it as well
 
@RobertHarvey That's true! It's creating instances that can be a problem. (They do have the concept of objects and a new keyword, but parts of the language's infrastructure on that side are problematic.)
 
(think)
 
@JimmyHoffa Jon Skeet would probably disagree with you on that one. He's got six different ways to make a C# singleton on his blog.
 
user55340
Its an object that enforces only one instance of itself.
 
@RobertHarvey I know. I call bullocks on all of them. He does too if I recall looking at it correctly - his "pattern" was basically all about making a thread safe static member
 
2:56 AM
@doppelgreener Javascript is a really cool language in some ways, if you can overlook its design errors.
 
@RobertHarvey I totally agree and I do.
 
Thread safety isn't an inherent part of the "singleton pattern" as @MichaelT just said, it allows only a single instance ergo singleton ergo static. Thread safety is a wholey separate concern.
 
Or rather, overlook & take steps to avoid.
 
@JimmyHoffa Ah, thread safety. Hadn't thought about that.
 
user55340
The thread safe static access is a key part in making sure that there is a single instance for some approaches to singleton design.
 
user20683
2:58 AM
@doppelgreener become familiar with Doug Crockford. He's not perfect when it comes to JS but he's got a lot of good things to ponder.
 
@WorldEngineer I have his Good Parts book and have read it cover to cover.
 
user55340
Personally, in Java, I like the enum singleton - there's only one instance of an enum field.
 
@MichaelT pfleh. Thread safety is inherent in C# though via static constructors, that's what Java's missing, I think?
 
user15026
@RobertHarvey Gonna curl up in bed with the parachute book and see what I can't mine from it :)
 
user20683
I'm gonna just go collapse
 
2:59 AM
This token thing is actually the first time I've had to worry about non-singletons in raw JS, come to think of it. Before now, all instantiation I've done has been in CoffeeScript.
 
@MichaelT all static reads are thread safe, it's updates you have to worry about, and replacing a static is just stupid, you replace members in the static so you don't need to lock and shit, but more importantly - you make the thing itself threadsafe and it no longer matters whether access to it is thread safe. Thread safety is so terribly misunderstood as you well know..
 
@AshleyNunn Enjoy. I have to finish reading mine.
 
parachute book? I wanna jump out of a plane too :( no fair.
 
user15026
This will be the first job advice book thing I have ever read. So I am curious to see how it goes.
 
@JimmyHoffa In my last project with the consumer/producer pipelines, I figured out that accessing a static variable in the pipeline was a great way to provide a communications channel between the pipelines. The purists would probably have an aneurysm.
 
3:03 AM
I refuse to read "How to make friends and influence people" or whatever it's called merely on the basis that it's a complete cliche that professionals suggest it and attribute success to it. Pfleh. I've been told to read it and I can heartily tell those who said such to eat a ****
 
user15026
@JimmyHoffa Yeah, that one always sounded less useful.
 
@JimmyHoffa Most of that book is just proof for the chapter titles, which say everything.
You can't win an argument, ever. If you want to gather honey, don't kick over the beehive. Criticism never works. Always tell the truth.
 
@RobertHarvey producer consumers are awesome. I wrote a journal just yesterday that was simple - on construction it starts a thread that polls a ConcurrentQueue<string> for shit to write, and writes everything in it until there's nothing left, then thread sleeps for the poll period before checking if there's anything new to write. The WriteToJournal(string message) just enqueues and dawdles off.
such a great way to deal with thread safety - use a thread safe data structure, let any thread write, and have a single reader thread.
Use signals if polling isn't fast enough and voila.
@RobertHarvey How about "Shit on people for money" ? That should be a chapter because the entire MBA profession has proven it's pure gold.
 
It worked great for me. Made dealing with threads very simple.
@JimmyHoffa That's what is so great about the book. Most of the pages are there to deal with the "Oh, but there must be some exceptions to the rules" crowd. No, there aren't.
 
@RobertHarvey works great for everyone, but people get caught up in patterns and well, from folk I've interviewed recently I've learned apparently very few people actually ever touch multithreading or know anything about it at all, which is strange
 
3:08 AM
I know enough to use producer and consumer threads. Lock synchronization is still a bit dicey for me. volatile? Forget it.
 
Must just be my experience- I've worked in enough highly concurrent systems that not becoming completely comfortable with multithreading hasn't been an option...
 
When there are so many better options available now like Task, immutability, async, etc., working with locks seems risky.
 
geez you'd think my cats would try to avoid the wet cement in my basement from the sewer line being replaced, nope, there will forever after be paw prints embedded in the slab beneath the carpet for as long as this house shall live...
dumbass cats, it's wet cement, it can't smell or feel good on your paws.
 
Now you know for certain that the cats own the house.
 
@RobertHarvey sure, but people don't seem to understand any of those things or locks, or really the idea of shared state and how to feel comfortable that you've protected it from race conditions. That's really what multithreading comes down to: Can you write code with shared state that can be executed in a highly concurrent situation and feel comfortable there's no race conditions? I can, I get the idea many others wouldn't even know what the question means based on the answers I've been given
@RobertHarvey I already learned that when they decided the entire basement was their urinal. If my wife wasn't an animal lover (ex-zoo-keeper, they don't get more hardcore unless you count PETA which is actually mentally unstable, not hardcore), these shites would have been gone years ago..
 
3:50 AM
@RobertHarvey What does chop-shop work mean in IT?
 
 
2 hours later…
5:32 AM
@doppelgreener It means little projects. As an example, I did a three-day job for the local newspaper a couple of weeks ago. It involved rehabilitating a VB.NET program that did some important work for their operation. I charged them $60 per hour; the company that I was referring to when I made the chop shop remark wants to pay half that.
Which, as far as I can tell, includes design work, requirements gathering, writing code, acceptance testing and signoff.
 
6:21 AM
@RobertHarvey Oh, thanks!
Yeah I can understand why you'd rather not go with them.
 
 
4 hours later…
9:53 AM
Hi. Can any C# folks here explain this bit of code : referencesource.microsoft.com/mscorlib/R/636e4f5bf81c5be1.html
is it referring to a winapi call?
 
 
2 hours later…
12:03 PM
 
12:38 PM
posted on April 24, 2015

This are sad news indeed. I am sure almost everyone here read at least one paper by Paul and many knew him personally. When I just started thinking about programming languages I was fascinated by DSLs and his work was simply inspiring. His voice will be missed. Discussions of Paul Hudak's work

 
1:25 PM
@ThomasOwens your first sentence is a bit hard to get through
 
@enderland I'll rework that. Thanks.
 
@ThomasOwens I would move a bit of the "why should you care you are reading this profile" stuff to the top, too
The first two paragraphs give your background but tell me little about what you like doing or why I should want you to work on my team (other than technical competence, but, you should be able to figure that just from the resume generally)
 
@enderland Isn't that the point of the summary? Although I see your point.
Yeah, makes sense.
 
Yeah it is, but if I'm reading say 10 or 20 of them, there's nothing in those paragraphs which makes me think, "oh Thomas Owens is an interesting person, let me read further"
 
Also, I took another MBTI last night. I do from time to time. Extravert (44%) iNtuitive (25%) Thinking (75%) Judging (56%).
 
1:33 PM
That's pretty close to me, though I'm about 50-50 on I/E
INTJ is what I normally "get"
 
@ThomasOwens Do you have one you like? There are so many.
 
Introvert(89%) iNtuitive(75%) Thinking(75%) Judging(56%)
oh hey look I'm consistent! ha
 
in Duga's Playground, 25 mins ago, by Duga
@EBrown yeah I had a feeling that is how this question was going to go. Should this go to the programmers stack exchange? — Robert Snyder 20 secs ago
(assisting @Duga)
 
Wow. INTP
Every other one I've taken I've been INTJ
 
1:42 PM
Probably being changed by a small company culture ;)
I am curious what percentage of people end up with what result from online tests
I feel like in ALL my circles most people are XNTJ
 
Introvert(56%) iNtuitive(12%) Thinking(75%) Perceiving(22%)
 
@durron597 that's pretty weak on N and P
 
oh i figured that meant it was very STRONG on those two numbers
like, 0% is maximum N, 100% is maximum S, 50% is in the middle
 
I don't htink so, I think it's a preference for
so 12% is a weak preference
 
Yeah. A low percentage means you could likely change to the other one in more situations.
 
user55340
1:57 PM
 
We all has [problems]
 
@MichaelT Is it in the stci question yet?
We have 9 , but...I got nothing.
 
but a malfunctioning tag system ain't one?
 
We'll go with that.
 
how do you link a tag in chat?
 
2:01 PM
do [tag:mytag]
 
ah, I see.
[tag:]
 
0
A: Structured Tag Cleanup Initiative Phase II Planning

durron597ergonomics It seems like people have already started working on this tag, it should be included in this

 
user55340
@ThomasOwens half the tag will dissapear with another delete vote.
 
@durron597 why call him?
 
user55340
2:15 PM
@ThomasOwens it's in durron's +13 one.
 
@ratchetfreak Because I figured you are highly likely to have already vtced them.
 
dang, I got there too late.
 
Thanks @ratchetfreak
 
user55340
And I ran out of votes early last night...
 
OK. Good. I'm hoping to take care of some low-hanging fruit first. Like knocking off the 32-bit/64-bit into word-size and any other merges or synonyms. I'll do that next week in prep for the May 1 kick-off of edits and closures and flags.
 
2:19 PM
@MichaelT down to 300 open, unlocked questions
 
@enderland How's the summary now? I just updated it.
 
Yeah I think that's better
 
Thanks!
 
Maybe change "I consider myself to be a well-rounded" to "A well-rounded"
"consider" comes across as pretty tentative
 
@ThomasOwens It seems to me that many / most of the wiki answers are getting tags, but not so much "what should we do with this tag"
"should the tag be blacklisted?" "should it be merged?" etc.
 
2:31 PM
@enderland Done. I caught myself doing that in a couple of places. I think I changed the other ones and missed that one.
 
@ThomasOwens engineering types tend to be fairly reserved when it comes to making declarative/absolute statements
 
in Duga's Playground, 2 mins ago, by Duga
Stack Overflow is for when you have an actual "problem", or bug. Right now, your question implies that you haven't even started coding yet. I don't know, but programmers.stackexchange.com might be what you are looking for. — cullub 45 secs ago
 
@SimonAndréForsberg Handled it, thanks
 
@cullub This question is much too broad for Programmers.SE. See What goes on Programmers.SE? A guide for StackOverflowdurron597 47 secs ago
 
man I have either gotten lucky or written good answers this week on Workplace... riding rep train again
 
2:45 PM
That will have 20 votes and make the hot questions list
 
sure why not
 
user55340
I'm doing nicely with history of cgi.
 
user41796
3:03 PM
I need help coming up with the correct google search terms
 
user41796
I have some forecast weather data from the NWS in an XML response
 
@GlenH7 what do you need?
 
user41796
They have "denormalized" the data to a degree where they provide several blocks with periods of time marked within them. And then there are other blocks with the actual forecast data. To assemble the full forecast, you have to combine the two blocks together
 
user55340
Btw, glance at forecast.io
 
user41796
What I'd like to do (I think) is to combine the two blocks to create an hourly forecast
 
user41796
3:05 PM
Or said another way, my requirement is to display hourly forecast for the next N days
 
user41796
and I need to expand out the time block "multiplied" against the forecast block
 
user41796
Sample A:
-<time-layout summarization="none" time-coordinate="local">
<layout-key>k-p24h-n6-2</layout-key>
<start-valid-time>2015-04-17T19:00:00-07:00</start-valid-time>
<end-valid-time>2015-04-18T08:00:00-07:00</end-valid-time>
<start-valid-time>2015-04-18T19:00:00-07:00</start-valid-time>
<end-valid-time>2015-04-19T08:00:00-07:00</end-valid-time>
<start-valid-time>2015-04-19T19:00:00-07:00</start-valid-time>
<end-valid-time>2015-04-20T08:00:00-07:00</end-valid-time>
<start-valid-time>2015-04-20T19:00:00-07:00</start-valid-time>
 
user41796
Sample B:
-<temperature time-layout="k-p24h-n6-2" units="Celsius" type="minimum">
<name>Daily Minimum Temperature</name>
<value>13</value>
<value>14</value>
<value>14</value>
<value>14</value>
<value>13</value>
<value>13</value>
</temperature>
 
user41796
So I'm trying to figure out the correct term for how that data is stored so I can search for either a technique to jam it all together or see if someone has already done that for me.
 
user41796
3:10 PM
@MichaelT Thanks, I will. Currently, I'm limited to NWS but we're going to want to expand beyond just their service area.
 
user55340
@GlenH7 it has multiple forecast models.
 
user55340
 
user41796
@MichaelT My main limitation at the moment is we already have existing code pulling from NWS and my task was to update the number of data points we were pulling in.
 
user41796
Existing code was written by dearly-departed from the team, and it's ... an ugly mess
 
user41796
3:14 PM
So my hope was to figure out how others tackled that problem of cross-referencing the data blocks against each other
 
19 hours ago, by Chad
Anyone want some spagetti... im drowing in it :(
 
user41796
@durron597 I noted his comment yesterday with a touch of irony, yes
 
user55340
@GlenH7 evil xslt or suck it up and rebuild data structures.
 
user41796
XSLT may be a lesser evil in this case.
 
user55340
You say that now.
 
user41796
3:16 PM
Is there a term for the "de-normalization" technique that NWS used though?
 
user41796
@MichaelT You don't know how crappy dearly-departed's code is
 
user55340
Even good xslt is its own circle of hell.
 
Are there better alternatives to XSLT?
I looked at the data above, and my first thought was to parse it and read it into some data structures. Then, you can do whatever you want with it.
Slice it and dice it, make julienne fries.
 
user55340
@RobertHarvey the road of good intentions takes you to the next circle.
 
user41796
@RobertHarvey That's what I'm leaning towards as well
 
3:19 PM
Most folks do this the hard way. If your XML is well-formed, you can model it with classes and read it with a generic reader. No need to write a custom parser.
 
user114359
@RobertHarvey depends on the class: is it an auto-generated class such as a DAO? Is it one-off?
 
user41796
My rough thought is that I know I'll need N hourly row entries in the datatable. From there, I can take each of the time blocks; find their associated value blocks; and then fill it out
 
user41796
@RobertHarvey How so?
 
user41796
and yes, the XML is well formed
 
Are you working in c#?
 
user41796
3:20 PM
yes
 
OK, brb.
 
user41796
So full generic container & linq support
 
user41796
Worth noting: I have t blocks of time, and each block of time will have 1 or more blocks of forecast data associated with it.
 
user41796
all blocks of t have the same start time and the same end time. But they will have varying amounts start / end times within the block
 
user114359
It isn't even noon yet and I'm already out of CVs.
 
3:25 PM
@Snowman welcome to programmers.SE
 
user114359
@ratchetfreak you are four years too late
 
user41796
He's referring to the common theme of regulars in here constantly being out of CVs
 
user55340
Some days are worse than others.
 
@Snowman CVs? or CVNs?
 
user114359
I know, I know... it won't be so bad after we clean up the old off-topic questions.
 
user55340
3:31 PM
Tag clean ups hit the queue hard... Though there are more than a few new problem questions.
 
user114359
Hopefully Thomas' work with the tag cleanup will help there
 
I was out two hours ago
 
CV-6 - USS Enterprise
 
user55340
Interesting ship. Four reactors - each a different design.
 
@MichaelT redundancy
 
user55340
 
Nah, that was CVN-65
 
if one gets obsoleted the others will still be fine
 
user55340
@ratchetfreak not really. They didn't know what design or layout worked. So they did one of each.
 
user55340
(My brother was in the engineering nuke program in the Navy)
 
user55340
@enderland correct. Just a neat series to watch.
 
3:45 PM
I love reading about the original CVs... WWII naval stuff is fascinating
 
user55340
Read about the new littoral ships?
 
user55340
The littoral combat ship (LCS) is a class of relatively small surface vessels intended for operations in the littoral zone (close to shore) by the United States Navy. It was "envisioned to be a networked, agile, stealthy surface combatant capable of defeating anti-access and asymmetric threats in the littorals." The Freedom class and the Independence class are the first two LCS variants, both are slightly smaller than the U.S. Navy's guided missile frigates and have been likened to corvettes. They have the capabilities of a small assault transport, including a flight deck and hangar for housing...
 
@MichaelT yeah. I find it really... fugly to say the least ;)
 
user114359
A late answer that actually adds something substantial to the existing answers (should be the accepted answer in my opinion):
 
user114359
1
A: How should a senior programmer monitor another senior programmer?

RemcoGerlichStart doing code reviews. Whenever he has some feature finished, go through all the changes together and discuss them. Do the same thing for all your code, discuss your code with him too. That way you can both make sure the other doesn't mess up, you both know what the other is doing, you can de...

 
user55340
Two designs. One is the trisomething hull. Other is more traditional.
 
user55340
USS Freedom (LCS 1) is the lead ship of the Freedom class of littoral combat ships (LCS). She is the third vessel of the United States Navy to be so named for the concept of freedom. She is the design competitor produced by the Lockheed Martin consortium, in competition with the General Dynamics-designed USS Independence. She was officially accepted by the Supervisor of Shipbuilding Gulf Coast on behalf of the US Navy from the Lockheed Martin/Marinette Marine/Gibbs and Cox team in Marinette, WI on 18 September 2008. She is designed for a variety of missions in shallow waters, capable agains...
 
user55340
(Go Wisconsin!)
 
this training video I'm listening to keeps talking about "the enterprise." making me amused right now
@MichaelT yeah. I really like the traditional look of ships, ie late 1930s (before they were splattered with AA)
 
user55340
An ironclad was a steam-propelled warship in the early part of the second half of the 19th century, protected by iron or steel armor plates. The ironclad was developed as a result of the vulnerability of wooden warships to explosive or incendiary shells. The first ironclad battleship, Gloire, was launched by the French Navy in November 1859. The British Admiralty had been considering armored warships since 1856 and prepared a draft design for an armored corvette in 1857; in early 1859 the Royal Navy started building two iron-hulled armored frigates, and by 1861 had made the decision to move to...
 
user55340
3:52 PM
 
@MichaelT those are also neat, though more the confederate ones (monitors look.... dumb)
 
user55340
Uh uh. And compare that to a modern destroyer?
 
user55340
 
I vastly prefer the WWII era destroyer appearance with current ones ;)
 
user55340
3:55 PM
The Zumwalt-class destroyers are a class of United States Navy guided missile destroyers designed as multi-mission stealth ships with a focus on land attack. The class is a scaled-back project that emerged after funding cuts to the larger DD-21 vessel program. The program was previously known as the "DD(X)". The class is multi-role and designed for surface warfare, anti-aircraft warfare, and naval fire support. They take the place of battleships in filling the former congressional mandate for naval fire support, though the requirement was reduced to allow them to fill this role. The vessels...
 
user55340
Compare that to confederate ironclad.
 
I like the late 1930s era stuff, not as much the Civil War era
The late 1800s have some bizarre... experiments
 
user55340
Meh. Tall ships for elegance of design.
 
It's kinda crazy how far apart Refiner and Illuminator badges are
50 -> 500
getting Refiner is not that easy
I mean, geez, I don't even have 500 answers on SO
 
psr
@durron597 - How would you recommend getting Urquan Masters? Source Forge has become a borderline malware distributor. I guess just build from the Source Forge source?
 
4:06 PM
@psr I've only ever gotten it from here:
I haven't had any malware problems with that link.
 
psr
Oh, cool. Looking at link I could probably just do apt-get install UQM on a VM.
 
@psr Sure... though I think you're being more paranoid than necessary
I agree about sourceforge in general but in specific I've never had a problem with those installers.
 
I dislike the sourceforge "fake download" ads
 
psr
@enderland I feel like I'm defusing I bomb when I use that site. "Click the red button - no the blue, the blue!"
 
@enderland those you find nearly everywhere
 
4:16 PM
@GlenH7: OK, here's your generic serializer and deserializer:
    public static class Xml
    {
        public static string Serialize<T>(T obj)
        {
            var serializer = new XmlSerializer(typeof(T));
            var settings = new XmlWriterSettings { Indent = true };

            using (var textWriter = new StringWriter())
            {
                using (var xmlWriter = XmlWriter.Create(textWriter, settings))
                {
                    serializer.Serialize(xmlWriter, obj);
                }
                return textWriter.ToString();
To use it with your XML, you need XSD.EXE, which should already be on your computer. I fed XSD.EXE your XML, and got this style sheet:
<?xml version='1.0' encoding='utf-8'?>
<xsl:stylesheet version='1.0' xmlns:xsl='http://www.w3.org/1999/XSL/Transform'
xmlns:dme='dme'
exclude-result-prefixes='dme'>
  <!--<xsl:param name='transformDateTime'/>   Can use this once rest of code is working-->
  <xsl:template match='/'>
    <html>
      <head>
        <title>Documents</title>
      </head>
      <body>
        <h1><xsl:attribute name='style'> color:red</xsl:attribute>Documents</h1>

        <!--<p>Transform DateTime <xsl:value-of select='$transformDateTime'/></p>-->
Then I fed that into XSD.EXE again, and got this C# class:
//------------------------------------------------------------------------------
// <auto-generated>
//     This code was generated by a tool.
//     Runtime Version:4.0.30319.34014
//
//     Changes to this file may cause incorrect behavior and will be lost if
//     the code is regenerated.
// </auto-generated>
//------------------------------------------------------------------------------

using System.Xml.Serialization;

//
// This source code was auto-generated by xsd, Version=4.0.30319.33440.
 
user41796
@RobertHarvey oh I like this!
 
Which is ridiculously conservative, of course. You can write these by hand, and for your XML, you need about a dozen lines of code to represent it. But, so long as XSD is willing to produce it, we get it for free.
Here's the test program:
        static void Main(string[] args)
        {
            var file = File.ReadAllText(@"C:\test\stuff.xml");
            timelayout obj = Xml.Deserialize<timelayout>(file);
            string target = Xml.Serialize<timelayout>(obj);
            File.WriteAllText(@"C:\test\target.xml", target);
        }
 
user41796
Yeah, and it's trivial for me to run the full XML output that I have against that in order to create the full class
 
Which is just a loopback. It produces the output:
<?xml version="1.0" encoding="utf-16"?>
<time-layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" summarization="none" time-coordinate="local">
  <layout-key>k-p24h-n6-2</layout-key>
  <start-valid-time>2015-04-17T19:00:00-07:00</start-valid-time>
  <start-valid-time>2015-04-18T19:00:00-07:00</start-valid-time>
  <start-valid-time>2015-04-19T19:00:00-07:00</start-valid-time>
  <start-valid-time>2015-04-20T19:00:00-07:00</start-valid-time>
  <start-valid-time>2015-04-21T19:00:00-07:00</start-valid-time>
Anyway, your data is in that auto-generated CS class, once you deserialize it.
 
user41796
Surprisingly, I don't have xsd.exe on my system. But that's easily rectified
 
user41796
4:24 PM
So at a broader level, I'll:
feed the xml into xsd.exe to get a foo.xsd file.
feed foo.xsd into xsd.exe to get the class
 
Yes. Use the /C switch to get the class. I used it both times, thinking I'd get the class right away, but it figured out I was an idiot, and just made the XSD.
 
user41796
And then I can use the serializer function you provided to populate instances of the class from the live data I pull.
And then I can move the xml class data into a DB class that I use to store it
 
Right on.
 
user41796
"Happy dance!"
 
It's all done with Reflection, so don't expect blazing speeds.
 
user41796
4:27 PM
The existing solution is soooo ugly. Lots of nested switch statements based upon the level type
 
what is xsd.exe? something that ships with VS?
 
user41796
@RobertHarvey pffft. This will run once an hour. No expectation of super fast speeds
 
@durron597 On my system, it's in the folder C:\Program Files (x86)\Microsoft SDKs\Windows\v8.1A\bin\NETFX 4.5.1 Tools
And a few other places as well.
 
user41796
W00t. Found it. :-)
 
psr
@GlenH7 Or you can use the LINQ to XML and do the transform by building the objects you want from that, rather than going from XML to objects that match XML to objects you want. Both work pretty well.
 
user41796
4:32 PM
@psr I had just started down that path while Robert was working his magic with xsd.exe
 
user41796
It appears that using the xsd.exe approach is going to work better for me as it auto-generates all the magic I need to populate the class object. Otherwise, I'll have a fairly lengthy LINQ query to write.
 
user41796
There's roughly 15 points underneath 8 parameter types
 
user41796
Or more broadly - there are L locations, N time-layout blocks, and 15 points per location underneath 8 parameter types
 
user41796
I think that pushes me towards using xsd magic with the understanding that if my parameters increase I have to recreate the class
 
user55340
4:41 PM
0
Q: Give extra close votes, only accessible via /review

MichaelTWith question and answer up and down votes, one has so many they may cast per vote period. From What are the limits on how I can cast, change, and retract votes? : Thirty post votes per day per user (includes upvotes and downvotes) Up to ten additional question-only votes per day per us...

 
user15026
@michaelT that sounds like a solid proposal to me.
 
I like it.
 
user55340
anything to get more people in /review.
 
user55340
Scales nicely with site activity too. Sites that don't need it, don't need it.
 
user55340
Builds on existing SE voting principle.
 
4:47 PM
So after two days of having SIT tones on my outgoing answering machine message, the telemarketer calls have all but stopped.
I've even had a couple of friends leave messages. They just ignore the tones.
There's one company that lets it ring for a couple of times, and then disconnects. But I ignore them. I've got number of rings set to 3 right now.
 
The 'Programmers' StackExchange site (programmers.stackexchange.com) may be a better place for you to as this question. — narner 45 secs ago
 
user41796
@RobertHarvey score one for the little guy! Take that big, evil, biz!
 

« first day (1694 days earlier)      last day (3299 days later) »