« first day (1185 days earlier)      last day (3131 days later) » 

Zak
Zak
13:06
Damnit. Parsing peoples' names is hard.
... with regex.
Zak
Zak
@Pimgd There's now much less regex
but there is still regex, and thus still a problem =D
Zak
Zak
But now I'm having to confront all the in-built assumptions, and some of them are really tricky.
Assume nothing
13:11
maybe you don't have a computer to run code on
now what
Zak
Zak
Okay, I was looking for useful recommendations. Or at least funny ones ^^
why are you parsing people's names
Zak
Zak
@Pimgd We have a drive full of Client Files, where each Client Folder has their name on it. We also have a CRM database full of peoples' personal information. I'm trying to cross-reference the 2 looking for people who are in one but not the other (or with different names, or whatever)
I think you might be looking for codereview.stackexchange.com :) — Dobz 51 secs ago
This should be on the Code Review SE - codereview.stackexchange.comDan W 17 secs ago
Zak
Zak
The problem is that I'm not the one who creates/uses either of these systems, so I have to try to require as few rules/conventions as possible.
13:21
-1
Q: if else cascading replacement

AndyI am developing a simple java program which is run from command prompt using the JAR that I built. My program involves a lot of if conditions. My scenario is like, even if one if condition fails there is no point in running the remaining program. When an if condition fails I want to do the foll...

-1
Q: Simple matrix class C++14

CorvinusI created a simple 4x4 matrix class (column-major). I would like it to be efficient and to use C++14's full capabilities. Can I improve it? #include <array> class mat4 { public: constexpr mat4() noexcept : matrix() {} constexpr mat4(const std::array<float, 16> &m) noexcept : matrix(m) ...

0
Q: Function for getting strings consisting of random characters

mizechI've made this function for to be used while testing. // ----- THE ACTUAL FUNCTION ------------------------- // Returns a string consisting of random alphabetic // characters. // @param { string } separator - Char which shall be // used to separate the single chars. // @param { numbe...

Thanks guys that Counters and defaultdict is what i'm looking for. Next time i'l use codereview (: — Guy s 57 secs ago
@CaptainObvious pls wait, getting real question...
@Pimgd I think I'm going to edit out that users comment about it not working with VS
okay
Right now it could be interpreted as looking for a fix to compile with that
13:25
Got a question about answer invalidation
Got a question I had asked and forgot that I had hardcoded a password in when trying to work out a bug - answerer pointed it out and due to security of it I'd like to delete it from the question (and answer :P)
1
Q: Phishing Project - Refactor Using Models

Trojan404After receiving some good feedback on the previous question, I've refactored my database and have begun to refactor the associated code. As a result of implementing models for all tables in the database, it has become smoother to use Eloquence Builder instead of a custom class using PDO. Below f...

@Trojan404 It would be in past revisions of edits, you need moderator help
@200_success You around? ^^
@syb0rg IK, that's why I asked here :)
Yep, needs moderator intervention
... never the less you ought to change the password where it's used now ofc
mhmmm, it's just a development testing email so I'm not that concerned about it, but nevertheless I still don't want it out there :P
Agreed, security has to be considered breached
13:30
What's up?
Redaction?
I'd replace it with "password", that way the answer and question still keep making sense
or something to that effect
I've initiated the redaction on the question, but it will require a second moderator to approve it before it takes effect.
We'll make the corresponding change to the answer as well.
@200_success all good - thx. mind deleting the statement like 3 lines ago that helped you find it?
13:40
OK
thx again
@Mast Also, the build of PortAudio seems to have broken for some reason, so I'm going to have to fix that
14:06
0
Q: Better way to do this with Ruby?

David WestI'm looking for a better way to write this. Maybe with #map and #reduce/#inject codes_and_totals = [{'1001' => 153, '212' => 153}, {'212' => 1}] totals_across_locations = {} codes_and_totals.each do |location| location.each do |class_code, total| totals_across_locations[class_code] ||= 0 ...

0
Q: Validations in filter class

JavadroiderFor my web application I have written AuthenticationFilter which validates each request to check against CSRF attacks,Browser Checks,Session Validity etc. Instead of putting multiple if else blocks I thought it can be implemented as following. Please let me know if I can go ahead with this. ...

Monking.
@Legato Monking!
0
Q: I haven't reviewed it myself... Can I ask for help?

Stewie GriffinMy question is this: Is it OK to ask for a review when I've spent a minimal amount of time trying to restructure and fix it myself? Background: I'm fairly experienced in MATLAB, but a complete beginner in Python and VBA, as evident from the two linked questions. I have to (and want to) us...

You should clean up the formatting of the question before posting on Code Review — syb0rg 26 secs ago
14:21
Turns out we got WiFi at the donor location now.
Smart move.
lol
I can't imagine us without our phones or wifi for more than 5 minutes
We'd all go more insane than we already are.
I didn't have a smartphone till 3 months ago or so. Didn't miss it.
0
Q: Yum Notification Script

FlyingPiMonsterThis is a Bash script I wrote to email me when updates are available for my server. I'm new to bash programming, so I don't know if I've done this well. It's meant to be fairly flexible, so I have a configuration file for it. Let me know if it would help to post the default config file. #!/bin/...

@syb0rg Could be linked to sphinxbase failing.
@Mast No, it was happening in it's own sandbox
14:25
Odd.
Trying to build any version of their source code was failing on my Mac
Couldn't find any output devices for some reason
An older version was not an option or do those fail as well?
Could be a configuration problem though.
I tried the latest source code, as well as the last "stable" build
Yeah, I was starting to wonder if it was a problem with my Mac setup
Cause the Travis builds weren't failing
Sounds suspicious indeed.
The weird thing is, with brew install portaudio, it works fine
Redid edit with more/better live demos: stackoverflow.com/documentation/proposed/changes/71313
14:35
Sorry for the post. Didn't realize there was a code review site. I moved the question/review to: codereview.stackexchange.com/questions/136548/…evilmonkey2148 26 secs ago
0
Q: Python Working with CSV and Strings

evilmonkey2148I am utilizing an API module for interacting with virustotal.com in order to get AntiVirus results based of SHA256 hashes. The code I have is working but I feel like it can be improved greatly. I think that I am brute forcing my way to some of the text fields I am looking for. Any suggestions on ...

possible answer invalidation by David West on question by David West: codereview.stackexchange.com/posts/136543/revisions
14:54
So our DBAs have been talking about one of our projects where we have to put stuff in the cloud
And we're going to be using AWS and they were worried we wouldn't have a data warehouse (since existing DW stuff is done on-site).
I had to inform them that a DW solution does exist in AWS.
sqlite db file hosted on a cdn
I'm surprised that no one thought about actually checking if something exists before assuming we don't have it :(
Data Warehouse?
Oh. It is no longer July.
2
15:05
possible answer invalidation by David West on question by David West: codereview.stackexchange.com/posts/136543/revisions
@Sumurai8 It's scary to think I go back to school in a month
I go back to school in a month too.
I still have a half-written Monopoly game sitting around.
0
Q: VBA Print Summary Pages - Excel - Runs Slow

RossLooking to speed up this code some if possible. There is a main page with this macro assigned to a button. Once the button is pressed it ask if you wish to continue and mentions it takes a while to run the macro. Looking to speed it up some if possible. Sub Picture11_Click() Dim sht As Workshe...

0
Q: Real Coded Genetic algorithm performance issue

user112995I am pretty new to genetic algorithms, and wrote a real valued genetic algorithm with an sbc function used for crossover. Currently I was trying to use the class below to train the weights for regression. It has failed pretty badly, producing an r^2 value of around of around .01, while SGD achiev...

I think that the last community challenge was too long. With 200 lines I have not even written half of the possible things that can happen in a game of Monopoly
Also monking
15:11
The only thing you need to write is friendship.ruin() because that's all that happens in Monopoly.
I find that there is little to review on ruined friendships. friendship.repair() is undefined, so you pretty much can only let friendship go out of scope to get rid of it.
(and yeah, tbh, monopoly is very far down the list of board games I like to play)
0
Q: Determining whether a date is within a range

Roll Tide BradI am taking a user input which consists of a from date and a to date. Those dates are compared against 4 cells in a row - a post date, pause date, resume date, and a close date. My goal with this code is to generate an array of rows with dates active within my date range. Primary concern is if ...

@Duga uhmmmmm
@Pimgd He's trying his David Best.
I don't know enough 'bout the language but it looks off
15:24
Well, I was planning on implementing Spotify support once I got builds to be stable but I'm not sure that can happen anymore: jonaslundqvist.net/2015/05/06/do-not-use-libspotify
15:36
What do you guys think of v1 of my logo? github.com/SafePhish/SafePhish_App/issues/6
I'm in the boat of removing the envelope because it just isn't working, but I just want feedback in general - font color etc
Yeah, I don't like the envelope
1
Q: Creating an If/Else Statement to Simplify my Code

striderno9I'm pretty new to javascript but I'm trying to created a text based game. I've written a few scenarios and based on the player's decision I have different scenarios written out. As of now I have the code written and it works but I feel like I can be more efficient with an if else statement in my ...

Yea I liked the idea when it was talked about, it just didn't pan out how I thought it would
@CaptainObvious I know the answer this needs but I don't have the time to write it out in full
... which is either go and use something like Twine or ... manipulate the dom with javascript yourself; don't go fading in elements
but alas, it's a beginner and a good answer would have proper explanation
@EBrown Why ping me?
15:43
I thought you would be interested in that.
Maybe, except I don't care for JS too much.
"We have to increase this Number column from varchar(10) to varchar(11)"
"Maybe it should be a integer?"
"It can't be an integer, because it starts with two characters for the country"
user image
4
sigh - maybe normalize it a bit more and separate out the implementation lol
Never mind that that row already has country info in it
Windows is such a PoS sometimes.
Especially Windows 10.
15:49
It's already normalised (which is a surprise, for this schema), but duplication of data and all @Trojan404
About 3/10 times I try to resume from Hibernate it crashes on startup.
I've not had a problem with Windows 10 so far
Except that stupid Cortana opens everything in stupid Edge using stupid Bing.
2
@DanPantry the elephant's face still says it all. he doesn't have questions, he just thinks you're insane
Stupid sexy Flanders Cortana.
@DanPantry I just don't even bother with Cortana, not hard to just hit START and type
15:50
It is when you're on the other side of the room.
@DanPantry you're telling me you actually use those magical things called 'legs'?
No, I roll across the floor like a slug.
2
ah makes better sense
Zak
Zak
@DanPantry I'm reasonably sure I can now recognise that imgur link on the starwall from memory
it's just such a 'wtf?' architecture decision. I don't understand.
Why did we keep it? If it's a case of backwards compatibility, we could always use a View.
15:54
I',m pimping my answer, but another answer on the same question needs attention, can you help improve that answer? codereview.stackexchange.com/questions/136322/…
Monking ALL!
> To be completely honest, this code snippet appears to be C rather than C++ with a few exceptions.
isn't that the definition of C++?
@DanPantry It's these kind of mistakes, though, that sparked me to redesign my entire database
"This C++ code is C++ except when it isn't"
Yes, but using references instead of pointers in function call might be better.
What's the difference? I haven't done C++ in any great detail
15:56
Question: when building a web API, should I throw exceptions, or just return an error response in JSON?
@EBrown exceptions would generally propogate as a JSON response to the user
0
Q: September 2016 Community Challenge

EBrownWe've just gotten the August 2016 Community Challenge going, so it's time to pick one for August. It's time to choose a community-challenge for September 2016. Post your challenge as an answer to this question. Feel free to resubmit non-winning ideas from previous months. Vote for those answ...

You knew something about Identity/claims, right?
Yes sir
15:57
have a look at that question if you don't mind
@DanPantry So I should wrap the whole thing in a try/catch block?
@JeroenVannevel Will do when I get home. Looks lengthy enough for me to not have time to answer it now, but also from a cursory look I have no clue
@EBrown in Node we use middleware (newer versions of OWIN/ASP NET can do this as well)
The controller/middleware that fails throws an exception
which is caught by a middleware and turned into a user friendly message
I'm just going to do it manually.
So I would say: throw, don't catch, let something else handle it. Separation of concerns and all that.
AKA: duck
15:59
app.use(async function (context, next) {
  try {
    await next()
  } catch (error) {
    context.body = { error: true }
  }
})
This is something I've done in JS before.. it calls the next middleware in the chain, and if it fails then it overwrites the body with something else
Did somebody say "duck"?
I think this belongs on codereview, because you have a working solution, asking to improve on it is out of scope for stackoverflow. — ker 23 secs ago
Quack owack.
@syb0rg Ever seen the t-shirt with this on the back "I'm a member of the bomb squad, it you see me running try to keep up!"
16:01
@Hosch250 Yay, somebody said "duck!" Quack! :3
@pacmaninbw Nope
It is out there, I've seen it, never saw them running.
16:13
2
Q: Cold Fusion Multi item shoppingCart

BryanI'm trying to build a multi item shopping cart. If users selects one product, it will take them from the product.cfm to shoppingcart.cfm, where it needs to print out product information. However, if user hits back arrow, and adds another item, the shopping cart needs to be able to recognize two i...

Oh wow, I HATE VB*!!!
I just was debugging why something wasn't working, and guess what the problem was?
The moment you realize that you eat too much Subway. Walk in and they start making my sandwhich before I even get to the bar.
4
Protected Overrides Function GetRevisedDocCommentTrivia(docCommentText As String) As SyntaxTriviaList
    SyntaxFactory.ParseLeadingTrivia(docCommentText)
End Function
@Trojan404 StarBucks does that too.
And no, I don't drink coffee. I read about it in, I believe, a management book for college.
Anyway, notice the bug--no return in the function, and it doesn't cause a compiler error.
Can someone please tell me who made that part of the spec?
0
Q: Time Limit Exceeded for ETF - Euler Totient Function at Spoj

sarvajeetsumanIn number theory, the totient φ of a positive integer n is defined to be the number of positive integers less than or equal to n that are coprime to n. Given an integer n (1 <= n <= 10^6). Compute the value of the totient φ. For the code written below, this is giving TLE. How i can optimize thi...

@Hosch250 Blame Lippert.
16:26
Really?
No idea, ask him.
@Hosch250 Which VB version?
Roslyn's version.
At least it does provide a compiler warning...
Should throw a warning about possible NRE.
Yeah, it does.
16:27
Does VBA have a pedantic or treat all warnings as errors setting?
Just think of all VB.NET methods as having a Return Nothing implicitly.
I don't think Option Explicit does it.
Nope.
No Option statements change that behavior.
In this case, it just resulted in no values being re-written into the document.
@Hosch250 Which is a pretty severe problem ^^
16:29
Yeah, I was thinking it was in another place.
I figured out it wasn't there, then was just glancing around and noticed that.
@Zak I hope that's not RD's fault.
Zak
Zak
@Hosch250 Nope.
@Zak Alt+F4.
And this means it is time to write tests.
Zak
Zak
16:31
@Mast I prefer Kill personally
@Zak I prefer Ctrl+Shift+Esc, kill the process.
There's probably a faster way to do that.
Question on an API design: I'm wrapping all responses in a Wrapper object (like SE API), should I wrap errors in the same object?
>
You've earned the "Taxonomist" badge (Create a tag used by 50 questions) for the "fun" tag.
Monking!
@Mat'sMug Can you swap the featured Community Challenge questions out?
16:36
@Mat'sMug What is this... fun... you speak of?
@Sumurai8 A nonsensical being, similar to the concept of a pot of gold at the end of a rainbow or unicorns existing
Ah. Nonsensical, but real.
@EBrown feature August I guess?
@Mat'sMug Yeah, feature August unfeature July.
16:38
Thanks! :)
Ah crap
I used a ref when I should have used an out.
Time to fix that.
@Sumurai8 Like Peter Pan?
Oh wait, it should be fine.
In the book context he was real, I mean.
@Hosch250 Peter Pan is not real. It is not a unicorn.
He also has a nose.
Not in real life, no. In the book, he was supposed to be real.
16:43
Unicorns have noses.
Do we live in a book?
@Sumurai8 It's called 'The Matrix'.
I just wrote all this code for an exception that will likely never happen.
3
#DevelopmentProblems
'The Matrix' is a computer simulation. I would hardly call that a book.
It's funner to write code that fixes about 5 seemingly-unrelated problems by avoiding an exception that does happen.
16:45
@Sumurai8 The name of the book about the simulation happens to be called the same.
            catch (ArgumentException e)
            {
                var aer = new ArgumentExceptionResponse();
                aer.Message = e.Message;
                aer.ViolatingParameter = e.ParamName;

                var wrapper = new ApiResponseWrapper<ArgumentExceptionResponse>();
                wrapper.Items.Add(aer);
                wrapper.IsError = true;
                wrapper.QuotaMax = int.MaxValue;
                wrapper.QuotaRemaining = int.MaxValue;

                string response = "";
Literally had to create two new objects just for one exception to be returned to the client.
@EBrown Why? You could just have executed rm -rf /. It would have been much more effective. It would never happen again...
And of course it's not robust at all.
Carp.
@Sumurai8 don't forget --no-preserve-root
It's a pity the slug comment got pushed off the starwall.
16:48
Since your code already works, the best SE to post this on is Code Review. — OrangeFlash81 18 secs ago
Oh carp
@Hosch250 @Mat'sMug I have quick quesiton
If I use GetType() on a C# class, does it get the most derived type?
I.e. if I have a parameter Exception exception and I use exception.GetType(), will it return ArgumentException if that's the most derived type?
@EBrown current object its type
aka ArgumentException
it's a runtime thing
@JeroenVannevel Totally forgot you were here! Thanks! :)
I just fixed the universe
2
16:52
Yes you did. <3
        public static void Exception(HttpContext context, Exception exception)
        {
            var exceptionType = exception.GetType().Name;

            switch (exceptionType)
            {
                case nameof(System.ArgumentException):
                    ArgumentException(context, (ArgumentException)exception);
                    break;
            }
        }
@DanPantry nvm -- apparently you have to set windows auth and disable anon auth on IIS as well and it's not enough to just do it in the config file
So that should work, right?
that's so ugly
if(exception is ArgumentException)
why make the roundtrip of getting type -> getting name -> getting name of exact type -> comparing names
Duh
and then you're still casting it again
16:53
Thanks...lol
I'm an idiot sometimes.
6
we've all been there
so has @DanPantry
I don't use is enough to remember it.
I remember as when I need it, but not is (even though they're closely related).
Actually, it is Contains.
@EBrown yes
Oh, Jeroen beat me to it lol
Yeah, by a mile...lol
16:55
shouldn't come as a surprise
But thanks @Mat'sMug! :)
I'm blaming my phone fwiw
Guess what effect "windowsAuthentication": true, "anonymousAuthentication": false has
none
I still have to manually set it in IIS
Yeah. IIS is weird sometimes.
And yes, this is in a config section called iisSettings
16:56
Check what the Web.config changes look like, I think it's a different setting.
aint no web.config in aspcore
this is stuff that the default scaffolding gave
@JeroenVannevel I have a weird question about handling this response.
I hear that sentence often from my female flatmates
all the boydrama
what's up?
16:58
Right, so, all my API methods have to share one thing in common:
They all take certain parameters, one being FileType, and return a response based on them obviously.
FileType is the common one between all of them.
They all also need to handle exceptions and return them as JSON.
Regardless of FileType.
Basically, they all have the following boilerplate code:

« first day (1185 days earlier)      last day (3131 days later) »