« first day (2003 days earlier)      last day (2949 days later) » 

6:00 PM
a single parameter that is one of the other two classes.
output should be something like this
ClassC parameter: ClassB
 
public class ClassC {
     public ClassC(ClassA a) {
         print(this.GetType().Name + " given an instance of " a.GetType().Name());
     }
}
 
Do we just do homework for people now?
 
Not looking for any help writing my code but full disclosure this is also for a course. I can't seem to fix this "A project with an Output type of Class Library cannot be started directly." I've tried setting it as a StartUp project which didn't do anything, and also tried changing the output type is seemingly not allowed for some reason (greyed out).
 
@wadry: thank you
 
@KernelPanic OK the latter statement is a weird one
I can't see why it would be greyed-out
 
6:04 PM
 
@KernelPanic if you are certaint everything should run just open it up in explorer and run the application from the .exe
 
oh crumbs that looks like a DNX project
 
without the vs
 
@misha130 yeah, it's not an exe
 
b-but its named BinaryTree..
 
6:06 PM
So the error message makes sense, but I can't see why it would stop you from changing the output type
 
@TomW I followed the instructions from my textbook. My professor told me to set it as a startup project but did nothing. Which is why I'm here trying to fix it.
 
oh well
 
@KernelPanic yeah, that's not what that does
'Set as startup project' just indicates to the IDE which (executable) project to start when you hit F5
It doesn't change anything about the project itself
 
Alright. Well what can I do? Or would I Just remake the project and move the code over?
 
What project type is it?
When you created it, which option did you pick?
 
6:08 PM
Portable Class Library.
 
Maybe that's set up to not be changeable. Never used one. Is that what the textbook says? Because that's wrong
You can't start a class library
 
what the fuck
but does it say you should run it, at any point?
 
is today homework day?
 
Right. You can't start a class library, end of. I'm sure the author knows that. What are you actually trying to do? I'd expect there to be something else in this book that tells you how to incorporate that code into an application you can start
 
6:11 PM
 
That doesn't say anything about starting it
 
yea, it doesnt say run it
just compile it
@TomW I thought DNX was an ASP.NET exclusive
 
@misha130 shrug
Yeah that was a red herring, the project properties just looked a little different to what I was familiar with, that was the only reason I said that
 
@TomW Ok REALLY stupid question here. So compiling is just getting the code ready to run but debugging is compiling then running it?
 
no matter, I amma read some incomplete docs about it
 
6:14 PM
@KernelPanic pretty much yes
 
Ah alright well now I know. Weird that my professor didn't catch on to that.
 
Compiling a class library produces a dynamic-link library (.dll). Compiling an application produces an executable (.exe). The only difference in .net is that an executable has a special method called an entry point
Executables can be started, libraries can't. Debugging from the point of view of visual studio is starting the executable and attaching a debugger to it
 
So libraries/dlls are like books and the exes are like readers? Probably a gross over simplification but that is how I see it.
 
@KernelPanic libraries are like chapters, exe's are like books
exe contains "cover" and "index" and may contain other pages, libraries can only contain pages and such but no covers
although its actually a bit more complex than that
 
^ so only with an executable do you know where the 'beginning' is :)
 
6:19 PM
as you can actually execute a dll if you define an entry point
 
@wadry witchcraft!
 
@TomW lol ... what do you think static void main is ... its basically an entry point in to what might otherwise just be a dll
 
@wadry yes, that was exactly the point I was making earlier
 
its also why you can change a dll project to compile to an exe by just setting a main method and changing the compile option to "exe"
 
I assumed you meant somehow hacking one into a project that is defined as a library
 
6:30 PM
yeh you can add one in to any library project
I also noticed the other day you can have many entry points but only 1 can be the main one lol
 
Now that definitely sounds like fuckery
 
This is going to be a weird question: Is anyone by chance a redmine administrator in here?
 
In which circumstances would it be a valid thing to do to choose a different entry point, and how?
 
@TomW out of the box supported fuckery
@TomW don't ask me ... I have no idea why / how I would ever use such fuckery
 
I am getting an error of Specified cast invalid.
?
 
user47589
6:46 PM
what do you get when you run that query in SSMS?
 
user47589
you get a single row with a single column containing a decimal value? that isn't what ExecuteScalar expects. you're running a query.
 
user47589
or are you getting no rows?
 
user47589
what steps have you taken to solve this problem?
 
@AccountUnknown do those labels contain things they shouldn't ... like maybe whitespace
also are back ticks allowed in sql ?
I thought you had to use single quotes
 
user47589
single quotes or square braces
 
6:49 PM
Query executes fine... no problem in that...
 
so there's something funky in the label text
 
Why we get cast invalid error?
 
bisday implies you have a bisuness day ... i'm guessing that its expecting a key from another table that represents business days or is it the text for a day of the week or something ?
not enough info from that sample to determine the problem
 
there is no funky in labels to...
the price is stored as double
 
user47589
then use double, not decimal.
 
6:53 PM
tried that too, same error
 
what happens if you do ...
 
Work Decimal.TryParse
 
Decimal sum = cmd2.ExecuteScalar() as decimal;
 
howday
 
sup @BrianJ
 
6:54 PM
@misha130 ?
 
not much doing a bit of Super Sunday programming :)
sup with you?
 
Just at "Decimal sum = (Decimal)cmd2.ExecuteScalar();" the error
 
Test what executescalar returns before actually applying it to a variable
or casting it
 
@BrianJ nuthin ... im gaming
 
user47589
i'm watching SW
 
6:55 PM
starwars?
 
Decimal parsed = 0; Decimal.TryParse(cmd2.ExecuteScalar(), out parsed);
 
user47589
yes
 
@misha130 returns an object I believe
 
I know
 
user47589
you can't call Parse on an object, it has to be a string.
 
6:55 PM
cool , winding down on the programming now after thi one last problem :P
then Netlfix
 
I just want him to debug it to be honest
 
haha just seen the sidebar about John Skeet, no way that's true
 
and most likely executescalar returns null
 
user47589
it was just yesterday evening when he threw a little fit in here when he didn't get the answer he wanted after not putting any effort into it himself.
 
user47589
to a different question
 
6:57 PM
on me
 
ok I have a question on a relay command set up, that I did put a bit of effort into debugging
 
but I am more curious about the answer
 
so I've set up a bool property to decide whether a relay command can fire or not. The bool property checks the values at init of 3 property values. But the condition within that bool doesn't fire again when I change the values on either of the property values it checks.It only checks the values on init of the calss.If that makes any sense to anyone else outside of my own head
 
@AccountUnknown did you try what i said ?
if the query doesn't return a decimal you probably get 0
 
its returning null...
i got it
thanks anyways...
 
user47589
7:01 PM
lol wtf
 
decimal foo = null; <--- works well i'm sure :)
 
code for context on the set up, I've pared down the class to include only the essentials, and wala here is the magical code I'm talking about
 
user47589
@wadry that'd be decimal?
 
@Amy to you or me ... yup ... lol
 
so the long and short of it is, the bool check on CanSendCommand only fires on the class init, and not when the values of the properties being checked change
 
user47589
7:02 PM
@AccountUnknown so the very first question that was asked of you, "what do you get when you run this in SSMS" is the very last question to be answered, and answered the problem.
 
I was expecting it to fire when I change a value for either of the properties within the bool condition
 
@BrianJ why are you promoting TFS on your website
 
not really promoting it, I just take notes of new things I learn at work :)
I'm a grad dev, so pretty much everything is new to me..helps me remember it later
excuse the noobness of the posts I'm still improving my blog/tech writing
 
no complaints, no complaints
 
I don't have a million dollar deal with them or anything ;)
 
user47589
7:09 PM
how many dollar deals do you have with them?
 
works out pretty good for them
a zero dollar deal
except they don't know about the deal
so in essence no deal at all
 
my pc hs gotten really loud of late
think it needs hoovering out
 
HYELLAW?
I EM HEPPY
 
user47589
spray it out with a garden hose
 
user47589
much easier.
 
7:19 PM
sounds smart
ur smart amy
 
@Amy i've actually done that before
so clogged up with shit it was the easiest way to go
that machine worked like a dream til i upgraded it
yeh that was the same week I started charging my iphone in the microwave
 
user47589
lol
 
did i have you there for a minute?
were you sat there going "WTF"
lol
 
user47589
i considered asking if you upgraded it with a garden hose
 
I need to get my mate over ... he blags those cans of air from his work
they work a treat
 
user47589
7:22 PM
distracted by star wars
 
hey again
so
Does anyone have an idea as to why the relay command bool func isn't firing in my code, when any of the property values changes?
nvm got it
:)
bindijg to the IsEnabled prop of the button instead
and use a bool prop
peace out
 
7:52 PM
hmmm pc runs hot ... get out the hoover, realise half my fans arent running, sort the problem out ... house is now boiling hot
cheers nVidia ... free home heating system for gaming
 
wadry u up for some guidance? :p
 
oh crap ... uh ... ask amy ... i'm having a typo weekend
 
Just answered a bad question on stackoverflow and now the guy is flaming me and that he has already watched some youtube tutorials.
 
lol
link?
 
u do not know the answer then please do not just post very general abroad suggestions ! I watched UWP Course already and I started already to apply some idea ! I don't think u read my questions and I don't think u have any idea about the answer I really do not know what in the world post such answer !!! — Max 7 mins ago
 
7:59 PM
lol godlike
 
xD
I wrote: @Max I don't know what you are meaning by I don't know the answers. I'm studying computer science. If you want to adjust the design of your xaml ui elements you have to create a custom style for those. You maybe want to use Blend for Visual Studio. After creating the custom style for it you bind it to the Style Property.
 
oh cmon wadryyy :(
 
whats the coding horror today then?
 
no no, i need guidance in life kinda in this domain
 
8:07 PM
@ElieSaad eh? im a programmer not a counsellor
 
haha that guy
man ! I really duno what's freakin wrong with u but Please THANKS ! Just no more aggravating answers coz it's so clear u did not read nothing in my post !
 
@wadry don't worry its enough :p
 
lol ok
 
If you mind i won't ask ...
 
@MatthiasHerrmann you tried to help but apparently you suck because despite knowing his answer ... you suck
lol
@ElieSaad you can ask ... its a public chat room after all ... im not the only one here lol
yay more homework questions
 
8:09 PM
not question
I dont understand the error
am done almost
 
The thing is, i am confused if go into security, or go c# deep, or understand how the web really works, not just the surface. I am really confused that i want to start somewhere :/
 
@wadry I'm now looking at his other questions and will answer them :D
 
@karan when you do ConvertTo the recieving item should be an IConvertable
sigh
You cant convert a class
You have to convert a property of the class
 
@ElieSaad first I would start by learning a language (eg C#) in doing so you will ifnd things you like doing in that language ... then you can specialise in say ... web or desktop
 
ohh
 
8:11 PM
@misha130 sure you can ... if its a valid cast
 
...
 
@misha130 you can implement that on any type
 
would you like to explain interfaces to karan here?
something that he still didnt study in school
 
sure
 
@wadry @Amy may i have your experience summoned on this topic as well before i go with it? :)
 
8:12 PM
oh thank you :^)
 
an interface is basically a definition of a contract between various code elements
 
you remember that blog post about the text editor with 1000 words
you posted a few days ago
 
yeh
 
thanks a lot both of you.
I know interfaces to some extent
but not fully
 
basically you tell ClassC to extend iconvertible and then implement a method that does the convert when ToInt is called
and this method would be like public object Convert(){ return 1; //for example }
 
8:18 PM
public intferface IFoo {  <-- an interface
   void DoStuff();         <-- an interface member
}

public class Bar : IFoo { <-- Bar implements IFoo
    public void DoStuff() {}  <-- must be here
}
its that simple
It gets deeper with inheritence but thats a good place to start
now if a nother block of code knows about IFoo it doesn't care how IFoo is implemented just that it is, then that block of code can use the thing its given
for example, a typical web stack pattern might have something like this in a webapi / mvc controller ...
public class StuffController : ApiController {

    public StuffController(IService service) {

    }
}
its then common practice to save that IService thing in to a private variable that controller actions can use
 
that is a very confusing example in the end there
because youd have to use DI to implement the IService
specfically in the controller
 
@misha130: am about to say same thing to Wardy
 
@misha130 no you wouldn't
 
lastone is confusing
 
this can be achieved very easily even without DI
@misha130 for example in MVC you can simply create a custom controller selector and build the controller instance yourself
it is however common when doing that to use DI in the custom controller selector
but DI / IoC is a much more complex subject than we want to get in to here right now
 
8:25 PM
well I guess DI is a design pattern afterall
it can be avoided
 
I suppose it sort of is a design pattern I guess .. i don't really consider it a pattern though, I always think of DI as the thing that make a good implementation possible of the service locator pattern
but again ... that's a deep subject
and many people have different views on it
 
@karan The IService is something unknown for this class and something this class doesn't care what it is. Its just a service and you can use it, without knowing what it does
 
its something that implements a known interface or another way to put it "something that adheres to the contract IService"
how it does that is irrelevant
 
wow, it's nice to see this chatroom active on a Sunday
 
one example might be a CRUD interface for a data source
 
8:28 PM
I work on sundays mate, kill me now
 
@misha130: I understand nothing .
 
@KalaJ To my knowledge we speak on Sundays as well :p
@misha130 on it.
 
checkout winsocks in general and different protocols
 
IDataContext {
    T Add<T>(T newT);
    void Delete<T>(T toRemove);
    T Update<T>(T newVersion);
    T Get<T>(int tId);
}
 
but who is beej may i ask? :P
 
8:30 PM
consider that basic interface
 
beats me
 
you might have an implementation of that that can store T in a file, or a SQL db or on a web service somewhere
 
don't give a generics example...
 
ah okay... sometimes it's a ghost town on weekends
 
you'll have to explain generics now
 
8:32 PM
templates in C++ are generics in C#, right? :p
 
typenames
 
This sounds like the lecture I give my coworker
 
i just went into generics and typenames and templates, God it's gonna be a long adventure in learning :p
 
Templates lets us work with typenames/generics
 
8:36 PM
here is a maybe monad i've built
you can see barely that C++ has the same power as C#
 
@KalaJ @misha130 Thank you guys :)
 
am fully lost now.
 
@misha130 you gotta learn one day right?
and who becomes a programmer then never asks ... how does that work?
 
not everything in one day
 
I don't think you can be effective and write anything useful without knowing a few core concepts
conditions, loops, declarations of basic types and some simple code organisation / patterns are not too much to ask of a programmer
 
8:43 PM
well I remember on like my first few lessons in school my teacher gave me an assigment to test efficiently without loops for example and some other constraints
 
If I ever meet another "experienced, with 15 years" programmer that has "focused on C# his entire career" and doesn't get at least linq generics and interfaces ... i'm gonna punch him
 
made me use byte shifting and such for simplest things
 
byte or bit?
 
bit
 
bit logic is fun
 
8:44 PM
not when you haven't got a clue what you are doing
 
im building some intersting stuff at the moment using bit arrays
 
flags?
 
nope
 
POINT IS THOUGH YOU KNOW
 
im constructing virtual worlds (pet project)
 
8:44 PM
you gotta slave through the sweat of your brow
on these small details to actually get them
with baby steps
 
yeh but knowing a small amoutn about bits and bytes is something a junior / student can do
i remember how hard i found it just figuring out how to declare a friggen class
all those dam bracs
and they never matched up
 
I remember pascal :^)
 
it was the semi-column;
 
first time i ever touched code was basic on the ZX spectrum
 
no brackets there
and then there was vb 6
and everyone was telling me how they still use it in the offices everywhere
 
8:48 PM
@misha130 yea over here it's still used a lot
 
@misha130 vb6 or vba
 
bwahahahah
 
very different beasts
 
vb6 mate
dont throw me in to the wolves
 
ok thats disturbing
soon as I heard micrsoft were going to announce this new thing they called ".net" and a whole new language called "c#" i was like ... meh ... might as well give it a try
I've been with C# since release pretty much
in act i recall having a beta version of the original VS
the support for VB was better than the support for c# back then lol
 
8:51 PM
well it ran its course
I just remember winforms being awful
 
!!winforms
 
@R593B Winforms did nothing wrong!
 
i've been dreaming of the day MS released roslyn ... it was beyond insane when they said it was also going open source though
 
and I dont mean the code, the bloody gui was so disgusting
 
x platform c# <3
 
8:54 PM
Asp.net <3 #nohomo
 
awesome that I can spin up asp.net in a console app now too lol
splash of owin / kestrel and bang ... console app becomes a self hosting website + server
 
i want to migrate actually
my senior dev is going on a vacation for 2 weeks
 
@wadry I like the mvc pattern and it is just so awesome to write plain c# code between html
 
and i'll wreck havoc while he is away ;^)
gonna get some linux support in to my webapps
 
@MatthiasHerrmann you're talking about the razor templating engine there
that thing is beast
 
8:56 PM
@wadry yep razor syntax
 
you know you can use razor outside of mvc right?
just on its own
 
using it as an email templater for example
 
^ seen that done
 
I have a templating service I built, I write templates out as Razor files and spit objects at it for it to give me back stuff like emails or web pages or even just csv files
 
In the most convoluted confusing BS manner possible
 
8:58 PM
@wadry Didn't take a look at that but it sounds interesting
 
why
 
dead easy ... takes about 3 lines of code
 
read template file, create template class out of file, create model for tempalate, pass model, receive html
 
@TomW some implementations i've seen are bloody evil ... no idea why people write soooo much code some times
@misha130 parse template, merge with model => use result
that's literally all that should be involved
right im off to bed ... got a long and shitty day tomorrow at work trying to solve this dumbass recursive entity problem in EF
 
@wadry, good luck. I have a similar problem with a MIA button lol
 
 
2 hours later…
10:44 PM
I'm integrating an existing client-server app with a vendor's web services. Client is Winforms and server is WCF hosted by IIS. This vendor dictates that I must not make more than 10 concurrent requests or my account will be suspended. Both my client app and server-side code will be initiating these requests. Any advice on how to approach this?
 
10:54 PM
Hello everyone
 

« first day (2003 days earlier)      last day (2949 days later) »