« first day (1804 days earlier)      last day (3373 days later) » 

14:00
@RoelvanUden omg. it works. 3 fps. but works.so happy.
@Slashy grats ")
thanks haha
why im geting always object is in use exception
damn
when i assign the current bitmap(after applying diff) to the picturebox
and then loop it again to apply diff
im getting that error..@RoelvanUden
You're probably doing something wrong.
14:05
anyone ever used anything from these guys? subsystems.com
i can use this  PictureBox.Image=new Bitmap(curr);
i can create new bitmap, but it's tons of memory everytime..
You don't have to do check. Double check everything you do. Don't do silly things and it's usually very straight forward.
Morning large group of people.
it's 4pm
@StevenLiekens I would immediately write them off for not being able to read the sub-text in their logo...
also wow that is expensive D:
14:11
      public void retreive()
        {

           byte[]  firstvalues= decompress( ReceiveVarData(s));

           MemoryStream memory = new MemoryStream(firstvalues);
           BinaryReader br = new BinaryReader(memory);
                Bitmap first = new Bitmap(RgbToBitmap(br));
                pictureBox1.Image=  first;

                while (true)
                {
                    byte[] delta = ReceiveVarData(s);

                    MemoryStream mem = new MemoryStream(delta);
                    BinaryReader br2 = new BinaryReader(memory);
@RoelvanUden im getting some various like this
like object is already in use elsewhere, bits are already locked..
You're creating new bitmaps in DeltaProcessing?
their pricing model is ridiculous, but so is their anti piracy code
@Slashy Do you unlock? :P
like you can decompile one of their DLLs and reverse engineer their serial number checker
sure bro
     private unsafe Bitmap DeltaProcessing(Bitmap bmp, BinaryReader br,int length)
        {
          BitmapData  bmData = bmp.LockBits(new System.Drawing.Rectangle(0, 0, 1920,1080), System.Drawing.Imaging.ImageLockMode.ReadWrite,PixelFormat.Format32bppRgb);
          IntPtr scan0 = bmData.Scan0;

            for (int x=0;x<length/4;x++)
            {

                    byte* p = (byte*)((uint)(scan0) + br.ReadUInt32());

                    byte r = br.ReadByte();
                    byte g = br.ReadByte();
14:13
or just delete the copy protection logic and recompile
seriously though, don't ever buy from sub systems
they leak your details on the internet
@RoelvanUden
and their own details too by the way
ftp://www.subsysctl.com
u37854439:9a!Z9a!Zb
@Slashy Looks fine. May be a UI thing.
@RoelvanUden getting on this line
 BitmapData  bmData = bmp.LockBits(new System.Drawing.Rectangle(0, 0, 1920,1080), System.Drawing.Imaging.ImageLockMode.ReadWrite,PixelFormat.Format32bppRgb);
object is currently in use elsewhere
hi guys i am having problems updating an entry in my ef i'm using an generic repo
this si the update method. The message seem pretty clear
14:20
@MatthewFlynn how are you calling it?
Just found a 3.3k loc file in our codebase
the error is pastie.org/10441670
its injected into the controller using autofac
            _Service.Update(appointment);
hey guys, what do you think is the future of C#?
and do you think asp.net mvc framework will be around in the future?
@MatthewFlynn does appointment come from a view?
@MatthewFlynn The error message means there is a different reference to the same PK already in the object graph
14:23
@KalaJ yes
its on a webapi sorry
apicontroller
@KalaJ no, we will all die after 10 years in WWIII
@shoe yes I am trying to update an existing entry in the db :)
@tweray but C# will live on into the new world.
@KalaJ Until AI gets to the point where you just verbally tell the computer what you want the program to do.
14:24
@MatthewFlynn Check for a different reference to the same object in your code
@Hypersapien until that AI becomes intelligent enough to write more AIs with C#...
heres a debug of the entity
the put is just this
public async Task<IHttpActionResult> Put(Appointment appointment)
{
so essentially i'm setting the FK and not the obejcts so they get linked rather than inserted?
            _Service.Update(appointment);
which then calls the generic update method
i would have thought that the ID should need to exist if I am updating?
i.e. setting to modified?
I had this discussion with my coworker and he says there will be no .net mvc in the future. It will be replaced with something else
that, i believe it can happen
Everything gets replaced. Except COBOL.
Question is when. Soon? No.
14:31
@MatthewFlynn First of all you shouldn't allow that sort of breadth when updating an object
c# is still going to live a long live, but .net mvc is a different story. even it can preserve the name, it will become some different monster in no more than 4-5 years
@MatthewFlynn A better way to update is to get the object to update from the db and then copy what properties you want onto the existing object
@tweray It already is. Vnext is very different from mvc5
and mvc5 was radically different from mvc4
well, but yet it still preserve its basic server rendered html concept. the future belongs to client side mvvm, i guess
I highly doubt that
Unless we move back to webforms
webforms is best forms
14:38
No, he means web MVVM. SPAs are simpler though.
Think Angular or React, and yes, I agree that those are probably the best.
@Failsafe WinForms
@ton.yeung It's somewhat complicated by the fact that we have a system that basically performs a middleware function for a group of corporations
I still haven't managed to really explain to my boss the difference between a permission and a claim and role to my boss quite right yet
@juanvan mmm
Pink Floyd Wish you were here album is free on google play today
my understanding is that a claim on it's own is worth nothing unless the claim is attached to a trusted identity
14:44
@Wardy do you need to?
MVC4 > MVC5 is like from South Carolina to Iowa,
but client side MVVM is Essex
@TomW there is a LONG transcript from him and tom yesterday about it
@tweray use references from the north east
@Wardy isn't role itself a claim?
@tweray you can build a client side mvvm model using mvc as well. So why would we move away from mvc?
14:45
@TomW I guess not but somehow I have bestow the confidence in my boss that my implementation caters to all the situations
@Failsafe well, you know i'm talking about battleship do you?
@tweray Unless you're saying moving away from server side templating?
@user3550283 A role is definition, a statement ... "This person is a"
@tweray Now i do
haha
a claim is more "An identity has this attribute"
the two are quite distinct
14:46
A claim is a fact about a person or object. A role can be a type of claim i.e. "this user holds role x". A role may grant certain permissions against a resource.
@RoelvanUden by the way.. the loop is length is the array length /7 right?
no length/4 . because as we said 4 byte is uint
We all get it. Why doesn't @Wardy's boss?
@TomW The current system is confusing as hell to me ... it basically says "if i am in this role I am only in this role within the context of this organisation"
usually when I deal with roles it's a case of "I am in this role system wide"
@Wardy are other organisations modelled?
The org is our client
we have multiple orgs
for any org we can add users and grant them permission using roles
that's the current model
14:48
@Shoe well, in a background that network became more of a bottleneck than client computing power, and on the other hand server side have more tend to scale out than scale up, sending model to clients ask them to render seems to be much better solution
Hm. I can see how that might be awkward. I suppose claims are only valid with respect to the provider that endorses them
The logic behind that then says "does this role apply to this data" (does the user have this role for this org basically)
The claims provider for your users' roles are I guess the orgs' active directories
Using Identity I can say something like "The Issuer claims the identity has this role"
then I can determine the issuers set of data
@tweray Okay but you can do that in mvc. Why does mvc have to go away to accomplish that?
14:50
so the problem I have is that I have a Repository<T> where T is some object definition like Invoice, and the repository in question stores all invoices for the entire platform
@Slashy Uhm. It's the length of the frame. The entire frame.
and each org has its own rules about who can see what
where org has collection of companies and companies have users in roles
Generic repositories......
Your application designer must have had really hated his job
So when someone issues a "GetAll()" on a Repo<T> what are they actually asking?
"from my visible set of data ... get all"
The issue is determining that visible set
14:52
@Shoe i'm not saying mvc have to go away, i'm saying the current concept of rendering html on server side, while still an acceptable approach, is no longer the best option. so if mvc want to stick on the top of time, they have to break their basic concept, which, somehow means go away and somehow not
@user3550283 This is my architecture lol
I know brutal
@tweray They already are through web api
@Shoe and you know it's called webapi not mvc right?
but i'm using DI to inject the rules ... just need to figure out how I want the security mechanism to inject the rules
@tweray mvc6 merges them both
14:53
@RoelvanUden Not a fan of generic repos?
@Wardy Why not separating your clients in application and database level?
@Shoe and yet it's not mvc... sigh... let's think about this, i here create a bike and name it car, does it really make it a car?
@user3550283 They all need to share a common set of data but then have their own apps that extend the common core for their business processes
@Wardy I can go on a whole crusade against (generic) repositories again but honestly, I'm getting tired of educating people about inherit problems of them.
so I have stuff like ...
SomeClientTRepo : ISomeClientRepo<T> : ISecureRepo<T> : IRepo<T>
When it comes to the implementation it's often not generic at all
14:56
@Wardy you know role claims get added to the current principal, right?
the inheritence to allow route binding and such for the stack
all claims, actually
@TomW depends on the implementation, in identity you can actually get the principle and not touch the roles / claims at all
but I have told the boss, users with thousands of claims is not happening
I'm in this wierd situation where I have to allow users access to data that spans multiple companies
I think it's the first time I've seen this built in to a single platform in my career
@tweray Well, what is it that makes something a car?
usually users have access to a system that talks to other systems
14:58
@tweray It's microsofts product they can name it whatever they want. What if I told you Windows was not an actual set of Windows but an operating system
@Shoe lie ... that is a claim, where is your evidence
@KendallFrey ICarFactory ?
@KendallFrey common sense, if you have to ride it by your leg, and it has only 2 wheels, then it's not a car
guys, I'm looking at something in the code that is weird. someone for deleterecord() has a foreach within a foreach within a foreach with several foreach statements... umm
@Wardy In your case I would have made a common core module. then extend them separately. Having separate Mongo Database (or Sql Schema/Db) and MVC assembly for each of the clients.
You're going to lose sleep maintaining that xD.
15:02
how bad is that? Is there a better way to refactor all those foreachs?
@user3550283 that's exactly what I have
Then I have a single security API that handles users across the system where identities can be given claims in to any of the applications
@KalaJ I would say generally if you're going past 2 loops you're probably doing something wrong
It's needed because of the way the system works, when a company enters in to a trading relationship users from certain roles in 1 company are given access to the modules that are custom to another company
Row-level visibility in SQL server? :D
@Shoe if someday ppl create some command line os and name it windows, it still doesn't make it windows. it's just simple common sense. MVC clearly indicate some architect pattern that has clear definition, and if you no longer follow the pattern, then it's not it anymore. The reason it is still called mvc6 is that they still support that pattern as a major option of architect for that framework
15:04
yeh thats the problem
@TomW how do i attach row level permission to everything in a db
my thinking is loosely put ... claims based auth can do this
What's 'everything'?
@KalaJ
I would make that guy write some node.js just for the lols
@TomW for any given EF context I define I will generate an OData context that sits on top of that from which applications may consume the data
any user potentially has rights in any application
based on their claims and their collection of identities
so each company can specify the identities / claims that they want to trust
based on that users can move around
@KalaJ btw I don't know what's happening on your code but if you're using an ORM shouldn't you have Proper Delete Cascades for that?
isnt that basically like saying ...
Delete() -> DeleteChildren() -> DeleteChildren() -> DeleteChildren()
15:14
@Wardy yeah exactly my thoughts
what a strange way to do things
master detail database deletes are always 'tricky' regardless of the ORM, SQL Constraints, etc
@tweray Okay so the pattern might evolve or go away. Doesn't mean anything for asp.net
@Wardy @user3550283, I'll change some of the names and post a sample. I am generally curious on how to refactor this dude's code
There are a lot of bad pratices here
15:18
@Shoe did i ever said asp.net is going away?
but I'm trying to learn the better ones
@Shoe i only say asp.net mvc have to either become something different or go away
@Wardy you can do row level with silo keys (partitions). Couple different options in EF
@CharlieBrown ? .. sounds interesting?
re: "how do i attach row level permission to everything in a db"
15:20
i'm open to suggestions
Right now this is very much in the prototyping stages but time is a bit tight
Dont do db permissions for your app security if that's what you're thinking on doing
@tweray Yet students still ask me if I know Spring MVC...
@Wardy if it's prototype stage, the easiest way is to re-architect and make sure you don't need row level access control, at least not among the whole database
Anyone good with kendo ui
It's an extremely unlikely case that I need to say "this user has some right on this row", usually the situation will be something like "from this set I need a base subset that the user has rights to, from that I will execute the query the user asked"
@Obviously i'm using it with my OData stuff ... pretty cool
@ton.yeung yeah
15:23
@Wardy simplest is you can save userid's to each row, or save groupids to each row... then filter the incoming queries. More difficult, but more flexible is access tables with composite (Table_PK, Group_PK) and filter on that
@CharlieBrown for that to work each db row would have a collection of user ids for each table
@user3550283 well, students usually cares more about how to match job requirement, you don't expect them to direct the future of openweb do you?
massive join table
ouch
So when using kendo grid, you can specify your column as
columns.ForeignKey(r => r.SomeKey, SomeObject.GetSomeCollection(), "Value", "Text").Title("Some Key Bruhhh");
var query = dbContent.SomeQueryThatIJustMadeUp().ApplyAuthorizationFilters();
15:24
@CharlieBrown that's my current train of thought
so what is the purpose of SomeObject.GetSomeCollection() in this lambda
where ApplyAuthFilters() is some injected rule set based on User and T
@tweray you got a point xD
@ton.yeung See anything obvious to improve (going for speed on this one) gist.github.com/carbonrobot/e2a9fadc31e1543cbf36
@Obviously its a foreign key to a property in the items in that collection
15:26
oh so we are specifying the name of the collection
to which it is foreign key?
but why?
@Obviously you are specifying the property on an item in the given collection to which the key represents as i understand it
basically creating a relationship to another grid
so hangry
@CharlieBrown Drop the foreach function, use a loop. Don't do lastIndexOf twice, save it in a result (my bad, it's different). Don't invoke search if k is null (move the check where it belongs).
huuuuge lists
@RoelvanUden i want to drop the foreach, but its lodash, so it works differently. not sure how to replace it
@ton.yeung good question... node
@CharlieBrown My boss actually planning to put 100 million rows in a single SQL table
wtf is that about?
15:30
Why not?
with unique permissions per user?
yeh ... fun
@RoelvanUden its iterating on a group with the following format...
[{
    "cap": [
            ///items
     ]
}]
_.forEach(groups,  function(group, key){ ... key is "cap" }
perf is giving 260kop/s right now, up from 140kop/s when I was using regex to do this
yikes, baseline on my machine (noop()) is 2,000kop/s
Here is the method I know needs some kind of refactoring: pastebin.com/5MUipKND
I cut it down though
The ToLists() everywhere are not a good sign
This is what code looks like when a developer does not know how to use Linq
I don't even know where to begin, it just looks wrong
15:41
If you set cascade up, all this happens automatically
I was working on another feature, I saw this and I am tempted to refactor it for them but wow
cascade up?
"Cascade" is a mechanism in ORM's (and EF) where deleting a parent will delete all children
ah okay
how can I set up a cascade for something like this?
Are you using fluent configuration, or attribute configuration?
I don't even know what that means
:S
15:44
I cry
lol
I'm still jr...
what horrible company do you work at that let's you work on code your not trained for?
but I'd like to learn
Do you havre protected override void OnModelCreating(DbModelBuilder modelBuilder) in your DbContext class?
yes
15:47
Are you doing model configuration in there?
yes
this is going to sound horrible but I looked this up: programmers.stackexchange.com/questions/159007/…
and it seems like we are doing both???
both is not uncommon.
we have classes/models with data annotations
and fluent models
ah ok
I use the basic dataannotations as attributes because other things like MVC recognize them. but I put most of my EF-specific stuff in modelconfiguration
Sometimes.... I wish my boss had more knowledge according coding...
15:48
yes that is what we're doing too.
Setting [Required] on a parent property enables cascade delete when the parent dies
ah hmm
@KalaJ wow ... i mean ... just ... wow!
lol
what's wow... wardy?
Charlie Brown
Are you using fluent configuration, or attribute configuration?

Kala J
I don't even know what that means :S

Charlie Brown
I cry
------------------------------
Lol!
15:51
aww okay :( I apologize
Thanks for the explanation though! eks
@KalaJ that is one impressive abuse of C# there
lol
yeah... I thought so and I want to know what's the best way to refactor it. I just saw it and got me thinking
Is there a method in there which is like Delete(db) that uses about half a MB of code to crawl through everything
lol
I wonder who wrote it, might have to check version control
@KalaJ Sadly Pastebin has blocked access from my country and my proxy is not responding, but I bookmarked it to check later.
15:53
@CharlieBrown it strongly depends on the company in which grade the coders are ok going for own research.
@KalaJ here's my version ...
public virtual void Delete(T entity)
{
    T itemToDelete = _context.Set<T>().Find(entity.GetId());

    if (itemToDelete != null)
    {
        _context.Set<T>().Remove(itemToDelete);

        if (_autoSave)
            _context.SaveChanges();
    }
}
I also have an async version of that
I have no issue with developers learning on their own or getting official training... my issue is with letting untrained developers learn on production code.
yeh thats bad practice
I for myself got employeed in a company without any IT-section. I was the first one that startet coding in here. Now we are 3.
I was a newbie for sure.
But they had the money to pay for my try-outs.
As long as no professional checks the code-design everything is good :D :D.
@Wardy where T : ISomething and ISomething implements GetId()?
15:55
I'm new too, what i should do to make good money?
@ton.yeung Whats the point of output cache if you're just turning it off
@CharlieBrown IRepository<T> where T : class
@Harish very broad question isnt it?
T itemToDelete = _context.Set<T>().Find(entity.GetId());
Learning learning learning learning. Then applying for jobs and hoping to get in.
15:57
T has no method "GetId"
!s/learning/building
@C4ud3x i make it small, i dont have any IT exp. and i want to be a good developer without any IT degrees.
is it possible for me?
@CharlieBrown yes it does ;)
GetId is an extension method I created
on class?
Since I know that my repo expects a context from which it will be pulling a set and EF requires something with a primary key I know that T has a primary key property
GetId recovers that primary key value
@Wardy, thanks for the solution attempt. I'll take a look and maybe test it
15:59
also, not to nitpick too much, but generally IRepository<T> is a code smell/anti-pattern
@KalaJ Entity Framework model builder has a WillCascadeOnDelete method when defining the relationships. after using it from bottom to top, deleting the top parent would delete all the children.
especially if your using EF under the covers
@CharlieBrown this is my base implementation
@CharlieBrown, that's the qualm I have right now. No money for training
*Actually no money and no time

« first day (1804 days earlier)      last day (3373 days later) »