« first day (622 days earlier)      last day (3389 days later) » 

7:00 PM
There is no possible subclass of yours which will work with that check in place.
 
hello
 
unless it returns a hard-coded iterator from somewhere that is not part of the constructor for the instance.
Something like:
 
@Gemtastic Greetings,
 
public Iterator<...> readIterator() {
    return Collections.emptyList().iterator();
}
 
Are you talking Java?
 
7:02 PM
apparently
 
@Gemtastic Yes. It's horrible, isn't it?
 
I'm confused yes, how will I even get this to work?
I don't want to pass the iterator from the top level (the non-library code)
 
@JeroenVannevel It's not that bad. I don't really know any better though... Java is my first :P
 
Done. 96%
 
@skiwi Oh, that's easy.....
 
7:03 PM
@Gemtastic I, too, was like you once. Do you have a moment spare to talk about our lord and savior, Microsoft?
 
24 mins ago, by skiwi
public ListLogReader(final List<String> inputList, final EntryParsers entryParsers) {
    super(entryParsers);
    Objects.requireNonNull(inputList, "inputList");
    this.iterator = new ArrayList<>(inputList).iterator();
}
change it to:
 
@JeroenVannevel How would I create a singleton or whatever you called it to pass my values between my SettingsPane and my VM?
 
super(entryParsers, new ArrayList<>(inputList).iterator());
 
I can do that easy enough, but how could I get the VM to update immediately?
 
@rolfl It gets a bit ugly if the iterator definition is a few lines long though
 
7:04 PM
then create a static helper method....
super(entryParsers, buildIterator(inputList));
 
@JeroenVannevel I don't invite satan into my home XD
Just kidding
 
Good point there @rolfl, thanks a lot, I believe this should work then
 
np
 
@Hosch250 I don't know what you mean by that. The VM backs the settingspane, no?
 
Yes.
You see, I have my VM instance declared public in my MainPage.xaml.cs.
 
7:06 PM
ew
Didn't I complain about that already?
 
Yes, that is why I brought it up.
You said it should be private and the settings should be passed between them with a singleton.
 
You really only need one viewmodel per page
 
The SettingsPane isn't really its own page - it updates the user settings.
So how would the VM know to update instantly if it isn't bound to the SettingsPane settings?
 
0
Q: Managing initialization for a vector abstract data type in C

amonAs an assignment, I was to create an \$n\$-dimensional vector type for \$n \le 20\$. This vector only has to support addition and scalar multiplication. I tried to write good code, with proper memory management, error reporting, and a nice API. However, I have little experience with C so I would...

 
Alright, couple o' questions first
 
7:08 PM
But now the AbstractLogReader no longer needs to be abstract... interesting
 
1. How many viewmodel *types* do you have?
2. What model is bound to the `SettingsPane`?
3. Do you have a session object already?
1. longer test test with types
 
Not sure what you mean by "types"
 
I don't know why it isn't putting types in italics
well, take this for example:
That is my masterfully beautiful and elegant project
 
I have one VM class.
 
Each page is backed by a viewmodel
no, ew
 
7:11 PM
I only have MainPage.xaml and SettingsPane.xaml
So really, I only need the one VM, and something to handle the settings.
 
Then you need at least two: one for whatever MainPage is about and one for settings
You store it globally in a session object, which uses the singleton pattern
like this
Relevant code:
private static Session _instance;

private Session()
{

}

public static Session Instance
{
	get { return _instance ?? (_instance = new Session()); }
}
 
So, if I make it static, then there is only ever one instance, which is basically what I want?
What if I made a public static struct with the settings.
 
No. Step away from the public static stuff.
 
OK.
 
It will do sort of the same, but you will back yourself into unnecessary corners
 
7:13 PM
> ##Update

After some experimentation, it appears the line numbers do carry over using IE 11, but not on other browsers tested. This may be pretty minor, as an IE 11 user could always just click Edit on the question and get the raw code from there.
 
OK.
 
Structs have several restrictions accompanied with them
And a singleton is a well-understood pattern (and actually applicable here!)
 
So, where are my settings stored? Does my MainPage.xaml bind directly into the other class for the settings?
 
But yes, in the end the idea is to have a globally available static object
No, your MainPage's codebehind can use the settings which you store in the session object
 
24 of 31 now succeeded as opposing to 8 of 31, improvement, I call it
 
7:15 PM
doesn't have to be anything fancy, might just be a public Dictionary<string, string>() Settings property
or you create a custom type for properties for each setting, as you wish
 
So basically, MainPageVM has a SetFontSize int value which is bound to the FontSize in MainPage.xaml.
And SetFontSize needs to be updated when the setting is updated.
 
0
Q: Brute force algorithm C# - need optimization

Nejc LovrencicI'm trying to create a C# brute force MD5 password checker. If I run it with "test1" without MD5, it completes in 15 seconds. This is the code: private string bruteForce(int lenght) { MD5 md55 = System.Security.Cryptography.MD5.Create(); char[] words = { ...

 
now you can just go into your code and do if((bool) Session.Instance.Settings["mykey"]) { /* bla */ }
 
So my MainPageVM is somehow bound to the session instance?
 
Nothing is bound, everything just uses it
You probably have an explicit get; set; implementation, right?
I'd just add it there
 
7:17 PM
Yes.
Oh, so Get - return value.
Set - (??)
 
public int FontSize {get; set { NotifyPropertyChanged(); Session.Instance.Settings["fontSize"] = value; }
Brb, food.
 
SettingsPaneVM calls Set, but SettingsPaneVM can't access my instance of MainPageVM because the instance is private?
 
@Malachi Does your lang-vb.js.patch work ok or are you working on it?
 
@Phrancis I didn't do much to it, I just added a key word to it. I am going to work on a VB6 version with the cool commenting thing though. but I don't have the time to do it at work right now...
 
That's cool I was just asking, do let me know whenever you have an update so I can update on my project :)
I just submitted a bug issue there about the IE 11 thing. Last update was almost 2 years ago so I'm not sure it will ever get done, but at least it's on the record.
Anyone care to chime in or change their vote:
The IE 11 is a pretty big deal breaker IMHO , since SE support that browser. I don't think using the edit option would be view as a valid alternative. — Marc-Andre 16 mins ago
@Marc-Andre I agree and feel disappointed
 
7:34 PM
Yeah, but is there a work-around available?
 
No idea. I think SE have made modifications to Prettify (for example, the scrollbar on long code blocks) and not sure how their system would treat line numbers. It's not open source so I don't have a way to fork it to test
<pre><code>id_user           dtl_master              date
  1         {"el1":"2","el2":"3"}       2015/01/01
  2         {"el1":"2","el2":"3"}       2015/01/01
  3         {"el1":"5","el2":"6"}       2015/01/01
</code></pre>
This is how the code blocks are formatted on SE. The "normal" way of using prettify is like this:
<pre class="prettyprint linenums">
code here
</pre>
 
Thanks @Jamal - edit edited
 
0
Q: Basic duel fight with OOP

Juha UntinenHow would you improve on this? It's been fairly long since I last did a bit more extensive in C++ so I'm looking for ways to be more compatible with modern C++ ways, and this style of OOP. I think especially the user action part and new opponent generation might be what needs the most work? Thank...

 
@DJanssens: did you buy your ryanair ticket from bookryanair.com or cheaptickets.be?
 
7:49 PM
@JeroenVannevel ryanair.com
 
Shows a price of 13289 HUF
How much booking taxes got on top of that?
That's +- 40€
 
@Phrancis what is the issue with IE 11?
Damn it IE, catch up or get the hell out of the way!
2
 
1.// this is a comment
2./*
3.** Block quote
4.*/
5.public static class Evaluate
6.{
7.    public static string FizzBuzz(int start, int end)
8.    {
9.        return Enumerable.Range(start, (end - start) + 1)
10.            .Select(FizzOrBuzz)
11.            .Aggregate(String.Empty, (y, x) => String.Format("{0} {1}", y, x))
12.            .Trim();
13.    }
14.
15.    public static string FizzOrBuzz(int n)
16.    {
17.        if (n % 15 == 0) return "fizzbuzz";
18.        if (n % 3 == 0) return "fizz";
When you copy&paste a Prettified code block with line numbers enabled
 
do you have an example somewhere?
I found a link
even Copy Paste from GITHUB is clunky with IE 10 and grabs the line numbers....
 
@JeroenVannevel servr error from that link
but if I remember correctly we didnt had to pay booking taxes
or it was something minimal
 
7:56 PM
Yeah, it's clear IE is the issue
 
@JeroenVannevel SettingsPaneVM calls Set, but SettingsPaneVM can't access my instance of MainPageVM because the instance is private?
 
@DJanssens Yeah I'm noticing the same. Aside from the "big hand luggage" that's restricted to 10kg and 55x40x20cm. Guess I'll have to put it in the baggage room
@Hosch250 Your viewmodels shouldn't work together
Why does your MainPageVM has the fontsize in the first place?
It's set in the settings pane
 
So that setting should be bound to the SettingsPane?
 
I had luggage that fitted thse measurements
 
@Hosch250 Yes, because that's where it is being interacted with
 
8:03 PM
Even though it changes something in the MainPage (or more accurately for expansion, app wide)?
OK, I see.
 
wait
How does it change from your MainPage?
 
I thought you were telling me not to earlier.
It does not change from the mainpage, it changes the mainpage.
 
And you can access it through the Session object
so that's no problem
 
OK, now I get it.
Thanks.
 
8:06 PM
Now of course, everything will probably change with the release of 10, and I'll have to do it over again :(
 
@DJanssens I'm way past it with my hikers bag, sadly
 
How did you get so lucky to be able to take classes for studying this?
 
Ic
 
@Hosch250 Aren't you studying programming in school as well?
 
I'm stuck with philosophy and multimedia applications.
@JeroenVannevel No.
I'm online, they only offer three programming online.
 
8:08 PM
Are you from the US?
 
And, there are all JAVA (not Java).
Yes.
 
Anyway, I'm an IT Management major, not CS.
 
Yeah okay, one year of computer science in a US university costs more than 10 times my entire college education
You know the free online courses, right?
 
Yeah. State U, resident.
 
8:09 PM
Given by MIT and Stanford and all those fancy things
 
You mean Coursera?
Or through their page?
 
Yeah and a few others
 
I can't really do Coursera/
They all start when I'm in finals, or finish when I'm starting, or overlap completely.
The U did it on purpose, too.
(No evidence here)
 
Coursera is the entire year, really. And you can just do it on your own tempo
 
I should persuade my parents to let me come over there.
 
8:11 PM
There's a few others as well
 
I have all but one class a 4.0 not counting this semester.
And that was an A-.
Maybe I could get a scholarship too.
I don't know Dutch, though :(
 
Studying in Europe will cost you quite a bit as well, as a non-EU citizen
 
My parents would never consent, either.
I should go to AK, they have free college.
My parents won't let me do that either :(
 
You need to rent a place (in Belgium typically +- 300€ / month for a student apartment), pay around 1000€ for a semester and show that you have the financials to back you up too
 
They fund it with the oil money, because the state owns the oil industry in Alaska.
The residents get the surplus.
 
8:15 PM
Oh, Alaska. I thought Arkansas
 
@Hosch250 your posting of bing.com links always cracks me up
 
:)
 
Another article of anybody is interested: lokiastari.com/blog/2015/01/15/…
 
never mind me, I keep reading "SP" as "Stored Procedure" ;)
 
8:19 PM
Sptr better
or SPtr
 
"SP" is fine in the context of the blog, well written BTW!
 
Oh well, I think I'm better off here anyway - I good at math, but I'm no genius.
 
0
Q: Can I ask for feedback on an idea for a standard?

SupuhstarI'm looking to come up with a standard for how to implement a system that will automatically update software. As such, there is no actual programming per se, but I still want to make sure my standard is robust before moving on to the stage where I build a proof-of-concept prototype. I have a goo...

 
I'd need to take Calc III to do CS.
 
8:27 PM
First post on Webmasters, let's see how it goes... webmasters.stackexchange.com/questions/76169/…
 
Shall we invade WebMasters and upvote it?
 
Your call
 
JK, but it already has one.
I don't have an account there.
 
I don't know the culture there, I checked the chat room but nobody was there
 
I wonder why the wiki article on Plato mainly covers Socrates?
 
8:29 PM
@Phrancis huh? how is that possible!!
 
I thought the same thing!
 
2nd Monitor spoiled us all...
 
Yeah, some are deader than dead.
 
WPF is usually in the first page at SO, and it is dead from late Friday through Monday morning every week.
 
8:31 PM
> 4 days later...
 
What about the one at Academics?
That is terrible too.
 
0
Q: Simple DRY Rails - check if a model belongs to a user

JeffI can clearly see I'm repeating myself, but I don't know how to refractor this without making it really ugly. What I have: class ChildModelController < ApplicationController def new @model = ParentModel.find(params[:id]) # Does the current user have permissions on the parent...

 
@Phrancis wow
 
@JeroenVannevel Bit late, but Coursera isn't the entire year through, it also starts at specific moments, the 'homework' there also has deadlines, which if missed cost you points. To achieve a statement of completion or certified certificate you really need to be motivated :)
 
My sisters have done a couple courses there.
 
8:34 PM
That said, the courses given there are very interesting and some are even better than the courses given at my university
I did the Mobile development course of Adam Porter there, I even payed for a certificate, mainly because I found it such an awesome course
 
In Java?
 
Android, so yes
:)
 
@DJanssens Oh sure, if you want the certificate. But I don't think they're that important
 
I've never touched Android.
 
Nah they probably aren't, I just wanted to support the course
 
8:35 PM
You can just put "Followed Coursera's course on X" on your resume if you do it anyway
 
though it looks cool :D
 
I have a OneNote cert that I watched 2 hours of videos from MS.
I learned one thing.
 
Ended up with a 75.5€ cost from what started as a 40€ flight
could be worse, I suppose
 
from the extra luggage
 
Need to go now, see you.
 
8:37 PM
Still better than the cheapest alternative: 227€
yeah, 25€ was from the luggage alone
 
Those courses are pretty beefy at Coursera
I spend quite some hours on that Mobile development track.
 
I did the first 3 or 4 lessons on Algorithms once
with Robert Sedgewick
 
he was awesome
 
I ended up buying his book, not finishing the course and not finishing the book
 
the old guy, right?
 
8:38 PM
Yet another book that is now halfway and will be finished in a few years
 
I only checked his first 2 videos too iirc
I tried Cryptography a way back (offered from stanford), but my mathematical background was lacking :p
 
Almost 100 upvotes on my Programmers question.
Who knew I could ask smart things as well
 
8:54 PM
yeah, who knew!
 
SURPRISE BIEBER
 
D:
 
Cannot counterflag my own message?!
Don't hate on Biebs
 
9:11 PM
0
Q: Possible class redundancy and improper enum usage

steveI am looking for code correctness and design usage as I think I might be over doing it in the class department. There are two things I'm mostly concerned with. The possible redundancy of classes derived from IPerks. As CommonPerks, UncommonPerks, etc, all look identical except for the rows/col...

 
@JeroenVannevel dude, WTF!?
 
@Mat'sMug I have a biebs song on my spotify
sue me
 
Oh, Ms. Black, where are you?
 
@JeroenVannevel out of stars....
 
@JeroenVannevel I am one of the few people that like Rebecca Black's "Friday", I for one won't sue you.
@Mat'sMug he said sue me, not star me...
 
9:22 PM
where's the button?
 
@Mat'sMug RSA
 
danke
 
bitte schön
 
eh, I've got bieber, backstreet boys, britney and a few more on my spotify
I'm liberal in that kind of stuff
 
D;
 
9:31 PM
I walked to the station listening to Backstreet's Back
You can't not shake your booty
it's magical
 
You probably wouldn't like my Spotify. Full to the brim with punk rock, industrial, metal and techno...
 
I'm boring and just have the Top 100 on spotify
 
Eh, I've got metal, hardstyle, jazz, piano, dutch schlagers, german schlagers, 80s pop, soviet anthems, goldies like this, eminem, etc
I listen to a lot
 
@JeroenVannevel ok, ok, ok, ok, ok. soviet anthems, wtf?
 
you've never listened to them?
 
9:37 PM
actually, no
 
I tried to listen to Eminem one time on the highway, I got confused thinking cops were all around us
Though I really think Eminem ft. Rihanna - The Monster is really cool
 
I like Eminem, unlike most other rap. It's vulgar, but there are songs with very profound messages.
 
yeah, his texts have a lot more depth than the typical rap songs
 
true
 
9:41 PM
And of course there are the funny, self-deprecating songs too :D
 
I'm into Muse these days
 
For the rest, when I'm actually listening to music it's a lot of alternative rock - Linkin Park, Three Days Grace, Bullet for My Valentine, etc.
but I can honestly listen almost everything... I can even survive Hardcore/Hardstyle for like half an hour
 
Anything except Happy Hardcore - UGH.
 
Hardcore is awesome. Going back to Reverze at the end of February
 
I stay away from rock and rap.
I wonder if I should propose an SE site - Answer Review.
 
9:44 PM
Psst, that's essentially the tag
 
^^ that
 
That is Question review, though.
 
also works for answers, but they must be posted as separate questions of course then
 
I see.
It wouldn't work for all answers, though.
 
Talking about music... I should go play Tony Hawk Pro Skater 2 again
 
9:46 PM
I found a pretty epic song today, randomly, not sure if anyone of you knows it? youtube.com/watch?v=IU22lKGevhI
 
Nope.
Ever heard of the Corries?
 
or Need for Speed Underground 2
 
The Bricklayers Song or The Sunday Driver?
 
@Hosch250 What's wrong with voting and comments?
 
nope :$
 
9:47 PM
Nothing.
 
Ever heard of Shreveport Stomp by Jelly Roll Morton?
 
I've heard of Jelly Roll Morton.
He's in our encyclopedias.
 
10:03 PM
0
Q: Returns the year for each month by period - nested case statements

notaceodef return_year_by_month_and_period(month) pw = self.property_water.first().billing_increment case pw when "12" self.property_water.where(period: month).first().year when "6" case month when 1, 2 self.property_water.where(period: 1).first().year when 3, 4 s...

 
Well, I just had some fun organizing histograms....
 
That 4-word song gets Lee's nod of approval, @DJanssens ... thanks
And now it's time for burgers, and, if folk have not yet seen the palindrome q feel free.
 
Ummmm... I think this should be deleted?
Or at least downvoted to hell
 
@Phrancis it.. is a CR answer - one that says "looks good" ...and sticks a foot in the mouth
 
10:11 PM
Ducky's is far superior, for damn sure.
 
> You've got a pretty big bug here. You don't actually end up with unique items in your final list.
well...
the dictionary is a wise decision
 
> declined - flags should not be used to indicate technical inaccuracies, or an altogether wrong answer
Just FYI... all ;-)
Spend the 1-rep and down-vote.
 
@rolfl Bah :p
 
NO MERCY
 
> Also, starting a new thread incurs some overhead - if I'm not sticking a foot in my mouth here, using the TPL the framework determines if it's a good idea to start a new thread or to let code run sequentially... which may buy you some extra performance right here.
right?
 
10:19 PM
context?
 
3
Q: Brute force MD5 password checker

Nejc LovrencicI'm trying to create a C# brute force MD5 password checker. If I run it with "test1" without MD5, it completes in 15 seconds. I would like to make it faster, but I'm a c# beginner, and don't know how to optimize code anymore. Basically, instead of nested for loops, if using flags (of type boolea...

actually in my answer
 
I've never actually worked with parallelism in C#, only asynchronicity. Although they sort of overlap, the Parallel stuff is foreign to me
It could be, though
Oh, the TPL also includes that of course
 
@rolfl yw :)
 
I've never heard of that to be honest
 
it's not clear how many threads OP is starting (what's stevilo.Text anyway?), but he's starting threads in a loop, ...doesn't sound too ideal, but I'm not exactly a MT guru
 
10:25 PM
I don't think there's any reason to still use Thread when Tasks are available
 
exactly
 
Thread.CurrentThread.Abort(); also raises some eyebrows
 
uh-huh
TTQW
 
@Mat'sMug No problem.
I need to do another multi-threading some time.
Let's see, the barbershop problem? The Dining Philosophers problem?
 
Thanks, Santa!
 
10:41 PM
Are you pretty close to Epic?
 
Well I don't mean to brag.. But people say that about me from time to time
 
> earned at least 200 reputation on 10 days
Not even close.
 
10 times closer than I am.
 
10:56 PM
@Mat'sMug I expanded on your comment about removing dead code a little bit, check it out
0
A: Brute force MD5 password checker

MalachiI am going to look at your button call a little bit and see if we can make it a little bit cleaner, first and see where we end up. private void Button_Click(object sender, RoutedEventArgs e) { int l = Convert.ToInt32(stevilo.Text); // lenght = 1; // string a = ""; ...

 
@JeroenVannevel Where is that?
 
@rolfl SO
Don't worry, I'm much sweeter on CR
 
K, they can have their bunfights....
But your profile does not represent that....
 
I look aggressive?!
 
No, it's that when I look at your recent profile it looks completely different.
 

« first day (622 days earlier)      last day (3389 days later) »