« first day (2244 days earlier)      last day (2706 days later) » 

11:00 PM
Can I get an object in a specific position in ArrayList?
or maybe I am not right using ArrayList?
In java I use ArrayList, and here, in C# I don't know if it is the same
 
@QuicoLlinaresLlorens - Use List
@QuicoLlinaresLlorens - Are you familiar with generics?
 
Ok, thanks
no
 
Do you know what a type is?
 
yes
It is like a superclass for objects?
 
can you give me a simple example of a type named test?
 
11:05 PM
what?
 
in c#, an example of a type, in code
or I can do it if you prefer, sometimes simple questions seem to easy
okay, so we have our simple type:
public class test{}
 
you mean
int
char..
?
 
yeah, that works too
Okay, so with List, you need a type (unless you use type of object which just lets everything in)
So for ints your lists type would be int, that is represented as List<int>
The <> argument, typically represented with a T as <T> is the generic argument
So when you see documentation about List, it will mention List<T> which is just to say that T is either int, or char, or test (our simple example type), and that is the only type you can hold in the List.
 
:)
 
11:09 PM
It is override the operator []?
in order to get an object with its position?
 
You can use .ElementAt(0) or [0] on a list to get the 0th item, or n to get the nth item (assuming it is in bounds)
Do you have an IDE open?
 
@TravisJ I'm using Azure Redis Cache
 
@TravisJ Yes I have VS
I think I can do it don't worry
 
Okay
Here is an easy example:
List<int> hundred = Enumerable.Range(0,100).ToList();
int twenty = hundred[20];//20
@jth41 - Sounds complex
 
yeah it is. Looking for some advice on working complex Object Models into a cache
how granular to make the entries
 
11:14 PM
Yeah, that is a good point. I have been considering doing something similar as well
 
and the correct way to handle 1-many and many-many relationships
 
If you just flat serialize them then you have to deserialize to inspect and could have a lot of duplication
 
exactly
 
handling relations in the cache you mean, right? I assume you have their structure already in place in the database
I would assume best practice dictate granularity.
 
so I have some Web Api routes that I'm trying to incorporate caching into. like getJobsBelongingToUser
 
11:16 PM
@jth41 - I had actually considered just making a very simple wrapper for my database context that would also persist data to the cache.
And that would allow the cache to share the same relational (4nf) structure as the db
 
hmm thats an interesting idea
lets you not think about it when writing your logic
 
Yeah, it just abstracts it somewhere for you
I think it would run very nice, but it would take some decent amount of time to develop
 
in the example getJobsBelongingToUser you would have to query every job in the cache correct? looking for one with the same user Id
 
I believe so, yes
The way stack exchange does it is by caching execution plans
 
I guess I could implement and just see exactly how slow or fast that is
please tell me more about that, I've not heard of those
 
11:20 PM
They cache the result of the SQL query that the call getJobs generated, and then if another exact execution plan comes along they feed it the previous results
Given it fits their cache window
 
and they just assume it hasnt changed
because its in the cache window
?
 
They accept that the changes should not be significant I think, but what I am unsure about is when the update gets populated
@jth41 - I analyzed it once, you can see the writeup here: meta.stackexchange.com/a/224165/178816
It is related to the view counter, but it involves some caching
 
System.NullReferenceException

Sonda cn = new Sonda();
            cn.Url = "http://" + textBox1.Text + "/Parking/services/Sonda?wsdl";
            lista_conexiones.Add(cn);
 
Interesting. I'm gonna go study some more
 
Why Do I get that Exception?
I forgot creating in the constructor of the class the list
sorry
 
11:33 PM
@jth41 - Let me know what you decide, I am curios too :D
@jth41 - I don't have to be in here for it, just ping me using @TravisJ and I will get it
 
hi
 
o/
 
I thought this room would be so busy
 
It has its moments
 
Jarvis, I am stuck in one programming problem in my web application. I went to the ASP.NET room but there wasn't anyone there!
Sorry I've mistaken your name! :/
 
11:45 PM
Jarvis has a nice ring to it lol
I am a Marvel fan
 
hehehehe sorry. I am so confused this is why I can't focus O.O"
 
Looks to me like your database was setup to not have that field be null, and then you tried to change it in the model, but then the database column was already set to be not null and would require a manual change in order to have that happen. </conjecture>
 
Can I ask an ASP.net question here?
 

« first day (2244 days earlier)      last day (2706 days later) »