« first day (627 days earlier)      last day (3688 days later) » 

18:02
0
Q: Generic sum method for a Collection<Number>

BrythanWhile answering this question, I wanted to use a generic sum of Collection function. Java doesn't have a native method, so I wrote one. There are a couple things I don't like about it though, so I wrote a more specific method for my answer. public static <T extends Number, U extends Collection<

Anyone that uses the Outlook Web App on an ipad?
It looks totally messed up, like someone scrambled with the css
"Outlook web app ipad layout messed up" doesn't yield many results
@JeroenVannevel Why not just use Mail on iPad?
But, you could also post on Apple.SE with a few screenshots, probably your best bet if Google doesn't help
@JeroenVannevel I don't have an iPad.
Looks like you might find some screenshots in there.
It's my mom's email from her work, I can't touch that or their IT departement will get angry at me
it goes through their secure login beforehand as well
I just took a screenshot and told her to give it to the IT departement
they get paid to fix this, I don't
If there is a problem, its the iPad, not Outlook :)
18:14
@JeroenVannevel That's the spirit!
If a reboot doesn't fix it, I'm out
@Hosch250 A bit biased, aren't we? ;p
Seriously, though, is it their security settings blocking something?
@Phrancis That's the grin, I was joking.
Doubt it, she had the same problem last week
A reboot fixed it then
Hmm, then it is the iPad.
Maybe it needs to be reset.
18:16
@Hosch250 Now you have two problems.
@SimonAndréForsberg How?
iPad and Outlook.
I haven't had much luck with any Microsoft Office products on Apple. Apple's tools tend to work a lot better on OS X/iOS platforms.
Office for Mac works on my mom's Mac.
Try using Excel on OS X and you're in for a world of pain.
18:18
0
Q: SQL - Remove select non-alphanumeric characters from a string

zhespeltI'm trying to sanitize strings in my company's databases (from the early days before we had better data validation). However, the function isn't working. I figured out that it's only assigning '[' to the @Pattern string, but I'm not sure why. Code to re-create the function (you'll need to add yo...

@Phrancis I have.
We worked on my church's budget in Excel.
It feels like using Excel 2003
Never used Excel 2003, but it was way more powerful than Numbers.
@CaptainObvious Aww too bad
I'm off for lunch.
See you.
18:25
I can't believe I just suggested regex to that SQL question. But, apparently it would work better than what OP has, it seems.
I've never really really used Excel...
1
Q: Recursive Depth First Search Performance Improvement Tips

Matt MorseI have a project that relies on finding all cycles in a graph that pass through a vertex at most k times. Naturally, I'm sticking with the case of k=1 for the sake of development right now. I've come to the conclusion that this algorithm as a depth first search is at worst O((kn)^(kn)) for a comp...

@nhgrif I use Excel like Dr. House takes Vicodin. So I felt really annoyed at how much the interface sucked on OS X...
You haven't used Excel until you've used it to play Mario: www.youtube.com/watch?v=D9IxSJ-3biM
I'm not sure what I'd use excel for
18:30
LISTS
It's good for making forms and such too
They actually redesigned Excel when they realized that people don't use it for calculations and analysis. People use it to make and keep lists.....
@DanLyons Who ever's playing is terrible.
I'm sure it has uses. Its uses just don't match my needs.
Pivot graphs FTW
sadly, I see a lot of non-technical people eventually grow their Excel spreadsheets to the point where they are hack-job databases
2
18:32
Truth is, 99% of people who use it have no idea of what they can do with it. And it probably doesn't match your needs @nhgrif. As a dev, something like Trello is a much better list keeper.
2
Q: Unit Testing Bejeweled Wilds

bazolaI created a pretty complex algorithm for calculating matches on a Bejeweled board that kept track of matches involving wilds. After doing some in-game testing, I found quite a few bugs that needed to be eliminated. In order to deal with this problem, I first created an undo system for the gam...

@DanLyons Sadly, it is my job to turn those hack job databases into real dbs and programs.
Or not so sad maybe. It pays the bills.
@RubberDuck one time, I offered to do just that, even going as far as writing the program and showing how it would automate all the data collection needed, but the manager in question decided to continue having someone else copy-and-paste from other spreadsheets into the franken-database spreadsheet
evening @all
Been there done that.
Hola @janos.
18:35
Hola @RubberDuck
in a Spanish mood today?
Si senor.
Does anyone know of an easy way to view all commit messages between two commits in git?
Where's google....
put a .. between the SHA1 ?
like, git log abc..efg
Is that inclusive?
doesn't include abc
thanks @janos
18:45
to include abc, write like this: git log abc^..efg
Or uhhhhhh...... Gracias.
de nada ;)
Hmm..... note to self. More frequent releases
FGITW on off-topic question codereview.stackexchange.com/a/78247/12390
by user with massive rep on SO
posted on January 21, 2015 by user3201264

res=pow(k,res)%1000000007; why is it showing in valid operator //1≤ K ≤ 100,000

0
Q: Better code for data conversion in Python

JaccoI have an array filled with 5 other arrays that consists of arrays of 2 values (first a date then a count): [ [ [dt, cnt], [dt, cnt], .... ], [ [dt, cnt], [dt, cnt], .... ], [ [dt, cnt], [dt, cnt], .... ], [ [dt, cnt], [dt, cnt], .... ], [ [dt,...

18:53
^^^ interesting formatting going on over there (the first one)
19:07
creepy
I come back to chat and see morpheus trying to tell me nonsense, he is but a figment of my imagination!
hopefully you will wake up any minute now
unless of course, you wake up realizing that humans are no longer born: they are bred
3
Oh wow, WhatsApp even works on website now... that's really interesting
Except that I've meanwhile have learnt how to type on a phone
I am starting trouble in the Java tags....lol
comments to this Answer say it all I think.... --> codereview.stackexchange.com/a/75119/18427
and then he comments in the answers.....
19:24
@MAL
@Malachi what is the problem?
I am looking for some meta links
just saying follow a link and there is the answer is looked down upon
(well that was spammish)
@Mat'sMug Any of my code in this release?
19:25
33
A: Can I put my code on a third party site and link to the site in my question?

Simon André ForsbergNo. We require the code to be contained within the question, for the following reasons: To avoid dependency on third-party hosting services. These links tend to go away after a while. To prevent review requests of huge projects. To make it easier to see the code and so it can interest more revi...

Not that it was much...
no that is only true if it is a link only answer, i'm linking information that can not be put in one message
+ i'm giving a hell lot of other information
You did that. Right?
Yup, nice.
19:27
@Malachi - This?
could you explain all of the changes that you would make and not just one or two. it makes for a better review. — Malachi 22 mins ago
It seriously wasn't much, though.
It was something I didn't have to @Hosch250, so it was plenty. =)
@user1281750 - I see your answer as good.
@rolfl yes ..... ?
@rolfl thank you for confirming
19:28
that one didn't quite make sense did it
a list of what you would change without explaining why isn't a review, it's a todo list
To be clear, @user1281750 - I think your answer is good, I think @Malachi sees areas where it can be improved. I agree that Malachi has a point, but it would take your answer from being "good" to being "great". I am happy that good is good enough, though.
@RubberDuck If I didn't have to write another page on Plato/Socrates (Aristotle is done), in my essay, I'd work on Outlook.
@Hosch250 oh that'd be awesome!
Yeah, maybe next summer.
we want Rubberduck unit tests to work everywhere VBA works :)
oh
well it might be implemented by then
19:30
Yeah, school ends beginning of June.
Maybe during spring break (middle of March), if I don't have to catch up/get ahead for viruses.
@rolfl I completely agree, the answer is not perfect. I limited the amount of text to be as easy as interpretted as possible. But he doesn't need to spam me or harrash me in one or another way. I'm happy to try contributing to stackexchange. But some people seem to have too much time on their hand. I lost 20 minutes of coding because of this
thanks for the cleanup @mod-with-delete-powers
I think @user1281750's answer was good enough, @Malachi was being too picky, but I flagged some of your rude comments
@user1281750 - just FYI, I removed a couple of your posts here, and I also purged all the comments on your answer.
let's move on guys
5
19:32
Um, yes....
Let's quit the flagging.
stargreed!
2
I've got a fun distraction.
Hey KitFox ;-) 2048?
Hey, yo.
No, actually I've got some data and I need to pull out hyperlinks.
Structured, or plain text data?
19:34
I pulled out just the stuff in between <a> and </a> tags, but sometimes there's more than one link.
@rolfl Structured.
Basically I need to make a list of links.
From a bazillion free text fields.
language requirements? C/Java/perl/etc.?
Um...What's going to make it easy?
I don't think I have access to Java.
Something that has a decent HTML parser, like, python and BeautifulSoup.
Probably the easy language for me to access atm is C#.
2
or regex
19:36
Well, regex got me this far.
I might have python.
@Mat'sMug don't star that! LOL JK
5
Q: C# library for parsing HTML?

Kenny EvittThe library should support at least .NET framework version 3.5, and 4.0; support for version 4.5, and future versions, would be great too. It should handle 'messy' HTML too, if possible.

I don't need to parse html. I need to pull out strings.
Regex and HTML are best friends, right?
3
20 secs ago, by KitFox
I don't need to parse html. I need to pull out strings.
^^^ actually, that's what you do need to do... ;-)
19:39
I don't see how that's going to help. I don't have html pages.
I have an oracle database and an excel spreadsheet.
I assumed you did when you said:
4 mins ago, by KitFox
I pulled out just the stuff in between <a> and </a> tags, but sometimes there's more than one link.
Oh I see.
They're embedded in text fields.
It's not html.
regex might actually work then!
It's in a field in the database I'm working with.
Regex got me this far.
19:40
OK, Can you paste an example of what a text field looks like?
text fields don't contain HTML, they contain text with some <a>...</a> tags and no tag is nested, right?
@Mat'sMug That's right.
@rolfl They're huge. I can give you a sample. Just a minute.
regex should work. what's your pattern like?
Hang on a sec, I've got my boss in my ear a min.
So it's a HTML fragment after all?
2
19:45
Kinda. They actually enter the markup in the text when they write it.
My pattern is: '<a.*</a>'
Which pulls out the records with links, but if I have more than one, I get all the stuff in between.
Everyone here has been holding off on posting this famous answer on SO:
2
4428
A: RegEx match open tags except XHTML self-contained tags

bobinceYou can't parse [X]HTML with regex. Because HTML can't be parsed by regex. Regex is not a tool that can be used to correctly parse HTML. As I have answered in HTML-and-regex questions here so many times before, the use of regex will not allow you to consume HTML. Regular expressions are a tool th...

you've been, apparently. and failed!
@KitFox Try "<a.*?</a>". At least in Perl/PCRE regexes, the question mark makes the "*" quantifier non-greedy. However, there are many failure modes for this regex, such as comments inside the link text…
I hate that answer. It's just a rant with no justification. I'd downvote it if the post weren't locked.
2
You may also want to put a group in to the regex: <a(.*?)</a>
19:48
but... but... but.. zalgo!
2
Actually, I lie, what you really want, is an expression like......
<a[^>]+\s+href=("([^"]*)"|'([^']*)')
and then pull either group 2 or 3, depending on which one, if either, are populated.
I'm not sure I'm following this. Will I get each link individually then?
And my apologies, but I need to delete that example text.
I hadn't thought about the quoting potentially breaking that.
Well, the href can be quoted with either href='http://....' or href="http://...."
if the quote is a " then the contents can contain '.
if the quote is a ' then the contents can contain "
So, you have to use your regex to find the right contents depending on the text.....
> Have you tried using an XML parser instead?
I am actually listening to Mozart today....
OK, what I'm trying to say is that using '<a.*</a>' I get things like: <a href="http://myurl.org/strain/doc021330.html">021330</a> are backcrossed, <br>--Stock No. <a href="http://myurl.org/strain/Doc001925.html">001925</a>
And I need both of those links.
Maybe I need to tokenize it?
I'm terrible with recursion though.
20:01
@rolfl Did you know that quoted attributes may include literal less-than and larger-than characters? And that attribute values may be unquoted? <a title="<>" href=/foo>link text</a> seems to be valid according to the spec
I did this once before where basically I replaced the search string, like '<a', with a pipe, then split it into tokens, pulled out each token successively and then pared the string down.
@KitFox - see: regex101.com/r/tM0bY2/1 perhaps that will help.
@amon and this is how the cookie crumbles
It's just that's a lot of iterations and maybe I'm missing something.
The updated regex, @amon : regex101.com/r/tM0bY2/2
<a.*?\s+href=("([^"]*)"|'([^']*)')
Which, I know, may be a problem for other reasons....
20:04
Isn't this way easier solved by an HTML parser than regex, just wondering?
meh, there's no sure way, other than to write a full parser.
But there are good enough ways, for a limited and restrained set of inputs.
To me that regex is already getting to look complicated
Yes. Don't parse HTML with regexes. Not because it's impossible (that depends on your regex engine), but because it slowly eats away your sanity if you try to do it even remotely correctly.
5
if all data rows start with a <p> and end with a </p>, I think you could just give it directly to Linq-to-Xml, and look for .Descendants("a") or something like that
@Mat'sMug They don't.
20:06
It does not even begin to process escaped content either.... like:
1
Q: Newbie's first project

Adam AgnelloThis is my first project over 50 lines of code, and considering that I've only started programming a few months ago, I'm fully aware I'm making all kinds of newbie mistakes that you should never ever do. But I don't know what those are, or at least, why those are. So without further ado, here's ...

@CaptainObvious Newbie's first title
3
href="http://this.url/path?parm=a&amp;val=b"
No more Stars!!!!
Note that this question will be closed if the code to be reviewed isn't embedded in the question. — Mat's Mug 30 secs ago
20:08
I mean that I have run out of them
3731 of 18482 records have more than one link, so at least I can whittle the list down significantly.
@KitFox then pretend they do - var value = "<bogus>" + theString + "</bogus>"; and then pass value down Linq-to-XML and extract "a" descendant nodes ;)
Hmm. That's an interesting approach.
html != xml. .... right?
but it might work.. no?
20:12
html5 is a case class of xml
html<5 is a non-compliant case class of xml
What, with content like: <p>This has a list <ul><li>a<li>b<li>c</ul><p> and another paragraph
Great! Close vote retracted ;) — Mat's Mug 12 secs ago
@Malachi - FYI:
189
Q: Your answer is in another castle: when is an answer not an answer?

Shog9I think we can all agree, this sucks: If you've been around a little while, you've probably encountered hundreds of answers like this in various forums, some of them even marked as "The Answer" by well-meaning1 forum admins looking to close a thread. We could try to enumerate the commonly-obse...

@janos nonono HTML is not XML. They share the concept of a DOM, but the syntax is incompatible. HTML does not always require closing tags. HTML does not require attributes to be quoted. HTML does not require an explicit root node, and many omitted elements will be inferred. HTML4 did have an XML representation (XHTML), but HTML5 does not have such a variant. However, you can restrict the HTML5 syntax to an XML-compatible subset.
20:16
@janos: The OP of this question claims that only typos were fixed in the code. Is this true, or was your answer really invalidated?
@amon thanks @amon, I feel enlightened!
@Mat'sMug This is why I love Shog.
Thanks, all. I have some ideas to try out.
Ima commute.
@Jamal I'll check the diff now
@Mat'sMug beat me to it
20:19
@Jamal sadly, yes, he invalidated it: he renamed the bad set and len variables to better names (as I suggested)
I left a comment for him
If he doesn't change it back, you can do a rollback.
ugh. ping-pong
uhm, yeah that's the easiest
It is in fact, not working code. Indeed that brick wall is what prompted me to realize that I could do with a bit of help. — Adam Agnello 4 mins ago
@Jamal I still don't have any stars
20:22
Although, given that reference, he should've used a peach instead of an apple. Oh well.
@Mat'sMug tricked us!
I'm afraid there's a bit of misunderstanding on what this site is about then. Code Review is for when you got your code to work as intended, when it's ready for a peer review. If it's broken code, it's unfortunately off-topic on this site. Please see our help center for all the details. Feel free to edit the working version into this post once you get it to work as intended: CR is undoubtedly the best place to come to learn new tricks and turn good code into great code! — Mat's Mug 14 secs ago
you can't vote to close can now, can you @Mat'sMug
> You voted to close this question 15 mins ago
You retracted your vote 11 mins ago
lol
I am flagging like crazy, I wonder how the mods feel about it?
20:29
@200_success I think I "fixed" the code in his question
I also updated my answer accordingly, so I don't comment on stuff that had to be removed to make the OP's code compile
Umm… is that appropriate procedure?
what do you mean?
Editing code in a question?
19
Q: Should you edit someone else's code in a question?

LstorI have seen several (suggested) reviews lately, where someone edits the code in the original poster's question. Should such edits be allowed? The edits in question are mostly minor. Some add spaces to the code to increase readability, others fix syntax errors in the posted code.

No, it's not, generally.
0
Q: Single Responsibility + Entity Framework

dark_perfectI still feel like I struggle to grasp some concepts of SOLID principles at times, and am hoping for some clarification here. The following classes are entities in an Entity Framework project. namespace MyCompany.MyProduct.Core { public abstract class DataError { public int ErrorId {...

20:40
@200_success I think we have something different here. I edited the code to bring the question to on-topic, only fixing bugs in it, and in line with the intent of the OP
@Malachi Mods don't have feelings. But they might secretly hope that you run for the upcoming elections, so that they can start flagging like crazy to see how you feel about it. ;)
@janos you are only supposed to fix what might be copypaste error
I overlooked the build problem caused by len while I answered, which made the question off-topic without non-trivial changes, and leading to this mess. All this wasn't fun for me at all
20:58
note to self: don't mess with mods' feelings.
note to self: don't mess with anyone's feelings.
^^ and note to @Mat'sMug
@Mat'sMug Only if they stop being mods.
I wonder who we will get, I rather hope we keep the three we have.
2
we do have a wonderful trio :)
@CaptainObvious I think this may be off-topic.
If the question is off-topic because of brokenness, then it's the OP's job to fix it.
21:08
I didn't read it carefully yet.
I don't think all the code is there, from my skim.
Oh, I guess it is an either/or/else question.
Next time, I'll read it better so I don't waste your time. Sorry.
0
Q: Stacked Bootstrap Modal Error - Disables Scrolling

Carl SmithHoping that someone can help me here with the Bootstrap Modal. I have a modal and within that modal, there is a dropdown that displays large hidden content, this is working. Now when you open the next modal, stacked on top of the first modal and dismiss it, the scrolling on modal underneath be...

@CaptainObvious Off-topic.
Crap, I should've closed with the broken reason.
@Jamal On topic now (unless the code is broken).
Looks fine, though.
> Now when you open the next modal, stacked on top of the first modal and dismiss it, the scrolling on modal underneath becomes disabled.

I have created a full example, including the steps to replicate the issue I am facing.
21:23
OK, I see.
I keep making mistakes today, maybe I'd better leave for a while.
I'll swap the reasons, then.
tremble, mortals:
in VBA, 38 secs ago, by Duga
I shall rule the world!
2
@Mat'sMug Or at least rule StackExchange chat
@Mat'sMug I think I will start with that
It get's really confusing when Duga starts talking....
@SirPython Sorry
21:32
Nothing to be sorry about - it's just a little startling ;-)
BTW
BTW-Work
@CaptainObvious Off topic
@Duga Already been on hold twice.
The only thing that would make this more cool is if Captain Obvious would have a conversation with "Duga"
I got a hat by changing my name to Captain Obvious.
Actually, I think I changed my avatar to his too.
in VBA, 6 mins ago, by Mat's Mug
I think @Duga is a conspiration to make us all run out of stars
21:37
Was it because you changed your name to "Captain Obvious", or because you changed your name.
I think it was the avatar.
Not sure, that hat had a bug.
@Mat'sMug I just lost a star starring that....
@Mat'sMug you really think they want me to run for Moderator?
@Malachi nope.
@Hosch250 I know I was just playing with it :)
21:42
Oh, so you know the sign-in too?
SEKRIT
Obviously.
I wasn't asking you to give it away, but you gave your self away.
0
Q: Allow Zero to be True in Python

MikeiLLUsing if not to test if a variable has been set, but what if it is set and has a zero value? Seeing a lot of posts explaining that bool is a subclass of int, but having trouble finding the answer to how to make something with a value of zero be true. Something tells me there's a better way to d...

0
Q: Net::SFTP Uploader Test

Graham JacksonI have the following class: class Uploader def initialize(host,user,opts) @host = host @user = user @opts = opts end def upload(local_file_path,remote_file_path) Net::SFTP.start(@host,@user,@opts) do |sftp| sftp.upload!(local_file_path,remote_file_...

"What!? We weren't expecting the pirates for another 6 days! Man the guns!!!"Xeoncross 23 hours ago
Difference between mph and nmph.

« first day (627 days earlier)      last day (3688 days later) »