« first day (3252 days earlier)      last day (1695 days later) » 

12:12 AM
How can I make this return an Task<List<T>>. I want to do async calls inside of a async call but cant get it to return the right type. And I cant use await unless this call is async as well. gist.github.com/tarrzan33/5aec476209d2d910c85ddb7dcaad6573
 
12:29 AM
Hey everyone, looking for advice regarding authentication with .net core 3. I have a SPA front-end, a back-end which serves it and manages requests to our API, and I'm trying to lock all calls from the front-end behind authentication. Our authentication system is an external system which supports OAuth/OpenID Connect endpoints. I'm trying to find a way to wire up the authentication middleware to redirect to it but running into snags
is there a library/framework component to help me route auth requests to their login page?
 
1:02 AM
@ZackTarr I would expect that code to compile except for your OnGet method not being async Task.
 
 
4 hours later…
4:58 AM
Goooooo moorniiiiiiing CeeeeeeShaaaaaaarp!!
Turns out it's hella empty here when coming early
 
mr5
yeah
I'm always alone here in between 9am - 2pm +0800
 
Man you get up when I go to sleep
 
mr5
5:16 AM
What time is it there?
 
It's currently 0726
We're UTC+2; I go to bed like 2100 UTC
 
5:44 AM
user image
3
 
Turns out there was a power outage around my company yesterday evening.
Dev server: online
Test server: dead
Release/Stage server: online but uses login service on test server
Live server: online but use webservices on now dead servers
Fuck.
We are currently a fancy frontend with basically no functionality.
 
6:07 AM
Ah databases are gone too
oh and the colleagues above us don't have power yet it seems.
dafuq is going on here
 
mr5
Russian spies on the lose
 
For german insurance stuff? Weird spies are weird.
 
6:28 AM
ohayou
 
6:49 AM
@Squirrelkiller well the power would be a good explanation for why the backend is down
you mean databases are gone or the service is down?
 
db servers are down
and therefore the services too
 
No, you said the databases are gone..
You understand there's a difference between gone and just offline
obviously anything depending on the databases would be down
 
our server says the database is gone, I just repeated that. server doesnt know if the db is gone or just offline.
 
Hey my systems were also fucked yesterday
 
7:04 AM
ok, well a bit of advice: when your boss asks you what happened, don't tell them the databases are gone
 
Hey guys.
 
you'll spend the next 5 minutes trying to return air to your boss and explaining the difference between gone and offline
 
Isn't a single loop enough ?
 
@GeekDroid yep, you can do it with one or with two slightly smaller loops
performance-wise it's always O(n)
 
My boss was a dev himself, as was his boss. We got good people here, they know their stuff.
 
7:08 AM
but wouldn't it be preferable to use concise terminology?
why wouldn't you prefer the term offline? Regardless of whether or not it is gone, it is offline in either case
 
because gone is different in german...it's more like "away", and that is a synonym for "offline" here.
 
yup thats code
 
I solved it only one loop
But that solution always uses 2 loops
But here's the catch it does not use 2 arrays..only one saving memory space..
 
Here's a shocker: That's a micro optimization. Nobody in the real world really cares, unless this is used so goddamn much that this optimization has an actual real-world impact. Which, it most likely, won't have.
I'd always choose for readability over micro optimizations, then once it's PROVEN TO BE A PROBLEM through PROFILING, optimize it but leave the original readable code in there. That's how I deal with most code, though.
 
7:16 AM
In terms of small arrays it won't have noticeable difference but in real world there will n number of elements for eg: 100000 that time it will make a huge difference..
That's what problem solving is all about..
 
GoOoOoOoOoOoOoOoOoOoOoOd Mornin' neglecterinos!
 
@GeekDroid In C#-land, we'd just use an enumerable with two slices of the array to have 0 performance impact.
But you were using Java, I think. So, eh.
@Squirrelintraining Gooooood morning!
 
@Squirrelkiller lel
@Squirrelkiller aswell sucks
 
@RoelvanUden What about for embedded devices that support .NET
 
Yeah...language-wise that is ok..but algorithm-wise performance matters more..
 
7:23 AM
o7 sama senpai
 
@RonaldMunodawafa If it's an actual real-world problem, then sure. If it isn't, why bother with hard-to-read optimisations?
 
@RoelvanUden in Java, you can build a Stream in O(1) of the shifted version
 
What is more expensive: Dev time or better hardware
 
Almost always the dev time.
 
Both
 
7:27 AM
Only on MASSIVE SCALE that is untrue.
 
Depends*
If the hardware is a rover going to mars, then I'd guess the hardware + shippinh might most likely be more expensive
 
In the context of high performance applications
?
 
High-performance with 1 user and limited data is a lot easier and simple to realize than high-performance with big data and trillions of users.
But let's be honest... who here works on software that serves the scale of the likes of Google or Facebook? I certainly don't.
 
fun main(args: Array<String>) {
    return
}
 
I'm concerned about the former case
 
7:30 AM
high performance application!!!
 
I'd say most of you don't work on software like that.
@Wietlol So many executions per cycle!!
 
1 user and limited data
 
@RoelvanUden ?
 
@Wietlol You can run that process so much in a single cpu cycle!! it's very well optimized!!
 
Welp thats givven sama senpai, there arn't that many huge corperations in comparison to all IT-Corperations.
Also most IT-Giants are from the USA and those people still are a sleep.
 
7:31 AM
@RoelvanUden This should be meme
 
its the most optimized application I have ever seen
 
@RonaldMunodawafa You'd have to truly botch your code to make a program feel like shit when serving one user with limited data :-P
 
I am trying to think of extreme cases
 
But does it DO anything @Wietlol?
 
If you have a lot of data in a DBMS like MS SQL Server, how can much can a performance be improved by SQL Queries ...What are other options other than indexing etc.
 
7:32 AM
What feeling will I get if I run that highly optimised application?
 
@Squirrelintraining it runs
 
@GeekDroid Oh, you can squeeze a LOT of performance out of MSSQL. It's a little beast. The better question is... do you NEED to?
 
@Squirrelintraining Resources will be used less thereby giving space to other applications needing it ...
 
@Squirrelintraining it might turn you on how performant it is
it is so fast, windows will probably not even notice it ran
 
@RoelvanUden Well one of my earlier client had a db of 1000000 records in 32 tables, the query was taking time to deliver results ...in the end affecting user experience.
 
7:33 AM
Banks seem to throw a lot of money at devwork and yet I have never seen any performance imporvements. Why is this so
 
Oh it definetally will wiet, it definetally will.
 
And their ATM's still ran Windows XP till now
@GeekDroid You are not serving a trillion years. STFU
LOL
 
Super exciting that an ATM runs Windows at all xD
 
Here's a fun financial comparison:
* A single 3GHZ CPU VM costs around 10 euro/month around here.
* A single developer costs around 4000 euro/month around here.
Therefore you can get 400! CPUs for a cost lower than a single dev.
If you are wasting a lot of time on optimizations, the dev is FAR FAR FAR more expensive
 
@RonaldMunodawafa Well that is the driver problem..if the driver supports latest versions of Windows then they will definitely switch to latest version
 
7:35 AM
So essentially: Leave optimisations to the compiler and follow the standard convention breaking away once you understand the corner cases they don't cover

^^^ Is this what you are saying Roel
 
I'm saying: Do the optimizations when the UX is affected or when the cost/benefit is okay.
Don't waste time on optimisations that will save your company 100 euro/year.
Your hour is more expensive than that.
 
Yeah true.
 
@RoelvanUden But it will pay out in like 13,5 years time!
 
Optimizing just for the sake of Optmizations will cost time and is useless.
 
7:38 AM
I suppose that solving the problem correctly is more important than time and space optimisations
And readability is a factor of producing correct solutions
 
Solving a problem takes in consideration of space and time complexity else it is useless
 
@RoelvanUden What if you just want your code to be perfect and flawless
Efficient, readable and correct
 
@RonaldMunodawafa I applaud thee, but business doesn't want to pay you for that.
Do that for your hobby projects ;-)
 
@Neil how would you solve it?
 
Writing and Reading code can be done by any dev..
 
7:40 AM
and will it pass all test cases on kattis?
 
The quality of code is different
 
@GeekDroid but you cant read my code
 
Why ?
 
well... you can read it... but you wont understand anything of it :D
 
I used to follow Joel on Software and the Y Combinator guy
 
7:41 AM
because it has been Wietinized
 
BEcause I am Java dev ?
 
But they don't publish as much anymore
 
@Wietlol I don't write homework solutions. That follows to you as well
 
Any other similarly insightful blogs?
I don't want tutorials
 
7:41 AM
May 5 '16 at 15:17, by BoltClock
THIS ROOM IS OUT OF CONTROL
 
@Neil it is an interesting problem tho
 
fascinating really
maybe we could solve P=NP afterwards
 
@GeekDroid there is nothing wrong with a Java dev
 
I'm sure it's just a couple steps beyond that
 
Java devs should be able to read most C# code
 
7:43 AM
@GeekDroid I'm a java programmer myself, not a C# programmer
 
Java devs should stay off my Facebook timeline
 
C# devs should also be able to read most Java code
 
Why do companies like Amazon,NetApp test on algorithms and data structures ..there you will questioned on space,time complexity and other things
 
I started getting ads for Java related products
@GeekDroid Fundamentals
You can't be an electrical engineer if your physics is off
 
Nope not fundamentals..
 
7:44 AM
@GeekDroid They want to know you understand the difference between insertion sort and quicksort, for instance
Why you would prefer to use one over the other
It comes up rarely, but the principles still apply every now and again, albeit for other things
 
I prefer to use Bogo Sort because it saves a lot of dev time
 
@Neil Any dev who has gone through that will know the difference and where each and every scenario will be applicable...what matters is your approach to solve the problem and how you treat space and time complexity
 
while (collection.isNotSorted()) collection.shuffle();
 
@GeekDroid Most of those questions are rubbish. How well did you study a text book? Do you really need to know that when developing most standard LOB applications? I don't think so. But when you go to work on a massive scale, which is QUITE likely for Amazon, then every bit of performance matters... and you want people that understand that.
 
there, entire algorithm coded in a few seconds
epic dev time optimization
 
7:45 AM
while (code.isSlow()) code.optimize();
 
@RoelvanUden You are forgetting that not everyone is writing LOB applications
 
@GeekDroid If you understand how the sorting algorithms work, you understand why they are favorable in certain circumstances
 
Most are
 
that's sort of the point of asking the question to begin with
 
@Neil Oh I get the point
 
7:46 AM
@RonaldMunodawafa I'm not forgetting. I'm adding that nuance but also recognizing that most developers don't really work on high-scale software
 
But such interview shouldn't be a problem for any dev who understands it.
 
I love counting sort, because it is O(n)
 
The only time I have experienced speed issues, it's always IO
 
but it isnt applicable in all cases
 
Is counting sort = linear sort?
 
7:47 AM
They still ask fizz-buzz from candidates to prove they understand fundamental programming
 
^ I still think that's a stupid question
 
it has a linear time complexity
 
And the funny thing is, some of the newer students get it wrong
 
good morning.
 
Not linear sort but rather brute force
 
7:48 AM
a true linear sort doesn't exist, does it?
maybe in the best case scenario it's O(n), but never the worst case scenario
 
If you go through Amazon's questions you ll know how tough they are...Round 1 is very basic Round 2 focusses fully on problem solving skills.
 
@Neil it also shows how your code style is
 
@Wietlol fair enough
 
will you use a 15-bulk loop with a sublist on the result?
 
@Neil I find that with interviews and me, it is less about what I know and can do and more about my anxiety
 
7:49 AM
will you create classes and interfaces for everything?
 
In one interview I walked out because I was about to vomit
 
will you simply make a loop and do a bunch of modulos?
 
Something about interviews scares me
 
its a very interesting thing
 
Oh I totally get that
I think they understand that too
 
7:50 AM
did you see fredoverflow's version?
 
@Wietlol What if you use different styles depending on the coding standard you have to be using
 
I was like "damn, that is clever... I hate clever, but this is pretty damn useful"
 
What works for me is to bring something to distract myself so that when they finally do call me, I don't have the opportunity to work myself up beforehand
 
@RonaldMunodawafa its not about the coding standard
its about the architectural design
 
Any texts you recommend on architecture?
That moves from architecture down to code
I get lost in the architectureal metaphors I read online
The text can be for any language
 
7:52 AM
@RonaldMunodawafa Suppose you're assigned to a big project, where the coding style is not what you're used to, and you don't particularly care for it. Do you A) rewrite the code style in the entire project, B) write new code in your style or C) write new code in the existing code style of the project?
 
@RonaldMunodawafa I dont read books... so I have none to recommend
or D) resign
 
The answer reflects where you put your emphasis
 
@Neil I would go for option D: Version the coding styles and make my new style a superset of what was already done because if I'm not jumping on a green field project, I'm likely to be using a newer version of the language than what the project was originally implemented in and some newer features may be better style-wise.
So let's say a project was implemented using lots of loops and I have LINQ available to me
 
ok, well that's kind of skipping the question
Assume you can't jump to a newer language
 
I think Niel is more about coding style conventions
 
7:55 AM
It's answering the question
 
like... tabs vs spaces
 
Tabs anytime of the day
Except in languages that force spaces sigh
Some people like two spaces. Others four. Others eight lol. Either way the key should be the same
 
so, if your team lead tells you to work on project X, which was coded with spaces, what do you do?
 
Continue in spaces
 
Not every language has a "newer" compatible version like Kotlin is to Java
And even if that were the case, you may not (probably not) get to do that
 
7:57 AM
It's context-dependent
 
Not every language is as perfect as Wietlang (possibly going to be named Kode)
 
True, but if your interviewer gives you a multiple choice question, generally you don't create your own choices :P
It's great to think outside the box, but it also doesn't answer the question being asked
 
If the original style is horrible and a mapping can be made to translate the code from the original style to a more readable one then and it actually saves time in the long run then I would do that
 
however, if it does answer the question being asked, it is quite interesting
 
@Wietlol Similar to the german word "Kot" which is a non-offensive term for "shit"?
 
7:58 AM
and?
 
@RonaldMunodawafa If you joined a team and then said "I went ahead and changed the codebase's style because it was horrible", you're not going to get very far.
 
@AvnerShahar-Kashtan Isn't that part of maintenance though?
 
I am sure there is some language that makes every word a swear word (looking at Tagalog)
 

« first day (3252 days earlier)      last day (1695 days later) »