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

7:01 PM
No one noticed this question had major bugs in it:
8
Q: CultureInfo with fallback routing to another language

KelonOur company needs a localization/translation behavior which allows incomplete (ResX) resources. If a String isn't available in italian fall back to the next roman language, like french fall back to our invariant (in this case: german) The easiest approach was a custom CultureInfo. /// <summary>

 
0
Q: Comments on a 'PullableView'

IHaveAQuestionI created a view called PullView which adds a level of interactivity to UI components. PullViews can be pulled sort of like a rubber-band and bounce a little when released. The code for it is fairly simple. I would like comments on how to improve code structure, performance, etc. if possible. ...

 
@EBrown I haven't seen that one
 
cultureInfo = FallbackCultureInfo.Build("it-CH", "fr-CH", "de-CH");
cultureInfo = FallbackCultureInfo.Build("fr-CH", "it-CH", "de-CH");
fr-CH
fr
de-CH
de
Wut
Where did it-CH go?
It got eaten, apparently.
cultureInfo = FallbackCultureInfo.Build("it-CH", "fr-CH", "de-CH");
cultureInfo = FallbackCultureInfo.Build("fr-CH");
fr-CH
fr
de-CH
de
Ah good, glad they gave me the de-CH, didn't figure I should need that but apparently I do.
 
0
Q: Declarative DependencyProperety registration

t3chb0tMost properties have simple requirements so it should be possible to register their Dependency Property fields declaratively. I made a small experiment and it seems to work just fine. The first attempt supports DefaultValue and Validation attributes. It looks a little bit like JavaScript ;-) ...

0
Q: Detect the missing number in a randomly-sorted array

EJoshuaSI was reviewing for an interview and encountered the following question (and I'm paraphrasing): Suppose you're given a shuffled array of numbers containing all of the numbers between a min and a max, inclusive, with one number missing. For example, for an array of size 5, you could have somet...

 
7:18 PM
@CaptainObvious FGITW
 
remonking
 
7:32 PM
Anyone want to jump on the VS hate train?
 
@skiwi public class
 
@EBrown Oh...
VS defaults to internal I suppose then
 
Yep.
C# in general does for interface, class, struct and enum.
Types are default internal, members are default private.
 
Except it still complains the same thing
 
Really?
Try a build first.
 
7:35 PM
Did that a lot of times by now :P
 
Huh.
Well I have nothing, I have to go to work unfortunately.
Maybe @JeroenVannevel or @Hosch250 can help you.
 
@skiwi the biggest problem I see is that it's not dark theme :x
 
@DanLyons Hush :P
Hmm the example doesn't have the namespace ... { } around all of the code, but it shouldn't matter I suppose?
It even shows up in the autocomplete of the XAML file lol
Looks like I'm stuck here because of VS then yay
 
0
Q: Hackerrank Designer PDF Viewer

Gabrieli was trying to solve a hackerrank problem, it looked simple but i'm having problem with one of the test cases, i'm afraid i don't truly understand what to do, though my code worked for all others test cases. The problem is this: https://www.hackerrank.com/challenges/designer-pdf-viewer?h_r=next...

 
Have you tried rebuilding and restarting VS ?
 
7:48 PM
@skiwi Bindings are beautiful.
@skiwi Show me your XAML.
 
@denis Yep
 
You've got something messed up there.
 
Look at your last error
That'll be the only real one, is my guess
 
Oh, I see.
 
7:51 PM
You are creating a custom control, but you are referencing it wrong.
 
lol, screw this, I renamed a file somewhere but it didn't update the reference in my custom control
 
Found the problem?
 
Yeah, it's that VS is broken and cannot properly rename a class
 
Well, you can submit a PR for that to the Roslyn repo if you can do it better.
 
Looks to be in the VS implementation though
 
7:57 PM
Most of VS is in the Roslyn repo.
 
My code doesn't quite work though, I followed stackoverflow.com/a/15960843/2057294
Probably forgot something important
 
8:19 PM
Hmm okay
public partial class MainWindow : Window
{
    public MainWindow()
    {
        InitializeComponent();
    }
If you remove InitializeCompontent() then things stop working, whoops
 
Yeah that loads your xaml
 
@EBrown For reference, that was was not a bug
 
Kaz
8:46 PM
Monking
How is everyone?
 
Monking @Kaz
 
Monking @Kaz
 
I felt pretty bored last days, now most of it has moved to feel frustration at Visual Studio
 
lol
VS does that, yea.
 
Also the frustrations of learning a "new" language :P
 
8:49 PM
@skiwi Duh.
 
I've played around with C# earlier, so this is kind of like a second try
 
You won't regret it.
Just be glad it is still OOP.
 
I could kind of survive FP by now too
 
Well, I can't exactly recommend it as good code at this point, but you can check my Checkers app out for a working example.
 
"standard" Java does have better documentation imo compared to any "standard" C# stuff
 
8:53 PM
You'll need to clone my Checkers and CheckersAI repos.
@skiwi Meh. You get used to it.
Once you know the language better, MSDN has everything you need, and SO supplements that for specific problems.
Someone found an F# compiler bug:
 
lol
 
Mission impossible
 
Compiler impossible.
 
lol
 
9:09 PM
I think I'll do the Field can be readonly analyzer for VSD soon.
That is one of the main tools from R# I use that VSD doesn't offer.
 
0
Q: Declarative method to return a stack of paths

mbigrasI'm building a stack of paths that each lead to a template directory. The idea is to crawl up the tree pushing paths onto the stack as long as there are contents in the template directory. This is an example file tree: $ tree . . ├── stack.rb ├── templates │   ├── gem │   │   ├── optionparser │ ...

0
Q: Binary Search Algorithm in JavaScript

TobiI've written this implementation of a binary search algorithm, and wanted to know if it was efficient and where I can improve. function search(el, olist) { // list = olist || LIST; var LIM = ~~Math.log(list.length) + 1, lb = 0, ub = list.length - 1, i; while (...

0
Q: Getting weather data from Open Weather Map API

Dominik RI'm trying to make a simple app in C# that gets the weather data from http://openweathermap.org/api (OWM). Here attached are two classes that I use to initialize WeatherData for selected City and to download and parse XML data from OWM API. I would like to know your opinion on the structure of t...

 
:) I've got a working application
And it's using the MVVM model
 
9:25 PM
Happy?
 
2
Q: Wrapping Checkers

Hosch250The next post in my Checker series: The C# wrapper for my F# library to make it cleaner for these methods to be called from C# code. GeneralTypes.cs public enum Player { White, Black } public enum PieceType { Checker, King } public static class Extensions { public static Playe...

-1
Q: Can't Get Python Code to Run, Errors with Print and Variable

Dizzy49I've never even looked at Python code until a few hours ago, but I am familiar with enough other languages that I thought I could figure this out... I was wrong. This is some old code that I downloaded. I installed Python 3.6, so I think it may be an issue with old code vs new compiler. I'm us...

 
@Mast Yeah
Though I feel like in HTML5/Javascript I could've done it in 5 minutes
 
9:54 PM
0
Q: Spreadsheet Generated through File Iteration

STowsleeI put together script which goes through all of the files in google drive, and writes a spreadsheet with all of the files with their name, containing folder, url, and date last updated. function Start_Up() { var spreadsheet = SpreadsheetApp.getActiveSpreadsheet(); var sheet = spreadsheet.ge...

 
10:05 PM
0
Q: How can I make my own oauth client testable?

user3777390For my side project, I am integrating github authentication and I wrote my own mini client for that using Silex. One of the many things I want to learn is writing testable code. Here's the main part of the code: interface Authentication { public function getState(); public function get...

0
Q: Return the indices of the two numbers such that they add up to a specific target

ɐuıɥɔɐɯ(...as I learn Kotlin) I want to get the indices of the two numbers such that they add up to a specific target from a given array of integers. Solution: fun sum(values: Array<Int>, result: Int): Array<Int> { for ((i, e1) in values.withIndex()) { for ((j, e2) in values.drop(i + 1).withInde...

 
@Phrancis hit me up
select count(*), p.SomeKey
from SomeTable p
group by p.SomeKey
Results in Arithmetic overflow error converting expression to data type int.
 
congrats ... wtf?
you got more records than 2^31-1
 
Changing the count(*) to count(cast (p.ID as bigint)) causes the same issue
Bah that sucks
Let's see if it works if I restrict data to this year
 
0
Q: rewrite for loop as filter() javascript

cssGEEKI have the following javascript code: var selectEnabledGenerators = function(generators) { //List of generator indexes to show var list = generators; var allGenerators = $(".generatorContainer"); //Hide all generators allGenerators.hide(); //maybe use filter here? for...

 
ugh
it ran for 6 minutes only to end up with that same error
 
10:31 PM
ah that explains
316 million entries in the last 2 months
3
no wait
1.2 billion
That's an extra digit there
user image
2
 
Entries? Transactions? LoC?
Extra rows inserted?
 
entries
no wonder analysis of this dataset takes some time
 
On something that big? Nah.
I was parsing PDFs the other day. Couple hundred books, couple hundred pages per book. The sample set of 30 books took 50 minutes for the easy stuff.
Not good.
 
10:59 PM
@JeroenVannevel found your issue?
 
Not sure what the issue was
I just restricted the query until it worked
2 months of data returns 1.2 billion rows so I assume >1 year of data returned too much for it to work
 
You could make a cursor to count a reasonable number of rows at a time and put then in a BIGINT field
 
0
Q: Patching ActiveRecord to make find_by convert strings to numbers more carefully

maxpleThere's some behavior with Active Record's find_by that can be unexpected: Say a table "Posts" has a numeric column "score". One could then say Post.find_by(score: 0) which is a typical use-case and works fine. If there are many records, only the first matching the condition is returned. The so...

 
Like a month at a time
 
mm I'll keep that in mind for future purposes
 
11:02 PM
Or preferably perhaps a number of rows at a time to avkid datetime bugs
 
Right now I just wanted to know the distribution of 0 vs 1 so considering the numbers, I think these 2 months are representative
 
@JeroenVannevel Have you tried a SUM instead of count? May of may not do what you want.
Or, not of.
 
it wouldn't
I need to know how many records have 0 or 1 for a certain column
 
Right, SUM(CASE Column = 0 THEN 1 ELSE 0 END)
I don't know if it will overflow though.
Then you can do the same for 1.
If you get my drift.
Or SUM(Column) for 1, and SUM(1 - Column) for 0.
Either technique should work.
I just don't know whether SUM will overflow or can be casted.
 
11:21 PM
How does that differ from a count()? Isn't that the same issue?
 
Well COUNT obviously overflows and isn't a BIGINT, I don't have a large enough data set at my disposal right now to test this theory.
If SUM can support a BIGINT though, then that could be your solution.
Or use COUNT_BIG. That is a thing apparently.
2
 
0
Q: Find all needles in the haystack and return their sum

MastThis is based on a programming challenge I recently solved. However, since the writer of the challenge asked me not to disclose the question and/or it's answer, I modified it a little. If it doesn't make sense: my mistake. The target is to find all numbers in a file and sum those. So if the foll...

 
Just googled 'sql server count bigint' and found that. Lol
 
11:48 PM
@CaptainObvious That looks like neural network output to me
 
@CaptainObvious Looking for a new job?
 
00:00 - 19:0019:00 - 00:00

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