« first day (1472 days earlier)      last day (3493 days later) » 

3:00 PM
depends on the definitions of "reach" and "client"
code outside of WCF never sees a response
internal WCF code gets the response, and fails
 
so the response gets sent from the server, and it gets to the client, but once it reaches the client, it doesn't get processed?
 
right
 
with that 413 error?
 
no, the 413 is when the client's message is too large
when the response is too large for the client, it times out
usually the response is bigger than the request, so the timeout is the more frequent problem
 
what type of client? desktop, laptop, thin client, terminal, embedded,...?
 
3:02 PM
desktop
right now I'm running both on localhost, in the same process even
 
@NateKerkhofs Why do I need json serializer when I am not reading, writing or creating json?
 
@Marek That's because you ARE reading json. That string you get is JSON, and you need to convert that to an object
you can't just read JSON using c#, you need to turn it into something that C# can understand
well, technically, you can read JSON, but it's FAR easier to first convert it
@KendallFrey have you tried debugging the client WCF to see what happens when it receives the response? my instinct is that it gets trapped in a loop
 
it throws an exception, I know that much
I don't know what happens afterward
I don't think I can step into .NET code
wait, I thought it threw an exception
 
@NateKerkhofs I tried this, what is wrong with it please?
                var json_serializer = new JsonSerializer();
                Subscriber routes_list = json_serializer.Deserialize<Subscriber>(hodnota);
 
oh wait, I might not have first chancers on
@Marek Does it work?
 
3:15 PM
@KendallFrey Nope, cannot convert from 'string' to 'Newtonsoft.Json.JsonReader'
 
well, that's why
very simple compile error
 
@Marek Here, take a look at my question. stackoverflow.com/questions/26431948/…
@Marek My answer, sorry.
 
I have class and everything.
 
@Marek Well, the code I posted works.
 
I just cant figure out how to do the serialize thing.
What are the two lines I am missing?
I have input in string format and nothing more. Just want to get that one value :/
 
3:19 PM
@Marek How do you think it should?
        List<SendCreditInformation> responseObject = new List<SendCreditInformation>();
        responseObject.Add(new SendCreditInformation() { Total = total.ToString(@"#,##0.00"), Tax = manual.ToString(@"#,##0.00") });
        string response = serializer.Serialize(responseObject);
 
@NateKerkhofs looks like it's trapped in a wait handle
 
I honestly feel like an idiot now :/
@Greg total.ToString(@"#,##0.00") where does the total come from please?
How is that possible that
  foreach (var customer in jo["_embedded"]["ngcp:customers"])
            {

                string contactIDElement = customer["contact_id"].ToString();
                string externalIDElement = customer["external_id"].ToString();
 
@KendallFrey so, what caused it?
 
this just worked in previous case??
 
@Marek those are variables I'm contoring, the Total and Tax are the two class properties I'm serializing to send back.
 
3:28 PM
In my case is it similar to contactIDElement? Or where thsi Total come form. @Greg
 
@NateKerkhofs idk, I can't see anything but the call stack
 
@KendallFrey What does the wait handle do?
 
um, waits?
times out?
 
And what does it wait for?
 
I would assume the response
 
3:34 PM
I'm cleaning up here at work, and I'm not that experience with WCF, so good luck
sorry I can't help that much
 
thanks for your help
 
@NateKerkhofs Can you please write those 3 lines of code for me? I am really stuck on that. You would make my day.
 
Sorry, I'm going home right now
maybe in an hour or so
 
@NateKerkhofs thanks for your kindness. I will try to solve that myself. Stuck on these 3 lines for almost 4hrs.
I just cannot solve how to retrieve username and id of this JSON jsoneditoronline.org/?id=de9664b2d4840ac4d5a57d8cf80c753f
 
@Marek I just told you, it comes from a Class property that I'm sending back.
public class SendCreditInformation
{
    public string Total { get; set; }
    public string Tax { get; set; }
}
Up above, I do:
        List<SendCreditInformation> responseObject = new List<SendCreditInformation>();
        responseObject.Add(new SendCreditInformation() { Total = total.ToString(@"#,##0.00"), Tax = manual.ToString(@"#,##0.00") });
        string response = serializer.Serialize(responseObject);
@Marek It is incredibly basic.
 
3:42 PM
I know where Total and Tax come from but what about total and manual? Sorry. @Greg
 
@Marek Those are variables, I'm calculating those within my foreach loop with the data sent from the client before I send back. My usage was to auto calculate total and tax.
 
@Greg do you have a minute please? I would like to ask about this: jsoneditoronline.org/?id=de9664b2d4840ac4d5a57d8cf80c753f that is what I retrieve.
I have it in this object:
var job = JObject.Parse(subscribers);
 
What is a subscriber?
 
subscribers is the returned string from API call
Its the JSON string itself
What would be the next step?
 
Okay, a raw string. Got it-
 
3:47 PM
I created this:
     List<Subscriber> subs = new List<Subscriber>();
  public class Subscriber
        {

            public string id { get; set; }
            public string status { get; set; }
            public string username { get; set; }

        }
 
@Marek if you spent as much time thinking and reading the documentation as you do begging other people to write your code for you, you'd probably have it solved already
3
 
@Marek You should my answer on that question. I post the data I'm sending to the server from Client, then I manipulate it and show that List being manipulated through a foreach. I just posted the serializer back to client.
 
@TomW I am just trying to understand what do I need to do here.
You have this:
JavaScriptSerializer serializer = new JavaScriptSerializer();
List<Address> deserialize = serializer.Deserialize<List<Address>>(address);
 
@Marek I believe @TomW will agree. The task your attempting is quite simple, well documented and done thousands of times. I've provided the means to solve, if you understand basic code.

The reality is, code posted to the server for deserializing isn't different than a parameter. It is simply the vessel and separated with a Comma. Like a Comma Separated Value file. In fact, the deserializer separates the values to your Properties for you. So you don't really need to parse anything.
 
                var serializer = new JsonSerializer();
                List<Subscriber> deserialize = serializer.Deserialize<List<Subscriber>>();
 
3:52 PM
@TomW What do you think of my answer.
 
Yikes...
I was going to ask a question but I'm having second thoughts now :/
 
@user658493 He has been asking the same question for four hours.
 
wow... now even I'm not that bad
 
May I just know what is wrong with this?
var job = JObject.Parse(subscribers);

foreach (var subscriber in job["_embedded"])
{
var serializer = new JsonSerializer();
List<Subscriber> deserialize = serializer.Deserialize<List<Subscriber>>(subscriber);
 
@user658493 Hm? You mean Marek? He's been here begging people to write his code for ages. People get annoyed at that eventually, truth be told, I'd think it'd be sooner (I have him ignored for a week now)
 
3:54 PM
haha... kinda reminds me of last time we spoke Roel
I think I was bugging you
but this time I'll do my best not to...
 
You probably didn't. I'd remember. I don't remember userxxxx names that are not annoying though. You might want to pick an actual name/avatar :-P
 
yeah... do I do that by signing in?
 
@user658493 That is because @RoelvanUden is incredibly helpful and knows his code.
 
@user658493 You are signed in. Just go onto SO and pick a user name, then relog here. :-)
 
okay so I have an entity framework issue regarding POCOs... my POCO model classes have integer ID's
ahh okay
I'll be back
 
3:58 PM
Uh oh, Plain Old C# Object. Chat is about to get crazy!
 
testing...
ah name not changed yet.
I'll log out and back in again
 
*CLR
 
testing...
ugh!
 
wait a day
 
yea CLR object not c#
ah okay.. from now on I will be known as
Ninja_Noob
right... so my question on Pocos...
I have an entity framework issue regarding POCOs... my POCO model classes have integer ID's. Um.. How do I get EF to auto increment these so that I don't have to specify them when saving a model to the DB?
 
4:02 PM
@KendallFrey Ah, damn you. Forgot about that-
 
@user658493 you do know that GUIDs are awesome, right?
 
should I be using GUIDS?
does that really offer an advantage?
 
@user658493 More randomized, so less chance of repeating value.
 
but an incrementing integer
 
@user658493 Don't use GUIDs as your PK though.
 
4:03 PM
okay.. so here's the thing
my ID's are the primary keys... they have the [key] attribute
 
Are you using code-first or model-first approach?
 
database first actually... I'm not sure if I should use POCO's with DB first...
 
Okay, so you have an EDMX filled with classes pulled from the DB, correct?
 
I deleted the generated classes
I also removed the custom tool (class generator)
 
So.. what do you use now?
 
4:07 PM
well I'm not sure if this is correct but I have a DLL which contains my model classes.
I am using those instead
 
But where did those model classes come from?
 
I mean I'm not sure if it's the correct way to do it..
well I took the generated classes
copied the code out of them and then put them into the models to make sure that I had all the correct fields etc
then I deleted the generated classes from the EDMX
then I removed the custom tool in the properties
 
Confused Why would you do that?
 
well what I'm trying to do is only use the models
so that I don't have to have a layer that will copy the info from my models
and put them into identical entity models
from your response I guess I shouldn't be doing that?
:/
 
If your database is leading, it makes little sense to create copies of database tables once only then to continue to disconnect the link, and then attempt to magically map them using some kind of EF magic tool that you now have to conjure up.
Just keep the EDMX around in your Models project and use a POCO generator.
You'll get all the EF love and your beloved POCOs without doing squat.
 
4:11 PM
ah yes... that's the other thing.. .
I looked at a tutorial on how to generate poco's it said you go into New Item>
but I couldn't see the poco generator anywhere...
even when I looked online
there was only one for EF4
 
right click on the EDMX designer --> add code generation item
there will be a POCO generator
 
Oops no that's what I meant sorry @pe
@PeterKiss
I did what you said and there is no poco generator in the list
just DBContext generators
 
but i will go with the original solution: wipe out the edmx or generate all poco classes in a complete different temporary project and copy all the classes from it into the actual solution
 
but I can't generate poco classes
there's no generator there
and if I look online I can only see one for EF4
 
How is " "domain_id": 3," called in json object please?
 
4:16 PM
@user658493 the DbContext generator will produce the POCO classes
 
That is json parameter?
 
AH @PeterKiss thank you! I will try that now
 
@user658493 after adding the DbContext generator check the solution's file via windows explorer
 
I can see under models.tt
the models are there
now can I move those models
into a separate DLL
away from the EF project?
I'm trying to separate concerns here
 
the way i do:
generate the classes in a tempory project
 
4:19 PM
@user658493 Why don't you make it functional first, then separate concerns? :-P
 
move the POCO-s into the real solution under the SOLUTIONNAME.Models project, even put them into folders (folder names based on the database schema names)
then put the generated DbContext into SOLUTIONNAME.DataAccess project
 
okay...
 
after this wipe out the temporary stuff not needed anymore
 
@Peter thank you I will try that now
@PeterKiss
 
If anyone is interested:
This is what works:
                var job = JObject.Parse(subscribers);

                foreach (var subscriber in job)
                {

                    var s = subscriber;
                    JObject t = JObject.Parse(s.Value.ToString());
                    string name = (string)t["ngcp:subscribers"]["username"];
                }
Thanks everyone for help @Greg, @NateKerkhofs @KendallFrey
 
5:26 PM
morning all
 
5:37 PM
wow, got an email asking me to help with a SO question I answered
Hello Cody,
I am facing an issue in fetching the group info of contacts in Android. I have seen some of your answers on stack overflow. It will be great if you can answer my question on Stack Overflow. Here is the link of the question:
http://stackoverflow.com/questions/26402340/how-to-get-the-group-of-android-contacts

I will be grateful to you for this help.

Thanks a lot.
 
I get those sometimes
 
user862319
a new subreddit was born today
 
I responded... since he did put a bit of effort into the question and emailing me
I unfortunately don't know the answer off the top of my head, I haven't worked on that for 3 years. I would take a look at the docs and maybe try simplifying your question. That's what I usually do :)
 
user862319
that stuff is next-level hilarious
 
5:41 PM
I'll take a look at it when I get home @Bob - I like new subreddits. I remember when ELI5 started :P
 
user862319
lmfao @ psytrance washing machine.
 
user862319
kudos to the engineers who designed that thing
 
user862319
 
all right, I'm bribing you guys now :P
0
Q: How do I use an overridden property value in a higher class?

Pheonixblade9I'm using IoC to define some behavior in my inherited class. I have a property protected virtual bool UsesThing{get{return true;}} in my top-level class. In my inherited class I have protected override bool UsesThing{get{return false;}} I'm using the property in my top level class, and it...

 
Can someone offer some advice; I've started learning this course over the last couple of days and I'm about 60% through: microsoftvirtualacademy.com/training-courses/…
The reason being that I want to be able to use Xamarin and I had no knowledge of C#, this course is however entirely Console based
 
5:51 PM
@James console is a good way to learn the absolute basics. The core code you learn there will be applicable everywhere.
 
How transferrable will what I learn be to using Xamarin for app development?
@Pheonixblade9 Thanks, good to know. The course itself is very good (for an absolute beginner, at least) just want to make sure I'm going about it the right way.
 
Yeah. It's tough to imagine just how complex and big the world of software engineering is, even if you just limit yourself to C#
 
user862319
@Pheonixblade9 Can't you just refer to base.UsesThing?
 

« first day (1472 days earlier)      last day (3493 days later) »