« first day (1941 days earlier)      last day (3010 days later) » 

user47589
1:04 AM
@Emre, remove the new keyword. var cmd = new connection.CreateCommand()
 
user47589
connection isn't a type
 
Can this be condensed, or is this ideal?

        TEntity ISearchable.Get<TEntity>(int id, params Expression<Func<TEntity, object>>[] includes)
        {
            try
            {
                return Set<TEntity>().IncludeMany(includes).Single(e => e.Id == id);
            }

            catch(Exception ex)
            {
                throw new Exception(String.Format("Either none or multiple entities located, exception thrown. {0}", ex.Message));
            }
        }
 
user47589
1:45 AM
maybe remove "exception thrown" from the exception message. Seems a bit redundant.
 
Other than that?
 
user47589
also, pass in ex as an argument to the exception constructor
 
user47589
you're throwing away the stack trace as is
 
Ah, true.
It is fairly self explanatory error though?
Would a stack be beneficial?
 
user47589
the stack is always beneficial
 
user47589
1:46 AM
it doesn't cost anything to keep it.
 
True.
 
user47589
you might be making an error of logic
 
user47589
what if the exception isn't thrown from Single()
 
user47589
in that case, the exception message might be incorrect.
 
user47589
a failure to connect to the database, perhaps
 
user47589
1:59 AM
imo, you should also return TEntity and id with the exception. it will make it easier to understand the cause of the exception
 
user47589
includes might even throw an exception
 
3:00 AM
can someone give me a hand with this question: stackoverflow.com/questions/35261533/…
 
 
2 hours later…
5:22 AM
I need to have a property called Version in my class...but it conflicts with type System.Version...
whats the correct way to write it?
 
5:44 AM
never mind...figured it out now...
 
6:30 AM
0
Q: How do i compile current project from a VSPackage?

javadaskariI want to compile current project from a VSPackage and I translate user errors and give him a show. I'm translate the user's current document errors: DTE d = ServiceProvider.GlobalProvider.GetService(typeof(DTE)) as DTE; Document actDoc = d.ActiveDocument; TextDocument altActTextDoc = (TextDo...

 
6:41 AM
hey guys. wanted to get an opinion on something
I'm building an app that translates different types of XML messages from one to another
My company has built classes around these different messages (and there are 12 of them atm) and we use those internally to work with them instead of throwing entire XML documents around
I'd like to be able to translate any message to any message given a mapping that a user can create
I also need to be able to capture the data for the messages, so I wanted to use WPF and bind it to these classes we use
 
 
Problem is when my company made all these classes they didn't implement them with properties, using fields instead, and they also obviously didnt implement INotifyPropertyChanged which WPF needs to do data binding
So my idea is to make a wrapper class at runtime to do all that, so you can give this thing any class and it generates properties for you and then uses the original class as it's backing field
I've got the code to generate properties down and working fine, I'm working on the interface implementation now but it's quite complex and I don't know if I'm overcomplicating things
 
7:01 AM
sounds difficult
difficult to implement, difficult to test and debug
 
7:20 AM
I have serialization doubt...?
what do you do suppose one property of class is non-seralizable?
You've to implement the class with ISeralizable ?
 
8:05 AM
Morning Puppies
 
8:16 AM
@deostroll does it need to be serializable?
 
@Logan Why don't you just change the fields to properties and be done with it?
 
@RoelvanUden they're pretty huge classes and I don't think I'm gonna get that past management
I guess I could give it a shot though
 
@Logan I need some value in it persisted...
 
@deostroll no I'm not going to be persisting anything, it can all live in memory
 
@Logan Why the fuck is management involved with code?
 
8:18 AM
@RoelvanUden strict deadlines, risk of breaking things etc.
 
@Logan Unless you are doing some funky reflection changing fields to properties shouldnt do anything
 
@AlexL yeah that's pretty much it. And the interface implementation
making events in CIL is not so fun :(
 
I will be honest what you were tring to do would have had a far higher chance of creating odd bugs
 
yeah that's what I'm afraid of
if someone along the lines writes their class properly using properties and that interface then obv I wouldn't need to wrap it
but for allthe existing stuff where that hasn't been a requirement I need to make a plan somehow
it's either this or I'm going to be writing a whole bunch of code that I believe WPF already does
Not really sure if there's anything else out there that does what I want
 
good (ugt) morning
 
8:23 AM
Yeah sorry, I still don't get why management is involved with code changes. They manage, they don't code. If they don't rely on your expertise and judgement, why the fuck are you even there? Just sheepishly writing code? On that note, good morning!
 
@Logan It seems to me You are writing a view model layer, and that is the wrapper You are talking about
 
Yeah I get that. I also know who's head will be on the chopping block if I break stuff :P
@ntohl yeah pretty much
 
Also, check github.com/Fody/PropertyChanged. Might help.
 
@RoelvanUden looks exactly like what I need
 
It's not. It still requires properties and weaving. It's not run-time.
 
8:25 AM
Ah.
 
Also if they go all crazy at changing some code, they'd be bound to go even more crazy at changing the compile pipeline and manipulating IL after compilation
 
What are these classes you are tring to wrap? some sort of model I asume
 
I see that
@alexl yeah they're just kind of
* they're a model of a bunch of ISO XML messages
+ it's a plus if it works with all the old stuff we wrote as well
I even thought about using some roslyn magic and building up an entire source c# file in memory and compiling that on the fly, but that requires VS2015 SDK right? I can't target that sadly
 
You can do it in CodeDOM too.
You probably just want to write a wrapper though. All that magic is.. yuck
 
yes exactly hence why I'm asking :P
 
8:29 AM
is there any reason you are resorting to runtime code hacks rather than just having hard coded view models?
 
@AlexL rewriting lots of code with risk of breaking stuff on a high risk project
 
I think the code already should have view model, so just do it
 
@Logan you dont rewrite jack, you create a new class
lets say you have FooMessage you would make FooMessageViewModel
FooMessageViewModel would take a FooMessage in its constructor
then you can referance the message's fields directly or copy them over
 
@AlexL but the place where FooMessage was used, now is binded to FooMessageViewModel. So the code is changed...
 
@AlexL didn't think of that...
no @ntohl that could work
although then we pretty much wind up with a lot of duplicate code.
 
8:33 AM
@ntohl no as the rest of his app isnt WPF and isnt using binding or he wouldnt have the problem
 
yeah I'm just using WPF as presentation layer
 
ok
 
@Logan remember it doesnt have to expose all the fields just the ones you need
 
@AlexL I need all of them :(
 
@Logan you have my pitty
 
8:35 AM
thanks.. I think :P
 
but its easy to do, just copy the fields then replace ; with { get; } or what ever
it should have 0 impact on existing code, and although its replicating code your model classes shouldnt be implementing interfaces they dont need just for WPF
thats why we have view models even though they tend to end up almost exactly the same as the model
 
I could possibly make use of that Fody link @RoelvanUden sent.
 
Honestly with a decent base you just require two lines of code for a property with binding anyway.
Fody just adds magic.
Don't rely on magic.
 
to give you an idea of what kind of stuff I'm talking about: iso20022.org/documents/messages/pain/schemas/…
this is just one message type, there are 11 others and they are completely overcomplicated and we use like 10% of them :|
 
looks fine to me
its a bit of copy pasting then some minor edits
 
8:46 AM
lol. The pain
 
8:59 AM
Thanks for the help guys :)
 
Monday guys!
 
Happy New Year!
 
Small question:

private void castVote(String favoriete)
{
using (var connection = createConnection())
{
using (var cmd = new connection.CreateCommand())
{
cmd.CommandText = "UPDATE docent SET aantalStemmen = aantalStemmen + 1 where docentid = @id";
cmd.Parameters.AddWithValue("@id", cmbFavoriete.Text);
// command must be actually executed, otherwise nothing happens
cmd.ExecuteNonQuery();
}
}
}
I get a error saying the type or namespace name connection could not be found?

How can I fix this?
That above is my code.
 
How to write tests around object serialization?
I've have an object. Persisted it. Deseralized into a new object of same type...Now how to check if the original & deseralized object have same values?
 
9:18 AM
@Emre Which database connection you are using? Simply say connection is not a valid namespace or class. It might be SQLconnection or OdbcConnection etc.,
 
Im using a sql-server Sqlconnection
@sank
@SankarRaj if i remove the new in front of connection it says I should add it
 
Hello all!
 
@Emre This [link] (google.co.in/… "Link") will help you. And you should learn about how to use Google. That Giant will help you lot than us.
 
I know I've used it, but I don't really know whats wrong by my code
 
@Emre Okay. Tell me where you are mentioned the connection is SQLConnection?
 
9:32 AM
private SqlConnection connect;
private const String ConnectionStr = "Data Source=localhost;Initial Catalog=docent;Integrated Security=True";

private SqlConnection createConnection()
{
try
{
connect = new SqlConnection(ConnectionStr);
connect.Open();
}
// this is laziness, but it is better than before
catch (Exception e)
{
// best to log the real error somewhere
throw e;
}
return null;
}
@SankarRaj in the same file just above in another blocks
 
is SqlCommand IDisposable? Do you need to using it?
(not that it would change anything)
 
I think I need it , why? Is it not needed then? How could I do it otherwise @Squiggle
 
MSDN :
> You can reset the CommandText property and reuse the SqlCommand object. However, you must close the SqlDataReader before you can execute a new or previous command.
 
@Emre In that function you have to return the SQLConnection object i.e) connect. But I don't know why you are returning null?
 
that still doesn't explain why it's disposable
 
9:37 AM
@Emre doesn't matter there. Ignore me :)
but well done for using SQL parameters. You'd be surprised the number of code samples we see here where people use string concatenation.
 
@SankarRaj if i don't use the return null; it will give me an error saying not all code paths return a value. But how do I return the function then sankar? How should I do it then?
 
@Squiggle ah, Yeah I'm just a rookie at the moment with C#. And I really wanna fix this error it might fix my whole program and I can be done..
 
return connect; use this line instead of return null;
 
"mananged objects" hehe
 
9:39 AM
:)
 
I've done that @SankarRaj thanks! But I still got the error for the 'connection' value
 
eek. I think i have an actual job interview tomorrow.
 
@Emre leave the whole connection stuff out, and check my answere here:
0
A: Select and Insert From two Sql Tables.C#

ntohlHere is my approach: First In visual studio (2015) I have added a data source. Please take into account that different versions of visual studio have different ways to add data source. So in VS2015 click project add new data source database dataset configure Your connection to the db select ta...

use the VS's data source
and use the given adapter
 
I don't use textboxes tho I use dropdownlists. But what do you mean by leaving the whole connection stuff out? My whole program should be changed then..
 
9:44 AM
yes. But I find data source using easier
and You will have less errors like that
create a little test application to check out if it works for You
 
Okay I'll try that out then..
But for my project i must use connections like this though
its for a school project
And I can't use a quick & dirty way
 
Your teacher will be pleased with that solution
it's definetly not dirty
 
oh
Can you give me an example in my code how I should do it? A little example?
 
when You create Your own query, You have a query editor too, that is extra checking.
1 min
 
Can anyone humour me on why this fails? dotnetpad.net/ViewPaste/8emkB7gv8E-Zf1zV79qkKw#c13,c15,
...to compile
I am trying to iterate collection without regarding its type...
 
9:53 AM
https://dotnetpad.net/ViewPaste/4jyGB1tUa0mHcxSXeg_1iQ#c21,c23,c29,c31,c33,c35,c58,c74,c77,c88,

This is my whole form @ntohl
 
@deostroll you need a using System.Collections;
 
Oh. I just rem I didnt add that...
 
it's thinking you meant IEnumerable<T> which is in the System.Collections.Generic, not the IEnumerable from System.Collections.
 
@Emre hmm
You are already using some sort of adapter
docentTableAdapter2
 
yes
thats for my gridview
 
9:58 AM
Do You have an xsd?
 
yeah
DocentDataSet.xsd
 
double click on it
 
yes
 
right click on the leerling's header
add new query
 
yes
namespace projectStemmen {


public partial class docentDataSet2 {
partial class docentDataTable
{
}
}
}
the outcome is like this?
 
10:00 AM
no
it should be a graph
 
Hey gang, is there a way to change an element into another WPF quickly in one place, instead of editing the first tag, and then editing the closing tag?
 
ah okay
yeah
Now?
 
@Emre like in the beginning of this vid:
 
yeah
I pressed on query aswell
Or shouldn't I press on query?
 
so. Add new query. copy paste this: into Select disabled from leerling where leerlingnummer = @number
yes. You should
 
10:02 AM
Okay I've done that
 
and if You configure it correctly in the xsd there will be a new method
save the xsd, build the project
 
I still got the errors of the 'connection'
the thype or namespace name ...
 
ohh...
 
Error 2 The type or namespace name 'connection' could not be found (are you missing a using directive or an assembly reference?)
 
comment out all the error making stuff
 
10:03 AM
well
then rest of my code doesnt work aswell xD
this is so annoying lol
 
you don't need much of Your code
just the form1.load
 
do you still have the new before connection....?
:-/
 
yes I do @Squiggle
Because If i remove the new
 
don't do that
 
it says i should put it
 
10:05 AM
that's VS being confused
 
because hwen i submit (by pressing button) I get the error
 
@Emre just call this.leerlingTableAdapter.xy(favoriet); in the isDisabled()
(xy is the name of the new query)
You don't need createConnection at all
 
That doesn't work @ntohl
 
post the new code
 
So a really stupid UI question.. I have this really nice looking Bootstrap form to edit an invoice address. Now I want to display the data, as in, not the edit view. How the fuck do I make this looks reasonably good? A simple key/value table seems wrong with how the form was originally structured... :/
 
10:08 AM
I think I have it sort of working now @ntohl
But with my previous code
@ntohl I thank you tho! You've really tried to help me which I really do appreciate
I've got to go to school now
So I'm going offline cya ! And thanks again!
 
@RoelvanUden can the data be grouped into smaller tables?
 
@AlexL Not exactly. Let me show you.
 
for me Your isDisabled method is this:
private bool isDisabled(string favoriet)
{
return this.leerlingTableAdapter.ScalarQuery(favoriet)
}
 
@AlexL So a form like that looks reasonably good. But then to display it..
 
@RoelvanUden print it like it would appear on an envelope
 
10:14 AM
@Squiggle This
 
@Emre bye
 
show it in the format people would expect it to be printed?
 
It might work in this case, but what about other types of data? :p
 
@RoelvanUden depends on the data
 
10:14 AM
Do you need the labels? Or can you get away with showing the data?
 
the is vat varified thing could be a banner
 
alternatively you could just show it in the current layout with the inputs disabled
 
The labels are mostly mandatory.
The inputs disabled was a thought I had. But showing them with a white color is a bit.. misleading.
Suggestions on making it still look good while being clear "This is not editable"
 
Did you try the two-column layout "label | value"?
 
10:19 AM
The essential problem is what, as you mention it, you expect data in a certain way. The form is mostly tailored to that, but showing a label | value (key/value) table is going to look bad I think
 
Name      David
Number    55
Street    Street Lane, Citysville
not so much a table, just a two-column justified layout
I'm not so keen on your original layout. Sure, it uses all whitespace, but it's not so consistent.
Material design forms would solve that :P
 
Material design forms solve that? How? They just look ugly for me :P
 
with our bootstrap forms we don't use columns
because of this precise issue
 
You just put each field beneath each other?
 
yep
 
10:23 AM
Does that look okay? Can I get a screenshot? I'd imagine it would look pretty silly?
 
That way it's clearly responsive. We encourage people to scroll, but we can use multi-page wizards if the form gets too long.
nah it looks OK
one sec.
There's a confirmation screen later in the wizard which shows the information you selected here, but the inputs are now just <span>s.
that looks fine
 
looks clean and simple, I like.
 
@RoelvanUden what do you think?
also, custom validation messages can be shown beneath the inputs
having everything sandwiched together leaves no room for that
 
you could do something like this: jsfiddle.net/b3owLqu0/2
 
@Squiggle Looks pretty boring. Sorry :P
But I see the benefits.
 
10:34 AM
@RoelvanUden oh sorry, didn't realise you were making a game ;)
@AlexL eww no. Too many borders.
 
>_<
@AlexL Looks actually nice but too much scrolling I think, yeah.
 
nothing wrong with scrolling!
 
I don't like UI design >_<'
 
same
 
I don't mind it, but it's much easier when there's strategy and consistency.
Material design is wonderful because the entire ethos explains why you're doing things.
 
10:50 AM
Bootstrap is cool because it gives you shortcuts to craft nice-looking forms, but doesn't present any real guidance on how to apply them in the context of an app.
 
I'm currently experimenting with just embedding the entire form as display.
Change the styles a little bit and see what happens.
 
test
 
@MilesA. Fail
 
Hi guys !
 
@Squiggle Well back to coding for Miles, i hope it at least builds
 
10:57 AM
@bhuvin eyup :)
 
@Squiggle : thanks ! ! !
Guys : i hope this is question isnt forbidden here .. and i am not gonna be kicked out; but do you feel these days the Use of .NET is seeing a bit of downfall ?
 
@bhuvin I would say it's not something I've noticed
 
More of the Websites move to PHP for low costs ; or NodeJS.
Besides that Desktop development is itself into a down since most of the things are going towards Mobiles ..
so like i m just getting a bit anxious ..
 
desktop development in general is declining in favor of the web and mobile.
 
yeah , thats what ..
 
11:02 AM
C# and the .Net stack is still going strong
 
whats a technique to restart a thread?
 
Technically yes ..
 
Java is still plodding along. A lot of traditional PHP developers have moved to NodeJS.
but I'm not seeing a decline in .Net. I'm expecting to see it expand given their open-sourcing and multi-platform coreCLR.
 
Thread.Stop(), Thread.Start()
yes , @Squiggle : But i feel still it has a scope towards Mobile development ..
 
can someone find me documentation for this please ?
 
11:06 AM
i mean if Microsoft since these days is going towards Cross-Platform .. Mobile is what needs a boost ..
Xamarin etc does exist
 
..but doesn't work
:P
 
but still if in case Microsoft itself takes an initiative .. this would really helpo
 
@bhuvin most business want to make money, not save..
 
@JakobMillah : Not exactly ..
@Mathematics : Its a wave of Startups .. where in it is a Big range
@JakobMillah : I have seen apps do work .. though not very "Efficiently"
 
@bhuvin with Xamarin, for sure. And WPF if you're doing stuff for Windows mobile devices.
So much stuff is heading server-side. I'm OK with that, and C#/.Net is a great stack for making web apps.
 
11:11 AM
@Squiggle : true .. but Windows phones again [In India] isnt seeing too much of light , How is it out der ?
@Squiggle : thats the point: If its just thats what it is , then i guess other technologies must be learned
I am into this Limbo : What Next ?
 
@bhuvin Windows tablets are finally taking off. Mobile devices != mobile phones.
everything is converging :D
Like some sort of app-singularity
 
@Squiggle : Windows tabs in india is a bit more uncommon than Windows phones ..
so m sorry to surpass that .. :P
 
they're getting a lot of traction in business
less so for consumers
 
hmm .. So if lets say if i am supposed to learn a new Technology what should be it ? which can give me impetus in the Industry ?
@Squiggle : by the way where do you belong ?
 
@bhuvin Containers? (docker)
 
11:21 AM
@bhuvin I don't know where this convo is going or the point of it ? :S
 
@bhuvin C#/.NET is, I feel, a good choice if you want good tooling and compiler checks. PHP is quickly being overtaken by NodeJS, which is similar in its dynamic nature, but so much faster and more powerful. NodeJS with TypeScript borders into a realm of competitiveness for certain types of applications, but no other language out there today is competitive with our ORMs and integrate queries.
 
@bhuvin "where do I belong"? that's a bit of a deep question
 
@Squiggle very strong indeed
 
@Squiggle : simpler one : where do you stay right now ?
 
@bhuvin Switzerland.
 
11:25 AM
@Mathematics : the point is i feel i need to learn other technologies also , and hence asking the Fraternity that what should be Next thing to Learn which is also be highly valued ?
 
You never get more stupid by learning more. However, .NET is absolutely not a worthless skill to master. And you probably haven't mastered it yet, so there is more to learn.
 
@RoelvanUden : true ..
 
@bhuvin those I've heard that have tried to get xamarin working, have failed
I went pretty much straight for android studio and like it. Since it actually works
 
Cordova > Native for most applications, IMHO.
 
@RoelvanUden It's interesting that PHP - a popular but messy language full of legacy features and unexpected behavior - is being replaced by javascript, a popular but messy language full of legacy features and unexpected behavior.
2
 
11:29 AM
@bhuvin which tech you already know, and what you really want to be ? a developer, an architect, trainer, fortune teller, technologist, consultant ?
 
@AvnerShahar-Kashtan It's funny how that works. :-)
 
Though I suppose it's more straightforward when you have one single JS engine, rather than having to support different browser environments.
 
@JakobMillah : I have Mono based modules on my server .. and they are working well ..
with even 5k users now ..
 
Last thing I would like to discuss in C# room is php
it would be more interesting to discuss it in JS room though
http://chat.stackoverflow.com/rooms/17/javascript-spread-knowledge-abolish-ignorance
 
@Mathematics : I am just a beginner in .NET have about 5 years of experience in the same , but currently seeking fortune tellers in this room who can guide me through my way to Solution architect or similar sorts ..
 
11:36 AM
wait what
 
@AvnerShahar-Kashtan : :D Lol
 
@RoelvanUden have you worked with Cordova?
Got an interview tomorrow, and experience with that is the one thing I lack.
 
Wonder if there's any performance difference between cordova and native
 
@bhuvin what's the "in the same" ?
 
@JakobMillah I used an app built on it, back when it was still PhoneGap. The answer was "yes, there is, definitely".
Don't know how far it's come since.
 
11:42 AM
@bhuvin if you want to be a solution architect, get involved with big projects and learn how to deal well with people. It's mostly about being able to argue, drawing diagrams and knowing some proprietary system like Sharepoint pretty well.
better to be a senior software engineer or project lead, IMO. Much more varied and interesting work.
 
@bhuvin I agree with @Squiggle, mostly. The way to become a solution architect is to work on projects where there's a solution architect, pay attention to what they say and do, learn how it's done, start making suggestions regarding the solution's architecture when you feel they're relevant, and thus slowly move up to that role.
 
I wouldn't want to go for one of those roles though. Too much time spent in meetings, not enough time at the coal face.
 
@Squiggle That's a preference, though. One I share, but I know a lot of people who want to move out of purely technical roles at some point.
In most companies, certainly the larger ones, meetings are where things are decided. If you want to be a decision-maker, even a technical decision-maker, you need to be part of the decision-making class.
 
@Squiggle : funny part is that :currently i am interested into both ..
 
agreed
 
11:52 AM
So then what should be the next place to go ? if i have to Take tech on the upper hand
 
@bhuvin depends what opportunities are given to you. What size business are you in right now?
 
See currently m working into a Startup and working on a File sharing and Syncing application completely architected end - to - end by me
 
Hi
 
but bad part into a Start-up that I have less ppl to guide me what better could be done ...
 
Got the error in RDLC report back button functionalityu
Same thing is working in another page
Any body expert here for RDLC report???
 
11:57 AM
@Smit not a clue :D
 
@Squiggle I have worked with it quite a lot yes
It's absolutely genius and easy to build complex apps with, cross-platform
Just.. don't want a native look :P
 

« first day (1941 days earlier)      last day (3010 days later) »