« first day (1046 days earlier)      last day (3103 days later) » 
00:00 - 23:0023:00 - 00:00

12:14 AM
@JoshMenzel How goes it?
 
funny enough got back from dinner myself
 
Nice. Sitting here with Pizza Hut.
 
Also, with all the windows in one window
I can rewrite the serverside code
to make it easier as well
 
user1881400
I'm trying to optimize a cellular automaton program written in WPF. It uses the Rectangle class to draw each cell and is very slow as a result. Can anybody tell me what the fastest way to draw this is? I'm leaning towards a bitmap, but I'm afraid locking, editing, casting, and encoding/decoding rituals might slow it down.
 
@FizzledOut WPF leverages DirectX under the hood; it should be very fast at drawing polygons. When you say cellular, do you mean hexagon cells?
 
user1881400
12:20 AM
@LynnCrumbling no. I'm supporting a basic square grid
 
Can you distill your drawing code down to a relatively small snippet that demonstrates the drawing algorithm?
I'd think you want to use canvas.
@JoshMenzel It certainly is easier to maintain code that all lives in a single window.
@JoshMenzel Let me know when you get to the tabs... that tab strip should be entirely bound as well.
 
@LynnCrumbling That might take a while
 
It'll blow your mind :)
 
I need to have it run some code at startup on the updatescreen
would I do this through the Content_Rendered event or how would I autostart a function?
 
Makes sense.. That'll all live in the viewmodel. In the vm ctor, I'd have a timer fire that kicks off updates.
 
user1881400
12:28 AM
(Fleshing out the code and meant to post on pastebin... sorry)
 
@JoshMenzel Have it wait 500ms or something small.
Let the vm ctor finish
 
ctor?
 
user1881400
@LynnCrumbling See pastebin.com/A1y6shFu for the relevant code.
 
user1881400
Also, I know the code is hacky, and I'm revising the rest of it for cleanliness too
 
@JoshMenzel constructor
 
12:38 AM
Would this be what I am looking for: stackoverflow.com/questions/13026826/…
 
@JoshMenzel Why not just fire off the code from the constructor, like I said?
 
so on the constructor init?
 
@FizzledOut Give me a couple seconds to take a look at this
@JoshMenzel Yep.
@JoshMenzel If you want it to not block execution, start a timer.
 
@LynnCrumbling Was thinking of doing a background worker
@LynnCrumbling and that background worker would be responsible for all information updating/syncing/changing, etc...
 
Background worker should be fine too.
Do you have a way to marshal calls back onto the main thread from the bgworker thread?
 
12:45 AM
the background worker has a RunWorkerCompleted event
but this worker will never be finished
it will always be listening and firing
I should look into making a DLL
that handles all the connections, events, etc..
 
Why? Do you need to reuse the code in another project?
 
not particularly, but it would help split the code up
I want to think of the connection more of a service
than a background thread
it's a service that runs in the background listening for changes/events that sends data and receives data
it's a separate job from the modelview isn't it?
 
I'd avoid making things into a DLL unless absolutely necessary. It's fine if you need to split it into classes, but to me, DLL = multiple executables/projects that require common code.
The background thread will be parented by the main thread (what the vm is running as).
A vm is just an instance of a class running on the main thread... it's not a separate thread or anything.
It will block the UI if you don't use a bgworker, so that's a great idea.
@FizzledOut Still around?
 
user1881400
@LynnCrumbling yes
I'm looking up datagrid now
 
Have you considered just using a DataGrid?
bound to a collection of rows?
How many columns are in the average row?
 
user1881400
1:00 AM
All rows are identical, all columns are identical. Number of columns to rows may differ, but size of each cell is square and all identical. Grid is rectangular.
 
user1881400
A quick search for datagrid speed brings up SO questions about how slow it is. I think it might be a good idea to avoid. Query: google.com/…
 
I'll be afk a bit... need to do a few things... back in 30 or so.
 
user1881400
@LynnCrumbling Take your time :) Thanks for the help.
 
1:24 AM
@LynnCrumbling Or better yet, create a class that does all the handling
and holds the background worker
 
 
10 hours later…
user4433485
10:55 AM
Hii
 
11:40 AM
Hi
I'm creating a custom control that inherits from ItemsControl. Is there a way to map the ItemsPresenter to a different DP than ItemsSource? I would like to wrap each items in a ContentControl like ListBoxItem for my control. How could I do that? I could probably use the Coerce function to do that but I think this is not good
 
12:03 PM
I have 3 or more asynch functions whihc was called using Relaycommand. I want to synch 3 events. After executing first relay command I need to execute second one . How could it be possible
 
@nkoniishvt what are you trying to achieve, are you sure you need to inherit ?
sorry I only read half of what you said :p
also, hi :)
(but I don't think you should inherit and then change the base class's behavior)
 
12:33 PM
@franssu Ok ok, so I should inherit from Control and remake all features I need from ItemsControl? I'm remaking a ComboBox. The Reason is that I have to use the 3.5 version of the dotnet framework and all controls must be able to handle a touch screen efficiently which base controls aren't. So I remade every controls interacting with mouse for touch screen compatibility.
Anyway, I must remake a ComboBox and the Microsoft's ComboBox wraps items in ComboBoxItem to handle selection, I'm trying to do that too
 
user4433485
@poke Are you here as well? lol
 
yup
 
user4433485
=D
 
2:04 PM
posted on August 31, 2015 by ericlippert

One of the C# oddities I noted in my recent article was that I find it odd that creating a numeric type with less-than, greater-than, and similar operators requires implementing a lot of redundant methods, methods whose values could be … Continue reading →

 
2:49 PM
Can we a ui elemnet silverlight bind to relay command bool output to trigger another relay comand
Have a prob
private void OnLoadsettingbtnClicked(object sender, RoutedEventArgs e)
{

//get selected item
KeyValuePair<string, string> selItem = (KeyValuePair<string, string>)LoadedsettingsList.SelectedItem;
//Chnage item value to preview
_vm.DoSetDefaultorPreviewSettings.Execute(selItem.Key.ToString() + "_0" );

//set broser state to preview
_vm.IsPreview = true;
//get current setting
_vm.DoGetConfigurationSettingList.Execute((object)int.Parse(selItem.Key));

//close load pop
LoadPopup.IsOpen = false;
//call settingpopbtnfn 3 times
Last reload depends on first 2 async calls outputs
but when it reloads the last 2 asnc would not be happened
 
3:07 PM
why are you calling commands ?
and use await ?
why not call the underlying async functions instead
 
 
5 hours later…
8:08 PM
Hi all
 
Hi
wow, what happened to everybody?
 
No clue
I have a question, I have an application that uses Socket.IO in order to send/receive data from a webserver and other clients
would it be best to write a class and wrap a background worker in that class or just have a separate background worker?
 
8:29 PM
You need some sort of class that represents that layer
 
8:49 PM
okay and then how would that class access the viewmodel
 
The view model would likely instantiate it
or some other model class would
models don't talk to view models
not directly anyways
You would use events to send information up the chain
 
that's kind of what I was thinking
 
9:49 PM
Also, I am using the Mahapps.metro framework and I am wondering with mvvm, how would I call an invoke to call showmessageasync
(i.e. MainWindw.ShowMessageAsync)
 
an event probably
 
in MVVM, most people use some form of a service to abstract that out
so you can "invoke" a call to show a VM through the service
and it'll be testable and/or wire it up to the appropriate dialog/message/etc
 
how would I go about doing that?
 
@JoshMenzel Hard at work, I see...
 
yeah
trying to figure out how to invoke
MainWindows.ShowMessageAsync
from the ViewModel
 
9:59 PM
Use that IMainWindowCallback interface that you're passing into the viewmodel.
Add a new member, right below ShowNotification
Call it ShowMessage....
Implement it in the view....
then just call out to IMainWindowCallbacks.ShowMessage();
(from the vm)
@BradleyDotNET That callbacks thing was I think your recommendation originally.
 
I don't recall making it
but it should work :)
 
Does for me :)
 
lol
the method doesn't let me access the mainwindow to perform the invoke
 
What does the line of code look like?
You don't need to access the mainwindow. You need to access the thing that holds the reference to your callbacks.
 
I need to call MainWindow.ShowMessageAsync(TITLE,MESSAGE,etc...)
and it has to invoke the dispatcher with an async function
the way that I have always done it is with
 
10:14 PM
Directly calling a view is a big no-no
 
this.Dispatcher.Invoke(async()=>{await this.ShowMessageAsync("Title","Message",theme,options);});
that's how I was doing it in the non-mvvm format
 
@BradleyDotNET He's got a IMainWindowCallbacks implemented as arg coming into the vm already.
 
but the mainwindowcallabcks won't give me Mainwindow.ShowMessageAsync
 
@JoshMenzel Does it have just ShowMessageAsync?
 
Nope
 
10:16 PM
mainwindowcallbacks is yours. You can add a new one.
 
Only options are the functions that are defined inside the callbacks class
 
Go into the interface cs file first.
Add a new method required by the interface.
 
void ShowMessage(string Title, string Message, Boolean exit);
 
After you do that, you'll need to into the mainwindow cs file and implement it.
You'll see an implementation for the function that was there already -- ShowNotification
 
okay yup
 
10:18 PM
Add your implementation for ShowMessage
It needs to match the interface declaration exactly.
 
okay
done
 
In that implemenation, you may be able to copy and paste your non-mvvm code.
 
now how do I invoke the call onto the current window instance
 
Now call it from the vm.
 
Yeah in the mainwindow callbacks,
 
10:19 PM
 
In the vm, where you want to call it -- type mainwindowcallbacks.ShowMessage()
it'll be there now.
 
this.Dispatcher does not work
in the mainwindowcallbacks
I need to grab the current dispatchr and window
without generating an invalid operation exception
 
pastebin the view codebehind for me.
 
kk one sec
 
Change MainWindowCallbacks to have a constructor that passes the Window as an arg. That way you'll have ref to it in the callback.
 
10:24 PM
 
You'll need to store that ref in the callback
so, in MainWindowCallbacks, add:
private Window _parent = null
public MainWindowCallbacks(Window parent) { _parent = parent; }
Then you can call _parent.Dispatcher.....
 
i see....
 
Follow all of that?
 
yes
I don't agree with how mahapps does the message boxes but...
 
Did you get the login implemented yet?
Curious if you got into any of the fun databinding stuff yet.
 
10:34 PM
No, I have decided to rewrite the server code a swell
as well*
Since this operates on one window, one connection should be all that is needed
therefore I can further optimize the server side code
iI am also at work working on my pc through tmvwr
 
gotchya
 
my job sees very little foot traffic so I can pretty much do what I want
 
What do you do?
 
first job is at a grocery store in the deli, 2nd job is at radioshack
 
Get out of there, man :)
 
10:37 PM
lol
we see very little traffic and it's a franchise so
I'm not losing my job either of them at any time soon
 
You could be making much more at a dev shop, even as a junior dev.
 
there are none
 
No less than 30k-35k, I'd think.
 
at least in my area
 
Home.Move();
 
10:39 PM
and I don't even have a college degree
 
lol I don't have any money to do that with
 
Eh, that doesn't matter.
 
but I would totally work for a dev shop
 
It would change your starting salary.
 
10:40 PM
that's what I want to do
 
Ah, ok.. so college is in the cards?
 
got done with one year at minnesota state university in mankato, mn
and I hated it
I don't want to be throwing $10k every 4.5-5 months just to be part of society
plus their program isn't even good
their professors are lousy
the math teachers are all foreign and can't speak english
 
Can't speak to that school, but a good program is immensely beneficial
 
I want a program that gives me hands on experience
 
You might consider a technical institute
 
10:43 PM
not textbooks
 
My alma matter (Oregon Institute of Technology) has an excellent hands-on program
 
as much as I love classrooms, I want a program that actually supports and is relevant to what I want to do
 
with just enough theory to be dangerous :)
 
lol
plus my parents put a lot of pressure on me to go to college and graduate in 4 years or less which is not gonna happen as I am taking this year off to work
 
We have a couple devs at our shop that aren't college grads. It helps get you in the door, though.
 
10:45 PM
seriously though, Comp Sci programs are typically far too theoretical/research
 
exactly
 
so many of those (Comp. Sci.) grads don't know how to program anything
 
I want Software Development, Networking administration
 
Get into a Software Engineering program
 
There's a lot of job listings that require bs in cs/ee/ce
 
10:45 PM
and networks are hell
 
^ star
 
in my area and MN
it may as well be bullshit in cs
 
@LynnCrumbling If they wouldn't take SE, I would be worried anyways :)
 
I graduated with a cs degree and look at me ... <grin>
 
like VB.NET, C#, Javascript, NodeJS were'n't even part of the curriculum
until senior year
which imho is complete bullshit
 
10:47 PM
The fact that VB.NET is in the curriculum at all...
 
Used vb6 for a decade and a half :)
 
We learned C++ year one
 
exactly
I started with python first semester
then failed calc 1 twice
 
C# junior year (as an elective) but once you can do C++, you can do them all
 
I hate math and for me personally, I don't see why I need more than Algebra
 
10:48 PM
Year 1: pascal, 2: c++, data structures, 3: survey of languages, compiler design 4: advanced topics (predator-prey simulations that actually was CS 400/BIO 400 class.
 
not to mention no calculators are allowed
 
Well, yeah
kind of the point that you can do the calculations
 
so when you get into trig functions, you have to either have it in your head or ur fucked
 
once you get past calc its a bit different
 
which tbh
 
10:48 PM
Math.Cos()
:)
 
which tbh is gay
 
not that bad, just five angles
 
since I will prbably use a calculator or even better google to solve my math probelm any way
 
and three (related) functions
 
um no
 
10:49 PM
there's something to be said for being able to do mental arithmetic
 
ok, I need to get back to working on an implementation for a chip and pin device. afk for a bit.
 
try all trig functions
 
Besides, most places will provide the trig table or notes
 
and radians and degrees conversions
 
There are only 3 trig functions
and then their reciprocals
which, if you can't do reciprocals in your head, we have issues
 
10:50 PM
sin, cos, tan, sin inverse, cos inverse, tan inverse,
 
Going backwards is the same way
 
not to mention the other 6 that I forget
 
cos(45) = sqrt(2) so... cos invierse(sqrt(2) = 45
 
and then you have to know all of the formulas such as sin^2 + cos^2 = 1 or some stupid shit
 
if nothing else, practicing logic like that makes you a better programmer
 
10:51 PM
all off the top of your head
 
I'll grant the identies
 
which is bullshit
 
but most of those are in the provided trig tables
assuming you have to know them
 
yes but none are provided
 
(not usually in calc+)
then your school sucks :)
 
10:52 PM
and you can't use them on anything but hw
exactly
 
I don't have a problem requiring the 5 basic angles
 
I refuse to support this society
 
but memorizing identities gets no one anywhere
 
exactly
theyw ant you to know everythign
off the top of your head like it's fucking magic
guess what it's not
 
certainly more work for some than others
 
10:53 PM
I like logic, algebra, consistency
 
I was a math tutor, I should know :)
Calc is just fancy algebra, you know
 
I know
 
and it can be useful, especially when doing anything with physics sims
 
and many people tell m that, but why should I spend time emorizing everythign having to do with that when I can open up google or pull out my calculator and figure it out way faster?
 
also useful: stats/probability (gaming), linear algebra (3D)
Because without being able to set up the problems, you aren't as competent
And without the ability to do the calculations if you had to you show lack of mastery
 
10:55 PM
I will not participate in programs that have professors that can't speak english, move through 2-3 sections a day and expect nothing less than perfection
I'm sorry but FUCK that
 
and I can't say how many times being able to estimate/calculate something off the top of my head is useful. I don't carry a calculator usually :)
 
I knwo
 
I can sympathise with your having a poor program
 
but still if I wanted to take calc 1 it would be that one class for the semester
 
but as Lynn said. Home.Move() to somewhere with a better one
 
10:56 PM
I would need all my attention on that
 
All SE programs will likely require it
I had to have 3
 
I am starting to consider moving out of state
 
(terms of calculus that is)
 
like I said
I want a program where professors actually now their shit and teach it
 
Those do exist
There are quite a few midwesterners usually here
 
10:57 PM
not sit around and talk about how they cancelled class yesterday morning so they could go to a banquet
 
maybe someone can give you a reccomendation
none online atm though
 
I am looking at devry in Chicago
I am looking at ITT
 
ugh
I've heard bad things about that one
 
exactly
 
I'd stick with a traditional 4-year, just do it at a technical institute
or a university advertising a practical program
 
10:59 PM
I need a program that gets decent ratings by students
not to mention professors that know their shit and how to teach it
 
I can't reccommend OIT enough
but Oregon is a bit far for you
 
it is
 
and they aren't easy. You have to know your stuff too
 
00:00 - 23:0023:00 - 00:00

« first day (1046 days earlier)      last day (3103 days later) »