« first day (830 days earlier)      last day (3486 days later) » 

19:00
@Duga Now on CR, while the code is broken.
@Sneha Why did you post it on Code Review then? Broken code is off-topic there! — Mast 20 secs ago
On the other hand, the question did not really require any context to start with. Even the title is enough to know what's going on.
Yes Android, please. Wait for me to touch my phone for the first time the entire day to update 20 programs
Definitely don't do that while it's just laying on my desk
You're liking Android so far @JeroenVannevel?
Its SDK is crappy and so is its UX sometimes
19:04
I'm starting to consider moving away from Android because of all security issues, obviously it's been going on for a long time but the Stagefright thing is getting really serious
but whatchagonnado
@skiwi cough goto fail cough
That wasn't Android.
All phones are flawed. You either accept it or you don't use them.
But iOS can be easily patched
^^^ that (and, by anyone ;-)
I'm just gonna wait and see if Stagefright is going to cause any real trouble under the non-recent Android devices... I don't see a reason why it wouldn't become an issue
19:06
Or use dumbphones instead of smartphones.
Well, I do want to feel smart
Yea, that's what I did. Got a laptop for the smarty stuff.
@skiwi Everything has security issues, if the hacker knows where to look
@Malachi It's a whole lot different if the exploit is out there in the open though
@skiwi if you can build it, someone can unmake it. just a matter of time
19:11
Correct me if wrong, but for Android devices that are not going to get updated anymore, I feel that Stagefright is similar to having a security bug in something as low as the BIOS in your PC
Android Devices that aren't getting updated anymore shouldn't be in use.
The reality is that some Android phones that have been released today, will never get updated
Even for popular (Western) brands they're out of the loop after 2-3 years
-1
Q: Using Struct/Union has KEY & VALUE in MAP

SnehaI'm very very new to C++ STL. I would appreciate if someone could review my below code and correct it or even suggest if any better approach to achieve the same. I'm trying to use Struct/Union has KEY & VALUE in a MAP. So that it would be easy to fill the key/value and parse it backwards (My Key...

0
Q: cat in go - is this idiomatic? What should be changed / improved?

Christian HujerIn order to learn Go, I've implemented the cat program in Go. I want to know if the code is idiomatic and what could be improved. package main import "fmt" import "io" import "os" var errors int var buffer []byte = make([]byte, 4096) func main() { catFilesOrStdin(os.Args[1:]) os.Exit(...

19:36
if (invokedType.Symbol?.MetadataName != typeof(string).Name || invokedMethod.Symbol?.MetadataName != nameof(string.Format))
pure sexiness
@rolfl: So far I've been declined from one IBM position, but two others are still pending.
I have been so preoccupied it's silly. I did nothing from my side...... let me catch up.....
@Jamal That's no good. :(
I'm sorry, but I don't see much special about being declined at <insert-big-company-here>
1
Q: Time spend in scoped timer

FooBarI want to check some timing of my (pre-C11) C++ and wrote a class: class ScopedTimer { timespec start_,end_; std::string name_; /// name of this timer (used in output) bool active_; /// if not active, no output is printed clockid_t clock_id_; /// clock type used...

0
Q: Haskell FizzBuzz - Getting Input Values into Functions

CodeNinjaSo I'm in need of a little assistance or at least a point in the right direction! I'm new to Haskell but I'm familiar with C# and PHP. I'm trying to create a FizzBuzz function that allows 3 parameters to be entered. I understand the general concept of FizzBuzz but I'm trying to be able to create...

19:38
It's of course very cool if you get it though ;)
@JeroenVannevel What does it even do?
@skiwi Checking if the invoked method is string.Format()
@EBrown It was for this one. I guess it was because I'm not familiar with microprocessor architecture and am somewhat weak with computer architecture.
in a totally type-safe manner and all that jazz
This question is probably better suited for CodeReviewdave 36 secs ago
@Jamal Ah, yeah. I can imagine that could be a reason.
19:41
it also only accesses MetadataName if invokedType.Symbol isn't null
@Mat'sMug Elvis is cool, right?
@JeroenVannevel Makes me dizzy.
@JeroenVannevel There's a new video about replacements of sun.misc.Unsafe
I totally didn't know the sun.misc.unsafe thing was actually a big deal at this moment
@Jamal I expect it's the lack of experience..... the Power group is selective, and you would have competition for a role that is more senior (band 8/9 is senior).
I would be surprised if you could get in on anything more than a 7..... it's an IBM thing.
It looks like an Electronical Engineer position. If they'd have it close to home, I'd sollicit on it.
19:45
This is the scariest part of my day...D:
@EBrown Going home in the middle of the night?
I hate publishing websites to new servers.
@Mast No, publishing a website through Visual Studio to our IIS Debug server.
@rolfl So I wouldn't understand? ;-)
If your code is working, then codereview.stackexchange.com would be a better place to ask this. — Mogsdad 41 secs ago
So this is weird...I can run this project locally but not on the debug server.
On the debug server it crashes at login.
19:49
@Jamal I think that specific posting is misleading. They are not asking for a recent grad, they are looking for someone with 5-15 years experience.
is anyone asking for recent grads / people with 0-3 years experience? and not going to severely underpay them?
4
Tell them about your paperroute you did in highschool
the experience in the listed technologies is different to "general" experience they want...... The internal information I can see makes it more clear. It is a job I could perhaps qualify for.
That adds a few years of experience
@rolfl Maybe the "Professional" thing at the very top should've given it away for me. At least I tried. There is this entry-level position at least.
19:50
@Mat'sMug Yea, they're usually called 'Young Talent Program' or stuff like that.
@Mat'sMug We call those internships here. :)
Only slightly underpayed, not severely.
@Jamal That is more in line what I would expect you to be eligible for, as a new grad.
@Mat'sMug I've only found one company who actually does this: Cerner. It's out-of-state for me and there's much competition. So now I just have to get lucky with a company that may hire me anyway, unless I find something with my alma mater.
In IBM terms, it's a band 6/7, which is "junior". Band 8/9 is senior, band 10 and up is "very senior".
19:52
@rolfl They don't ask for a cover letter, but I hope my resume is good enough. I got an evaluation from TopResume, and the results weren't entirely ideal. However, they may be more concerned about selling me a service.
@rolfl band 5-and-below is "don't even bother"?
If I do miraculously make it to an interview, would I be able to use you as a name drop, or would it work best for employees at the same office?
@Mat'sMug Band 5 and below would be for non-technical staff.... assistants, etc.
I can't seem to google a decent infographic on IBM structures... they've been arranged the way they are for the past century or so, I am sure ;O
I can send over my resume to someone willing to take a look at it. I especially need someone in my field to evaluate it.
@Jamal I can take a look at it for you.
19:59
Email?
Okay
Then delete that message if desired.
Sent
@Mat'sMug What field/languages, specifically?
anything .net
@Jamal The first thing I noticed is that you need references, badly.
@Mat'sMug What area/locale/geographic region?
20:04
was more of a rethorical question, but say Montreal area
How do I get references? Just anyone in my field who knows enough about my work?
@Jamal Usually professors, previous bosses, family friends (though not too close).
Usually you want at least three of them.
Let me find my resume so I can give you examples.
I have no previous bosses or family friends, just professors.
@EBrown I've never put family on my resume, but that may be a cultural thing.
@Jamal That's a huge start.
I'm also sending my resume over so you can see what has worked for me to get this job as well.
You definitely need references though.
20:09
I probably know of one professor, maybe two, I can consider for references.
You should also have an "objective" stated at the top.
One sentence, something as simple as: "To explore a career in the Information Technology field, primarily in a programming, network administration, or server administration field."
@Jamal You don't have any professional colleagues you worked with? No one you did a large-scale project with?
@EBrown Nyeah, that's outdated for our industry
I've seen more people discourage it than encourage it
I haven't done a large-scale project with any.
@JeroenVannevel I've always had one, and no one has mentioned anything of it.
@Jamal No students you worked regularly with? I think that is what is hurting you most: you have no people who can vouch for you.
You're either replying to a job advert in which case it's obvious what your goal is or you're cold calling in which case your cover letter covers it
20:12
@JeroenVannevel That's pretty much what they told me, yea.
Also, @Jamal, I assume I can trust you if I leave my contact info in the copy I send to you? Really don't want to go export it from Word again...lol
@EBrown Of course. :-) It's no different than what I've agreed to in the moderator agreement.
@EBrown Knowing Jamal, he'll edit it out ^^
7
20:36
Only references I have at this point are @Mat'sMug, @RubberDuck, and @JeroenVannevel, if they accept...
I'm voting to close this question as off-topic because it's about code review. — BartoszKP 45 secs ago
If it works then this question is probably better suited for CodeReview, however I would check against their policy before posting there — Steve 37 secs ago
20:53
I finally started putting projects on my GitHub, so I can add that to my resume.
If I saw that code in a code review I'd wipe the coffee off my screen and grab my shotgun.... — John Conde 32 secs ago
0
A: Looking for a functional collapse/group-by of this data in ruby

rahul# v = data.map{|d| d.values[0]} # k = data.map{|d| d.keys[0]} k,v = [:keys, :values].map{|m| data.map{|d| d.send(m)[0]}} seq = v.sort.uniq.map{|x| {:start => k[v.index(x)], :stop => k[v.rindex(x)], :value => x} } seq.each do |p| p p end

Great. I think I might have to finally write a regex
I dreaded this moment for a long time
@RoboSanta wtf santa, you just find downvoteable stuff!
3
on a related note, that question is closed...
21:17
@Vogel612 Stargreed.
I'm not sure who's bot it is, but perhaps a rename to Downvotable Stuff Notificator would be better.
Or something like that, we all know my naming sucks.
@Mast I think it's janos'. Ask Mat'sMug.
DownBotPLZ
@SirPython Yea, I heard @Mat'sMug saying something like that.
The idea is good and flawed at the same time.
Accepted answers with 0 score usually have 0 score with a reason.
On the other hand, it's good to sort those out. If they're low scoring while they're good, they deserve upvotes. If they're low scoring and they're bad, somebody is usually good enough to downvote it.
21:34
I have a regex that matches when it sees an uneven amount of curly brackets around a number
However when I have an even amount of brackets (say 4 on each side of the number), it considers it still a match and claims it matches the inner three
@JeroenVannevel If I need to match brackets, I do it the easy way.
If it's a {, +1
as you can see here: regexr.com/3bir8
If it's a } -1
If the result is 0, they're matched.
If the result isn't 0, they aren't matched.
You could do that with a regex or with 2 if statements. I tend to go for the latter, but there must be a third option.
that wouldn't take nested brackets in account
like {{Hello {1}, my name is {0}.}}
@JeroenVannevel Works fine, results 0
21:39
I wouldn't be able to use it in my scenario because I don't want to just know when something has an equal amount of curly braces
**{**{Hello {1}, my name is {0}.}} 1
**{{**Hello {1}, my name is {0}.}} 2
**{{Hello {**1}, my name is {0}.}} 3
Markdown is still broken for multi-line...
I want that {1} to be triggered as a match
@JeroenVannevel Why?
It's matched or it isn't matched.
@Mast won't be fixed anytime soon, I figure
@JeroenVannevel so you want the smallest group?
@Vogel612 Not in development anymore IIRC
21:40
> // Verify that all placeholders are counting from low to high.
// Not all placeholders have to be used necessarily, we only re-order the ones that are actually used in the format string.
//
// Get all elements in a string that are enclosed by an uneven amount of curly brackets (to account for escaped brackets).
// The result will be elements that are either plain integers or integers with a format appended to it, delimited by a colon.
// Display a warning when the integers in question are not in ascending order.
@Vogel612 I'm trying to get all the placeholders that would be valid for a string.Format() call. Consider these scenarios: regexr.com/3bir8
@JeroenVannevel this sounds like something you need extra stuff for
@JeroenVannevel What exactly are you trying to do? Can you give an example of several inputs and expected outputs? Perhaps I can help you.
Ah, I see now.
@JeroenVannevel you'll have to check the group-count..
@EBrown regexr.com/3bir8 I updated it with more info
Greetings
21:44
@Vogel612 Not quite sure what that entails. Can you elaborate?
@BartoszKP I don't know where you've ever worked, but rewriting bad code or improving existing code is a major part of what I do. Asking questions related to such tasks can always be labelled "code review", but that doesn't make the question illegitimate or off topic. This question is on how to improve a specific method doing a specific task. If that isn't on-topic I don't know what is anymore. — Morten Mertner 15 secs ago
@JeroenVannevel well you get your matches in matched groups.
you'll need to grab a match and then examine it in code to find out whether the braces are balanced or not
that said you should change \d to (\d+)(?::.{2})?
this gets you the trigger on the colon stuff.
 \{(:?\{\{)*(\d+)(?::.{2})?\}(:?\}\})*
@Vogel612 alright, getting close then
So are you saying that I can't distinguish between 4 brackets and 3 brackets because it will always consider those 3 brackets part of the 4 brackets?
given the string {{{{4}}}} it triggers on {{{4}}} (the three innermost brackets)
you could try working with lookaheads (and behinds)
Is there no way to say that it has to be an uneven pair without any brackets surrounding it after that?
21:51
you'll still need to check for balanced...
I'd use the regex to find the opening braces and find the closing braces one by one before continuing with finding the rest. That could work.
Why would I need to check for balanced brackets? It seems to work just fine like this: it always takes an uneven amount of brackets
17 mins ago, by Jeroen Vannevel
However when I have an even amount of brackets (say 4 on each side of the number), it considers it still a match and claims it matches the inner three
it matches on the 3 brackets that are part of the - in total - 4 brackets
That's 3 brackets or 3 sets of brackets?
21:54
Referring to regexr.com/3bir8 : You see the {{{{4}}}}? It triggers on the 3 brackets on each side of it. So yes, it matches an uneven set of brackets but it shouldn't because it's 4 sets in reality
So yes, sets of brackets. 3 brackets on each side
My bad if that was unclear
@JeroenVannevel but it also triggers for things like {{{{{4} which isn't really balanced, is it?
No but that's fine: I don't really care about that
that innermost {4} is a valid placeholder for string.Format
In my code, I will strip all the brackets out anyway (if I can't do that with the regex)
It's what inside the brackets that I'm interested in
wat...
although {{{4}} also triggers. Which it shouldn't. Damn it.
@JeroenVannevel regexr is being a PITA.
I figure you're not using js?
what do you think of the following?
22:01
C#
that...
seems perfect
No wait
{{{{4}}}} {1} {{2}} {{{3}}} // Trigger on '1' and '3'
There yours triggers on the 4 and 2 as well
yes, the darn lookaheads and behinds don't work as intended..
What are you trying to match?
1
Q: How do I clean up all these if statements?

Habeeb BaigRight so I was doing a quick project, and sought a quick way to finish one section of my python code. I handed it in, but I'm well aware that it's bad code, but I was wondering if there was a good way to condense this code into fewer lines. def nGen_army(level, strength, weakness): if weakness ...

@MortenMertner: After reading through stackoverflow.com/help/on-topic and codereview.stackexchange.com/help/on-topic, I would consider this question to be off-topic for StackOverflow and on-topic for CodeReview. It doesn't ask a single, practical, answerable question. Instead, it is asking for feedback on a specific, working piece of code in the areas of performance and best practices. — StriplingWarrior 32 secs ago
No context (with some informal text), but still two upvotes.
22:10
Or I could try to adapt the way .NET handles it internally.. github.com/dotnet/coreclr/blob/master/src/mscorlib/src/System/…
@Jamal His problem is fairly straightforward.
We have no idea what he's doing and why, but the ifs are a dead giveaway.
@JeroenVannevel I think I got something figured out..
@Vogel612 Try /\{(\d+)(?::([a-z\d]{2}))?\}/gi
@IsmaelMiguel doesn't account for the uneven number of braces
22:13
(?<!\{)\{(?:\{\{)*+(\d++(?::.*?)?)\}(?:\}\})*+(?!\})
@Vogel612 That seems to work for all those scenarios!
How does it differ from the previous version?
The difference between yours and mine is that yours matches {{{3}}} while mine only does {3}
12 more votes on this one and I could get a Guru badge!! --> codereview.stackexchange.com/a/40280/18427
@IsmaelMiguel incorrect.
And the {{{{4}}}}
22:14
yours will match {{{{4}}}}, mine won't
also the {{2}} is incorrectly matched
@JeroenVannevel the lookaheads and lookbehinds are organized differently
So, it must only match uneven braces?
also I'm using more posessive quantifiers
@IsmaelMiguel yep. that's a pain, but eh
you need a negative lookbehind with greedy double opening brace + 1 for the opening side
and 1 + greedy double closing brace + negative lookahead for the closings
@Vogel612 What would that magic look like?
22:17
3 mins ago, by Vogel612
(?<!\{)\{(?:\{\{)*+(\d++(?::.*?)?)\}(?:\}\})*+(?!\})
and it works reasonably well. just 350 steps for 15 matches on the blurb text
still doesn't solve the problem of unbalanced counts..
@Vogel612 You wouldn't happen to know what that translates to in C# regex?
For testing purposes:
void Main()
{
	var inputs = new[]
	{
		"{0} {1} {2}",
		"{1}, {2}, {0}",
		"{{Hoho}} {0}, {3}",
		"{0:hh} {1:D2}",
		"{{{{4}}}} {1} {{2}} {{{3}}",
		"{{{{1}} 2}}"
	};

	string pattern = "";
	foreach (var input in inputs)
	{
		var matches = Regex.Match(input, pattern);
		foreach (var group in matches.Groups)
		{
			Console.Write(group);
		}
		Console.WriteLine();
	}
}
don't you have regexbuddy?
You're my regexbuddy
3
If you're too busy/not interested I'll dive into regex after my exams but right now I don't have that much time so I'd prefer to receive a quick-and/or-dirty solution rather than learning regex right now
that thing is PCRE compliant
you should be able to drop it into a @"" and use that as pattern for whatever C# uses for matchers
(in java you'd have to escape all the darn backslashes...)
I'm getting argumentexceptions
> parsing "(?<!\{)\{(?:\{\{)*+(\d++(?::.*?)?)\}(?:\}\})*+(?!\})" - Nested quantifier +.
22:24
ohh the posessive quantifiers are not supported? damn that's bad for the backtracking, I think
okay you should be fine if you remove three pluses
*+ and ++ have loose the trailing +
I found a small maintained .NET library that is PCRE compliant and runs your regex perfectly
How is the performance between the PCRE and the .NET one?
for your sample text the difference is inexistant
I think the posessive quantifier is not really helping that much here, so the difference should be negligible
Is there a usecase that would make the difference have a larger impact?
I doubt it
Alright, then I won't incur the extra dependency
Appreciate the solid help, @Vogel612!
22:31
you're welcome. I learned from it :)
@Mast Someone just suggested a better title, so I accepted that and made other changes. I also undoed the indentation edit since answers have already been posted.
Bit of code review: using the Path.Combine method is safer (more refactor-friendly; less error prone) than string concatenation when building file paths: String filePath = Path.Combine(sourceFolder, fileName);Sam Axe 17 secs ago
okay WAT...
300 steps to 1.9k steps...
difference: moving the location of an opening brace...
23:01
@Vogel612 That's almost like fixing an error in Java.
Nope it's only catastrophic backtracking
Alright. The analyzer seems to work in all scenarios I've accounted for so far
Now comes the hard part
23:46
This is probably better suited for codereview.stackexchange.com, but please read this before posting there. — chepner 9 secs ago
Belongs on codereview.stackexchange.com — glenn jackman 14 secs ago

« first day (830 days earlier)      last day (3486 days later) »