« first day (740 days earlier)      last day (3574 days later) » 

18:00
This falls under the whole "technical debt" argument though, right? When you write that new feature (or modify an existing one), is it taking three times as long as long and producing ten times as many bugs as it would have if you'd kept up with your refactoring? If so, then maybe skipping the refactoring was a false economy. — Ben Aaronson 6 hours ago
0
Q: Sudoku Solver using forward checking - Performance optimization

bradleykinsGood afternoon, I was compelled to look into a Sudoku Solver in Java using the principles I have learned in a course, namely i wanted to make something that included backtracking and forward checking. Has anybody else managed to produce a Sudoku Solver that uses the forward checking algorithm th...

@JeroenVannevel Good, it's finally time to investigate this whole OAuth thing!
@Simon, okay my bad. I should have mentioned that. — laurisvr 23 mins ago
It's easy: send request for token to server, server returns token, use token in calls
it gets hard when you use refresh tokens and external auth providers
18:03
If this code already works, then this might be a better question for Code Review. — John Saunders 10 secs ago
then you have to start sending refreshtokens to get your new token
Or with external providers you first request a token at that provider, use the returned token with your own special endpoint which returns you a local token and then you use that token for your requests
A token is meant to be valid for an entire session, right?
You choose for yourself how long they're valid
I have my tokens set at.. 1 day? I'm not sure
and refreshtokens at 1 month
there's no such thing as a session in REST
Session is explicitly the opposite of REST
In this setup I'm more thinking about having a website in the frontend that communites with the backend via a REST API
when someone uses facebook to login at my app I don't want them to have to do this each time the token expires. That's what the refreshtoken is for. When that expires they have to relog and each time they send it, it gets refreshed
so use the app once a month and you won't be prompted for login
18:06
So user logs in > request to API > if valid token gets returned to the frontend (something like ReactJS/AngularJS) > then that token is used for api calls
at least that's how I understood the theory
I'm aware that the token itself needs to be sent with a REST API call
You will always receive a valid token though
In the case of a website, you want to auto-logout your users I guess, though
You'll get either a token or a HTTP 401
auto-logout?
What site does that?
18:07
Yes, if they manually logout it directly invalidates their token
@JeroenVannevel There are some... more important example could be that if youu close yoru browser (close session), then session's over
Hmm, this leads to an interesting scenario now I think about it
closing a browser should not result in a logout
or at least should not be expected to
I'm not sure if we are on the same track regarding "being logged in"
For general purpose websites and mostly mobile apps I also think that you should be logged in "forever"
But if you are doing more sensitive things (like PayPal or whatever), they do logout you somehow
0
Q: Need validation of code whether Dependency Injection is implemented properly or not

user1948304I implemented below code looking at a dependency injection program as an example,I wanted to confirm with you all,whether this below code implementation is the right way of doing the same. namespace TestAsyncProjectWithDI { public interface IReadFileTypes { ...

18:11
Well you can always invalide it when you want of course
They might also just use a low lifespan for your tokens
Say.. 5 minutes?
5 minutes inactivity: session timeout popup and force the user to login again
Hey folks.
@kleinfreund Hi!
@JeroenVannevel Hmm okay yes
hey there @kleinfreund!
Yo, I have a pretty basic problem of understanding the way regexp's are matched. Consider [2-8]|0[2-8]. With the teststring 2xxx, this matches 2. But I want it to match only numbers between 2-8 with or without leading zeros. This seems to be a fundamental issue with me not getting how regexp's work.
@kleinfreund 1) Do you want to capture what you match? 2) When saying numbers between 2-8 are you talking about 2, 3, 4, etc. or also about 22, 87, 45, etc.?
18:16
I want to test different date formats. When I say 2-8 I mean 2, 3, 4, ..., 8 (with leading zeros: 02, 03, 04, ..., 08).
 0*[2-8]+
Note that the selection of 2 and 8 are arbitrary.
Don't I want 0? for no or only one leading zero?
Any number of zero's followed by at least 1 2-through-8
Yeah, right.
> But I want it to match only numbers between 2-8 with or without leading zeros
I interpreted that as more than 1 leading zero possible ;-)
18:18
Hah, yes, plural refers to 2-8 being multiple numbers, not to the zeros. :P
Oh, and hi ;-)
I think @kleinfreund wants 0*[2-8] then
Hey, rolfl.
actually, he wants 0?[2-8]+
I'm missing a balloon fest downstairs.
18:19
I thought I wanted 0?[2-8], but that matches 8 when testing 8xxxx.
I don't care for balloons - they hurt my ears when they bust.
are you 'matching', or replacing?
This is where your language and context makes a difference.
Matching as in the script we are supposed to use does .match() in Python.
So that is starts with ....
> Python offers two different primitive operations based on regular expressions: re.match() checks for a match only at the beginning of the string, while re.search() checks for a match anywhere in the string (this is what Perl does by default).
So, what you want to do is anchor your expression....
you want to make it ^0?[2-8]+$
^ - starts with, $ - ends with?
In combinated - exact match?
18:22
^ -> begining of search area, $ -> end of search context
Yeah, I get that. That might actually be what I'm missing.
... waits for the: OMG - it works now!!!
2
@kleinfreund Do you want to match '0234567' ? If not, then you want ^0?[2-8]$
(and hi btw)
That too^^^
Hey @Simon
18:28
I definitely think ^ and $ is what you were primarily missing
Yeah, I think I got it now.
Indeed.^^
Hmmm... I find I am in the middle of a moral quandry.....
I think I will stick with the.....
I can highly recommend the phone-a-friend-system btw.
Also, incoming:
VBA monsters......
> This is a fun one! I wrote some code to automatically get the next revision letter for a file by looking at the existing letter. It works, but I think there is room for improvement as far as simplifying it or making more efficient.
0
Q: Next revision letter - looking for feedback on cleaning up, simplifying

CBRF23This is a fun one! I wrote some code to automatically get the next revision letter for a file by looking at the existing letter. It works, but I think there is room for improvement as far as simplifying it or making more efficient. Our revision scheme follows ASME Y14.35, which specifies the f...

Yeah.... what you think is fun..... not so sure.
18:32
regex101.com
@rolfl yup, that one's awesome!
What is it with people and VBA these days? Soon VBA will become the most popular tag on Code Review!
naaah
it's just your impression..
I'm voting to close this question as off-topic because is more appropiate for codereview.stackexchange.com — JuanZe 9 secs ago
Hmmm, suddenly my NPEs has become more descriptive.
> java.lang.NullPointerException: Cannot invoke method value() on null object
18:35
5 hours ago, by rolfl
Some CRitters have turned Code Review in to VBA central .... a Gravitational sink of expertise
@SimonAndréForsberg Groovy?!
@skiwi I suspect so.
No @SimonAndréForsberg it's just the same guy posting all his crap code on the same day. Who will end up not listening to a word Mug & I say.
oh, okay.
Why do I always forget @Retention(RetentionPolicy.Runtime) ?
Because annotations are hacked on.
Why are you using them?
it takes a special case for them to be necessary, I consider them to be 95% of the way to reflection, and if you need reflection, you're probably doing things wrong.
18:41
@rolfl OH RLY?
I never do things wrong.
Things like hibernate and spring, jUnit, and so on, are essentially reflection engines.
I'm not using any of those at the moment. I'm making things up on my own.
There are times when it is needed, and annotations make it so much neater, but, it is still, essentially, reflection.
I think there's a wormhole in my floor... I dropped something, and I cannot find it back again
@SimonAndréForsberg Out of stars :(
@rolfl The thing is, Groovy allows 'closures' (essentially lambda expressions) as values inside an annotation, and this feels just way too nice for me to be able to resist it.
18:44
@SimonAndréForsberg Imagine what happens when I get my hands on them
@skiwi oh dear...
Well the only way to use annotations is through reflection
The great thing about source control, it makes it easier to share your bug fixes with your coworkers. The bad thing about source control, it makes it easier for your coworkers to share their bugs with you.
2
so you can up that from 95% to 100%
Well, my Groovy is non-existent, so you're on your own, but, if you program groovy by defining annotations, I am not impressed.
18:45
@nhgrif Stop saying starrable things!
@rolfl I do a whole lot more than just defining annotations.
@SimonAndréForsberg Well, I assumed this was Java, so I opened my mouth, now I know it's not Java, it could mean anything.
it's still running on the JVM though
Annotations though, are POI's in the Source, and they make reflection targets easy to find.
and Groovy and Java can interact really well. It's almost.... wait for it.... groovy
POI's? Persons of Interest?
18:49
s/Persons/Points/
@SimonAndréForsberg I'm afraid we're going to hear that word a loooooot of times
So Groovy code should be written in a Groovy way?
What makes you think that? You don't like it? You don't think it's.... groo okay, I'll shut up now ;)
Okay, thanks friends. That was the whole trick. Just prepend a ^ and append a $ to the whole freakin' regexp.
no problem ;-)
The technical term is "anchors"... you'll find that term in the documentation.
You're reading the documentation, right?
s/reading/writing/ (dependign on context)
18:52
Nope, but now I am.... (reading).
There's also the so regex canonical
link?
regex has the best terminology....
anchors, lookarounds, greedy, non-greedy... etc.
0
Q: Having one background task start after the first completes

Brandon ShegaI have two methods that I need to have happen in the background when the app is suspended, but I need the first to finish before the second starts. The code blocks are pretty lengthy but please bear with me. This method gets statistics from health kit in the background used to calculate achieve...

52
Q: Reference - What does this regex mean?

HamZaWhat is this? This is a collection of common Q&A. This is also a Community Wiki, so everyone is invited to participate in maintaining it. Why is this? regex is suffering from give me ze code type of questions and poor answers with no explanation. This reference is meant to provide links to qua...

@rolfl posessive, lazy, ...
interestingly it's often the lazy matchers that do more work than the greedy ones.
reluctant
19:04
@CaptainObvious that ObjC question might be off-topic. It doesn't appear to always work?
19:15
0
Q: It's acceptable to have some duplicate code?

Daniela Marques de MoraisI developed three methods that have only some similarities, the three must remain separate. However, it seems there is a significant amount of duplicate code. They basically seek the same list and set a BasicDBObject with a few different attributes. How to solve it? Or is acceptable as is? These ...

@CaptainObvious This title could use some work.
19:44
@EthanBierlein If you're serious about learning VHDL, try me again tomorrow. I should have some decent books laying around in PDF.
@Mast Okay, thank you!
0
Q: Generic implementation of the Knuth-Morris-Pratt algorithm

Achilles RasquinhaImplemented a generic version of the Knuth-Morris-Pratt algorithm in the given code below. Would appreciate for some feedback and scope of improvements, (standard naming conventions, flaws, etc.). Also, how should I go about overloading the function with given pattern length = 1 (a key as paramet...

@Mast It sounds very interesting and I would love to learn it.
@EthanBierlein You do realize you'll need either a simulator or an FPGA to actually use your code?
@Mast Yeah, I have a whole weekend though, so I could probably get one set up.
19:46
Allright, will talk about it tomorrow, TTGTB now
@Mast Which one would you recommend?
Game under active development is open sourced
what's better though is that it's in C#
@Mast Sorry for the one last thing, I'm looking at this one, but I'm not sure if it's the right one.
I have a question 50% of questions here like code review requests, is SO a right place for that? I met some links to other website for code review, but can't remember which one — Alex 20 secs ago
@Alex I think you're looking for codereview.stackexchange.com. Please be sure to stop by the help center there. — RubberDuck 21 secs ago
@Alex Note that this particular question is off-topic for Code Review. It is seeking debugging help. — Simon André Forsberg 42 secs ago
> The variable names lngX, strX, strY, and strZ are 75% Hungarian and 25% useless.
lulz out loud
1
A: Next revision letter

200_successThe variable names lngX, strX, strY, and strZ are 75% Hungarian and 25% useless. I don't have a good idea of what their purpose is. You don't have to write a comment telling me that you are declaring variables; the Dim keyword is obvious enough. You've used recursion to solve this problem, whic...

19:56
in VBA, 2 mins ago, by Mat's Mug
> The variable names lngX, strX, strY, and strZ are 75% Hungarian and 25% useless.
in VBA, 2 mins ago, by Mat's Mug
0
A: Next revision letter

200_successThe variable names lngX, strX, strY, and strZ are 75% Hungarian and 25% useless. I don't have a good idea of what their purpose is. You don't have to write a comment telling me that you are declaring variables; the Dim keyword is obvious enough. You've used recursion to solve this problem, whic...

lol
My For loop is broken too.
MSDN seemed to suggest it would work.
right. fixed
it's getting hard to find VBA docs on MSDN
most search results point to VB.NET
0
Q: Why wont this check to see if a user exists?

MrJoshFisherI'm performing a query to check if a user exists before adding it to the database. If that result comes back then die and echo 'username already exists' but if it comes back empty then add the new user to the database. For some reason it just adds a new user to the database anyway. //Ch...

@Mat'sMug I have it bookmarked just because it's frustrating to google.
FWIW I posted a complementary answer, but @200_success really owned that one
20:09
Thanks for the editing help, guys. I'm kind of surprised that the code "worked" as well as it did, other than that.
oh and I'm 3 votes from rep-capping, and 4 votes from a silver tag badge :)
It looks like I've made an A in my Unix class. I certainly didn't expect that.
congrats!
Definitely a good decision taking it. I have answered one Unix question on CR, and I may look for more. I even got a Fedora virtual appliance out of it, too. It's not specifically tied to the class.
@200_success You're welcome. Thanks for the laugh.
20:19
^^
Thanks Mat's Mug - I will play with the byte iteration eventually, but @200_Success's code already executes WAY faster than my code and is easier to read to boot. One consideration for the byte iteration is that even though it may be faster, for me it's a lot easier to read the string matching method above. — CBRF23 1 min ago
WAY faster. why am I not surprised? ;)
Pending edit on 200's answer there... not sure I understand...
@rolfl I do. OP is fixing some bad syntax in 200's answer.
Good... (that they're fixing things , not that I don't understand).
2
20:49
:)
@JeroenVannevel am I sticking a foot in my mouth here? (I think not)
@Zer0 sure, except new T() reduces the amount of reflection API code in your method, and the new() generic type constraint ensures at compile-time that there's a public parameterless constructor whereas Activator.CreateInstance<T>() would blow up at runtime if no such constructor exists. — Mat's Mug 1 min ago
@Mat'sMug Nice!
@Mat'sMug I picked a bad time to run out of stars!
21:06
@Mat'sMug nope, foot all out of the mouth
@RubberDuck I wish I could star that...
1200 @SimonAndréForsberg's on the wall ;-)
0
A: Can you control how an SVG's stroke-width is drawn?

cocoWith computers anyting is possible

21:11
...even spellcheck!
Jeez. Oh whell.
@Mat'sMug OH RLY!?
YA RLY @SimonAndréForsberg!
Hello, everybody! Anyone here who can answer a really stupid SQL question? It's something I should be able to do by now, but can't figure out. :-| It's embarrassing!
@Shortstuff81000 That's what SO is for! :)
21:18
Hey @Shortstuff81000 how is it going?
@EthanBierlein Haha that's the first place I looked, but I couldn't find ANY simple code!
Well, I'm not a SQL expert, so you may want to ask someone else.
@Lyle'sMug Hi! I've been busy these past few weeks. I've got a conference to go to on Monday and Tuesday, I'm trying to wrap up some updates to a website, and I have possibly 2 more clients to talk to this weekend!
hey welcome back @Shortstuff81000!
Thanks! Got any idea how to fix this? `SELECT * FROM [Ppl1st_Events]
WHERE [Location] <> "N/A" AND [Ppl1st_Events].[Location] <> "Black Hills Works";` It's supposed to be comparing text, but it's comparing column names instead. :(
21:23
column names? I'm WTF'd!
@Mat'sMug Oh darn it! :D I'll stay here just in case somebody knows - looks like the SQL Helpline room is dead, but I'll keep looking.
@Shortstuff81000 is this SQL Server? you should be using single quotes for strings not double quotes
double quotes do weird things in SSMS every time I try to type them in.
@Lyle'sMug Oh holy crap it worked! I should've known that!! I'm losing it! Things better settle down after this conference or I'll go nuts!! :D Thanks, Lyle's Mug!!
@Shortstuff81000 you're welcome
@Lyle'sMug Well I'm outta here. I've set some big goals for myself tonight; I meet with one of those potential clients tomorrow! :)
21:29
that sounds awesome. you have a good night, and good luck!
21:39
0
Q: Looking for feedback/critiques/alternatives to my solution for the c# Project

Pestrnkousing System; using System.Collections; using System.ComponentModel; using System.Data; using System.Data.Odbc; using System.Drawing; using System.IO; using System.Windows.Forms; using xNet.Net; using Microsoft.Win32; using System.Text.RegularExpressions; using Newtonsoft.Json; namespace Main...

@CaptainObvious Looking for feedback/critiques/alternatives to my solution for the title
0
Q: Creating a Wrapper for CSV Data

user245185I am trying to complete a Ruby coding exercise. The specifics of the excercise can be found on a the level_up_exercises GitHub repo. This repo also contains the CSV file used in the exercise. I would like you to comment on how well you think I met the requirements with the exception of loadin...

Uh... I know very little about web development.
22:07
I just found out what the best thing about Groovy is! It doesn't suck!
0
Q: Currying in matlab (is there a better way?)

OmnipotentEntityAs MATLAB has a hard maximum of 10 input arguments it's possible, but ugly, to implement a curry function in this manner: %% turns a standard function into a curried one % if g has 3 input arguments then you can call: % h = curry(g) % h(1)(2)(3) == g(1, 2, 3) % Matlab doesn't like h(1)(2)(3)...

0
Q: What are the rules on linking to code outside of the question?

user245185Can the code that I want reviewed be linked somewhere else, or must it be contained within the question?

Recently learned to code in Groovy and so far I absolutely love it. I need help to finding bad things about it!! #groovylang #Programming
@SimonAndréForsberg have you tried "Your language sucks" yet?
22:22
15 mins ago, by Simon André Forsberg
I just found out what the best thing about Groovy is! It doesn't suck!
Your language sucks was the first thing I checked
Hmm... And it seems the worst thing anyone has to say about it is that no one has anything bad to say about it.
well, I did check Wikipedia first to see if there was a "Criticism" section.
There must be something...!
@SimonAndréForsberg Closest thing I could find.
@SimonAndréForsberg That's groovy! (sorry)
I'm so, so sorry.
Sad David Tenet is sad.
22:39
-1
Q: creating a 2 dimensional array

user3327637i want to create a 2 dimensional array of dimension 100,000 X 100,000 in R. i tried using the matrix command but it doesnt allow for creation of matrix that big and i get this error message: Error: cannot allocate vector of size 7.5 Gb In addition: Warning messages: 1: In matrix(0, 1000...

0
Q: Project Euler - Let's Refactor

BrendanNOTICE: I AM NOT LOOKING FOR OPTIMIZATION OF PROBLEMS / SOLUTIONS Hello everyone, sorry for the extensive post, I just want to be thorough. I recently finished a class on Design Patterns and Refactoring for my Master's program, and want to apply some of what I learned to a personal project of mi...

MONKING
Monking, Phrancis.
@RubberDuck thanks. One thing stated there does indeed suck. And I think @skiwi should definitely read that one (as he's considering the Grails framework for a webapp)
22:56
I'm sorry to tell you, but you're in the wrong place. This isn't a forum, or a place for discussion. This is a question and answer site. If you want to have a conversation, you can stop by Code Review Chat. If you want to have your code reviewed, read our help center and edit your question appropriately. — RubberDuck 3 mins ago
I like how some people insist on using the literal definition of code review to justify posting their off-topic question. Just another instance of not bothering to understand what Stack Exchange is about.
Yeah. I won't respond anymore beyond that. I think the close reason is pretty dang clear.
23:16
and so my journey begins
@rolfl this, too, is your fault btw ^
i want to test my implementation of meek's algorithm against the one in this paper which is -- of course -- in pascal
We just started planning a brand new mod tentatively called "Mythos". Come and share your ideas! http://bit.ly/mythos-tcg
Retweets and also ideas/suggestions very welcome :)
23:44
@mjolka Everything is my fault.
Ctrl-K and Ctrl-B - Turbo-pascal for copy/paste.... before the standards were set
@mjolka What's wrong with Pascal?
@SimonAndréForsberg nothing that i know of. it's rolfl's fault for making me learn new things :)
Pascal is a pretty old thing though ;)
about time you learn it! :)
My programming life start with Delphi + Pascal
...16 years ago...
i started with qbasic
heh, I've been programming for a longer time than @Ethan's been alive!
Am I getting old?
23:49
c:\src, excellent path name!
(path name for purposes of screenshot only)
@mjolka Ew that looks old
... wait... is that... an IDE??
@Phrancis yep, i have seen the error of my ways and am renouncing visual studio
vs doesn't have an awesome ascii art splash screen
2
@Phrancis i think my favourite is the open file dialog
check out that drop shadow
I learned turbo pascal at university.... 1992/3 and the monitors were amber....
it was an "IDE" of sorts.
23:57
And I thought Rubberduck targeted a painful IDE...
Reminds me of the OS on that old Tandy computer my dad bought when I was like... 7-8 years old?
@rolfl the golden amber age of 14"!
Argh... crap... now I remember that the actual computers had a turbo button.....
Did you all know that?
I did
@rolfl yep our family computer had a turbo button :)
23:59
Let me guess... It didn't make the computer go faster, now did it?
It was always a trick to twist off the terminator of the network cable, or push all the turbo buttons on the university lan....
Actually, @Phrancis - it was to make the computer slower.
(I sort of kid you not...).
I'm sure that confused a few people!
RELOAD!

« first day (740 days earlier)      last day (3574 days later) »