« first day (1333 days earlier)      last day (2669 days later) » 
00:00 - 19:0019:00 - 00:00

12:00 AM
RELOAD! There are 3241 unanswered questions (91.9761% answered)
@DanielHerr At first glance it seems like it also requires a stream : mediaRecorder = new MediaRecorder(stream, options) . It says: The MediaStream can be from: Web Audio, once this issue is implemented. — Nim 55 secs ago
 
12:26 AM
@EBrown writing Java wat
 
Yeah it's been a long day lol
 
Guess it's about as strange as me learning some C
 
0
Q: Computationally approximating PI

TobiIs this an efficient way to get the value of Pi, where the limit of j ∝ accuracy? PI = 0; for (var j = 1; j < 100; j+=2) PI += (4/j)*((j+1)%4?1:-1);

 
1:02 AM
1
Q: Game where you guess whether an article is from r/theonion or r/nottheonion

user298519How can I make my code better? function generateRandNum(min, max) { minimum = Math.ceil(min); maximum = Math.floor(max); return Math.floor(Math.random() * (maximum - minimum)) + minimum; } function generateNewPost(json_data) { var rand_num = generateRandNum(0, json_data.length)...

 
@EBrown Do you have a votes/active user/day stat?
 
@Hosch250 No but we went over that yesterday I think.
Or did we do questions?
Either way, it's easy to get.
 
We did questions/answers.
 
QuestionsPerDay	QuestionsPerDayPerActiveUser	VotesPerDay	VotesPerDayPerActiveUser
18.6180811808118081180	0.0054391122351188454	217.3477859778597785977	0.0634962857078176390
18.6215966774342408860	0.0054433196952453203	217.2953391785879095523	0.0635180763456848610
18.6269621421975992613	0.0054464801585373097	217.2663896583564173591	0.0635281841106305313
18.6360277136258660508	0.0054475380630300690	217.2540415704387990762	0.0635060045514290555
18.6284658040665434380	0.0054485129581943677	217.1820702402957486136	0.0635221030243626056
The VotesPerDay has gone up, but VotesPerDayPerActiveUser has gone down.
 
Thanks.
 
1:07 AM
Gathered	DaysSinceLaunch	QuestionsPerDay	QuestionsPerDayPerActiveUser	VotesPerDay	VotesPerDayPerActiveUser
2016-12-26 00:03:33.9560841	2168	18.6180811808118081180	0.0054391122351188454	217.3477859778597785977	0.0634962857078176390
2016-08-10 07:33:03.8194495	2030	18.0049261083743842364	0.0055725552795959096	212.8413793103448275862	0.0658747692077823669
2016-04-10 22:45:37.4295755	1908	17.3904612159329140461	NULL	206.1567085953878406708	NULL
 
So, active users are slowly contributing less, even though the site stats as a total are gradually rising.
 
Generally speaking, yes.
We're getting more active users than we are getting of votes/questions/answers.
Which means we're probably getting more people who are less frequently active.
I know I don't help the Votes metric(s) at all.
I should start collecting numbers of users >1k rep.
 
And I've not posted regularly for quite a while.
 
0
Q: Number of fives in a list

J.user94I'm new to Java and I was wondering why my "else if" statement is not working for this code. Thank you public static void numFives(){ int [] list = {11, 21, 5, 31, 5, 41, 5 }; int i = 0; int fives = 0; while(i < list.length){ if(list[i] == 5) { fives = fi...

 
1:36 AM
0
Q: Reversal of a singly list in Rust

Anurag SoniI was trying to write some simple data structures to practice ownership concepts in Rust. I'd like a review: type Link<T> = Option<Box<Node<T>>>; struct Node<T> { elem: T, next: Link<T>, } struct List<T> { head: Link<T>, } pub struct Iter<'a, T: 'a> { next: Option<&'a Node<T>>...

 
 
2 hours later…
3:38 AM
0
Q: Find smallest subset prefixes (part 2)

Lin MaHere is my code for this problem. Any bugs, performance in terms of algorithm time complexity, code style advice are appreciated. This is a continued discussion from (Find smallest subset prefixes) and since it is new code, I post a new thread. Problem: Given a set of strings, return the sm...

 
4:15 AM
possible answer invalidation by CodeYogi on question by CodeYogi: codereview.stackexchange.com/posts/150844/revisions
 
4:35 AM
possible answer invalidation by CodeYogi on question by CodeYogi: codereview.stackexchange.com/posts/150297/revisions
 
5:02 AM
0
Q: minimal number of airplanes needed

Lin MaWorking on the problem of finding minimal numbers of air plane needed, given schedule of each flight, and schedule may overlap. For example, schedule (0,1) means a flight starts at clock 0 and lands at clock 1. Here is my code written in Python 2.7, and major ideas is to find max overlap, any ad...

 
5:25 AM
0
Q: CamelCase word count

CodeYogiSee the online challenge on Hacker Rank. public class Solution { private static int solve(String input) { int len = input.length(); if (len == 0) { return 0; } int count = 1; for (int i = 0; i < len; i++) { char c = input.charAt...

 
5:39 AM
We watched Despicable Me 2 Christmas afternoon. My favorite part was the first scene with Jillian.
She comes up carrying on about all the eligible females she knows, and Gru picks up a garden hose and sprays her in the face and goes "spray... Sorry, I didn't see you there. spray... I didn't see you there either."
 
5:50 AM
Also, browsing Little Women again. It's been years since I read that. It is hilarious (but then, so are most good books, or at least they seem so to me).
Wow, Reed posted 200 C# answers very quickly on SO.
Bronze badge on March 17, '09
Silver badge on April 25, '09
Gold badge on July 9, '09
 
6:29 AM
0
Q: Leetcode 15. 3 Sum

Jianmin ChenProblem statement Given an array S of n integers, are there elements a, b, c in S such that a + b + c = 0? Find all unique triplets in the array which gives the sum of zero. Note: The solution set must not contain duplicate triplets. For example, given array S = [-1, 0, 1, 2, -1, -4], A solut...

 
6:42 AM
Monkevening
malloc() sounds semi-fun...
I bet malloc()'ing strings with different character sets is a blast
Maybe C doesn't support that though
 
7:05 AM
@Phrancis just make sure you allocate enough room. The array only stores, it doesn't interpret.
 
That's sensible, thank you
 
7:38 AM
Merry XMAS monkeys. ^^
 
Merry XMAS
 
Merry 2nd-XMAS, denizens of EU
 
0
Q: Super Reduced String.

CodeYogiSee the online challenge on Hacker Rank. public class Solution { private static String solve(String input) { int len = input.length(); int i = 0; while (i < len - 1) { char current = input.charAt(i); char next = input.charAt(i+1); ...

 
BTW today is Tuesday for the rest of us ;D
 
It's Tuesday for me too but I didn't wish you all the best 'cause I was unable to join the room while Christmas was still up & runnin'
 
7:52 AM
Sorry to hear about that, thank you for the wishes & merries :)
 
well author is looking for solution, not code review. but agree there is incorrect usage of loops. — a-man 42 secs ago
 
0
Q: Modern C++ data from C-like API

LiviuThe following code works on VS 2015: template<TOKEN_INFORMATION_CLASS> struct TokenInfo; template<> struct TokenInfo<TokenUser> { using Type = TOKEN_USER; }; template<> struct TokenInfo<TokenGroups> { using Type = TOKEN_GROUPS; }; template<> struct TokenInfo<TokenGroupsAndPrivileges> { ...

 
 
2 hours later…
9:58 AM
0
Q: Workflow / pipeline management on SLURM cluster

SajberI'm a PhD student in bioinformatics, but with a background in pure biology (i.e. very little programming), and I have a pipeline for analysing commonly available bioinformatic datasets, starting with downloading the data all the way through intermediate and final analyses. It's basically a bash w...

 
10:13 AM
0
Q: WinAPI C++ string wrapper

LiviuThe following code works on VS 2015: #include <windows.h> /* Reference: http://stackoverflow.com/questions/9792411/how-to-get-windows-domain-name "C++ - Using STL Strings at Win32 API Boundaries": https://msdn.microsoft.com/en-us/magazine/mt238407.aspx */ static inline auto...

 
10:25 AM
0
Q: HackerRank university codesprint array construction

Jianmin ChenProblem statement Professor GukiZ has hobby — constructing different arrays. His best student, Nenad, gave him the following task that he just can't manage to solve: Construct an \$n\$-element array, \$A\$, where the sum of all elements is equal to \$s\$ and the sum of absolute differences betw...

 
10:57 AM
@Phrancis Ya that was yesterday...
Monking btw
 
possible answer invalidation by Liviu on question by Liviu: codereview.stackexchange.com/posts/150927/revisions
possible answer invalidation by Vogel612 on question by CodeYogi: codereview.stackexchange.com/posts/150297/revisions
If this is working code that you think could be improved, see Code Review. One obvious issue is that you ask the user for binary input and then immediately convert it to an integer as decimal input, which seems counterproductive. — jonrsharpe 44 secs ago
 
11:25 AM
-1
Q: Want Avoid the Comma separation.And of the data should be come one by one down

Abhi[![patient registrion form][1]][1] i want to save my checkboxlist selectedvalue to database,by adding each selected value to new row

 
11:48 AM
Monking
 
12:14 PM
0
Q: How to start with sonarqube?

Antony NaveenI learned about what is static code analysis. Static code analysis is used for code complexity, duplicaton code, code review..For example. String[] arr=new String{'A','B','C'}; for(int i=0;i<arr.length();i++) { } //here length() is a inbuilt function. so It will execute 3 times int len=array.l...

 
LOL, if anyone's interested in photography, check out the Canon FD 5200mm lens
 
12:36 PM
0
Q: Making Dependency Property registration strongly typed v2

t3chb0tThis is my second attempt to create a strongly typed builder for the Dependency Property. I've fixed the main issues from the previous version which were: Cannot specify other PropertyMatadata types Cannot use DependencyProperty.UnsetValue I've fixed the PropertyMatadata by creating another...

 
12:53 PM
0
Q: Christmas Tree in Kotlin

Piotr Aleksander ChmielowskiPlease review my code for printing a Christmas Tree. The idea was to merge some functional programming ideas (immutability, streams) and OOP (every thing is a small object). I'm looking for a review focused on readability of the code. Here is a output from the code: * *** *****...

 
1:25 PM
0
Q: My questions are being vandalized, can I denounce these people somewhere

LiviuThis one, by exemple: Modern C++ data from C-like API. http://codereview.stackexchange.com/users/9357/200-success and http://codereview.stackexchange.com/users/39848/edward are adding random stuff, I do not understand their gabbarish sentences, I suspect they are robots.

 
1:42 PM
This question seems like it belongs on codereview.stackexchange.comBryan Oakley 49 secs ago
 
@skiwi Ah what?
5200mm?
Crazy.
 
@Mast Yep
 
> This code got invalidated by evil monkeys: instead of resting their evil spirits, these abominable baboons randomly add useless garbage links.
 
@Mast he's already in the penalty box
@Phrancis you write on meta that SE does not save unpublished drafts should you navigate away from the page... mhmm... but it does, I often use this feature
 
@t3chb0t Could it be a feature that Firefox offers?
 
1:56 PM
funny, it works on SO but not on CR (anymore)... but why?
@skiwi I'm using chrome and opera and it's be always working
 
Hmm okay, the browser could add support for it independent of a site, not sure which one does though
 
I didn't know it existed but once I wanted to discard a question and navigated away... then some time later I press Ask Question and the one, few days old was still there
 
Hmm, I don't get this:
0
Q: Minimal number of airplanes needed

Lin MaI'm working on a problem of finding the minimal numbers of airplanes needed, given the schedule of each flight, while schedules may overlap. For example, schedule (0,1) means a flight starts at clock 0 and lands at clock 1. The major idea is to find the max overlap. Any advice is highly apprecia...

 
Ripe zombie; open question with answers, at least one answer having score 0, no answer having score > 0: Execute commands over Telnet, logging to a file
 
2:21 PM
@Dex'ter You got a couple of scheduled flights. Some of those flights happen at the same time. How many airplanes do you need to fly all flights?
 
@Mast but there're only two flights with the same schedule
 
Monking
 
I meant it isnt accepted there so I will continue asking it here. I dont want my code reviewed as to if it will work, I just want to know the bst practice in situations like this. — user_mda 25 secs ago
 
@Dex'ter 3.
(6,9),(6,9),(7,10)
You need 3 planes for that.
 
@Mast why is (7, 10) in the list ?
I'm confused :D
 
2:25 PM
@Dex'ter If I understand the representation correctly, the first number is the date of departure and the second number the date of arrival.
The list fed as input is all flights that have to be made.
So if you have (6,9),(6,9),(7,10), you want two flights at the same time and a third partially at that same time.
At day 7, the other two aren't available yet.
So you need a third plane.
It ain't rocket science.
It's probably a simplified version of a well-known math problem somewhere.
 
oh, got it :D
@Mast that partially is giving me headaches
if the last two are partially at the same time, why not the first two pairs?
 
they are entirely at the same time
 
2:42 PM
(6,9),(6,9) have 100% overlap.
All days are mutual.
(6,9),(7,10) have 3/4 overlap.
Assuming all dates are inclusive.
 
6--9
6--9
 7--10
 
But how much overlap they have is quite irrelevant.
The flight at 7 happens before the planes leaving at 6 are back.
So, you need a new plane.
 
3:00 PM
@t3chb0t Hmm if you jave experience with it to explain how it works please edit the post or post a separate answer, I didn't realize that actually existed
(editing it is probably better fof clarity)
 
3:13 PM
@Phrancis I wrote a new answer, I didn't know how to work it in your answer... meta.codereview.stackexchange.com/a/7112/59161
 
@Phrancis @Hosch250 and anyone else interested in SESE, care to comment on this issue I have on GitHub‌​?
 
3:34 PM
I'm voting to close this question as off-topic because as suggested - migrate to codereview.stackexchange.com — MikeD 27 secs ago
This question seems to be better suited at SE CodeReview. — πάντα ῥεῖ 15 secs ago
 
.NET Framework 4.6.x is C# 6?
Though C# 7 should be out already too if I'm not mistaken..
 
Yes and almost @skiwi.
C#7.0 is RC right now.
 
Hmm I should look into adding that framework somehow then
I need to upgrade Visual Studio 2015 I guess then
 
@skiwi You can use any version of C# (most commonly 5.0 and 6.0) for .NET AFAIU.
 
I want to be the very best, like no one ever was...
 
3:39 PM
Don't you dare
3
 
Or should I install VS 2017, but I'm kind of out of disk space
 
VS2017 is huge and RC right now.
And 2015 is moderately reliable.
Though C#7.0 is only supported on 2017.
 
> What follows is a description of all the planned language features in C# 7.0. With the release of Visual Studio “15” Preview 4, most of these features are coming alive. Now is a great time to take them for a spin and tell us your thoughts!
 
@skiwi I have VS2015 and I tell you it's not in them.
 
Also Preview 4?
 
3:41 PM
Greetings, Programs.
 
I want to believe Microsoft :p
Greetings, @Donald.McLean
 
@skiwi VS 2015 hasn't been a preview for a while.
VS2017 is a preview.
 
I suppose they mean the preview of update 4 or something
 
Possibly.
And I wouldn't trust Microsoft blindly like that.
 
Jokes on them, I don't have anything working yet, so they cannot break anything
 
3:44 PM
VS 2015 is not VS 15
VS15 is VS 2017
 
Well maybe their documentation should say that somewhere.
At any rate, it's irrelevant.
 
I should probably pick VS 2015 with C# 6 support to save me from trouble
@JeroenVannevel Ow... okay, that's unexpected
 
no reason not to pick VS 2015
 
C# 7 sounds cool
 
C#7.0 doesn't look like it's going to have a major effect on a lot of code like 6.0 did.
The biggest "new" thing that will be nice is how they updated out parameters.
 
3:47 PM
I'd argue it'll be the opposite
pattern matching, tuples and ref returns fundamentally change syntax
C# 6 was a lot of syntactic sugar
 
They're not used enough in regular code.
 
how would you know? It literally doesn't exist yet
New language features will inspire new idioms
 
In fact, Tuple usage is generally frowned upon ("make a POCO!!!11!!1!1!").
And if this is what changes that thought, then that's ridiculous.
Pattern matching may or may not be useful.
 
It's frowned upon because the values are unnamed and the syntax is messy
that is addressed by natively implementing tuples
 
We'll see.
The only time I've ever needed a Tuple is to avoid an out parameter in a parsing method.
But now that they updated how you can use out, I don't know that it matters at this point.
The one that is nice is the case typing.
Now you can match a case on type natively.
 
3:50 PM
@EBrown I think 2 and 3 are good
 
@Phrancis I was thinking I'd use option 3, modified, as well.
 
4:24 PM
@JeroenVannevel Does it have 2 names or is VS15 simply the 2017 release and did they drop the naming scheme where the year is in the name?
 
0
Q: UVA 524 - Prime Ring

Abhisek A ring is composed of n (even number) circles as shown in diagram. Put natural numbers 1,2,...,n into each circle separately, and the sum of numbers in two adjacent circles should be a prime. Note: the number of first circle should always be 1. Input n (0 < n <= 16) Output ...

0
Q: How do I refactor this code to reduce redundancies? (Protocol with associated type)

BerryI need help with code redundancies. I've been stuck for days trying to figure out a design that solves this. I'm working on a back-end server. The program runs, however I'm very unhappy with the current design. First, I have a Data Access Object protocol that interacts with a database: protocol...

 
VS15 was the "internal" development name, I think
Should really be referred to as VS 2017 from now on
Or the other way around
 
Would be nice if they didn't mix internals with externals :P
 
I don't know, MS is pretty bad with their naming
 
IKR, has anyone found Windows 9 yet?
 
4:26 PM
@Mast It got released in between Windows 95 and Windows 98
 
I've seen Win 3, 4, 6, 7, 8 and 10. No clue where 5 and 9 are.
5 might have been embedded-only like 6.
95, 98 and 2000 somehow came between that series.
5 might have been XP as well...
Yea, bad with naming.
 
@JeroenVannevel VS15 is the version number.
It's 15.0.xxxxx.
My VS 2015 version is 14.0.25431.01 Update 3, my VS 2017 version is 15.0.25920.0
 
In fairness, Battlefield has an even odder version system, but that's because they keep skipping through history...
1942, 2, 2142, 1943, BC2, 3, 4, 1
And that's only the numbered ones...
 
Now let's talk about Star Wars...
 
lmao
 
4:33 PM
Though Battlefield would come pretty close if it were a film series :P
 
JDK is a bit twitchy as well.
> The next Limited Update for JDK 7 will be numbered 7u40, and the next 3 CPUs after that will be numbered 7u45, 7u51, and 7u55. The next release will be a Limited Update 7u60, followed by CPUs 7u65, 7u71, and 7u75.
Although they got a somewhat good reason for that.
 
They have reasons
Argh, this is not what I wanted
 
Shrink your solution explorer a bit.
 
@Hosch250 I added a review of Minimax to the answer to your F# question.
 
@Mast It's in an entirely different screen right now :P But fixed it
 
4:39 PM
Of-course, it all gets better when you realize Windows 7 was actually Windows 6.1...
 
@Mast Windows 8.1 was 6.3 IIRC.
 
I guess I've got to learn with these weird brackets now
 
Oh, and if you deploy an app to Windows 8.1 or 10, the version numbers are 6.3 and 10.0 respectively, but if your app is manifested for Windows 8 you will see 6.2 as the version number on both.
 
...
 
wat
 
4:42 PM
Turns out Win 2000 is considered Win 5
 
Win 95, 98, 98SE and ME are all Win 4.
 
Operating system	Version number	dwMajorVersion	dwMinorVersion	Other
Windows 10	10.0*	10	0	OSVERSIONINFOEX.wProductType == VER_NT_WORKSTATION
Windows Server 2016	10.0*	10	0	OSVERSIONINFOEX.wProductType != VER_NT_WORKSTATION
Windows 8.1	6.3*	6	3	OSVERSIONINFOEX.wProductType == VER_NT_WORKSTATION
Windows Server 2012 R2	6.3*	6	3	OSVERSIONINFOEX.wProductType != VER_NT_WORKSTATION
Windows 8	6.2	6	2	OSVERSIONINFOEX.wProductType == VER_NT_WORKSTATION
 
Don't ask me how.
 
Your reference to this question had me very confused, and very curious about all these features of C# enums I had never seen. But then I realized that the reason that code won't compile as C# is because it's Java. — Carl G Oct 7 '12 at 13:31
lol
 
4:43 PM
> * For applications that have been manifested for Windows 8.1 or Windows 10. Applications not manifested for Windows 8.1 or Windows 10 will return the Windows 8 OS version value (6.2). To manifest your applications for Windows 8.1 or Windows 10, refer to Targeting your application for Windows.
 
Are enums second-hand citizens in the C# world? Defining a method on them is not exactly easy
/s/easy/maintainable/
 
@skiwi In C# Enum is literally a numeric type.
And you can pretend to define methods on them via extension methods.
 
I'm coming from Java... should I just make a class and add static members? I don't need to switch over the class/enum
 
@skiwi VS "15" is the codename for VS 2017.
 
public static class MyEnumExtensions
{
    public static int EnumAsInt(this MyEnum value)
    {
        return (int)value;
    }
}
@skiwi Something like that ^^
 
4:46 PM
Yeah, except you need to switch over the possible enum values or use reflection and take a performance hit
 
You can define extension methods, and they'll look like methods on the enum.
@skiwi What? No you don't.
They're integers (or whatever type you specify), you can freely cast them between the same numeric type.
 
@skiwi Maybe not.
 
If I want each enum member to return an unique description
 
@skiwi NO!
 
@skiwi Ah, in that case maybe. You could build a DescriptionAttribute and get the description from it.
 
4:48 PM
@skiwi Oh, then use strings.
 
That uses reflection but it doesn't seem to be slow reflection.
 
Enums are more for flag-type values than actually storing information.
 
0
Q: Optimizing code to search and copy files

Manimy code works as expected but I am on how to optimize the code. The purpose of the code is to find files with given parameters and copy them to a separate folder. import java.io.File; import java.io.IOException; import org.apache.commons.io.FileUtils; import javax.swing.JOptionPane; import java....

 
And depending on what you are doing, you can do Enum.GetNames, or Enum.GetValue, and maybe avoid the switch.
 
As an example I want to store all heroes in HearthStone where I use a hard-coded identifier (the heroes/classes don't change, if it would then it would be a major change) and then add GetDisplayname() and GetImage() methods or something of that sort
 
4:50 PM
Don't use an enum
Make it a class/struct
 
In Java I'd do it 100% with enum, and that's my experience, but I don't think I want that here, probably a class with static readonly members
 
@skiwi Readonly, yes, not static.
Make a Hero class with all the information you need.
Make a list of Heroes, or something.
 
Ah yes, a class doesn't provide that anymore, good point
Why not static though?
 
Because if you have static fields, you'll end up with only one value across all those instances.
 
I don't want instances, I want one static value
 
4:53 PM
So, if you want all your Heroes to have the same name...
 
Well, the static values are instances of course :P
@Hosch250 Hmm okay, my bad, I want to store all heroclasses
 
public class Hero
{
    public string Name { get; private set; }

    public static readonly Hero Zeus => new Hero { Name = "Zeus" };
}
Something like that, @skiwi?
 
@EBrown Comes pretty close yeah
 
@EBrown No! Make that Name { get; }
And make a ctor that takes the name.
 
Except probably public readonly string Name; and then define it in a constructor? I don't know the specific syntax yet
 
4:56 PM
@Hosch250 Then when @skiwi adds a mullion properties.
@skiwi Personally, I'd make set a private and leave it be.
 
@EBrown I wouldn't.
Heroes can't change their name. That misrepresents what can happen.
 
Heroes probably can't change anything, but I would suggest that having a class with two dozen immutable properties would be very painful to build a constructor for.
 
(hey my university JetBrains student license still works :D)
 
@EBrown Doesn't make a difference. They will have to be assigned before the instance can be used, anyway, so it should go in the ctor.
 
agree with hosch
 
4:58 PM
For what do I use ReSharper other than changing the keyboard scheme to IntelliJ scheme?
 
@Hosch250 Now you have to build a constructor with two dozen parameters, when you can create properties that are simply private mutable.
 
so?
You have to assign them anyway if they're required
 
...
 
now you make the requirement explicit
 
I give up.
You just want to create excess work for the poor person.
 
4:59 PM
So, how is new Hero(1, 2, 3, 4) any different than new Hero() {1 = 1; 2 = 2; 3 = 3; 4=4}?
 
@Hosch250 You're right.
I'm done
Suggest whatever you like.
Obviously I'm in the wrong here.
 
public class Hero
{
    public Hero (string name)
    {
        Name = name;
    }

    public string Name { get; }
}
 
Hmm, readonly does not prevent me not assigning anything to it in the constructor?
 
readonly = inline or ctor assignment
 
@skiwi Readonly and get-only can be assigned in the ctor or when the variable is created.
That's the only place it can be assigned.
 
5:01 PM
it doesn't require a value
 
Hmm okay that differs from Java's final then, the compiler gets very mad at me if I forget it
 
0
Q: How to refactor the below javascript?

rJ7I want to optimize the below code in order to call the same controller method twice without using async: false in the ajax call and call the same controller method synchronously. Appreciate your help... HTML: <div> <div class="col-md-6"> <input c...

 
If you want it only assignable at the place it is created, then make it a const. Just know that those have to be compile-time constants.
BBIAB.
 
Does this look okay? pastebin.com/ri1vJNSC
 
5:07 PM
use properties
not public fields
 
I know the name is exactly the same as the variable name, but I'd like to avoid a direct relation
 
Otherwise sure, although I'd return an immutable collection instead
 
I think I fixed it, the Druid, etc. can be fields, correct?
Well they're instances actually
 
Can be, though I prefer properties for everything but const fields
fields & instances are different things
a field is a member, an instance is a specific materialization of a class definition
 
Yeah, I messed up my wording there
Hmm I'm curious why VS 2015 with ReSharper enabled doesn't pull up ImmutableList automatically, probably doing something stupid
 
5:12 PM
Might need a reference
System.Collections.Immutable?
 
I cannot find it right now, need to leave for dinner though, I'm sure it's hiding somewhere
I'm targeting 4.6.1 so it should be available
 
0
Q: Queue Notifier Extension Script

MalachiI am trying to keep the progression of the Review Queue Notifier moving forward. My next big move is to turn it into an extension for Chrome and FireFox and eventually Edge. I would like the Javascript for the code reviewed again to get me back into the groove of coding this extension/script. ...

 
-2
A: "Ella" Java chatbot

Asthawhich database should be used to develop a chattbot using java as the programming language? How can one start the coding in java for developing a chattbot?

 
@Hosch250 Perhaps instead of plastering it around we should simply VTD it.
 
@EBrown I did VTD it. I want you guys to too.
 
5:25 PM
just realized that I did not get the Christmas hat this year
 
Ohh... System.Collections.Immutable is a NuGet package?
That's interesting
 
@skiwi Yeah.
 
pastebin.com/z6BtqZnF - so this would be the resulting version?
 
@skiwi Just use a ReadOnlyList or ReadOnlyDictionary.
No NuGet packages needed.
 
Don't put Class at the end of the class name.
 
5:33 PM
Hello
 
Hi, @denis.
Hmm, if you assign an IList field to an ImmutableList value, does the immutability stick?
IList doesn't ensure immutability, so...
 
it actually does by the IsReadOnly property
 
Oh, OK.
public static HeroClass Druid { get; } = new HeroClass("Druid");
That should be public static HeroClass Druid { get; } = new HeroClass(nameof(Druid));
Also, if you are just using the names, and nothing else, then use an enum.
 
and probably even
 
You can do HeroClass.Druid.ToString().
 
5:36 PM
static HeroClass Druid => new HeroClass(nameof(Druid));
 
@t3chb0t Yup.
 
What are we looking at :?
 
so that you get a new hero each time in case you're going to modify them later
 
@t3chb0t IIRC, those only assign once.
They don't keep recalculating.
 
@Hosch250 They recalculate.
 
5:38 PM
 
Every time you call an expression-bodied member it reevaluates itself.
 
If you really want to make sure it evaluates once a lazy instantiation should do the job but that will require a backing field.
 
@denis or you just assign it directly
lazy is irrelevant here
 
5:50 PM
@Hosch250 Gone.
 
This is better suited for codereview.stackexchange.com — dantiston 48 secs ago
 
0
Q: Game of Thrones

CodeYogiOnline challenge on Hacker Rank. The king has a string composed of lowercase English letters. Help him figure out whether any anagram of the string can be a palindrome or not. Input Format A single line which contains the input string. Constraints 1 <= length of string <

0
Q: What is the issue with this implementation of linear regression

theideasmithI tried to implement linear regresion with gradient descent, but my error diverges to infinity. I've read over my code and still cannot figure out where I went wrong. I'm hoping someone can help me debug why this implementation of linear regression isn't working. I am using mean squared error ...

 
@CaptainObvious Ninja'd by the Jamalizer.
2
 
6:10 PM
@Hosch250 But it's a class in the game
 
Oh, NVM then.
Did you see my point about enums?
 
Yeah, but I don't like coupling it
I feel that the fact that the name equals nameof(Druid) is not a given
 
@skiwi Huh?
 
I don't want the name to change if I would change the variable for example, and vice versa
 
Ripe zombie; open question with answers, at least one answer having score 0, no answer having score > 0: Kth largest element BST
 
6:20 PM
Oh.
 
I'm more worried about the WPF part, what I want is to have a "main window" and load different windows into it, but my main window will save some of the state too, if that makes sense
A bad way would be to use singletons, but let's not to do that, at all
Actually it's more of a flow, select something on screen 1, then pass that information to screen 2
 
Use custom controls and bindings.
 
0
Q: Injecting stereotypical role implementations by IoC container (2)

Dmitry NoginPrevious version is here. Sources are available on GitHub. I am trying to define a plug and play CQRS architecture which leverages stereotypical role implementations (Validator, Reader, Writer, Logger, Query, etc) by automatically instantiating associated services through a very limited use of S...

 
It'll probably end up being a mess, but hopefully a working one
Hmm
in Cardshifter and other projects, 26 secs ago, by Duga
[skiwi2/ArenaDraftAssistant]‌​ skiwi2 pushed commit 98bde1d6 to master: Added menu bar and quitting the application now quits the application.
Maybe I should've reworded that
@Hosch250 Aren't bindings ugly in WPF? At least in some code samples I found they look ugly
4
Q: WPF bind title of window to property

lace.johnI am trying to bind the value of a property (MyTitle) of a class (MainWindow) that derives from Window. I have created a dependency property called MyTitleProperty, implemented the INotifyPropertyChanged interface and modified the set method of MyTitle to call the PropertyChanged event, passing "...

Like that for example
 
00:00 - 19:0019:00 - 00:00

« first day (1333 days earlier)      last day (2669 days later) »