« first day (1965 days earlier)      last day (3002 days later) » 

9:02 PM
@SimonForsberg is it a console application? I bet I could just take the tiny snippets for logging in open id and retrieving fkey, keep them as-is but make the whole thing a CLI getInfo <user> <pass> that prints the fkey straight to stdout so it could be utilized in other scripts
ah here's the secret sauce you're using com.gistlabs.mechanize
that gives you the virtual dom to make it easy to do fake browser activities for login which is an enormous pain to do by hand scripting
 
@JimmyHoffa No, unfortunately @Duga is not a console app. She's a full-fledged web-app, as she supports Github webhooks. You could probably extract the things you need though.
@JimmyHoffa yes, that does the magic.
 
@SimonForsberg web-app? Duga's hosted in an application thinger?
(technical term)
 
@JimmyHoffa An application thinger? A container?
 
@ThomasOwens (technical term)
 
Just got another answer here:
0
A: Self referential enum with immutable parameters

Ed PriceNice question. Perhaps you will like this solution: public class Test { public enum Flippable { A, B, Y, Z; private Flippable opposite; static { final Flippable[] a = Flippable.values(); final int n = a.length; for (int i = 0; i <...

Anyone remember this one?
Still no solutions I like there
 
9:13 PM
@durron597 never seen it before. Any particular reason to be using an Enum?
 
I don't remember why I thought of the question
 
@durron597 why doesn't your initial work? Because it reads the declarations in-line?
 
Z doesn't exist yet when it tries to create A
(yes)
 
well, mutual type recursion may solve it for you
depending on the intricacies of the java parser which apparently reads some things in-line which is truly terrible
 
does the .NET version compile?
 
9:19 PM
@durron597 .NET Enums are different, but yes in .NET that would compile perfectly well using normal objects with static members
 
enums in .NET are not full objects?
 
in .NET an enum is literally a list of numeric values that you reference by string name. Not an object at all, you can choose the type of underlying value by doing enum SomeEnum : char for instance, but it has to be a value type to back an enum
and you can set the values like enum SomeEnum : char { Red = 'r', Blue = 'b' }
 
yeah, so there isn't an equivalent question in .NET
obviously, with normal objects it would work in Java
 
oh
(not obviously, I mean, if Enums are objects, and it doesn't work with them ... why would it work with objects?)
 
9:22 PM
the enum constructor is... weird
there's a lot of black magic that happens under the hood
 
> Main.java:8: error: illegal forward reference
My initial thought is a mutual recursion that can sometimes be called a forward reference, so I'm not certain this will work given it's erroring with that specific message
but I'll give it a shot
 
How do you become an expert in project retrospectives? Isn't that a really narrow focus of expertise?
 
1
A: What are the best practices for single-instanced classes in java?

AlexWienDon't make the constructor private, this makes problems when you later want to unit test it. Just instantiate it once. There are no software terrorist which secretly instantiate your class multiple times.

those software terrorists are out to get people
 
user114359
@durron597 there is no possible way to have final member fields referencing between two objects like that in Java. Even with reflection, you are looking at many ugly hacks and you cannot satisfy both yourself and the compiler at the same time.
 
user114359
Your option two (minus that hideous switch) is the most direct option.
 
9:28 PM
@durron597 this at least compiles:
enum FlippableMember {
	A(Flippable.A), B(Flippable.B), Y(Flippable.Y), Z(Flippable.Z);
	private final Flippable value;

  private FlippableMember(Flippable value) {
    this.value = value;
  }

  public Flippable value() {
    return value;
  }
}

enum Flippable {
  A (FlippableMember.Z), B (FlippableMember.Y), Y (FlippableMember.B), Z (FlippableMember.A);

  private final Flippable opposite;

  private Flippable(FlippableMember opposite) {
    this.opposite = opposite.value();
  }

  public Flippable flip() {
 
user55340
@ThomasOwens what is the close reason for "lazy in the extreme"?
 
user55340
-4
Q: How does parseInt() method with two arguments work in Java?

Rishabh MalikTo be precise, I can't understand the following: int b = Integer.parseInt("444",16); System.out.println(b); The result is: 1092 Why?

 
@JimmyHoffa yes, unfortunately she is. Which is why I want to modularize her to make her easier to develop and deploy without all the overhead that a web application brings. Unfortunately(?) I am working a lot on Machine Learning these days though.
 
@durron597 FlippableMember in this example is simply an intermediary to hold the forward reference for the parser to not crap itself. It serves no purpose but to placate the parser and allow you to use Flippable moving forward
(presuming it doesn't overflow or something else at runtime which I don't know off hand how to test)
how do you print in Java?
 
i lied, it doesn't work with normal objects
package test;

public class Flippable {
	private static final A a = new A(z);
	private static final B b = new B(y);
	private static final Y y = new Y(b);
	private static final Z z = new Z(a);

	public static class A extends Flippable {
		public A(Flippable opposite) {
			super(opposite);
		}
	}

	public static class B extends Flippable {
		public B(Flippable opposite) {
			super(opposite);
		}
	}

	public static class Y extends Flippable {
		public Y(Flippable opposite) {
			super(opposite);
		}
 
9:31 PM
@durron597 well I have it working. Here: ideone.com/gVvgW4
 
yeah that works
 
@MichaelT heh :) that was an amusing question, I wonder if that person actually got it or not
 
user55340
It speaks poorly of their future ability to code if the first instinct is "ask here"
 
@durron597 It's just their weak parser that it doesn't construct it's own scope-level forward references because - as is often the case in imperative coding - recursion is not much encouraged.
poor recursion support stinks, but it's a hole in so many languages..
 
user114359
Burninate with extreme prejudice:
 
user114359
9:41 PM
-2
Q: A notion to change the notation of web service to webservice

GeroI am not sure, if this is the right place to ask, but what would it take to change the notation of "web service" to "webservice". Once and for all. Seriously... it is one of the most annoying things. Do I have to write a letter to Tim Burners-Lee? Somebody needs to fix this!

 
@JimmyHoffa your solution doesn't work
it's printing null
 
@durron597 no?
 
i haven't figured out why yet
@JimmyHoffa I tossed a random System.out.println(foo.flip()); in there
 
@durron597 didn't know how to print in Java :D
 
oh
the reason is that one object is created before the other
you can reference an object before the constructor finishes, which i think you're doing here
 
9:45 PM
@durron597 the whole concept of your recursive enums is borked. It cannot work because there must be some initalization order. Therefore: you need some indirection and/or some mutability. I'd define a function (a, b) = makePair() which maintains the actual information, then initialize the enums from that pair. Let me draft an ideone…
 
@JimmyHoffa FlippableMember objects are created before Flippables are
@amon I prefer indirection here
 
@durron597 yes I see this now. Basically there's no support for such fashion of recursion here.
you can always put the reference off until runtime by using a Lambda but I haven't the foggiest the Java syntax for it plus it requires java 8 plus it's some pretty terribly verbose syntax if I recall correctly; which is unfortunate
 
user55340
10:03 PM
It's times like this I would love to have a CM stop by and look at the last 6h of questions and ponder out close rate.
 
user55340
Ideally, one would also have said CM post a comment on each question that they agree is off topic or too broad or whatever and have them try helping the user reformulate the question or go to another site.
 
Alas, the Consenting Adults argument was insufficient for the folks at Stack Overflow who (years ago) insisted that I parameterize my SQL Statements for an internal app that would never, ever be publicly released, otherwise I wasn't a Real Professional.â„¢ — Robert Harvey 1 min ago
 
user41796
@RobertHarvey - That's merely because they've never forgiven you for the "Little Bobby Tales" incident. But I thought that was obvious and didn't need to be brought back up. — GlenH7 12 secs ago
 
Ah, right. My first name is Robert.
@MichaelT That's not how the CM's work. They're actually drive-by CM's. System triggers close alert on old, popular question; CM reopens question, CM leaves. Meta post results, hilarity ensues.
CM wonders what hit 'im.
 
user55340
@RobertHarvey That's what it seems like at times.
 
10:16 PM
CM no understand site scope
CM confused
 
user55340
The thing is, our 70% problem doesn't need an understanding of site scope.
 
user41796
I think the problem is with the alert
 
user55340
It just needs a glance at the 50 newest questions today.
 
Yup.
In other news, extension methods are awesome.
 
user55340
> I want to duplicate or add another chat box every time the user chooses another user to talk with. All I can think of is by using jquery clone() method but I'm not sure if that's enough or that's the exact way they did it? Any idea on this?
 
10:18 PM
@durron597 Mutability is good, in small doses. I like this solution I came up with. Ignore the generics. The class RefPair<> is unnecessary, strictly speaking, and could be folded into Flipper.
 
user55340
That one makes me chuckle.
 
brain.Clone()
 
user41796
@RobertHarvey They can be very, very powerful tools
 
@amon That's either a pinball machine, or a porpoise simulator.
 
user55340
@RobertHarvey Its take your clone to work day.
 
user55340
10:21 PM
Though slightly more serious, Kiln People is a neat book.
 
user55340
Kiln People is a 2002 science fiction novel by David Brin. It was published in the United Kingdom under the title Kil'n People. It has the distinction of being short-listed in four different awards for best SF/fantasy novel of 2002 – the Hugo, the Locus, the John W. Campbell Award, and the Arthur C. Clarke Award – each time finishing behind a different book. In the world of the novel, surveillance technology is pervasive, as studied in Brin's essay The Transparent Society. Kiln People also makes extensive literary and conceptual references, including those to Firesign Theatre and the legend of...
 
user55340
> The novel takes place in a future in which people can create clay duplicates (called "dittos" or golems) of themselves. A ditto retains all of the archetype's memories up until the time of duplication. The duplicate lasts only about a day, and the original person (referred to in the book as an archie, from "archetype", or "rig", from "original") can then choose whether or not to upload the ditto's memories.
 
That does sound like an interesting book.
 
user55340
You don't go to work, your ditto does. Need to do landscaping and mow the lawn? Get a ditto.
 
user41796
Makes me wonder what the Achilles heel is
 
10:23 PM
The clay, perhaps?
 
user55340
> A cheap ditto suitable for housework is green, whereas a quality one for business is gray. Ebonies are highly specialized dittos that are good at intelligent data analysis; platinums are only used by the very rich, and closely resemble real people. Ivory dittos specialize in the reception of pleasure and sexual fulfillment. Other colors of ditto (such as purple, red, and yellow) exist, but are rarely mentioned in the novel.
 
You'd send a ditto in your place to have sex?
That doesn't sound like a good use of my ditto.
 
user41796
Talk about dialing it in for a day
 
user55340
No transmissiable diseases... and doesn't have to match your form exactly.
 
Ehm...
Two dittos walk into a bar.
One ditto says to the other, "Hey, Clay!"
 
user55340
10:25 PM
flag as bad pun.
 
Now my mind is going weird (possibly NSFW) places. I better stop before I get into trouble.
 
user41796
@RobertHarvey I promise to delete instead of flagging
 
user55340
The other thing is, not all your copies come out exactly right. Sometimes they may decide to say "screw this housework, I'm going out to have fun and not upload"
 
user41796
Although I don't think a flag against your comment would do anything. Don't think it would even annotate
 
user55340
And well, if your ditto does illegal things, guess who gets in trouble.
 
user41796
10:27 PM
So that's the heel
 
user55340
@GlenH7 The protagonist of the story is remarkably good at having his dittos do what he wants. Another character is remarkably bad at that.
 
user55340
> The green comes out of the kiln and starts doing the chores he was made to do, but soon displays a lack of motivation to complete his assigned tasks and instead heads off to the beach. Once there, he decides that he is an imperfect copy of Albert, or a "frankie" (a fictional slang word derived from Frankenstein's monster).
 
user55340
It is a very interesting book.
 
@AshleyNunn Actually, most of them post on EL&U. "What should I name this method that adds things together?" and other such things that we close.
 
How you all doing tonight, guys?
 
10:41 PM
Doing. Yourself?
 
Procrastinating.
 
user15026
@KitZ.Fox Ah, so because you are a meanie and close them, then they stab the dictionary?
 
@AshleyNunn Yes. I am solely responsible for all the world's suffering.
4
 
So I have this bit of code:
        /// <summary>
        /// Extracts the value attribute from the HTML element having the specified id attribute.
        /// </summary>
        public string Extract(string id)
        {
            return Regex.Match(Html, @"id=""" + id + @""" value=""([^""]*)")
                        .Groups[1]
                        .Value;
        }
 
user41796
@KitZ.Fox Naming things is one of those universally off-topic subjects for SE
 
user41796
10:46 PM
@RobertHarvey flags...
 
I still don't understand why you can't parse html with regex. It's basically a flat file, innit? If you renamed it with a .txt extension, nothing would happen.
 
user41796
> Regular expressions are a tool that is insufficiently sophisticated to understand the constructs employed by HTML. HTML is not a regular language and hence cannot be parsed by regular expressions. Regex queries are not equipped to break down HTML into its meaningful parts.
 
Yeah. So?
 
user41796
From the answer that Robert linked and I didn't flagged
 
user41796
@KitZ.Fox What do you mean by parse then?
 
10:48 PM
I mean, if I'm looking for a particular string, why do I care about "meaningful parts"?
 
user41796
In that case, I think we're talking about two different subjects
 
Oh.
Oooooohhhhhh.
So that's why I didn't get what the big deal was.
 
user41796
Remember that people abuse regex to do things it wasn't really ever meant to do
 
I've used the above code several times without incident, mostly to retrieve form values. Nothing bad has happened so far.
But I'll let you know if it suddenly summons raptors.
 
@KitZ.Fox HTML is a plain text serialization of a tree data structure. Unfortunately, there are many ways to serialize the same tree. E.g. each tag can have attributes. But those might use no quotes attr=value, single quotes attr='value', or double quotes attr="value", might use escape codes, might have a different order, might be commented out…. Unless I properly parse this into a data structure, I can't simply access any values. I am guessing. And guesses may be wrong.
 
10:50 PM
The only parser like that which I have used is XPath, I guess. So if I tried that with regex...Hmm, OK.
@amon Yeah, but if you needed something besides guessing, why would you use regex in the first place?
 
@KitZ.Fox that is often the correct attitude =)
 
Is XPath a parser? I though XPath was a query language. I use it with Html Agility Pack, but HAP is the parser, not XPath. XPath is just the language used to specify which nodes to return.
 
the classic example of trying to "parse HTML with regex" that is provably mathematically impossible is checking if all tags in an HTML file come in correctly matched open/close tag pairs
 
Or maybe it's the equivalent of trying to query a database table by exporting it to a flat file and using regex? I'm having a hard time understanding the significance of the question, I guess.
 
@KitZ.Fox regexes are valid solutions for some problems. Many plain-text search problems can be easily solved with them. Just not anything involving HTML, because the language is way to complicated. I've read some parts of the spec, it's horrible.
 
10:53 PM
@RobertHarvey Yeah, you're right. I'm a little cross-eyed right now.
 
@KitZ.Fox it's more like the equivalent of trying to solve a calculus problem using long division
the tool you're applying literally cannot do this thing
 
OK.
 
@Ixrec Well, yeah. For that I'd write real code. Who would in their right mind use a Regex for that except crystallography weenies and C++ programmers?
 
user114359
Within the fields of computer science and linguistics, specifically in the area of formal languages, the Chomsky hierarchy (occasionally referred to as Chomsky-Schützenberger hierarchy) is a containment hierarchy of classes of formal grammars. This hierarchy of grammars was described by Noam Chomsky in 1956. It is also named after Marcel-Paul Schützenberger, who played a crucial role in the development of the theory of formal languages. == Formal grammars == A formal grammar of this type consists of a finite set of production rules (left-hand side → right-hand side), where each side consists of...
 
I was about to list a bunch of those words myself but yeah that article pretty much covers it
HTML is not a "regular language"
 
10:54 PM
I use regex with some frequency for various purposes, but always just for probing things, never for really doing things.
@Ixrec OK, that makes more sense to me now then.
 
which, oddly enough, is what it was originally intended for
 
I was conceiving of the problem as "I need to find what urls are embedded in this document" kind of thing, which I have done before with regex.
 
user114359
@KitZ.Fox That you can probably do with regex, but not HTML parsing in general
 
Yes. I see now that my conception was overly limited.
 
user114359
There is a difference between "extract data from an HTML document" and "parse an HTML document into a DOM tree"
 
10:56 PM
Although in my defense, it is because I can't imagine why someone would do such a thing.
 
it sounds to me like Kit had the right idea all along (yes, we can't imagine why someone would do that either) and just didn't know any of the jargon
 
I mean. I could paint a room using a hacksaw, but I'd need a lot of victims and the stains would never come out of this shirt.
2
And it's my favorite shirt.
 
I could write a web server in x86 assembly, but I'd probably kill myself in the process.
 
@Ixrec Yes. I suppose I didn't have a clear distinction between extracting data and parsing a document.
I'm very data-oriented these days.
Dinner time! You lads up for drinking later?
 
user41796
@KitZ.Fox Almost always
 
11:03 PM
Are you guys in the same geographical location, or do you just drink together virtually?
 
user41796
Virtually
 
user41796
I'm about equidistant between you and Kit
 
psr
@KitZ.Fox In practice that would usually work fine unless someone was deliberately writing HTML to fool your parser, in which case they would always win. You might get unlucky if the HTML was for a page displaying a list of popular URLs but not actually linking any, or something like that. With a correct parser you could always do it accurately.
 
Can we get one more close vote on this, please?
 
> You have no more close votes today; come back in 46 minutes.
=(
 
11:14 PM
>_<
That's why we need three-votes-to-close.
 
literally everyone who actually uses this site understands that
 
user41796
@RobertHarvey couldn't VTC, but I did VTD
 
I wasn't quite sure what to do with that question
 
Pretty sure he didn't design that architecture.
It's tacked to every lunch room wall at Microsoft.
 
11:17 PM
lol
 
sighs I guess I need to earn some reps on the site so I can help VTC.
 
user15026
I've been saying that for forever but since I am not a programmer, it's a little hard
 
[places a couple of bounties to award to @AshleyNunn]
 
I'm too rusty to be of use. I can offer help on requirements gathering and analysis.
 
user114359
> Keeping a low profile.

This user hasn't posted... yet.
 
11:19 PM
I suppose I could ask some questions.
 
user15026
@RobertHarvey I'd have to make a post, and I don't think I've done that :P
 
@psr I wouldn't use regex for that though. I've only done it for pages in my jurisdiction.
 
@GlenH7 So you're in... triangulates, carries the one, multiplies by the subsistence factor
Damn it. I divided by zero again.
 
user41796
It happens to the best of us
 
user41796
11:26 PM
But I need to disappear for a bit. I ought to be back online in a few hours.
 
I had to explain that to the tester today. The "check to make sure the dev handled dividing by zero" thing.
There are few things more delightful than watching kids watch Looney Tunes for the first time.
I wish I could bottle that and ferment it and then drink it over ice this summer.
 
user15026
@KitZ.Fox I have friends who have a 1.5 year old and we keep a running list of "things we want to introduce him to" and that's on the list.
 
user55340
@Ixrec dvcs doesn't fix the bad commit problem. And once you git push origin you are in trouble.
 
user55340
@AshleyNunn lemons.
 
Mmm, lemons.
 
user15026
11:33 PM
@MichaelT He makes an excellent lemon face.
 
@AshleyNunn Do you realize that you are Kit Z. Fox chat user - 34? Or rather that I am Ashley Nunn chat user + 34?
 
@MichaelT it does give you the option of manually fixing it at least
 
user15026
@KitZ.Fox I did not! That's fancy.
 
user15026
Also, I did not get to the soup this weekend like I hoped, but it is COLD WINTER AAAAAAA here now so this weekend is going to be soup weekend.
 
user15026
(I did make slow cooker borscht, but that's not the same as that awesome soup recipe you gave me)
 

« first day (1965 days earlier)      last day (3002 days later) »