« first day (1855 days earlier)      last day (3134 days later) » 

12:02 AM
@durron597 utter nonsense. I remember people I've met and even worked with for years horribly. I however have strong memories of the people I worked with who did something during that period that really stuck out. Ok, all things being equal, I think I was hit in the head a bit much because I don't remember names or details of people for a damn altogether.
 
user41796
12:45 AM
Both current and previous employers did, yes. That and drug screens. They're supposed to disclose ahead of time if it's a credit check as well. Generally, it's just a criminal background check to see if you come up on any known offender lists. And even if you do, it's not necessarily a deal killer.
Generally, companies use a 3rd party to perform the check which in turn runs your name against a number of registries. The 3rd party then sends a reply back to the hiring company to the effect of "nothing found" or "XYZ was found."
 
user41796
Some roles I've had excluded felons as part of the job description. Other roles I've had relied upon above average credit ratings as a proxy of being financially trustworthy.
 
1:43 AM
@GlenH7 You here?
 
1:58 AM
Hi, I'm GlenH7.
Version two.
Not buying it, eh?
 
user55340
Wouldn't that be GlenH8? All the H8... grumpy and the like?
 
Perfect.
 
user55340
Because there is nothing you H8 more than crossposting?
 
user55340
-1
Q: How can I create a countdown loop with message boxes?

rooroo26I am having a hard time finding a code that will allow me to do this with Microsoft Visual C#. How can I create a loop to display 10 message boxes, each with a countdown from 10 to 1 when I click ? I also need to change the text of the TimeLabel to how the correct number(countdown from 10 to 1)....

 
user55340
2:00 AM
Ahh... the good ole days.
 
user55340
A nice amber VT52 on your desk, ed as your editor and everything was good.
 
This one was actually white phosphor. We were stylin', man.
I kinda miss that machine. Though I don't miss cassette tape.
 
user55340
There's still something about amber and green screens that makes me feel nostalgic.
 
user55340
Less harsh on the eyes... better for that dimly lit terminal room late at night.
 
My first 386 came with an amber display. Burn-in was a real problem.
You had to be real careful not to leave it on.
 
user55340
2:03 AM
The lab I spent most of my time in in college had two amber, and two green.
 
user55340
Had a screen saver - it was always on.
 
2:18 AM
rooroo26 hit my patience threshold.
2
A: How can I create a countdown loop with message boxes?

Mohit ShrivastavaAre you looking for this for(int i = 10; i > 0; i--) { MessageBox.Show("Your Message " + i, "Your Title " + i); }

(see comments below the answer)
Mad skillz, and a name that sounds like Scooby Doo.
 
user114359
2:40 AM
@RobertHarvey That is one of those questions I just add my vote to and walk away from. Although I have to say that Blorgbeard is a sweet name.
 
This might be a better fit over on programmers.stackexchange.comj08691 52 secs ago
 
user114359
@RobertHarvey he's at it again:
 
user114359
0
Q: How to get a label to display 2 random variables (multiplication question app)

rooroo26Relevant labels for this app: 1. SubmitButton 2. PromptLabel 3. NewButton In my application here is the code I have thus far: private void NewButton_Click(object sender, EventArgs e) { Random rand = new Random(); int var1 = rand.Next(10); int var2 = r...

 
@Snowman I finally just deleted his Stack Overflow question.
 
user114359
@RobertHarvey I bet he is thrilled that you "followed" him over to Programmers
 
2:52 AM
pfft.
 
3:05 AM
@FilipeMerker: Javascript was a language that was designed in 10 days, and released essentially unchanged in Netscape Navigator a few months later. 'Nuff said? For comparison, Rich Hickey worked on Clojure for 2½ years before releasing the first version. — Robert Harvey ♦ 16 mins ago
 
user55340
@RobertHarvey did you know that WHYT is not blocked on P.SE?
 
user55340
You may also find what have you tried to be a useful resource when trying to formulate a question. You need to demonstrate that you are not just trying to get other people to do your work for you, that you are capable of solving the problem yourself when given the proper resources, and that you won't immediately turn around and ask about the very next step you are to take. — MichaelT 26 secs ago
 
"What have you tried?" has a long and colorful history on Stack Overflow. It begat the "minimal understanding" close reason, quietly retired due to much wailing and gnashing of teeth, and the utter incapability of the community to understand and use it properly.
That was somehow never a problem on Programmers. At least, not one that warranted a "minimal understanding" close reason. Too Broad and Unclear What you are Asking cover the bases quite nicely anyway, even on Stack Overflow.
 
user114359
To give one specific example, I use Rubber Duck Debugging on a regular basis and I am a very senior-level developer (the author alludes that it is a beginner technique: it is useful for anyone). I think that will help you here: read the paragraph on that debugging method, then step through your program. I am confident it will help. — Snowman 2 mins ago
 
user114359
I am serious too, I use rubber duck debugging almost daily. I can't remember what I ate for breakfast, let alone what code I wrote ten minutes ago. I need all the help I can get.
 
3:11 AM
Meh. He's already gone. Probably to Yahoo Answers or Quora, in the hope that someone will write his program there.
 
user114359
I'm sure his give-a-damn is broken and he will ignore our advice, but at least it can be a signpost for someone else.
 
user55340
He's one more closed question away from either severe rate limiting or a ban here.
 
user114359
 
If you write Javascript code in a functional style (that is, incorporating the ideas of functional programming such as immutability, referential transparency, etc.), then yes, you can claim that it's functional programming, or at least code that is written in a functional style. — Robert Harvey ♦ 16 mins ago
 
user55340
3:27 AM
@RobertHarvey My first lisp program... back when I was in college taking an AI class... when critiqued / reviewed by a emacs / lisp guy commented on it as "You write beautiful C in that Lisp code"
 
user55340
The point being "sure, you can write functional styled code in Javascript if you want. You can write procedural styled code in Lisp if you want. At the end of the day, all that matters is 'can you maintain it?'"
 
Well, that's not all that matters.
"Write-only code" can be very useful in some performance scenarios.
 
user114359
3:50 AM
@RobertHarvey I have seen Perl used many places, but nowhere performance-critical.
 
7:27 AM
Maybe Programmers would be better for this. — Peter Wood 42 secs ago
 
 
3 hours later…
10:36 AM
Your question is very broad and very unspecific, please consider revising it to focus on a particular, programming-related problem that can be answered unambiguously. Or try programmers.stackexchange.comNobilis 11 secs ago
 
11:14 AM
Wow, that is ballsy to sing the song a professional opera singer couldn't without having technology
 
 
1 hour later…
12:38 PM
Happy Coffee Day
 
1:10 PM
@Nobilis questions which are too broad on one Stack Exchange site are nearly always too broad on others. In this case, as written this question will be quickly closed/downvoted/deleted on programmers.stackexchange.com — enderland 47 secs ago
 
user55340
@Telastyn Yep. And she did it. Notice how the judge was "yep" as soon as the first note was hit.
 
user55340
I wonder what the original sounded like.
 
the original?
 
user55340
Lucia di Lammermoor is a dramma tragico (tragic opera) in three acts by Gaetano Donizetti. Salvadore Cammarano wrote the Italian language libretto loosely based upon Sir Walter Scott's historical novel The Bride of Lammermoor. Donizetti wrote Lucia di Lammermoor in 1835, a time when several factors led to the height of his reputation as a composer of opera. Gioachino Rossini had recently retired and Vincenzo Bellini had died shortly before the premiere of Lucia leaving Donizetti as "the sole reigning genius of Italian opera". Not only were conditions ripe for Donizetti's success as a composer,...
 
user55340
> The "Mad Scene" aria "Il dolce suono" appears in the Luc Besson film The Fifth Element in a performance by the alien diva Plavalaguna (voiced by Albanian soprano Inva Mula and played onscreen by French actress Maïwenn Le Besco).
 
user55340
1:12 PM
So, how did it sound in 1835?
 
Before technology you had to actually be good to sound good, whereas now you can do all sorts of things to fake being good!
 
user55340
There's also the queen of the night aria that is crazy in what the voice can do.
 
user55340
(skip to 2:50 if you want the crazy voice things)
 
user55340
It takes a particular type of soprano to be able to sing it:
 
user55340
1:16 PM
A coloratura soprano is a type of operatic soprano voice who specializes in music that is distinguished by agile runs, leaps and trills. The term coloratura refers to the elaborate ornamentation of a melody, which is a typical component of the music written for this voice. Within the coloratura category, there are roles written specifically for lighter voices known as lyric coloraturas and others for larger voices known as dramatic coloraturas. Some roles may be sung by either voice. For example, Donizetti's Lucia di Lammermoor was famously done at the Metropolitan Opera for many years by lyric...
 
interesting
 
user55340
The Magic Flute (German: Die Zauberflöte), K. 620, is an opera in two acts by Wolfgang Amadeus Mozart to a German libretto by Emanuel Schikaneder. The work is in the form of a Singspiel, a popular form that included both singing and spoken dialogue. The work premiered on 30 September 1791 at Schikaneder's theatre, the Freihaus-Theater auf der Wieden in Vienna. == CompositionEdit == The opera was the culmination of a period of increasing involvement by Mozart with Schikaneder's theatrical troupe, which since 1789 had been the resident company at the Theater auf der Wieden. Mozart was a close friend...
 
user55340
> Mozart evidently wrote keeping in mind the skills of the singers intended for the premiere, which included both virtuosi and ordinary comic actors asked to sing for the occasion. ... In contrast, Mozart's sister-in-law Josepha Hofer, who premiered the role of the Queen of the Night, evidently needed little such help: this role is famous for its difficulty. In ensembles, Mozart skillfully combined voices of different ability levels.
 
user55340
> The vocal ranges of two of the original singers for whom Mozart tailored his music have posed challenges for many singers who have since recreated their roles. Both arias of the Queen of the Night, "O zittre nicht, mein lieber Sohn" and "Der Hölle Rache kocht in meinem Herzen" require high F6, rare in opera. At the low end, the part of Sarastro, premiered by Franz Xaver Gerl, includes a conspicuous F2 in a few locations.
 
user55340
That particular aria is:
 
user55340
1:19 PM
"Der Hölle Rache kocht in meinem Herzen" ("Hell's vengeance boils in my heart"), commonly abbreviated Der Hölle Rache, is the second aria sung by the Queen of the Night, a soprano coloratura part, in Mozart's opera The Magic Flute (Die Zauberflöte). It is considered to be one of the most famous opera arias, highly memorable, fast paced and menacingly grandiose. It is often referred to as the Queen of the Night's Aria despite the fact that the Queen of the Night character sings another distinguished aria earlier in the opera, "O zittre nicht, mein lieber Sohn". The aria forms part of the second...
 
user55340
And if you're familiar with music, this should scare you:
 
user55340
 
user55340
But yea, there are some people who can do crazy things with their voice. Its hard, and its one of those "if you find the person who can do it - they get the role. period." Fifth element had the advantage of technology that it didn't need to be as selective.
 
1:57 PM
@enderland So, yeah, I'm definitely in a situation where if I accept the offer, I want to do it ASAP for reasons
 
Yeah, totally understandable
 
if I start Nov 2 then I'll have three weeks of work before thanksgiving and I definitely want to visit my family as I've traditionally done plus i'm going to be even farther from them now
but if I start like, Nov 16 then it's... yuck.
 
alternatively you could just wait to start after thanksgiving too (maybe? that's pretty far out still)
depending on how you feel your current place would like it, you may be able to help with some of your transition worries that way too?
Not sure how Employer+ might feel about that though
 
they are never going to be able to find a body to replace me in two weeks or a month.
 
well sure, but you can focus on transitioning stuff (as best possible?) or at least feel better about having tried if they just try to get as many new features as possible out of you
 
2:04 PM
there's a reason Employer+ is giving me such a large raise... this place was able to get me on the cheap because I had played poker for 4 years
but now i've been a programmer for three. actually my third year anniversary is something like next weekish, i forget the exact day
 
@durron597 You played poker as a living?
 
@ThomasOwens yep
Why do you think a HFT shop was the first job I was able to get when I decided to start using my degree again? ;)
 
@durron597 ugh, you've only been doing this 3 years? everyone here makes me feel like an idiot super inexperienced/n00b :P
 
@durron597 No clue.
But I guess it makes sense?
 
@enderland well i was a programmer from early 2005 -> 2008, poker 08 - 12, this job 12 - 15
 
2:11 PM
I.. guess that helps :P
 
I don't even know what kinds of special domain knowledge or skills you need for HFT.
I barely know what HFT stands for. :\
 
> And anyone who bought made a killing. Hunsader had no way of knowing who was who, because this information was deemed confidential. It was like watching a game of poker between players wearing masks.
HFT = High Frequency Trading
The similarities between finance industry and professional poker is actually more similar than I thought when I was just playing cards all day
 
@ThomasOwens it's all about probabilities and risk analysis with mathematical algorithms - lots of signal processing akin to in control systems - applied to financial instruments et al. Lots of math and yeah like @durron597 said - all the probability analysis and risk weighting makes it a great deal like poker.
 
2:28 PM
well, to be clear, there are two kinds of trading
there is arbitrage trading, which basically means "the market is inefficient in some way, here is a mathematically guaranteed way to make money"
for example, if i buy euros on exchange A and sell them on exchange B and make money because at that moment the prices are different enough that I can beat commissions and so forth
the problem is, because arbitrage trading is free money and is really simple, you don't need to be particularly smart to do it; you just need really fast computers and a really good network connection
(because everyone is trying to do it)
s/everyone is/enough people with lots of money are/
that isn't like poker so much.
predictive trading is an attempt to analyze what will happen in the near future
 
user41796
2:47 PM
@durron597 - my general answer would be to wait and assume it isn't going to happen.
 
user41796
Letting $300 pressure your decision is a bit foolhardy when you're trying to make a decision that will have tens of thousands of dollars in impact as well as lasting for years.
 
and I'm pretty sure any signing bonus is more than $300 :)
 
user41796
To put it in perspective, you dropped quite a bit more at the table when you were in Vegas recently. And while you didn't intend to drop that amount, it was something you could afford, otherwise you wouldn't have played. And presumably, you got some value out of the time (entertainment) while you were playing.
 
user41796
Write the $300 late fee off as an opportunity cost and banish it from your consideration.
 
user41796
I understand that may be her $300 and not your $300, but the fundamental principle is the same here
 
user41796
2:52 PM
You've got options A, B, and C (current) that you need to weigh and investigate and it sounds like you can't get more information regarding B for a bit longer. In comparison, $300 is trivial and shouldn't rush your decision in light of the fixed schedule for information gathering.
 
user41796
A different analogy comes to mind - when you're playing poker, you try to keep a fixed expression going so that other players can't predict what's in your hand. This is the same type of a thing, but at a bigger scale. Don't make any obvious tells until you can lay out your hand and sweep the pot.
 
@durron597 true, they are a bit different. Arbitrage is a huge money maker on the exchange markets
 
@GlenH7 okay
That's what I've figured
 
Just out of curiosity - you aren't doing arbitrage are you? Just the stuff you've talked about has sounded far more like you're doing predictive signal analysis, but perhaps I'm wrong. On the other hand, it's none of my business :)
 
Yes, 100% predictive
I wouldn't choose Java for arbitrage, I'd choose C++ or even C
And I'd do the legwork of super ridiculous optimizations required to make those languages faster than a managed language
 
user41796
3:00 PM
@durron597 You're a card away from having the winning hand, but you're not quite there yet. So you gotta play the game accordingly
 
@durron597 yeah, arbitrage is where you start talking about those people who are skipping TCP and working directly on their NICs juggling frame buffers
 
@JimmyHoffa exactly.
I'm fast, but I'm not trying to shave off tens of microseconds yet.
 
user41796
@JimmyHoffa The exchange I interviewed at optimizes the hell out of their communication stack. But it's all TCP, IIRC
 
@GlenH7 streams or UDP? Even video games use UDP for performance, but to be fair they may still be using TCP but that doesn't mean they're using a standard TCP stack - when people are juggling their NIC frame buffers on their own they are often still communicating by some standard protocol, they're just doing it hackily skipping the robustness provided by a typical OS's IP stack in favor of higher performance
 
user41796
Pretty certain they used TCP as that was the lingua franca. But yes, customized to all get out.
 
3:05 PM
When it comes to pure speed of data transfer, reliable UDP for the win. You effectively get TCP, but with individual data packets that may come out of order (reordered on receiver, if necessary) and no overhead of the ramp up (and no decline if a packet is missed).
 
yeah; TCP is just a protocol, doesn't mean you can't get faster TCP by skipping a standard stack going straight to the NIC on your own. There are some really interesting things out there for stuff like this; I recall a super-high performant but higher failure form of TCP some people came up with years ago but it required both sides to use the technique to get the improvements...gotta go look it up now..
@ThomasOwens yeah the exchange at Employer^ was all UDP multi-casting for instrumentation and redundancy
 
@JimmyHoffa Was it just UDP or were they using a UDP-based protocol?
 
@ThomasOwens I didn't work on it directly; don't know the details other than it was just doing UDP broadcasting and the story was they scratched it up themselves.
 
user41796
@JimmyHoffa I could well be wrong - we didn't get super deep into that level of detail.
 
@durron597 FYI a side effect of hearing your process over the past few weeks is that combined with the recent SE blog post, it's making me seriously consider whether my current role is what I want to be doing right now...
 
user41796
3:10 PM
@enderland Didn't you read the rant in here about that post?
 
@enderland What do you mean?
I do use a driver that skips the OS but I think it's still TCP. Honestly the low level network part of what I do is offloaded to a third party firm
 
@GlenH7 oh yeah, I have similar objections to that post - but what it did is make me consider, "does this job really get me where I want to be?" and "where will the job that I'm in now get me in the future?" and the answers to those is basically "cooshy and boring job dealing with frustrating technology"
 
@enderland how long have you been there?
I know it's recent but I forget how recent
 
@durron597 I've been in this current role for about 5 months now (mid-April). Doing ETL type of work, which I am good at since I'm a detail person but, it's not really the most engaging work and the tool which we use is horrible (and has nearly no good documentation at all)
 
user41796
@enderland On the flipside, it's a very secure role which affords you time to finish your degree project.
 
3:14 PM
I'm nearly guaranteed to be relocating after my wife graduates school in december too, which is part of this, the job market there for non-current company is pretty weak (where I'm at currently has a LOT more external options)
@GlenH7 yeah, this is true
It's one of those things where everything about the job is great but the technology I work with is horrible
 
user41796
Technology will change, that's guaranteed
 
@GlenH7 idk, this is an SAP tool, it's like.... the skeleton of this company - it's not likely to change in the next 3-5 years at least. :P
 
@GlenH7 shit. I thought I was sorted out for the rest of my career :|
 
user114359
@enderland One day, the devil was feeling especially evil. Abusing puppies just wasn't evil enough, so he created SAP.
 
user41796
@enderland There's a lot of cobol consultants out there making serious bank working with horrible technology. Just saying....
 
3:17 PM
@GlenH7 oh yeah. I totally believe that if I want to optimize my career earnings I should just stick doing what I'm doing and become an expert in it (since I can do the people thing I'm basically guaranteed great income for my career)
 
user41796
@MetaFight Hopefully your career won't stay in its immediate state. Otherwise, you are sorted out for the rest of your career. :-P
 
the last 2 years or so of my dad's career was teaching Indian guys to write Cobol.
after spending 40-some years writing Cobol.
 
user41796
@enderland For as much value as you place on your outside-of-work activities, there is great wisdom in that path.
 
@GlenH7 Some people seem to like a stagnating career. Not me, unfortunately.
 
user41796
@MetaFight Based upon some of the things you had mentioned, I'm not surprised you needed a walkabout.
 
3:20 PM
I'm living out of a tent this week. It's very refreshing (literally and figuratively).
 
user41796
I was camping this past weekend, too. Fortunately, just a quick overnight. But it was nice to get out into the forest
 
@GlenH7 yeah, that's the trick though eh?
 
user41796
Experience and age bring about the wisdom in seeing those things more clearly.
 
@enderland Ugh, this is the worst amount of time
 
@GlenH7 25 years from now I'll be there: "Can you fix up our horrible .NET legacy?"
 
3:23 PM
"yes, but it'll cost you $500/hr"
"ok"
"no you were supposed to say no"
 
It's just long enough to begin to scare a future employer, but it's also the farthest from the other side "I know he'll stay for at least X years"
 
user41796
@JimmyHoffa "Yes, yes I can. That will be$500/hr, please."
 
@durron597 well fortunately I've been with this company for 5.5 years now since my first internship (wow that is a long time)
 
@enderland oh, so if you left externally you can say "i was there for 5.5 years" not "i was there 5 months"
 
user41796
How would you name a list of lists?
 
3:24 PM
aye, I used to work with a guy in .NET who left it for a COBOL position for exactly that reason. I sure enjoy staying current and working with latest stuff, but there'll come a day where I'll just be happy to keep working on shit and resolving people's terrible .NET legacy seems like a grand approach
 
zomg wtf roflcopter I just asked a question on main
1
Q: How do I store multiple views of data in memory?

durron597I have a bunch of modules. I can break these modules into different categories that are complete and do not overlap. For example, three categories, with ids that can be expressed as Animal, Vegetable, and Mineral. I further break these categories down into subcategories, which again are distinct,...

it's probably really unclear / too long, let me know if you see places where I can clean it up
 
@durron597 yeah something like that, though because of my rotational program I've become conditioned to be a perpetual job hopper (#cynicism)
 
user41796
@durron597 VTC'd because I'm still groggy and feeling spiteful. :-)
 
user41796
@enderland Break the cycle. Free your soul of the corporate conditioning. :-)
 
@GlenH7 Well I'm glad someone negative VTCed to cancel it out then
 
3:26 PM
@durron597 ...you genuinely should learn Haskell. Of all the people here- you would enjoy it the most and probably understand it the best given your interest and approach to data analysis...
 
user41796
@durron597 I was too tired to make all those clicky-clicks anyway.
 
@JimmyHoffa Freshman year I was the best OCaml programmer amongst my friends
too bad I haven't looked at it since 2000, literally
 
@durron597 doesn't surprise me, you obviously have a strong math bias. The tricks you'd learn for managing state and analyzing data from Haskell are all 100% usable in other languages, you'd find it worth your while for sure.
 
I believe I am also the best OCaml programmer amongst my friends.
 
@Telastyn freshman fall CS101 at my school is an OCaml class, it's actually a relevant sentence :)
 
3:31 PM
:D
 
alternatively, you both might just have no friends... (null check? :)
 
@durron597 so.. you need a flat view of the data - at all times ? Because if you can make it an on-request thing, just providing a flat iterator at the root that does a recursive flattening visitation wouldn't be hard at all...
 
@JimmyHoffa The flat view is what gets sent over the network
 
@durron597 well that's on request, plenty easy to just use an iterator
 
hm, if I wrote a custom serializer then I wouldn't need to store the view i guess
but we try to keep the flat view updating in real time, it gets updated like 4 times per second
@JimmyHoffa See edit
 
3:40 PM
@durron597 hell to serializer; use a standard serializer, just put a uniform method all node levels provide by interface, ITreeNode<T extends ITreeNode> or whatever. Collection<ITreeNode> flatView() { initial = new Collection<ITreeNode>(); initial.Add(this); foreach(var childNode in children) { initial.Concat(childNode.flatView()); } return initial; }
(something like that - that's totally arbitrary and to be seen as pseudo code)
gads you solved a data graph issue for @ThomasOwens just the other day and now you're griping of having nearly the exact same structured graph issue? :P
 
@JimmyHoffa I basically do that already
 
@durron597 is there a reason to update it so often? Is it viewed by something? Is the dataset so large that a simple visitation would take a long time?
 
the flatview is regenerated if something changes
 
@durron597 why? Again, why not just "generate" only upon request?
 
@JimmyHoffa Sorry, I do generate upon request
and I wipe the cached view if something changes
 
3:43 PM
@durron597 so why have a cached view?
 
	public synchronized Collection<Algorithm> getAlgos() {
		if (algos == null) {
			List<Algorithm> algorithmListBuilder = Lists.newLinkedList();

			for(ProductBundle bundle : algorithms.values()) {
				algorithmListBuilder.addAll(bundle.getAllAlgorithms());
			}
			algos = Collections.unmodifiableCollection(algorithmListBuilder);
		}
		return algos;
	}
 
@durron597 and you cache this for some reason?
 
@JimmyHoffa because it doesn't change after startup
ever
the data inside the individual algos changes, but the structure of the view itself doesn't.
 
@durron597 are you saying the algos being pointed at by the flat view are copies and not the genuine instances?
 
no, they are genuine instances
 
3:46 PM
then why do they need updating separate from the real-time updates occurring in the in-situ graph?
 
i'm saying if i have essentially a Map<Category, Map<Subcat, Algo>>, if convert that into a flat values(), the values() never changes.
@JimmyHoffa they don't
i'm just saying the flat view is what gets sent over the network, even though the data is stored in tree form on the server, it's presented in a flat way to the user in the client
 
@durron597 ok, so it's generated once and never needs any editing? Well that seems perfectly fine then.
to be sure; if it were me I'd store the flat view as a member of the root, just a side note. This way when you have the root you always have a choice of views; flat or structured (or any other views you may create)
 
@JimmyHoffa I'm doing that too
the problem is that the business logic (passing methods through to modules) is in the same class as the data structure
 
I think maybe your first solution is the right one then without having a super clear understanding of the problem
 
Honestly, there might not be a good way to do this, period, without method references.
Which means Java 8.
 
3:52 PM
@durron597 Yeah, that shouldn't be. The data structure should be treated as it is: A data graph. It should have logic only relevant to the things a data graph should have, basic CRUD (not validated), and outside actors
@durron597 pah. Java 8's method references are so verboce you may as well be using the simple earlier way: Create a generic interface IMethod<T,U> { U Apply(T target); } and then do anonymous instances wherever you need new IMethod<Integer,String> { String Apply(Integer target) { return target.toString(); } }
 
No problem, it also works with other sites as well. [Programmers.SE], etc. :) — EBrown 45 secs ago
 
@JimmyHoffa that is a lot more verbose than java 8.
all that code you wrote vs target::toString()
 
@durron597 perhaps, but it's still a better solution than none at all
In .NET we have delegate types, and you create them as delegate Int MethodName(String paramOne, long paramTwo) and all of our standard lambdas are just pre-defined in the framework as void Action<T1>(T1 target) void Action<T1, T2>(T1 tOne, T2 tTwo) up to a crapload of parameters and a non-void version U Func<T, U>(T target)
you can create the same set of permutations of that interface I described above for void and non-void forms with zero, one, two, three, ... params etc
 
@JimmyHoffa I like Java 8's equivalent of delegate. What's verbose and too long is Java 8's equivalent of Linq.
 
and use those as anonymous functions in place of lambdas. Java 8 may make it better, but I wouldn't avoid the design solution of applying functions to a data graph where the function logic is outside of the graph and the graph has an Apply method that takes those functions as parameters and self-applies (yuck, stateful but whatever) just because you aren't in Java 8
 
3:59 PM
@JimmyHoffa What's more grief, all that boilerplate anonymous functions or upgrading to java 8? ;)
 
@durron597 I don't know? If upgrading is an option obviously I'd aim for that, but... I don't know which is more grief?
 
@JimmyHoffa I think upgrading is less grief, at this point Java 8 is pretty stable.
 
I just mean, I'd go with that type of function variable applied to graph approach, whether in Java 8 or not, because more grief is the alternative
 
@JimmyHoffa i agree
 
@durron597 LINQ is super easy though - if you have delegates, anyone can create LINQ from scratch. LINQ is just a collection of simple standard functions on graphs that take functions. map or select or apply or however you want to call it to iterate a graph of As and return a graph of Bs when given a function that takes an A and returns a B. Then you put in fold or aggregate or reduce however you want to call it which takes a function and applies to both
it's last return and the next element in the graph
so you can say fold someGraphOfInts (+) 0 and it'll take 0 + someGraphOfInts[0] then the result of that + someGraphOfInts[1] and the result of ther + someGraphOfInts[2] et al. Map and fold are really the core of LINQ, beyhond that, filter or where, skip, all those other functions... each one of them is super trivial implementations
 
4:05 PM
@JimmyHoffa Oh, I understand the basics of Linq (not the syntax obviously) i'm just saying the way that Java 8 implements such behavior is almost as long as doing it without Linq-like syntax.
 
@durron597 Java 8 has a LINQ equivalent? where? Or do you mean the Lambda parameters?
 
user114359
@JimmyHoffa Java 8 has stream operations. Not nearly as flexible as LINQ but a step in the right direction
 
3
A: How can I convert a Stream of Strings to Stream of String pairs?

durron597This should do what you want, based on @njzk2's comment of using the stream twice, skipping the first element in the second case. It uses the zip method that you link in your original question. public static void main(String[] args) { List<String> input = Arrays.asList("A", "Apple", "B", "Bana...

(as an example)
 
@durron597 ah.. uhh, that doesn't make sense at all... And I see, so the one built into Java 8 sucks. Still, you can implement your own super easily.
You wanted to split a string on every two elements? I'm not sure I'd use zipWith for that which is what that guy did
 
@JimmyHoffa The accepted answer or me?
 
4:12 PM
@durron597 you
didn't realize it was you
 
@JimmyHoffa lol, yeah, that was my first java 8 answer ever
 
ah
yeah, I see though, it's still mighty verbose, but to be fair zipWith is one of the more convoluted oddball functions in graph fiddling. I think you could have done the same with a fold, does Java 8s version of linq have a fold that includes the index in the function?
 
@JimmyHoffa That was the only way I could think to do it, there really isn't a good way to solve that particular problem I don't think. Maybe you have a better one. How woul dyou do it in C#?
 
If not you can add a counter
 
there is no concept of stream item index in java 8
there is also no concept of adjacent elements
 
4:15 PM
@durron597 well you can always count in a fold, so not a huge deal
 
4:28 PM
int counter = 0;
stream
    .Aggregate(
        new Tuple<string, string>[],
        (seed, current) => counter++ % 2 == 0
            ? new[]{Tuple.Create(current, "")}.Concat(seed)
            : new[]{Tuple.Create(seed.First().Item1, current)}.Concat(seed.Skip(1))
    )
    .Select(double => new[] {double.Item1, double.Item2});
That's the first approach that comes to mind, though it's not a great deal better. It's an odd case
Aggregate = Fold = Reduce
and I might need to reverse my if and else scenarios
you could use a triple and go with seed.First().Item1 for tracking the counter if you can't use the counter in a parent scope in Java like I did
also it's reversed; you could reverse it back after the select with .Reverse() or reverse the .Concat order so it's seed.concat(new), but then you have to use Last() throughout which is far less performant than First()
zipWith does look like the better way really (what does that .Collect() thing at the end do?)
 
@JimmyHoffa turns the stream back into a list
 
@durron597 oh, forces execution, makes sense.
 
@JimmyHoffa I could have also used collectors.toList
 
@JimmyHoffa counter becomes final in java
 
@ratchetfreak ah, then it would be seed.First().Item1++ % 2 == 0 and Tuple.Create(seed.First().Item1, current, "") so you continually carry a counter around and then don't include it in the select at the end. Yeah, the zipWith approach really is better
 
4:44 PM
@JimmyHoffa except for the fact that zip is not included with Java 8 so you have to add it manually
 
it's interesting how aggregate/fold/reduce can define map/select/apply with
public IEnumerable<U> Map<T, U>(IEnumerable<T> target, Func<T,U> f)
{
    return target.Aggregate(new U[]{} as IEnumerable<U>, (seed, current) => seed.Concat(new U[]{f(current)}));
}
@durron597 ah well you can define zip / zip with in terms of reduce as I described above
 
@JimmyHoffa Oddly it was in one of the betas but they took it out. not sure why
 
reduce really is an amazing primitive in how you can define so many other things in terms of it.
 
@JimmyHoffa It's the NAND gate of Linq?
 
@durron597 I never learned low level stuff for a damn :/
 
4:47 PM
Because the NAND function has functional completeness all logic systems can be converted into NAND gates. This is also true of NOR gates. In principle, any combinatorial logic function can be realized with enough NAND gates. == NAND == A NAND gate is an inverted AND gate. It has the following truth table: == NOT == A NOT gate is made by joining the inputs of a NAND gate together. Since a NAND gate is equivalent to an AND gate followed by a NOT gate, joining the inputs of a NAND gate leaves only the NOT gate. == AND == An AND gate is made by following a NAND gate with a NOT gate as shown below....
 
neat. Yeah, pretty much true.
 
user41796
NAND is awesome
 
public IEnumerable<T> Where<T>(IEnumerable<T> target, Func<T,Bool> predicate)
{
    return target.Aggregate(new T[]{} as IEnumerable<T>, (seed, current) =>
        predicate(current)
            ? seed.Concat(new T[]{current}))
            : current
    );
}
skip, take, skipat, etc can all be done using the counter method I mentioned further up
@durron597 Now I know what I'm supposed to do with those feckin' redstone comparators in Minecraft. I figured out their logic but couldn't come up with the reason for it; I guess I'm supposed to combine them to create complete circuits.
 
user41796
Yes
 
5:01 PM
Was trying to figure out how to use it with an activator rail so when I sit in the cart and flip the lever the rail goes live, but then when I complete the loop and hit the activator, the lever is reset. Guess I'll need two levers and a circuit
doesn't seem you can toggle the levers automatically
but with the activator and comaprators I should be able to make it automatically reset
 
user41796
Pretty certain there's a way to do it. You may need a timer circuit
 
psr
5:58 PM
@durron597 Poker where some of the players get to see everyone's cards before the bets.
 
6:10 PM
or a rising edge detector
or just use a button
 
@ratchetfreak button? Perhaps that's what I need to make stops on my track that automatically go back to off when I press go
 
user41796
Yeah, buttons automatically reset
 
ah. That must be it. I'm sure I could just read about all this crap online, but half the fun is figuring it out on my own
 
user41796
There's a lot of redstone tutorials out there
 
user41796
I really ought to get the permissions fixed on the kids' server this weekend
 
6:17 PM
the other half is the look on my kids face when I put him in a cart and send him on a roller coaster along with a cart with a sheep
 
user114359
@JimmyHoffa that's how new stuff gets invented, e.g. penicillin.
 
nah that stuff gets invented by trying to figure something out and then accidentally figuring something else out :P
 
user114359
@enderland That's the point...
 
6:34 PM
Since your question is about architecture and design rather than code, it will probably receive better responses on Programmers Stack Exchange. See this post for more information. — Courtney B Reid 22 secs ago
 
6:49 PM
@enderland @GlenH7 Team A is the "make tools to make everyone else more efficient" team
Some data analytics, that sort of thing
 
nice :D that sort of job is pretty much my dream job... I love enabling other people
 
there is a scotch joke there.
 
@Telastyn Scotch is NOT a joke.
 
Your mom is a joke?
There's a joke somewhere damnit.
also, TGIF.
 

« first day (1855 days earlier)      last day (3134 days later) »