« first day (1601 days earlier)      last day (3352 days later) » 

10:09 AM
Hi, guys. Has anyone used MVVM Light?
 
Not I. What is it?
 
yo
 
lo
 
Quite possibly one more day of doing fuck all
Well, learning tings.
 
@Squiggle It is a toolkit that helps using MVVM pattern in WPF, Windows Phone and Windows 8 applications.
 
10:16 AM
ah cool
 
Provides different classes, such as ViewModelBase, ServiceLocator etc. And one of the features I am interested in is EventToCommand. I have some troubles with it. It allows to bind events to commands in XAML. And I can't get it working with my custom RoutedEvent.
 
Wish I could help, @Denver...
 
@Denver I'd avoid it honestly.
It's much easier to use your own base instead of that broken thing.
 
@RoelvanUden Avoid MVVM Light or ViewModelBase stuff?
Right now I'm doing a sorta-MVVM approach in my program, but it might help me to use a small framework
 
@RoelvanUden I have not yet experienced any trouble with ViewModelBase if that's what you are talking about. And EventToCommand feature is pretty helpful.
 
10:21 AM
Honestly, it's only two classes to get the required stuff you want.
I wouldn't rely on a framework for that.
 
It is not a framework, just a toolkit.
Also I am using more things from there.
Messenger, few code snippets etc.
 
Use whatever you want. It just adds complexity and you just noticed that with your problem. It only gets worse as you start using more of it.
 
I guess you are right at some point. However for now it served me well. Also I am not skilled enough to write my own EventToCommand behaviour.
 
EventToCommand? Why would you use an event as a command?
 
To avoid references from View to Model.
 
10:26 AM
But.. event? It uses an event? Really?
 
WPF allows to bind Commands to some methods. But Commands are supported only by controls like Buttons and triggers only on click. With EventToCommand feature I can call a command on mouse move, in example.
<i:Interaction.Triggers>
    <i:EventTrigger EventName="SizeChanged">
        <command:EventToCommand Command="{Binding RelativeSource={RelativeSource TemplatedParent}, Path=ApplyScaleCommand}"/>
    </i:EventTrigger>
</i:Interaction.Triggers>
An example.
 
Yeah, because doing work on presentation-specific stuff (like mouse movements) should be kept in the presentation layer, not in the ViewModel. You're effectively breaking the separation of concerns by doing that.
 
hi guys :)
 
ViewModel is just the glue between Model and View. Like the Model can't know about a ViewModel, a ViewModel can't know about the View. Presentation-specific stuff? Keep it in the presentation layer.
(And this is why I said you only need 2 classes; a ViewModelBase and a DelegateToCommand and that's it; nothing more is necessary)
 
is there a simple code delete row in sql , rather than this?
NewCmd = new SqlCommand("Delete from MutiPart Where Id=" + Convert.ToInt32((listBox2.SelectedItem.ToString())), SQLink.ConnectionX);
NewCmd.ExecuteNonQuery();
hi shell :))
 
10:35 AM
hello @geek007
 
@RoelvanUden Well, you've made your point. It was wrong to try to bind VM Commands to View Events. But I still may find EventToCommand useful, even when working just within presenation layer.
 
@geek007 Look into a data mapper like Dapper, or even EntityFramework.
 
@RoelvanUden oki, gimme a sec
@RoelvanUden ty
 
@Denver You don't need commands then. Just add event handlers and let them appear in the code-behind and write your code. Simple huh? ;-)
 
yeah EF will work great but, i dont think that you have implemented it in your project
 
10:39 AM
@RoelvanUden Yes, but I feel like managing commands is easier than events.
Since your handlers may accept zero parameters, while default event handlers have to accept sender and some arguments.
 
@Denver The whole idea of a command is having a state (enabled/disabled), checking if it can be executed and finally running the execution routine. Having a command for an event is just completely wrong. There is nothing simpler than just using an event instead of going through 3 abstraction hoops to do something simple. :-)
 
Now you make me feel like I was somewhat overhyped.
Well, thanks for the little discussion. You've slightly fixed my mind, I guess.
 
Dr. van Uden
 
I shall be henceforth be known as 'Dr. Advocate of Simplicity', the one and true terror of over-engineering, over-abstraction, complicated frameworks, anti-patterns, repositories and Squiggle.
6
 
oi. I'm an anti-complexity crusader too, y'know.
 
10:47 AM
I just wanted to be your terror.
 
@RoelvanUden You're A terror alright
 
hey
i am running in to 1 problem
could anybody please help me
 
Hi guys im trying export some data to an exsisting excel template and im having problems with the server.MapPath here:

  string filename = Server.MapPath("") + @"\intraweb\c$\inetpub\wwwroot\Accounting_service\Accounting_Templates" + custName + ".xlsx";
If anyone could tell me what im doing wrong with the path
 
11:04 AM
well .. you're not mapping a path in the actual MapPath method for one.
 
@MishMish Are you trying to get the current directory with Server.MapPath("")?
If so, you shouldd use Server.MapPath(".")
 
:21923849 I just figured out it was a wrong path it should look something like this:

  string filename = Server.MapPath("") + @"\\INTRAWEB\Accounting_Templates\" + custName + ".xlsx";
still not working though
 
"not working" is a great description of what is going wrong.
 
What's Server.MapPath("") supposed to return?
 
The workbook must contain at least one worksheet. error msg
means it cant find it
 
11:08 AM
@BenjaminDiele I gave up already
 
server mapPath shoudl return the template im looking for
poor u sippy
;)
 
@Sippy That seems the best course. It's frustrating when you try to help people, and have to pry every piece of info from them.
 
Uhuh.
@MishMish Well I already know how to use MapPath sooo ..
 
@Sippy Nice!, good for you :-)
 
Lol
 
11:11 AM
@Sippy Prove it!
 
hahaha
 
That would be the best answer :P
I'm just kidding though @MishMish He did try to help you
 
I think I already solved my problem, now i'm an elite just like sippy hehe
I know silva was just joking :)
thanks guys :)
 
@Squiggle I was so sure that was gonna be a trap
 
11:12 AM
@Sippy would I ever?
 
Well...
 
2 messages moved to Trash
 
I honestly didn't know.
@Sippy ^
 
Shit happens
 
It just annoys me that some people want to get help, put in no effort at all, and then are mad that people ain't helping. And when they get it right by happenstance, they get all arrogant.
 
11:18 AM
In a method such as this: pastie.org/private/pztpcntmxaq4fg7ggjugeg Would it be better to just check the response code inside the callback?
 
@RodrigoSilva It would be better not to use a repository pattern ;D
 
For example: if (response.StatusCode == 500) throw new SomethingBadHappenedException();
 
I lied
You're calling an API aren't you
 
CARRY ON SIR
I think anyway I'm not totally versed with APIs yet :D
 
11:20 AM
I just dived in :P
I'm making a small project as an excuse to use Node.JS
 
:D
 
@Sippy How would you do it though?
 
Persons/getPersons, sounds like you didn't make it really RESTful :P
 
Well, it should be people for starters xD
 
I'm often led to believe that throwing is expensive, so returning the error code would probably work more in your favor
 
11:22 AM
But what do you mean @RoelvanUden?
And I meant I made that mistake btw, not you :P
 
@RodrigoSilva In REST the HTTP verbs determine the action. You have GET, POST, PUT and DELETE verbs. Say you do a GET on /People, you get a list. POST to /People, you add one. PUT to /People to replace the entire collection, or DELETE /People to clear the collection. You can also GET /People/:id to get details about one person. Or PUT /People/:id to update it. Or DELETE /People/:id to delete it.
A path /Persons/getPersons is not RESTful at all.
Check the table "RESTful API HTTP methods" at en.wikipedia.org/wiki/Representational_state_transfer
 
@RoelvanUden Oh I see... That makes sense
@Sippy But if I return the error code I'd have to handle the return value everytime I call the function, if I just return an empty list I won't have to repeat the code all over
 
how can you make visual studio work with git? if i do add to source control there isn't a git option it just comes up with the team server connect screen
 
I don't need to let the user know something bad happened, I'd just like to know for app logging purposes
 
@RodrigoSilva Return 200 or 404 for most cases. 200 is OK, 404 not found. It's OK to return empty collections if they are empty etc.
 
11:28 AM
@RoelvanUden But I can't access the status code outside the callback, so I'd have to check it there, which for some readon seems weird
 
I don't often call APIs from C# sorry. No clue about that. Just don't compromise on proper API design for the sake of some C# oddities. It will help noone in the long run.
 
@RoelvanUden Eh, thanks for you help :)
I'll change the API accordingly
 
Bah, no C# or .Net user groups near me.
 
@RoelvanUden So I can't really check if an error occured outside the callback unless I write something in the response body, right? Or make it synchronous
 
@RodrigoSilva What errors would there be?
 
11:34 AM
@Sippy Well, I actually just want to know if the operation has been successful
 
a REST api is gonna have request succeeded(200), request failed(404) or .. iunno really
Maybe 500 for connection failures
 
@Sippy Yeah, I got that. But how can I access the response status code outside the callback?
 
@RodrigoSilva Like .. where do you mean?
There's a whole wide world outside that callback :D
 
@Sippy In this code snippet: pastie.org/private/pztpcntmxaq4fg7ggjugeg
But the response is only accessible inside of it :(
 
oic
 
11:40 AM
Hm, is that an acronym?
 
Oh I see*
 
Hi all
I got F# on Linux working fine but it seems to be terribly slow
it's the slowest language on that linux box, slower than Erlang, Ruby
 
Google found "ORganization of the Islamic Conference"
Hence the doubt :p
 
Yeah you can do a few things I think
Can you make your async callback into a method that can return your response status?
I have to admit I know next to nothing about async in C#
 
@Andrew ooh interesting. That's one part of a learning goal I have
 
11:42 AM
It's something I'm learning
 
@Sippy I think I'll just use my own async class and await the functions, instead of using this lib
I like the async await approach much better
 
All 60 review tasks done and it ain't even midday lol
 
@Sippy On SO or on your job? :D
 
SO lol
SO is my job at the moment apparently
 
12:08 PM
If I want to ask a question about recursion in c# did I come to the right chat?
 
@n.Stenvang yes
 
My recursion method is looping through packages. And if I reach a specific package I want to print out its name which also applies for all its underlying packages but not for the rest of the packages.
The packages has a unique ID.
Can you help me out here?
I'm able to detect when I reach the specific package and then I could set a Boolean to true (bool insertHeadings = true). But I can't figure out when I leave the specific package..
 
I'm being made to do an extended workstation health and safety course. Please send rescue.
 
@Sippy "workstation health", is that how to care for your computer?
 
12:23 PM
"health and safety" typically comes under one term
It's health and safety for working at a workstation :/
 
ah, but you don't have that problem!
you're not working at your workstation.
 
Don't use the toilet on the same floor. Move to another floor instead.
Excercise
 
@n.Stenvang If that's what you class as exercise you may be in for a surprise ..
@BenjaminDiele I don't get it lol, where am I working? :P
It said that the course would take a minimum of half an hour per module so I'm taking that as a challenge.
 
@Sippy you're not working :D
 
Ah ofc
He looks like a sound guy
 
12:32 PM
Looks more like a camera guy to me
or maybe a lights guy
 
She quite clearly isn't inside.
Holy shit this guy has a scanner in his eyes
 
s/c/p/
shit just got real
 
Also if you fail a question on the little end of module tests
You just have to keep clicking till you get the right answer then you can continue.
This is teaching me all the things.
Oh there's a proper test
Gonna try to do it without reading any of the questions
 
Banging head against the wall should work too
 
Oh my fuck
63 question risk assessment ffs
 
12:38 PM
Give us the questions. We want to laugh
 
Not reading them
randomanswerftw
Lol
"How long do you spend away from your desk every hour?"
 
foreach question in questions then question.answer(rng.gen())?
 
"14 - 18 hours"
 
"Less than 5 minutes"
"10 minutes"
"20 minutes"
I put less than 5 mins and got a fucking report about how bad that is.
 
oh, "every hour". Missed that part :D
 
12:39 PM
Cos on average, I don't get up every hour lol
I get up once maybe every 2-3 hours
For coffee :D
 
I'd be atrophied by then.
 
I have a damn comfy chair
 
I get up maybe 2~3 times PER DAY.
 
I stole it from someone else when they left. :D
@RoelvanUden Mine works out like that xD
I do try to do the eye exercises cos I get tired eyes, but I have glasses for that now so I don't do it very often at all.
Ah fuck there's a home workers module as well
cba.
 
@RoelvanUden How do you people live like that. I can't sit still for an hour.
 
12:45 PM
I wouldn't remember to get up every hour even if I cared to lol
 
@BenjaminDiele It's called focus :P
 
That might help yeah :D
 
NDC having trouble with the agenda => ndcoslo.oktaset.com/agenda
 
"We'll teach you how to build sites."
- "Hang on. Our site is crashing."
 
12:55 PM
Also someone changed "datalis" to "detalis", then someone else changed that to "details" when it was obviously meant to be "datalist". Fuckin chinese whispers in edit!
4
 
haha yeah
That goes on twitter for sure
 
@Sippy lmao
 
@Sippy TBF, he said are
 
@KendallFrey good morning!
 
wtf happened to you
 
1:08 PM
wutchu talkin bout
willis
 
you aren't supposed to be nice
is this really you
:)
 
lol awwwkward
 
that's not awkward compared to the rest of the internet
 
true true
 
chain
 
1:11 PM
true !false
 
the nerdy version of a choo choo train
 
lol
 
Jesus... That was so bad I laughed
 
i didn't even get it until you said that
now i do, and its still lol
 
lol, as in the biggest lie on the internet?
 
1:13 PM
huh?
 
Noone laughs when saying lol
 
yeah thats true
 
@RodrigoSilva People lie?
 
i say that when i smile
 
@BenjaminDiele Don't they?
 
1:15 PM
I never!
 
That's a lie right there :P
 
Don't quote me on that.
 
Everyone lies!
 
53 secs ago, by Benjamin Diele
I never!
 
Everyone lies with Rodrigo's... oh geez, Kendall, stop
 
1:17 PM
:/
 
@Steve Damnit Steve.
 
@KendallFrey wat
 
Hihi
 
@Markus :)
 
had a sql question, but....
 
1:27 PM
@Markus add a clustered index? Enforce referential integrity? It's a spelling error? User permissions? bug in EF?
:D
 
who said anything about EF? :)
 
It's a C# room. Most SQL problems are either caused by - or solved by - EF.
 
That's why I didn't ask my question :)
btw, I'm using NHibernate
 
:(
wow retro :)
 
mature
 
1:31 PM
EF is mature now, TBH.
EF4 was utter balls. EF5 was getting there, and EF6 is actually a pleasure to use (most of the time)
 
Afternoon. In c# if I have

return Math.Round(m_Rate, 2);

How can I ensure that if the value of m_Rate is 60, that it is returned as 60.00
 
m_Rate = 60;
return Math.Round(m_Rate, 2);
 
So i need to assign it first ?
 
!!tell steve toteshomo
 
Infact this is what I have
         public decimal Rate
        {
            get
            {
                return Math.Round(m_Rate, 2);
            }
            set
            {
                m_Rate = value;
            }
        }
 
public void StartFight() //The actual turn based fighting part of the code.
        {

            while (_player.isFighting && !isDead())
            {

                int thisDamage = GetDamage();

                _monster.HP -= thisDamage;

                _game.SendTextToTextBox(Environment.NewLine + "You deal  " + thisDamage + "  damage to " + _monster.Name + Environment.NewLine);

                Thread.Sleep(100);

            }

            getReward(); //death message, exp, rewards, good stuff.
This is just pausing it and then spitting out all the text...I kind of wanted it to print line, pause, print, etc. is thread.sleep() wrong to use for that?
 
@Markus Did see my code snippet above
 
Actually I don't get what you are trying to do?
if you always want 60, why don't you make it a const?
 
I have this property
        public decimal Rate
        {
            get
            {
                return Math.Round(m_Rate, 2);
            }
            set
            {
                m_Rate = value;
            }
        }
It is being set as 60 not 60.00
I want to return 60.00
not 60
 
but you always want to return 60.00?
is there a difference?
 
1:41 PM
I want to returned a decimal to two decimal places
 
well, that's not how types work...
do you want to print it as 60.00 some where?
 
I have a API service that will return rates
 
@Markus It is how decimal works, stupid as that is
 
I know I can format when converting to string
like
d.ToString("#.##")
 
Mathematically that's valid. 60.00 is different to 60. Dunno how the decimal type represents that though. I'd expect it not to see a distinction
 
1:43 PM
@TomW huh? Mathematically 60.00 === 60
 
do you mean that 60 could just as well be 60.02342?
 
@Markus lol maybe
It might be just 60
which it is in this case
 
I'm pretty sure equality works as expected with decimal, but there is a distinction between precisions
 
@KendallFrey I know that in my physics class the teacher marked that wrong if we wrote something like 60 when we meant 60.00 though
 
@Markus no
@BenjaminDiele You mean if you didn't explicitly state precision?
 
1:45 PM
anyway.. do you always want the property to return 60.00 then you can return that instead of m_Rate
 
@KendallFrey Yeah, because writing 60.00 means you're sure that the 2 numbers after the point are that value. If you write 60, you don't know for sure.
 
get { return 60.00; }
 
right
 
@KendallFrey Anyhow, that was physics class 10 years ago.
 
@Markus I don't want to return just 60.00, that was just a example number
 
1:45 PM
ok
sorry
 
@BenjaminDiele: Physics has changed a lot in 10 years...
:)
 
@KendallFrey what they said. The extra zeroes denote precision.
 
@scheien Yeah, but I don't think that part changed :D
 
Exactly :p
 
1:47 PM
@Markus nope, didn't work
 
return m_Rate + 0.01 - 0.01;?
 
this is just getting silly
 
yup
 
@KendallFrey I agree. Thought it would be a simple answer
 
@Tommassiov You should really only be worried about this when you display the number
6 mins ago, by Tommassiov
d.ToString("#.##")
do that
 
1:48 PM
Right, I will
 
How about ToString("N2")?
 
0
A: Asp .Net MVC form post not working on submit. Form object shows null

vortexPass HtmlPrfix in your EditorFor. @Html.EditorFor(model => model.Question, new ViewDataDictionary() { TemplateInfo = new TemplateInfo { HtmlFieldPrefix = "QuestionMaster " }}) This way the names of the fields will be correct and the model binder will be able to bind them.

uhm
I don't even
 
So is there a way to get my code to pause for like 2 seconds?
 
Timer
 
Thread.Sleep(2000);
if you want to be hacky
 
1:56 PM
pull out the power for 2 seconds
 
@Tokencodingnewbie what's the issue? This smells like a work-around...
 
I used thread.sleep but instead of it printing one line, waiting, printing, waiting, it just waits and then prints everything at once.
public void StartFight() //The actual turn based fighting part of the code.
        {

            while (_player.isFighting && !isDead())
            {

                int thisDamage = GetDamage();

                _monster.HP -= thisDamage;

                _game.SendTextToTextBox(Environment.NewLine + "You deal  " + thisDamage + "  damage to " + _monster.Name + Environment.NewLine);
                Thread.Sleep(100);

                if(!isDead()) //Check to see if the mob gets a chance to attack before death.
 

« first day (1601 days earlier)      last day (3352 days later) »