« first day (1154 days earlier)      last day (2865 days later) » 

3:00 PM
but why do we have everyonelovesstackoverflow divs on CR
 
I guess it deppends on what you counts as dangerous
If dangerous means chance to fail, then I totally agree,
 
I randomly stumbled across Jamal Jamalizing in his younger days: stackoverflow.com/q/18182419/1937270
 
@N3buchadnezzar no
not "chance"
try "impact of failure"
 
Try number of deaths in formula one compared to number of deaths in rocket launches
Or number of deaths by coconuts compared to formula one
 
can we do that as "manned rocket launches"
and "deaths per crash"
 
3:04 PM
0
Q: How can I do a prefix tree?

Andrea ChaBalI wanna do a preffix tree with this suffix array code but I don't know how to do it, can somebody help me? import java.io.BufferedReader; import java.io.FileReader; import java.io.File; import java.io.IOException; import java.util.Scanner; import java.util.regex.Matcher; import java.util.regex...

 
@Pimgd Rocket doesn't even have to hit anything. If something comes loose, driver is vaporized.
 
@CaptainObvious VTC
 
An interesting question is wheter it is more likely I would be injured in a formula 1 crash or manned spacelaunch :p
 
@Mast joke works better when visualizing a car hitting a wall and a rocket hitting a wall
 
That is not a joke, that is horrible!§
 
3:07 PM
@N3buchadnezzar depends on your definition of crash
@N3buchadnezzar don't worry, rocket contained kerbals. Nascar car also contained kerbals. That's why both of them are heading towards a wall.
 
Well the chances of me attending both are terribly slim so.
 
@N3buchadnezzar ... yes, if you die in a spacelaunch it'll be tough to get into a formula 1 crash...?
 
Challenge accepted!
 
anyway, I imagine there's data available for both
 
As of 2016, in-flight accidents have killed 18 astronauts, in four separate incidents.[2]
Formula 1 holds a count of 51.
 
3:12 PM
Great, only need a few more variables
how many launches
how many cars
 
You could check wikipedia
Ooooor we could change subject. How is the weather?
 
Well basically I think that there's about 12 races per cup and 1 cup per year and probably been going on for like 40 years
and like, 30 cars participating?
14400 car "launches", 51 deaths
vs ??? manned rocket launches, 18 deaths
I think it's gonna be less than 5000
312 says wikipedia
so yeah, manned spaceflight is more dangerous
 
The only thing Wikipedia is good for, is as source of sources.
 
which was kinda what I expected
 
Don't use it for facts directly.
 
3:18 PM
These chronological lists include all crewed spaceflights that reached an altitude of at least 100 km (the FAI definition of spaceflight, see Kármán line), or were launched with that intention but failed. The USA has adopted a slightly different definition of spaceflight, requiring an altitude of only 50 miles (80 km). During the 1960s, 13 flights of the US X-15 rocket plane met the US criteria, but only two met the FAI's. These lists include only the latter two flights; see the list of highest X-15 flights for all 13. As of 6 May 2014, there have been 301 manned spaceflights that reached 100 km...
it's got a huge list
 
@Pimgd And who checked whether that list is correct?
 
I did
it looks about right
It doesn't seem to be missing 90% of the data
I don't need it to be correct
I need it to be close enough
wikipedia says 312
maybe it's 350, maybe it's 250
but it's not gonna be 5000
 
Holy **** it is like seriously close
I did the maths
 
now I wanna see the calculation and results
... ?
 
Formula one has gone on since 1946, so 70 years. One race per year, 22 drives. So 22* 70 = 1540 launches. The death by launch ratio is therefore 51*1540 approx 0.03311688312 .
There have been 312 manned launches. en.wikipedia.org/wiki/List_of_human_spaceflights.
18*/312 approx 0.05769230769.
 
3:27 PM
One race per year?
 
But I used to watch formula 1 live
it was on every week
 
Oh I forgot to factor in the different laps
 
google "formula 1 2016"
 
Open-ended code review questions aren't appropriate for Stack Overflow. I recommend migrating this to Code Review. — zzzzBov 34 secs ago
 
3:28 PM
Formula One Schedule
#	Date	Race	Winner/Time (*)
1
Mar 20
Australian Grand Prix
Nico Rosberg - Mercedes
2
Apr 3
Bahrain Grand Prix
Nico Rosberg - Mercedes
3
Apr 17
Chinese Grand Prix
Nico Rosberg - Mercedes
4
May 1
Russian Grand Prix
Nico Rosberg - Mercedes
5
May 15
Spanish Grand Prix
Max Verstappen - Red Bull
6
May 29
Monaco Grand Prix
Lewis Hamilton - Mercedes
7
Jun 12
Canadian Grand Prix
Lewis Hamilton - Mercedes
8
Jun 19
European Grand Prix
Nico Rosberg - Mercedes
9
Jul 3
Austrian Grand Prix
21 races
aka take that 1540 and multiply by about 10 or 20, depending on how many races they had for each year
 
also, my guesstimation of 14400 seems pretty close-ish
 
@Pimgd Yeah
 
> As of the 2016 European Grand Prix, 943 World Championship Grands Prix have been held,
 
Why does formula one has more than 1 race a year. Stupid irresponsible drives.
 
3:30 PM
The following is a complete list of Grands Prix which have been a part of the FIA World Championship since its inception in 1950. As of the 2016 European Grand Prix, 943 World Championship Grands Prix have been held, including the Indianapolis 500 races which were a part of the World Championships from 1950 until 1960. Major auto racing events are often named Grands Prix (plural form of Grand Prix), a tradition dating back to the first decade of the 20th Century and the Grand Prix motor racing of the 1920s and 1930s. Formally, for a race to be called a Grand Prix, it should have a race distance...
943 * 22 = estimated 20746 car launches
and then it's... not even close anymore
 
You're excluding some data as well, such as test drives
 
@syb0rg Then you have to include test drives for the launches as well
And or training accidents (there are 14 of them :p)
 
@N3buchadnezzar Those I doubt would be manned
 
@syb0rg adjust upwards by a bit?
like, I dunno, 21500
 
@Pimgd Probably, I doubt you would find concrete data on the number of test drives
 
3:40 PM
0
Q: Why there is no asp.net-core-mvc tag?

vsarunovAs I have noticed there are only tags such as: asp.net,asp.net-mvc-3 and asp.net-mvc-4. However there is no tag for asp.net-core-mvc, why so? I believed it is a must have to separate the question into a new category with different issues. I cannot create a new tag due to my reputation. Am I wrong...

 
The amount of puns in titles have been lacking lately.
 
I need to Git someone to help me.
7
Seriously, though, I found a problem bug.
In fact, it is so problematic I don't know where the origin is, so I figure I'll do a sort of binary-search through the commits to find the source.
Turns out someone wasn't keeping up-to-date, so all of a sudden, they pull and the bug is there.
It wasn't there on the first commit before that that had the new feature.
Ah, I solved my problem.
I need to checkout A, then cherry-pick B, C, and D.
 
duck strikes again
 
Bah, doesn't work.
> fatal: bad revision '959cecb'
Oh, wrong hash.
 
So I ask on SO about displaying objects in a DataGrid, which is supposed to be a table/spreadsheet. This guy comes along and says "just use ToString() for your object with all the properties you want." -.-
 
3:56 PM
I'm thinking I'm going to have to work with LibSndFile's creator to get proper Windows support for Khronos
 
 
I wonder how long it will take him to respond: github.com/erikd/libsndfile/issues/136
 
If someone knows WPF, would they mind taking a peek at this: stackoverflow.com/questions/38149336/…
I have had two doofus answers so far (been deleted).
 
@MichaelBrandonMorris SOHVA
 
4:07 PM
Stack Overflow Help Vote Applied
2
 
@syb0rg Ah, thanks.
 
Maybe I should create a better acronym
 
@syb0rg I just don't recall seeing it before.
 
@syb0rg Nah, it's good.
 
@Mast So you know the issue you encountered on Linux with LibSndFile?
I've replicated it on Windows and my Mac
So I went to his Github to see if we can find a solution together
(dunno if you saw the link I posted above or not)
 
4:16 PM
@syb0rg Good idea. I'm about to leave though, so I'll check it out later. Feel free to remind me tomorrow though ^^
 
@syb0rg SOA given - Stack Overflow Assist given
 
@skiwi No, that's SOAP.
SO Assist Provided.
 
I like that
SOHVA is finnish for sofa apparently
 
@Hosch250 SOAP web services? :D
 
Ja.
 
4:22 PM
Ah, that's why you don't understand the joke, I forgot it was Dutch, SOA = STD translated as acronym
3
 
@skiwi Assists in cleaning up SO.
 
Standard?
 
-1
Q: Simplify IF statement

SudhakarAny suggestions on simplifying the following If check Approach1 if( response != null && null != response.firstLevel() && null != response.firstLevel().getSecondLevel() && null != response.firstLevel().getSecondLevel() && null != response.firstLevel().getSecondLevel().getThirdLevel() && nul...

 
@Hosch250 STD = sexually transmitted disease
 
@CaptainObvious Use C# 6.
Oh.
I only knew it from using namespace std; in C++.
 
4:25 PM
@MichaelBrandonMorris No, standard deviation.
Where is everybody? It is friday
 
if (response?.firstLevel()?.getSecondLevel()?.getThirdLevel()?.getFouthLevel()?.getVerifiedInput() != null)
2
 
@N3buchadnezzar Lots of meanings...
using std::herpes
 
@Hosch250 That's possible?
 
@syb0rg C# 6, yes.
Isn't it totally awesome?
 
@syb0rg If all you are doing is checking for nulls, then yeah.
 
4:26 PM
@Hosch250 Burn it with fire
 
@Hosch250 Vewy
 
Well, you can also do this:
if (response?.GetString() == "test")
 
"How would I test them" is too broad. What precisely are you having an issue with? If you want a code review, SO is not the place for this. You should take a look at this site and check whether your question is a fit there. — Louis 18 secs ago
 
If response == null, then it will evaluate the entire thing as null, but it isn't an explicit null check, really.
It is, but it isn't, if you get what I mean.
 
0
Q: Making template meta-programming a little easier with integer packs

user2296177In template meta-programming, integer sequences and ranges are very useful. I've made a couple of utility classes that do various operations on compile-time integer packs. The implementation is non-recursive, allowing faster compilation and a greater number of template arguments. Major function...

 
4:53 PM
0
Q: base string to decimal convertor in JavaScript

lookidHow can i get max speed up for this code? For example, this code will be called 1000 times in sec. For different digits. Caching doesn't work. Thanx function hex2dec(ch) { if(ch.charCodeAt(0) >= '0'.charCodeAt(0) && ch.charCodeAt(0) <= '9'.charCodeAt(0)) return ch.charCodeAt(0) - '0...

 
@CaptainObvious Well now it's gone... I'm guessing he didn't know about the built in function
Off to lunch
 
Woo popular question get.
 
0
Q: functional javascript of a validation process

BenjI recently converted a code to what I think is partly at least, functional javascript. It's a form validation process. At each step of the process, the functions perform their own layer of validation and modify the data before passing it to the next function. You will notice that in requiredFie...

0
Q: Snakes on a prime

LegatoThe challenge is to find and print the largest palindrome prime under 1000. def reverse(integer): result = 0 while (integer != 0): result *= 10 result += (integer % 10) integer //= 10 return result def is_palindromic(integer): return integer == reverse(i...

 
5:15 PM
possible answer invalidation by sparkr on question by sparkr: codereview.stackexchange.com/posts/133606/revisions
 
0
Q: Encoding to wave a list of frequencies. Python

Solid CoderThis code gets a list of signals with predefined frequency from struc.num I need to encode it to wave format, so i use this code. This works, but i dont sure it is a correct decision to encode like this in python. Is there any ways to do it better? def compiler(): import out print("Loa...

 
@Legato, you here?
 
@MichaelBrandonMorris question: Shouldn't you be setting Data in your GetUsersCommandExecute?
because just setting the backing field will not result in NotifyPropertyChanged()
 
@Vogel612 I'm a f*****g idiot...
 
either you fire NotifyPropertyChanged("Data") in that method or you set the prop
did I mention I just started WPF like... a week ago?
@MichaelBrandonMorris I think you should tell them what the problem was. Consider self-answering
 
5:21 PM
@Vogel612 It rendered the question off-topic.
 
I personally really want to find out wtf I missed when I work on an SO question
@MichaelBrandonMorris not really, no
 
@Vogel612 :o Interesting, I started a couple of days ago
 
and even if it did, just hearing "I found the problem" sucks
 
My WPF learning experience consists out WTF moments though
 
because then I still don't know wtf the problem was that I missed
 
5:22 PM
It would have been different had I included the faulty method in the first place, but I was telling everyone that the method wasn't faulty.
 
8
Q: WPF TextBox to enter decimal values

SamIs there any decent way to get a WPF control which is bound to a decimal value? When I just bind the TextBox or DataGridTextColumn to a decimal, data entry sucks big time. <TextBox Text="{Binding MyDecimal, UpdateSourceTrigger=PropertyChanged, ValidatesOnDataErrors=True}"/> When I try to ente...

=_=
I'm trying to have a currency field, and I want bindings to immediately update, but if I do that then validation and correction also immediately applies making it almost impossible to enter something
 
@skiwi there will be no shortage of those
 
From time to time I begin to have the feeling that WPF is really easy and makes lots of sense, until I hit the next issue
 
there are a lot of things which are really simple and awesome to use
and other things that make me wonder if an intern wrote it
I'm looking at you, XamlParseException
 
@DanLyons Shhhh
 
5:26 PM
0
Q: Wrap glium_text so that parameters aren't passed redundantly

JoonazanI was annoyed by the API of glium_text, so I decided to make a wrapper that cleans up the API instead of coding my own text rendering. (I might do that later.) The wrapping turned out to be rather nontrivial. I was mystified by the amount of generics that were involved in glium_text. Surely ther...

 
0
Q: Snakes on a prime

LegatoThe challenge is to find and print the largest palindrome prime under 1000. def reverse(integer): result = 0 while (integer != 0): result *= 10 result += (integer % 10) integer //= 10 return result def is_palindromic(integer): return integer == reverse(i...

The memeing is strong in this one
 
Are event listeners strictly off-limits in MVVM, or can they be used if they are isolated to the view, like a DataGrid AutoGeneratingColumn event?
 
You can use them all you want.
Just try to delegate any non-directly-UI work to the VM.
 
lol, best title
39
Q: How can I format a decimal bound to TextBox without angering my users?

epalmI'm trying to display a formatted decimal in a TextBox using data binding in WPF. Goals Goal 1: When setting a decimal property in code, display 2 decimal places in the TextBox. Goal 2: When a user interacts with (types in) the TextBox, don't piss him/her off. Goal 3: Bindings must update sou...

 
"Perfectly normal"? I would firmly reject this at code review, as currently written. — Lightness Races in Orbit 24 secs ago
 
5:35 PM
@Duga For a moment I thought this was unrelated, but got it related a few seconds later.
 
This looks like a question for codereview.stackexchange.comelclanrs 41 secs ago
 
Who you gonna call? Code reviewers!
 
http://www.commitstrip.com/en/2016/07/01/nostalgia/
CommitStrip
Nostalgia
CommitStrip
1467394670
 
@N3buchadnezzar CodeReview man CodeReview man...
 
code reviewers are the voluntary people working at CodeReview...
 
5:49 PM
Really, the question has 42 upvotes and the best answer has 3 upvotes
Thanks Rachel, your second solution did the trick for me. @epalm & @BillTarbell I had the same issue. This can be fixed by adding a Delay=350 to the UpdateSourceTrigger=PropertyChanged Binding. (350 can be replaced with any time in ms). — Kevin Cruijssen Sep 16 '15 at 9:58
Really...
 
Lol
I got an answer saying you should do X to speedup. But I already use X and clearly say I use X in my question. Lol :p
 
@N3buchadnezzar Do it more
MOAR
 
why is 4chan here?
 
6:04 PM
/b/ecause
 
neat - F# might be getting a Result type
 
@DanLyons That's like Rust, pretty cool
 
@N3buchadnezzar What's up?
 
^
 
6:29 PM
GitHub graphs are actually quite interesting: github.com/syb0rg/Khronos/graphs/traffic
I can see people that cloned Khronos
Views... referring sites as well
 
@Legato You asked the snake question right?
 
Yes.
 
slow code is slow
 
Ok?
 
6:32 PM
@N3buchadnezzar I mean, you aren't wrong
 
It's on here because I wouldn't know if you didn't tell me, so if you would point out, explicitly, the reason why and maybe what could be done to improve it, if possible, it would be appreciated.
 
@Legato Working on it
I have like 4 different solutions :p
 
That's somewhere between my 3rd-5th python program. I just think about logic that works.
 
As a short tip it is faster to start at the limit and work backwards.
 
You know what.
I'm not sure about that.
It depends on how high the limit is, imo.
 
6:35 PM
1000 - 999 - 998. Then instead of generating the primes, you could simply check if the number is prime
 
possible answer invalidation by Redu on question by Redu: codereview.stackexchange.com/posts/133586/revisions
 
Also you would obviously not count every number, just the numbers likely to be prime
 
I was thinking of making the methods work well on average.
 
@Duga Handled
 
I don't think that would work so well if you did something like 10 million.
I look forward to reading and testing your suggestion!
 
6:41 PM
@Legato Try 10**7
It will break hard
or even 10***9
 
Didn't break, took about 2 seconds though, for the former.
 
0
Q: How to execute a method within only if multiple are set properly?

STORMLets assume that we have a simple class with multiple properties using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; namespace classtest2 { class ClassA { private AnotherClassB anotherClassb; public Another...

 
@Legato Ops try10**6 :p
 
 
10 ** 7 works, 10 ** 9 slowed my comp, lol.
I do notice an optimization I could make though.
 
6:47 PM
0.34629451445 ms
0.000696416948697 ms
My times for 10**7
 
Hm, @SimonForsberg you wanna take this one? codereview.stackexchange.com/questions/133586/…
Hello btw ;)
 
@syb0rg I converted the "answer" to a comment and re-applied his edit.
 
@SimonForsberg Perfect, thanks
 
As the answer you got was more a comment "It's not working as nicely as it should", I converted the answer to a comment and re-applied your edits. I hope you get some nice real reviews. — Simon Forsberg ♦ 10 secs ago
 
That's the java 8 way, I think
 
6:59 PM
@Pimgd you're utterly ignoring that each of the steps might have a null value in there
 
optional =)
 
hmm.. eurgh. it's still kinda ugly
 
possible answer invalidation by Goozo on question by Goozo: codereview.stackexchange.com/posts/133570/revisions
 
> If a value is present, apply the provided mapping function to it, and if the result is non-null, return an Optional describing the result. Otherwise return an empty Optional.
 
@Duga seems okay
@Pimgd yup. still fugly
 
7:01 PM
@Pimgd Oh wow, that's even worse than the original, I'd say.
 
it's way shorter
and makes the best of the crap that is that situation
 
meh.. the best would be to find out why the LoD is violated and fix the root cause of that
 
Is there a way to round a number down to the nearest odd?
 
nearest odd?
 
odd number
 
7:02 PM
yes
floor
 
round down to the nearest odd is easy
 
num - 1 - num % 2 works
 
and then if even, -1
 
round to the nearest odd is a tad harder
 
always down
@Pimgd But it is ugly
num - (1 - num%2)
 
7:06 PM
@N3buchadnezzar bug
try again
 
@Pimgd I did check above
 
it overflows
I don't think it should do that
hmhm well I dunno if it is a bug
it's just... dunno
what should it do with Long.MIN_VALUE
 
its python, it does not care ,o
 
@FirstStep This is an inappropriate topic to be sent to CodeReview. CodeReview expects code that is A) Fully Functional, and B): significantly more complete than what has been provided. — Xirema 13 secs ago
@Xirema I am not sure about CodeReview but I am sure that this is off topic here — FirstStep 34 secs ago
 
7:17 PM
I cannot post the actual code. I provided a gist of the code that i am trying to rewrite and sincerely hope is enough to suggest solutions. Let me know specific questions if something is not clear. Downvoting without feedback doesnt help anyone. — Sudhakar 3 mins ago
Legal issues,
please close question immediately
 
@FirstStep CodeReview needs Code to Review, obviously. As for SO, why do you think this is off-topic here? — underscore_d 54 secs ago
@underscore_d because OP is asking for "other efficient way to do something (fill in the map with word as a key)". I got downvoted for that and sent to Code Review — FirstStep 50 secs ago
@FirstStep Code Review needs to provide working code, as well as it's needed to provide a Minimal, Complete, and Verifiable example here. — πάντα ῥεῖ 15 secs ago
 
Is it normal that you can type both a '.' and a ',' as a decimal separator in your language?
 
nope
German exclusively uses ',' and English exclusively uses '.'
 
and dutchies use ...
I think it's a .
 
I mean for typing though, for example in Excel
Whether I type '5.25' or '5,25' they both end up as '5,25'
 
7:21 PM
@skiwi that's because normal people are stupid and will enter whatever
 
I still have to replicate that behavior :/
 
lastIndexOf
 
'Ugh I hate normal people, they are so normal.
 
I should probably just create my own converter... I don't care about thousand separators at the moment so all I want to deal with is the comma in this case
And it has to accept both comma and dot and convert it to the decimal separator of choice
 
if it's about money,
 
7:26 PM
Or I could fix it later and get on with my life
 
7:47 PM
Wut
I got a message on Careers on SO.
 
@EBrown I didn't know you lived in Toledo... I knew a few friends that lived there back in the day
 
@skiwi Sounds like a pretty bad idea IMHO, perhaps consider instead just displaying the commas as thousand separators when rendering the numbers to the end-user
(monking!)
I think if commas are allowed to take the place of periods to indicate decimals, it will get really confusing
Consider if a user types 100,000,00 vs. 100,000,000
 

« first day (1154 days earlier)      last day (2865 days later) »