« first day (1540 days earlier)      last day (2772 days later) » 

00:00
RELOAD! There are 4190 unanswered questions (90.8637% answered)
@EBrown You around?
I'm available to re-explain how we do our DTO's.
0
Q: Coin flip in C not working

Rafael CocaSo I'm programming a coin flip in C, however it seems the random part of it isn't working because it just keeps showing the same answer again and again. Here's the code: #include <stdio.h> #include <stdlib.h> int main() { int a,b = rand() % 100; again: printf("Start program?\n1:Yes\...

@Hosch250 Sorta, at dinner but feel free to fire away. I'll read it as I get the chance.
00:38
Left for a little, and then got locked out.
We are using Mediatr, so that affects our structure some.
We have a P... project that is our DB model. We are using EF with explicit migrations.
That project has a bunch of stuff that shouldn't be in it, but we are getting it cleaned up.
That project is in a folder with two other projects. E.BusinessLogic.Messages (E.BL.Messages [E isn't the full name]) and E.BL.MessageHandlers
E.BL.Messages has the DTOs and the Mediator messages. E.BL.MessageHandlers has the message handlers.
So, the message handlers ctor-inject the relevant DB tables with a custom IGenericRepository<T> and transforms them into the appropriate DTO.
We have mapper classes that are helpful here too.
Then, we have our UI project G...
And equivalent G.BL.Messages and G.BL.MessageHandlers projects.
G.BL.Messages has the ViewModels and more messages, and G.BL.MessageHandlers has the message handlers.
These message handlers usually use Mediator to get the DTO object from the table, then map the DTO to the VM, which is customized to the view; most of the time, it is just identical to the DTO.
And the DTO is mostly just the same as the table, but has everything loaded into memory.
So, if I want a FooVM, I do _mediator.Send(new FooMessage()).Result.
That calls FooMessageHandlers `Handle method in G.BL.MessageHandlers, which is roughly:
public TResult Handle(TMessage)
{
     var dto = _mediator.Send(new FooDTOMessage());
     // map dto to vm and return
}
Then FooDTOMessageHandler, we would do the same, except from the DBO to the DTO.
That seems like a lot of overhead for something that simple.
Yeah, tell me about it.
Then, when you want to save, you have to go all the way back up.
But then, we aren't really that simple. We have N widgets that you can stick on a page all together.
Basically, we are a build-your-own-internal-promotional-webpage company.
I think one of our clients has one public webpage using our stuff, or something.
We probably have 100+ tables and 20+ widgets.
Most of our widgets have customizable settings, too.
00:57
Yeah I built a thing like that except more abstract for a project for a previous group with less overhead, but it was with duck-typing.
Almost done rewriting the settings for a widget.
It was scary. There were 0 unit tests to start.
Now, I have just about all the logic under test.
This started as a fall-back project.
Next up: redoing the user-side of the widget.
Then, this provides data for a third side that gives our client's employees points that are worth money they buy from us.
Then, they can redeem them for things.
There aren't any tests for the main widget or that. The whole thing is unmaintainable.
And it is our biggest widget, and we are getting more feature requests left and right because it is mainly used by our biggest client.
Most of the people there are impressed with how well-rounded my skills are.
They basically hired me to do back-end work. I got assigned to this widget, and I'm getting tons of front-end work, plus UI design, plus testing above and beyond my own work.
I learned the core EF stuff pretty well. That is, migrations and creating tables and stuff.
Learning SQL. I know the core commands, but queries I can't do in Linq are harder.
Like, I had to write a query to find a user that might be the 16k'th user and rank them based on all the other users.
Their main SQL guy had to help me get the core stuff down, and we ended up creating a bunch of temp tables and using a cursor.
Linq was too slow because we had to return all the users to the server and do the iteration there because TakeWhile doesn't work in Linq-to-Entities, nor do assignments.
01:13
I usually use LINQ-to-SQL until performance becomes an issue.
It was a serious issue. Pages were timing out.
I believe it.
 
2 hours later…
03:48
This belongs on codereview.stackexchange.com — Mateen Ulhaq 51 secs ago
04:37
Trying Surfy browser out. Not too bad.
04:55
possible answer invalidation by Erik Pragt on question by Erik Pragt: codereview.stackexchange.com/posts/169740/revisions
05:08
cdhowie, I actually wasn't aware of the code review stack exchange. Good Point! — Kamajii 27 secs ago
 
2 hours later…
07:34
Monking!
Could a moderator remove this question? codereview.stackexchange.com/questions/170903/…
08:31
@MrGrj Why? Your comment appears to be invalid.
It's a personal page, hardly spam.
09:09
@MrGrj Nope, but I can close it.
Not sure what link it was you saw first. Unfortunately there's no indication of the question having been edited either.
09:45
possible answer invalidation by Pro on question by Pro: codereview.stackexchange.com/posts/169689/revisions
10:30
possible answer invalidation by Kontula on question by Kontula: codereview.stackexchange.com/posts/170912/revisions
 
1 hour later…
11:59
Zonking
12:34
Are Pro and Kontula the same person? Between them there are five questions which seem to be asking about the same ugly C++ program.
12:46
@Edward Possibly, same style.
Same code.
1
Q: Pawns on board game using dice on c++

KontulaI have a board game with four players: Anton, Rony, Young, Gabe. Each of them has four pieces and this function will handle the move of the pawns on the board. I need help to improve my way of implementing this method. My game board consists of 24 places(from 1-24)(numeral values) and four place...

1
Q: Strategy game move involving countries and dice

ProI have a game that consists of multiple countries and each of them has several choices. For instance, First Country(France) has multiple choices, Choice 1, Choice 2, Choice 3, .......etc And the idea of the code is that if France gets number 6(the diceĀ“result) it gets one (choice)soldier of its...

The only difference is one frames it as "countries" and the other as "players" but the code is virtually identical.
School assignment is another possibility.
If it's a school assignment, I hope they teach 'em better than that!
@Edward If I remember my college correctly, they didn't have the time to teach it right.
We learned C in six lessons, C++ in another six.
Everyone considered C++ as 'C with bonus features'.
That's a shame.
So our code sucked, yea.
Oddly though, I think it's the same problem in most of academics. I'm following a course in genomic data science and they keep skipping the important parts that make the difference between hasty research and solid research.
Code review: Don't disable pooling and don't recreate the connection and command in the loop. — Crowcoder 5 secs ago
13:01
@Edward Left a comment on both questions.
My daughter recently took a course in programming for non-majors and they taught Python.
Seemed to me that although there wasn't a lot of depth, that they did convey what good programming and poor programming practices looked like.
In Python it's easier than in C though. Half of C is undefined behaviour, while most of Python is described in the PEPs.
But that's good to hear.
I've looked at the programming syllabi for some of the local universities, and at least at that level they look fairly solid, but as you note, you can't cram everything into a single semester.
What's your interest in genomic data science? Sounds interesting!
@Edward I started with the Rosalind challenges and got hooked :-)
Now I'm following a course at Johns Hopkins.
It's relaxing to learn something complicated that has nothing to do with your day job.
I agree. I'm reading a book on European history right now for similar reasons.
13:11
@devak23 That heavily depends on your code. For starters, I find it odd to have wait groups as global vars the first place. But without your code, it is hard to say what to do. Maybe you can post it on codereview.stackexchange.com and we can find out what to do. — Markus W Mahlberg 58 secs ago
@Edward Ah, any particular era?
Yes, very particular. The title of the book is "The Pursuit of Power: Europe 1815-1914" by Richard J. Evans.
I had already read five of his earlier books, so I saw this one in the library and grabbed it.
That Rosalind challenge thing looks interesting. Dangerously interesting. I can see my weekend plans dissolving before my eyes... :)
@Edward Sounds familiar. I still blame this meta question for bringing it up.
I'd had some previous experience in the matter with programs like Foldit and Folding@Home, but Rosalind is what really got me carried away.
@Edward I can imagine that's not some light reading for non-Europeans.
True, but Evans is both a scholar and a good writer.
Got a great book about Soviet Russia and the West that starts roughly at the end of that time frame once you've finished it :-)
13:20
What's the title?
@Edward Russia and the West under Lenin and Stalin, George F. Kennan
Kennan has written quite some books around that topic.
I haven't read that one yet. I'll add it to my list. Thanks!
You're welcome.
 
1 hour later…
14:31
@Peilonrayz I think I accidentally put my interactive Python in debugging mode:
>>> exit()
# clear __builtin__._
# clear sys.path
# clear sys.argv
# clear sys.ps1
# clear sys.ps2
# clear sys.exitfunc
# clear sys.exc_type
# clear sys.exc_value
# clear sys.exc_traceback
# clear sys.last_type
# clear sys.last_value
# clear sys.last_traceback
# clear sys.path_hooks
# clear sys.path_importer_cache
# clear sys.meta_path
# clear sys.flags
# clear sys.float_info
# restore sys.stdin
# restore sys.stdout
# restore sys.stderr
# cleanup __main__
# cleanup[1] encodings
# cleanup[1] site
WTF is that
Never come across that before, XD
When entering and exiting it, I get a whole lot of crap like that.
Must've triggered something by accident.
Looks like -v mode to me
> Python -v
import _frozen_importlib # frozen
import _imp # builtin
import sys # builtin
import '_warnings' # <class '_frozen_importlib.BuiltinImporter'>
import '_thread' # <class '_frozen_importlib.BuiltinImporter'>
import '_weakref' # <class '_frozen_importlib.BuiltinImporter'>
Oh, right, I was trying to get my exact version info and got a whole lot of text instead.
Which is kind of stupid in it's own right, since Python will tell you what version it is anyway when starting.
$ python
Python 2.7.12 (default, Nov 19 2016, 06:48:10)
[GCC 5.4.0 20160609] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> exit()
It's not exactly rocket science.
Finding the docs for it is a pain in the arse. But here's the argument docs, and try changing PYTHONVERBOSE to an empty string
IIRC there's a flag to print just that info...
Oh, it python -V prints Python 3.6.1... Not very helpful IMO
14:41
@Peilonrayz Right, capital V.
@Mast Yeah, :/
However python -c "import sys;print (sys.version)" is better, it prints 3.6.1 (v3.6.1:69c0db5, Mar 21 2017, 17:54:52) [MSC v.1900 32 bit (Intel)] for me
Mistakes like that are the difference between doing something recursive or setting your privileges to read-only :-)
I always double check when it comes to things like that, ;P
What's the worst Python'll do if I use the wrong argument... I guess just shout at me
As long as you stay away from eval, fileutils and things like that, probably.
I don't really know why you'd be doing those things in arguments... But yeah, I'd be careful with them, ;P
15:04
I finally got to use template<auto> /o/
Today is a great day.
Also hi :)
lol
Monking
Oh right, monking xD
15:22
@Morwenn I'm not familiar with that. What does it mean?
@Edward It's equivalent to template<typename T, T value>, except that T is deduced.
Interesting. Is that a C++17 feature?
Yup :)
I might have a use for that right now...
Thanks!
No problem :)
I just used it to make function_constant class so that some function pointers weight nothing when you know them at compile-time :p
15:28
I'm looking into a response to this:
1
Q: Select member for comparison in sort or search

Jerry CoffinThis code is predicated on the notion that when sorting (or using a sorted collection of items, such as with std::lower_bound) you're usually comparing a single field in each object being sorted/searched. So a typical sort might look something like: // Sort by age std::sort(people.begin(), peop...

cppsort::sort(people, &Person::last_name) and you're done :p
:) I should have known you've already created and published an excellent answer!
But I haven't answered the question at all :o
Your library answers the question very neatly. You should post it as an answer.
I'm still trying to make it work, and you've already got it published.
I'm going to study your code and see if I can learn something.
@Edward I don't like to promote it here: it looks clean, but it's bloated under the hood, slow to compile, and has a few quircks that make it too dangerous for production :/
15:37
I've cloned it and I'm looking at it now.
If I get inspired, maybe you'll get a pull request someday soon.
@Edward Good luck understanding some parts of it.
If there wasn't the testsuite, I would be pretty sure that it's broken everywhere.
I'm already giving my monitor a quizzical look... There are things I rarely use like std::decay_t
Well, it's useful to remove const, volatile and references, but it also does some additional useless things under the hood.
The proposed std::uncvref_t would be better suited almost everywhere.
I need to study template stuff more closely.
Generating code to make code appeals to my lazy self. :)
Well, you don't need to, but it's fun :p
Especially error messages.
15:45
Looks like both clang and gcc have improved their template related error messages considerably in the past few years.
See for instance this answer on codereviewSE — oerkelens 7 secs ago
@Edward It doesn't really help when you have hundreds of lines of SFINAE error messages though :/
That's what usually causes me the most pain.
Especially when I get "clever" and provide templates for pointers, references, etc.
That's also one of the reasons why I don't want people to use cpp-sort in production environments or for serious projects :/
Most of my software projects are either for fun or for research purposes, so essentially none are serious projects.
15:51
Serious projects are overrated anyway :D
3
@Morwenn Definitely. One of my peers is working with undergraduate students to build a virtual reality training simulation. He claims it's a serious project, but we all know he just wants to play with toys.
16:06
Speaking of toys, I better stop playing and do a little work. See you later.
Bye :)
16:38
If the code is complete, and works, and you just want improvement suggestions, it should be on Code Review, not here. — Carcigenicate 12 secs ago
17:07
I think you should try to ask this in here. — nutmeg64 10 secs ago
Is there an error in your code? This question should be on Code Review. — Erich 11 secs ago
17:29
If you asking for code quality and best approach, please post this question in codereview stackechange. If you want to test your request body, please validator component in it, thanks. — Ankit Rana 42 secs ago
17:39
Monking!
Hey :)
Hi ya!
How's it going? Haven't seen you in ages.
@RubberDuck I'm fine. It's just that I became bored of reviewing code at some point ^^'
What about you?
About the same. I ended up with a job where I spent more time reviewing code than writing it. New job, new stack, and finally a bit of extra time and motivation to come back.
Motivation coming back is the hardest part.
I even have trouble being motivated enough to work on my sorting library ^^"
17:53
@RubberDuck Welcome back :-)
I almost never work on my projects anymore since I got a job :(
sigh side projects.
So many things to do, so little time.
@Hosch250 Getting enough motivation to code side projects after having coded all day at work is hard :/
3
Getting enough motivation to do anything semi-serious at all after having done any hard work is hard.
This question is a bad fit for Stack Overflow, but you may have better luck at Code Review. Make sure to read their guidelines first. — vaultah 6 secs ago
17:57
@Mast Doing chores is surprisingly not so hard after work.
I generally don't want to use my computer right now, so doing chores is a decent alternative.
@Morwenn Agreed
I barely code at home either anymore
And our software at work is way cooler than what I'll ever get for free, but it's not for sale/use outside company :(
My best motivation during the latest months was using new C++17 features that I couldn't use before to improve my library.
Well, technically it use, but it's too expensive
Of course most of the improvements were useless, but it felt great :3
@Morwenn Imagine this, we have a ban on the standard library at work for C++
18:00
@skiwi What I develop at work isn't for use outside of our company either, but I'm ok with that ^^
@skiwi Don't use C++ at work then xD
The point was that 20-30 years ago the standard library was actually worse than hand-written libraries, so they wrote their own standard library, so we need to use that
We do have MSVC 2012 though, and in the future (probably after we release our next major later in the room) we're switching to MSVC 2017, so we have all the new features :D
MSVC 2012 ><
The C++ I write generally only works with the latest g++ and clang++.
I wouldn't quite feel the difference, as the most advanced feature we use is probably templates xD
I spend my time mostly in their proprietary language or in C# though
Well, I use templates everywhere, and MSVC 2015 wasn't able to compile those templates :/
Probably not the easiest ones then
18:06
Indeed.
There SFINAE nightmares everywhere.
C# 7 is cool though :D
2
C# looks cool, but not cool enough for me to start a project with.
Ok, I haven't started new projects in a while.
We finally have half decent tuples. OMG
Well. Out of time. This bug will have to wait. TTFN
@RubberDuck Yeah, I've been refactoring a bit to use that
@Morwenn I've got some projects that I want to start, but fantasizing over them while playing games is also fun :D
@skiwi I don't even have cool projects to fantasize over xD
 
2 hours later…
19:42
3
Q: Calculating a ton of mathematical constants

esoteFor a while now I have been working to construct a program to calculate a lot of mathematical constants. Before I explain, here's the code: Code #include <boost/math/constants/constants.hpp> #include <boost/multiprecision/cpp_dec_float.hpp> #include <boost/math/special_functions.hpp> #include <...

-2
Q: Compile time error on missing specialization for a traits class

KamajiiIn a current project I have implemented a small non-intrusive serialization framework based on type traits. The generic trait template looks like this: template<typename T> class Serializable { public: static const bool isSerializableToString = false; static QString toString(const T &t)...

2
Q: If a move IsPossible () in a boardgame

KontulaI have a board game with four players: Anton, Rony, Young, Gabe. Each of them has four pieces and this function will detect if amove is possible for a pawn. My game board consists of 24 places (from 1-24)(numeral values) and four places for each team as home so all together are 40 places. AntonĀ“...

-2
Q: First HTML5 CSS Code Feedback

user144879Wrote my first HTML5/CSS page. I would like to get feedback on it. I know there are hundreds of different ways to do something. I am looking to get feedback especially semantics. Any feedback is appreciated. jsfiddle.net/g97o9ej1/5

1
Q: Classification of Date/Time/DateTime

James SchinnerI'd like to share a methodology I've been using when faced with a classification problem. This particular example is designed to classify time data as Date/Time/DateTime. Though I believe it could easily be adapted to many other problems The basic idea is: Create a list of regular expression...

0
Q: trying to figure out the calculations on this calculator

Carlthere is a calculator on the WSOP website @ http://www.wsop.com/2017/poy/. from viewing the source, the code for the calculator shows: <script> function rounder(v, p) { var m = Math.pow(10, p || 0); return (Math.round(v * m) / m).toString(); } function POYclr() { $('#iBuyin').val(""); $(...

0
Q: Checking if a number is palindrome or not in Java

Egek92Got this question in a technical interview and here is my solution: public class Main { public static void main(String[] args) { Scanner in = new Scanner(System.in); if (!in.hasNextInt()) { System.out.println("not a number!"); } int number = in.nextInt(); System....

2
Q: applyFilters - function which take array of items and array of excludes and return filtered by excludes array of items

TranotheronI wrote some function which should take an array of items:Array<Object> and array of excludes:Array<Object> with keys which values can't be present in items. and should return an array of filtered items. Is there some way to improve it? Is complexity of that function equal O(n + k)? const i...

0
Q: Pawns on board game using dice on c++

KontulaI have a board game with four players: Anton, Rony, Young, Gabe. Each of them has four pieces and this function will handle the move of the pawns on the board. I need help to improve my way of implementing this method. My game board consists of 24 places(from 1-24)(numeral values) and four place...

0
Q: Arrays of arraylist not working.

Fire.Here is a problem statement given (I am not pasting here as it is a long problem) which I am trying to solve using Arraylist which I have solved like this. But it is not working. Can anyone point my mistakes? import java.io.*; import java.util.*; public class Arraylist { public static void ...

0
Q: Checking if a number is Armstrong number or not

Egek92here is another basic interview question that I had: Armstrong Numbers public class ArmstrongCheck { public static void main(String[] args) { Scanner in = new Scanner(System.in); if (!in.hasNextInt()) { System.out.println("error"); } int number = in.nextInt(); a...

-1
Q: how many number exists which are less than or equal to n and are divisible by a ,b or c

timFirst line contains 't' denoting the number of test cases. Next t lines contain 4 integers denoting n, a, b and c separated by spaces. sample input 1 15 2 3 5 output 11 import java.io.IOException; import java.io.PrintWriter; import java.math.BigInteger; import java.util.HashSe...

0
Q: Am I designing this right ? I feel like it is extremely hairy

sulicatThis is a question about the quality of the approach. I am attempting to get better at writing nicer code, however I can't tell if certain things are good to do / bad to do sometimes. Here is the project I am currently working on. I can't post the whole thing as it is kinda big, however I'll pos...

1
Q: Merge Sort in Kotlin

TarptaeyaI started learning kotlin recently,with some background in java. So I wrote a merge sort algorithm in kotlin. I am looking for best practices in kotlin and looking for this code review. I also wanted to know about its efficiency and ways to increase it. Thanks fun merge(list: List<Int>,lo: In...

0
Q: Simple Hangman game - Python 2

Nicholas SmithThis is a simple game of Hangman, and my first program. Would love some feedback on my code. Be ruthless. Any suggestions on how I can improve this code in terms of making it more efficient and cleaner looking. (It's asking me for more details, however im not sure what else to post)(It's askin...

1
Q: Parking lot OO design

Tywin LannisterI have tried to design the parking lot problem. Here is the problem statement. Design a parking lot system where Admin can look up all the available spots for parking, He should be able to choose both randomly as well as orderly Using the register number and the type of the vehicle he should be ...

0
Q: Scraping information from a webpage not knowing it's last page number

SMth80I've written some code in vba to scrape names and phone numbers from a webpage that has spread across some pages I don't wish to know of. The main interesting thing with this scraper is that It only needs to know the first page number then it traverse across all the pages and fetch the informatio...

0
Q: implementing classes into my prototype in python

EntroyI need help to implement classes into my fully functioning fotboll point system, where the code mainly does use the file Premier_League.txt, as it asks about hometeam/awayteam and what the score was, it enters into the file that specific teams (played matches, matches won, losses, ties, let in go...

0
Q: Generic Template imlementation of merge sort in c++

ExOfDea few month ago i wrote several basic sort algorithm for educational purposes as generic as possible in c++. In a few days time i want to present some of that stuff in my class but before that i thought i show my implementation to you and listen to your comments of what do you find confusing or v...

Why so many mergesort questions? o_o
WTF Captain?
Monking @Morwenn
Hey :)
 
1 hour later…
20:56
@Morwenn linkedlist is evolving
@skiwi Hehe :D
21:18
This sounds like a programming challenge - might be appropriate on codegolf or codereview.stackexchange.com — Sam Onela 29 secs ago
21:29
2
Q: What to do about "It's asking for more details"?

Simon ForsbergFor a while now we've had "Clippy", which among other things has support for detecting when there's a lot of code posted but not a lot of description. The feature is nice and comes with good intentions but a lot of users have had problems with this. They've encountered this restriction so they a...

Feeds to slow.
 
1 hour later…
22:33
If you have working code you could try posting here: codereview.stackexchange.comyuriy636 57 secs ago
2
Q: What to do about "It's asking for more details"?

Simon ForsbergFor a while now we've had "Clippy", which among other things has support for detecting when there's a lot of code posted but not a lot of description. The feature is nice and comes with good intentions but a lot of users have had problems with this. They've encountered this restriction so they a...

22:52
0
Q: JavaScript - Regex Credit Card expiry date auto format

Maulik SuchakIt was originally posted on Stackoverflow, but someone said it's better if you post here. I'm trying to write a function that will get content from input element and try to format numbers entered in input box in MM/YY. Following is a solution that I've, I want to reduce numbers of lines it has. ...

0
Q: Android activity that uses Retrofit to hit REST endpoint

TheLearnerToday I accomplished creating an activity that retrieves all the restaraunts from self created rest endpoints. The searched text is passed on from an EditText that is from the previous activity. Is there anything I did wrong? Or any suggestions? @Override protected void onCreate(Bundle savedIn...

I'd suggest looking at codereview.stackexchange.com to see if maybe that's a valid venue for your question. But if you do post there, please include your code in your question - not a link. — David Makogon 28 secs ago
23:28
This question looks like an ideal candidate for codereview.stackexchange.com. Can it be migrated? — Philipp Claßen 47 secs ago
0
Q: Finding the best schedule from a set of Movies

ChillaxGiven a list of Movie show timings with start and end timings, I need to find the best schedule of Movie shows - with the maximum number of shows. For Eg: Movie 1: Starts on 7th Jul at 08:00, Ends at 10:00 Movie 2: Starts on 7th Jul at 09:00, Ends at 11:00 Movie 3: Starts on 7th Jul at 12:30,...


« first day (1540 days earlier)      last day (2772 days later) »