« first day (425 days earlier)      last day (3589 days later) » 

6:11 PM
So...CR is 3x as active with better numbers than Movies&TV, and M&TV is scheduled for graduation. Anyone know if CR is on that schedule as well?
Oh, and if y'all know any modelers : area51.stackexchange.com/proposals/63543/model-hobbyist
 
0
Q: angular ui.route best practice

romanI'm new to ui.router in angular and have to build a app. it contains a header, sidebar (off-canvas), feedback area (save successful and warnings area) and a content area. I thought it would be best, if i split up all things and create different (nested) ui-views. and that's the result index.html

 
@JohnP I used to build and fly airplanes, but it's too expensive.
 
@ckuhn203 - I never got the hang of the controls for flying, I'm more of the fire and forget (rocketry) type.
 
@rolfl Email template singletons: broken code is off topic, right? so the question really belongs somewhere else (stackoverflow, programmers), rephrased as a "why does this code produce weird instance counts?" which presumably has something to do with the static methods inside, rather than outside, the enum definition
Actually, strike that -- I misread my output when I attempted to repro the issue. I haven't the foggiest idea why the profiler is saying that
If you guys are right that the profiler is the wrong tool to use, then it becomes a very interesting question for somewhere else
 
@JohnP I saw a guy with a rocket glider once. I've wanted to build one ever since.
 
6:24 PM
@ckuhn203 - That's an easy one to build, actually. They're a lot of fun except in a crosswind :p
 
I couldn't ever figure out how to keep the wings from ripping off.
 
hello
@rolfl are you there?
@rolfl The code works fine. I am trying to understand why the single instance is not doing what it's suppose to do.
 
Hey James.... yeah, I'm here.
Real life happened.
 
@syb0rg - What about putting dyslexic curse words in a profile photo so they show up on every question/answer?
 
@rolfl I do sometimes....
 
6:34 PM
I just started using profiler (jprofilier) and when I did. I see multiple instances of a class that's only suppose to have 1 instance.
 
Your code produces two instances at least.
One for each enum member.
 
yes,
 
So, there's the FORGOT_PASSWORD instance, and the CONFIRM_EMAIL one
 
yes.
 
Are you seeing multiple instances with the same internal mFile?
 
6:36 PM
no.
 
Right, so are you sure there's a problem with multiple instances that are unexpected?
 
Wow, I think I just figured what my bug was... I forgot to send the extra newline after the headers of the HTTP request
 
I am trying to understand the profiler. I assumed if the instance count is not 1 then multiple instances are being created.
 
@JohnP lol
 
6:39 PM
Awesomesauce @JohnP!!! Thanks.
 
@James There are two things to consider here: 1. the profiler does not claim to be 100% accurate, and 2. you should expect one instance at least, for each enum member....
I cannot see anything wrong with the code....
(not buggy-wrong, anyway).
 
Does the profiler estmate or really count here?
 
@rolfl The code works fine. I was just wondering why I was seeing multiple instances.
 
I believe, in most instances, the profiler samples, and guesses.
it cannot track each and every allocation without a huge performance hit.
 
I think with the Netbeans profiler you can set it to really count, but it does introduce a 3x overhead
 
6:43 PM
It may also back-count the references, and the references may end up 'virtually' duplicated in memory, even though the apparent members are unique.
all depends on how the JVM actually implements the code.
Especially with JIT, and other factors.
 
Once you're done with the discussion, I've got somethign interesting over here as well
 
Thanks.
 
So, @James, I think the profiler has thrown you a red-herring.
 
Could use some help on an SO question: stackoverflow.com/q/24561016/1937270
 
@rolfl Yes. it did I thought, I was doing something wrong.
 
6:46 PM
The profiler is not intended to be an exacting micrometer of your system... it's a relative thing, a guide.
So, I recommend you revise your question, bcause the code you do have, is interesting, and would be good for the review as working code, not as something buggy.
 
Okay cool. I'll do that asap
 
I'm at a loss here... I've got a website that does not respond to pings neither on it's domain name nor on it's ip address, yet it does serve a certain file.
 
@skiwi ... what's up?
@skiwi that's normal.
 
@rolfl How is it?
 
ICMP packets (pings) can be routed and ignored, and 'dropped' at the discretion of the recieving end of the system.
 
Most hosting services will drop ICMP packets...
 
I don't see many actual servers do that... Even though my experience mostly consists out of google
 
@skiwi This is due to their use in DDoS attacks. Many servers do this now.
 
The underlying problem I'm solving is that I am rerouting currently a HTTP/1.1 GET request
 
which is a TCP connection.... not ICMP.
 
6:51 PM
But it's simply dropped, I may be confused on how I should send it, declassified example of the request:
GET top.secret.com/secretservices/services/TopSecretServices?wsdl HTTP/1.1
User-Agent: Java/1.8.0
Host: top.secret.com
Accept: text/html, image/gif, image/jpeg, *; q=.2, */*; q=.2
Proxy-Connection: keep-alive
 
Now my proxy server intercepts this message, and I need to resend it
 
The default setting for linux servers is to drop all ICMP packets.
 
@rolfl That probably explains
 
you have to have "rule 12" to re-enable them.
 
6:53 PM
And now I need to reconstruct the original destination of the request
 
(that's if you turn the firewall on, without the firewall, it accepts everything.
 
Which in turn is:
String hostValue = headerMap.get("Host");
if (hostValue != null) {
    if (hostValue.contains(":")) {
        String[] hostParts = hostValue.split(":");
        address = InetAddress.getByName(hostParts[0]);
        try {
            port = Integer.parseInt(hostParts[1]);
        } catch (NumberFormatException ex) {
            //ignore
        }
    }
    else {
        address = InetAddress.getByName(hostValue);
    }
}
Socket outputSocket = new Socket(address, port);
With above that bunch of code:
InetAddress address = InetAddress.getByName(new URL(url).getHost());
int port = DEFAULT_HTTP_PORT;
Former is to have HTTP/1.0 compatability
Now as destination it has selected address = top.secret.com and port = 80
 
Use Squid ... ?
I need to get to a meeting.....
 
Aw ok
I need to handcraft it because I need to change some headers based on some rules
Thanks @SimonAndréForsberg!!!
I just remembered your advice on printWriter.flush()
So the code I just posted here is correct
 
7:10 PM
Out of interest anyone know of a decent radix tree implementation either in java or c# that uses generics? (If its java ill port to c#)
 
Hmm... I don't even know what a radix tree is
 
In computer science, a radix tree (also patricia trie or radix trie or compact prefix tree) is a space-optimized trie data structure where each node with only one child is merged with its parent. The result is that every internal node has up to the number of children of the radix of the radix trie, where is a positive integer and a power of 2, having ≥ 1. Unlike in regular tries, edges can be labeled with sequences of elements as well as single elements. This makes them much more efficient for small sets (especially if the strings are long) and for sets of strings that share long pref...
 
I don't know anything
 
@skiwi Lucky for you I had the same issue just a couple of days ago, and realized a flush was needed :)
 
@SimonAndréForsberg I totally forgot to add it when you said it
 
7:15 PM
I actually did the same error twice just a couple of days ago, both in the client and in the server...
I hope I have learned my lesson now.
 
@SimonAndréForsberg Atleast you didn't fool yourself twice at the exact same spot
 
@skiwi At least not that time.
@Mat'sMug 2864 rep to target!
Incoming JDQ #153 !
 
7:34 PM
0
Q: Delete N nodes after M in a linkedlist

JavaDeveloperGiven a linked list and two integers M and N. Traverse the linked list such that you retain M nodes then delete next N nodes, continue the same till end of the linked list. Diagram is Input: M = 2, N = 2 Linked List: 1->2->3->4->5->6->7->8 Output: Linked List: 1->2->5->6 Looking fo...

 
@Mat'sMug, I really want that bounty!
 
8:16 PM
0
Q: Unity DI Composition Root vs XML

Andy Danger GagneI'm having trouble figuring out the best approach with DI. After doing more research, Mark Seeman recommends using the Composition Root approach. In my example, I am using XML configuration to design my mappings which allows me to drop any new dll that implements an interface without having to pe...

 
8:29 PM
-1
Q: I still get Wrong Answer even verifying some extreme test cases

BF MohtediI'm working on this problem : http://www.codechef.com/problems/DIGJUMP I tried many test cases, and all of them are right. The solution implements BFS, but I don't know where the problem is because I still get wrong answer when I submit. Here's my code: http://www.codechef.com/viewsolution/409704...

 
#smash
0
A: Given a BST, transform it into greater sum tree

Simon André ForsbergCompiler Warnings Iterable is a raw type. References to generic type Iterable should be parameterized This is very easy to fix. It's horrible that you haven't fixed it already. I'm sure that you know what generics is by now so I don't need to explain it to you. Whenever you see this warning...

@rolfl I think our dear JavaDeveloper might have circumvented our "working code" requirement. Or he's just... I don't know what... confused? Mistaken?
 
@SimonAndréForsberg - "Given how many trees I've seen you implement, I really thought your code would be better than this."
 
@JohnP Too harsh?
 
One wonders if he's cut/pasting code rather than doing it himself. (And no, not harsh at all)
 
@JohnP Then where's the vote?
 
8:42 PM
what vote?
 
lol, nevermind :)
 
@SimonAndréForsberg - I can tell you he's getting all of his "assignments" from geeksforgeeks, unless that's a known thing.
 
@JohnP geeksforgeeks? Never heard of it. What's that? Where's that?
 
That's his last two questions on the BST and the linked list word for word.
Still trying to find if he cut/pasted a known answer or is just taking known answers and trying to dupe in java.
 
@Malachi I'll read all answers tonight and see who's earning it :)
 
8:53 PM
:)
 
TTQW - first day was fun! :)
4
 
@JohnP Doesn't look like he's copying anything
 
@Mat'sMug have a nice relaxing evening!
 
Yeah, I can't find any copies either. Definitely the major source of his questions though.
 
@JohnP Indeed. I didn't know that before. I don't think anyone else knew it either.
 
9:03 PM
Where's @Phrancis when you need him? LOL JK
anyone else good with SQL and SSRS?
 
@Malachi - I've heard of SSRS...
 
Your bounty on question "Capture the notion of invertible functions" has expired.
:(
 
@JohnP It's a class of antidepressant, isn't it?
No, I guess that's SSRI...
 
@Edward - I dunno, I find my SQL knowledge to be pretty depressing at times...
But yes, SSRI (Select Seretonin Rsomething Inhibitors, IIRC)
 
@JohnP SQL is depressing when you've forgotten it, and depressing when you haven't.
 
9:12 PM
Where does "haven't learned much of it yet" fall in that spectrum?
 
@JohnP That would be "preparing to become depressed"
 
Ok, that's where I'm at.
 
I"m a big fan.
 
@Edward - My computing history: Minor in CS, 1993. Didn't program again until 1999, upon which time I spent 12 years exclusively doing Clipper and Cold Fusion. Now I'm playing massive catch up, and it sucks.
I always know what I want to do, just not how to do it. And OOP still confuses me somewhat.
And things like this:
<?xml version="1.0" encoding="utf-8"?>
That gives me a warning in one android app, but the same line doesn't warn in a different app. qua?
 
I've been programming since the 1970s and I still have those kinds of moments.
As I have explained to colleagues over the years, only half joking...
 
9:21 PM
Me too, I just took large gaps in the middle. My first computer was a Vic-20 with the 16k memory expansion and an 8 cassette "Teach yourself BASIC" package.
 
"The mistake you're making is to assume that computers run on logic..."
 
"The good thing is that computers only do what you tell them to. The bad thing is that computers only do what you tell them to."
 
@Edward so not true. I like SQL
 
I don't know what you're doing for learning OOP, but IMHO, if you're using C++, The C++ Programming Language, 4th ed by Bjarne Strostrup is good. If you're using Java, I think the Big Java books are pretty good.
 
@Malachi - I like SQL like I like root canals. The only good thing about it is the final result.
 
9:25 PM
@Malachi I like assembly language. Some people consider it to be a personality flaw.
 
C#, Android and probably ASP.Net in the near future.
 
@JohnP you mean C# and Java
 
@JohnP If Android, then probably Java, right?
 
good languages to learn
 
@Malachi - Yeah, I thought about that right after I said it. :p
 
9:26 PM
lol
 
Monking
 
Our programming is now done in C#, legacy Clipper, Cold Fusion and mySql. But, the company that bought us a couple years ago is heavily invested in the .NET legacy.
 
@Malachi you tagged me but I didn't see a link... help?
Something about SQL and SSRS lol... I hate SSRS
 
SSRS, not sure how to phrase the question.....
@Phrancis LOL
 
@Edward - The problem is that I can generally find out how to do something, but I have no clue of the why.
 
9:29 PM
@Malachi if I can try to help with anything let me know
 
@JohnP That's why I think these books might be helpful.
 
going to try and tell it not to run certain queries on when ...... SIGH
 
I personally think SSRS should come with an additional character, i.e., "SSRS?"
 
lol ikr
 
Like my last program, I was able to create a custom class in C# that incorporated IComparable and IEquatable to do a custom matching routine on sets of paired variables. It works, but I don't know why, nor could I create it from scratch.
 
9:31 PM
in an if statement can I still use the IN keyword in my conditional?
 
@JohnP Creating code from scratch and then submitting it for review on CR is probably a good way to advance your knowledge and skill.
 
@Edward - I'd love to, but that code has to work first. I have trouble meeting that criteria with my own C# code at the moment. :p
 
@Phrancis here is what I am trying to do inside the SSRS Query editor thingy
set @NodeListDescr = ltrim(substring(@NodeListDescr,2,5000))
IF @NodeListDescr IN ('Buffalo','Shannon','Todd')
BEGIN
END
ELSE
	exec rpt_EOMPreClosureReport_01 @StartDate, @EndDate,@NodeList, @NodeListDescr,@SiteDesc,@UserIdIn
END
 
@Edward - I have a great idea for a dead simple app, but getting it implemented and working is driving me batty.
 
@Malachi what kind of error are you getting, if any?
 
9:35 PM
haven't tried it yet.....
 
@JohnP Ah, the magic of computers...
 
@Edward - My wife just got me this, evidently she was tired of my whining.
 
@Malachi if I understand your code well, you're trying to trim 5000 characters from a string, starting after 2 characters? My main concern is does the data look like?
 
@JohnP :) I have a similar book but haven't devoted much time to it yet.
 
the code is not my own, I am just trying to make sure that the underlying stored procedure doesn't run for 3 counties when the report is run
there are three of these sub reports that need this functionality.
 
9:39 PM
Also, referencing a variable back to itself seems unusual...
 
the 5k character thing is in the SPROCs too, I don't like that it seems a little overboard for the information held in the fields.
 
I figured it wasn't, you seem like a better programmer than this... Any chance you could create a private room and show me the whole script?
Or some such
Or at least give an idea of what the fields actually contain, esp. the ones being trimmed
 
what I am adding is just the IF statement
IF @NodeListDescr IN ('Buffalo','Shannon','Todd')
BEGIN
END
ELSE
	exec rpt_EOMPreClosureReport_01 @StartDate, @EndDate,@NodeList, @NodeListDescr,@SiteDesc,@UserIdIn
END
 
Well if it's functional, good enough I guess. I would likely have designed the whole sproc differently but that's neither here nor there
If it were my design I would have set a user-defined variable like @counties or something like that.
 
a third party application pulls in SSRS Reports. this report calls stored procedures that pull in the XMLs from other reports and displays them in a single custom report.
 
9:51 PM
Ah. I guess what you have may be about as good as it's going to get then...
 
kind of complex and kind of confuses me a little bit, but we are dealing with half third party vendor stuff and half in house stuff (that I didn't write)
I was thinking that the NodeListDescr and the NodeList were actual lists, which didn't help me at all.
declare @NodeList varchar(5000)
declare @NodeListDescr varchar(5000)
declare @SiteDesc varchar(200)
declare @UserIdIn varchar(25)
set @UserIdIn = @UserId

set @SiteDesc = 'SDODYSTAGE'

set @NodeList = ''
set @NodeListDescr = ''

select @NodeList = @NodeList + ',' + ltrim(STR(NodeId)),
	@NodeListDescr = @NodeListDescr + ',' + rtrim(CountyName)
	from SDUJS.dbo.NodeDescriptions
	where NodeID in (@NodeId)

set @NodeList = ltrim(substring(@NodeList,2,5000))

set @NodeListDescr = ltrim(substring(@NodeListDescr,2,5000))
 
You would think so based on how they are named...
 
@Phrancis that is the full script I am working with inside of SSRS for one of the reports
they would have been subreports except they are not our reports so all we have is the XML I think...
 
Whoever wrote this must have been having a bad day
 
yeah. lots of the code I deal with is messy......ugh
 
9:55 PM
0
Q: Purpose: To display data in 3d plot. Concern: Not working

Ali KakakhelI am working on a project for my radiation oncology department. We have a device that we place on the patient and it sends back information about its orientation, acceleration, etc. I am writing a program to display this data on a 3d plot over time. I have been working on this for some time. I ca...

 
@Malachi can you tell me what data type is NodeId?
 
it is a Comma Delimited field, it is populated by SSRS as a Comma Delimited field, but in the database I think that it is an Integer
 
Assuming INT but could very well be wrong
 
in that select statement I think that it would have to be a VARCHAR so that it can hold a list of values
 
What really bugs me is why in the would those 5000 extra characters come into play...
 
10:00 PM
I agree, they are supposed to be county names, when I write SCripts for county names I only make them about 100 characters long at the most
 
Is this some form of website address or other kind of ridiculously long string??
 
and that is too big
 
Speaking of expletives: F**k b**bs!
 
Yeah I wouldn't expect a county name to be more than, say, VARCHAR(30) if even that
But 100 is playing it safe... 5K seems very excessive
 
I wonder if they thought they were going to have a whole XML file in those fields for some reason?
 
10:02 PM
That would be stupidly bad design IMO if that were the case
I'm really perplexed why it is trimming everything after the 2nd character.......
If all you want is the first 2 characters, make it VARCHAR(2) no?
 
there are 3 counties that don't have courthouses so these reports error out when the overhead report is run, and I said it's not good for the Database and that I think I can make it so those reports aren't even attempted
that's why I am on this project for at least a day more.
they want everything after the 2 character
 
Oh. OK.
 
Maybe the first two characters were once some kind of reference item? Kind of like DOS text files, you have the invisible CR and LF values at the end of lines.
 
May be more efficient to work this in a WHERE condition instead of IF like...
WHERE @NodeListDescr NOT IN ('Buffalo','Shannon','Todd')
The placement of it would be different of course, perhaps even in the sproc.
The whole thing just smells like bad design to me.
 
I wasn't sure how to make the sproc do nothing or return nothing to the report, this way I am not running the (sub) report at all
it is smelly I agree
I will finish it on Monday though. TTQW
 
10:09 PM
Be well @Malachi
 
you as well @Phrancis
 
@200_success and @rolfl is it just me or is some voting data available at the SEDE?
@Malachi Don't forget what day song it is tomorrow!
 
"Votes" in Data Explorer are just various forms of feedback — basically everything except votes.
103
Q: Database schema documentation for the public data dump and SEDE

Stu ThompsonStack Exchange releases "data dumps" of all its publicly available content roughly every three months via archive.org, and also makes that information queryable over the Internet at the Stack Exchange Data Explorer (SEDE). Over time, as new features and other bits of data are introduced to Stack ...

Favorites, bounties, etc.
 
Oh crap :(
Thanks @200
I wanted to grab data of when a user has voted (the day would be enough), I don't care about what they voted for, but I guess that's not available either.
 
Are you sure about votes? VoteType includes UpMod and DownMod, which sound like +1/-1
 
10:20 PM
@DanLyons The problem is that in the SEDE, the Votes never contains any VoteTypeId of 2 or 3 (UpMod / DownMod)
 
I wonder why. It seems like those would be the most important types to have.
 
just ah
hey
 
@DanLyons Votes are meant to be anonymous. That's why.
hey @user44517
 
do u know cyclomatic complexity?
 
Then the UpMod and DownMod types are unnecessary and misleading :)
 
10:24 PM
@user44517 I'm a bit familiar with it, yes.
@DanLyons Yes, for the purpose of the SEDE, they are. They're probably used internally by SE though.
 
is there somekind of formula to calculate a path for it?
 
@user44517 I'm not entirely sure. That would be a good question for Programmers, I think.
 
Wikipedia has a reasonably thorough explanation of it and how to calculate the value.
 
A while ago I asked this question on Programmers:
8
Q: Cyclomatic complexity when calling same method multiple times

Simon André ForsbergThanks to a question over at Code Review I got into a little disagreement (which essentially is an opportunity to learn something) about what exactly the Cyclomatic Complexity is for the below code. public static void main(String[] args) { try { thro(); thro(); thro()...

 
10:28 PM
0
Q: Threadsafe get method on queue that draws values from other queues?

Hanii PuppyI have a class that implements Queue which draws values from other queues added to it. I want the method to draw values from the queues by checking over all values indefinitely and after a value is checked twice. (id est, when all other values have been checks and the current next value has been ...

 
no i am just confused
well if no one know ok then
 
@user44517 I think in.nextLine() can throw an exception, which would add to the complexity, as the method can just end there.
 
err lets assume it only accept if else and while
according to this journal
the formula is
 
Hey Simon, yes, some voting data is available.
 
#Edges - #Nodes + #terminal vertices (usually 2)
#Predicate Nodes + 1
Number of regions of flow graph.
 
10:30 PM
@rolfl Not the kind of voting data I wanted though
 
Simon - type 5 => Favourite and type 8 - bounty-offered
 
but i think hat formula is wrong
or i just wrong?
*that
 
@user44517 I said I was familiar with it, not that I knew how to calculate it :) Unfortunately, I don't think I can help you with that.
 
hmmmm
:\
 
@rolfl Yeah, the fish explained that too me. You're late, monkey :)
 
10:32 PM
Also, Simon, there are vote-types +1 and -1, just they don't have a userid associated with them
and, they are just the date (not the time and date)
but the order can be determined from the id#
 
@rolfl OK, understandably. So I assume there's no way to find out the number of up-votes a user has given in a specific day / week / month / year / anything ?
 
Well, you can get all their upvotes.... and downvotes
but since they joined.
Part of the users table is the Upvotes and downvotes columns
 
10:51 PM
Yeah, well, that I knew already :)
 
11:11 PM
snarky simon
meh, home network has been a PITA recently
I wonder if I had some static issue or something.... both my firewall and my DSL modem are being bad
 
11:22 PM
critical JDQ response posted.
 
Weird. So many trees, yet JDQ can make them worse? I can't help but think that he just uses these reviews to improve his code and not also his skills.
 
@Jamal Considering the (lack of) usefulness of his code, what would be the use of improving his code but not his skills?
 
There wouldn't be, but code reviews should help do both (which depends on how the asker utilizes them).
 
11:55 PM
Thanks, Santa!
 
Thanks Night, Santa!
 

« first day (425 days earlier)      last day (3589 days later) »