Register a SA Forums Account here!
JOINING THE SA FORUMS WILL REMOVE THIS BIG AD, THE ANNOYING UNDERLINED ADS, AND STUPID INTERSTITIAL ADS!!!

You can: log in, read the tech support FAQ, or request your lost password. This dumb message (and those ads) will appear on every screen until you register! Get rid of this crap by registering your own SA Forums Account and joining roughly 150,000 Goons, for the one-time price of $9.95! We charge money because it costs us money per month for bills, and since we don't believe in showing ads to our users, we try to make the money back through forum registrations.
 
  • Locked thread
coffeetable
Feb 5, 2006

TELL ME AGAIN HOW GREAT BRITAIN WOULD BE IF IT WAS RULED BY THE MERCILESS JACKBOOT OF PRINCE CHARLES

YES I DO TALK TO PLANTS ACTUALLY
is there any bit of open source scientific/heavily mathematical software that's considered particularly well written? trying to work out how to best structure a set of difference equations for modularity + clarity

Adbot
ADBOT LOVES YOU

JewKiller 3000
Nov 28, 2006

by Lowtax
fftw

Chilled Milk
Jun 22, 2003

No one here is alone,
satellites in every home
html programming

fritz
Jul 26, 2003

coffeetable posted:

is there any bit of open source scientific/heavily mathematical software that's considered particularly well written? trying to work out how to best structure a set of difference equations for modularity + clarity

find some lovely stuff (it'll be easy) and don't do what they do

Fuck them
Jan 21, 2011

and their bullshit
:yotj:
I wish to hide out from the bad programmers.

DONT THREAD ON ME
Oct 1, 2002

by Nyc_Tattoo
Floss Finder

2banks1swap.avi posted:

I wish to hide out from the bad programmers.

you'll need to remove all the mirrors from your house

compuserved
Mar 20, 2006

Nap Ghost

Cocoa Crispies
Jul 20, 2001

Vehicular Manslaughter!

Pillbug

USSMICHELLEBACHMAN posted:

you'll need to remove all the mirrors from your house

no, then you'd end up with a ullillillia infestation

Morkai
May 2, 2004

aaag babbys
we need a new thread for solid middling tier programmers whos heads explode in the pro thread and dont find anything helpful in this thread :smith:

DONT THREAD ON ME
Oct 1, 2002

by Nyc_Tattoo
Floss Finder

Morkai posted:

we need a new thread for solid middling tier programmers whos heads explode in the pro thread and dont find anything helpful in this thread :smith:

that's acttually this thred

Pollyanna
Mar 5, 2005

Milk's on them.


i know functional programming and oop and web development and how to make a game in python and hire me :downs:

Morkai
May 2, 2004

aaag babbys

USSMICHELLEBACHMAN posted:

that's acttually this thred

oh

coffeetable
Feb 5, 2006

TELL ME AGAIN HOW GREAT BRITAIN WOULD BE IF IT WAS RULED BY THE MERCILESS JACKBOOT OF PRINCE CHARLES

YES I DO TALK TO PLANTS ACTUALLY

oh this is cool

ty

coffeetable
Feb 5, 2006

TELL ME AGAIN HOW GREAT BRITAIN WOULD BE IF IT WAS RULED BY THE MERCILESS JACKBOOT OF PRINCE CHARLES

YES I DO TALK TO PLANTS ACTUALLY

Morkai posted:

we need a new thread for solid middling tier programmers whos heads explode in the pro thread and dont find anything helpful in this thread :smith:

ask some solid middlin tier questions

no reason this thread has to be just me askin what a for loop is

Dr Monkeysee
Oct 11, 2002

just a fox like a hundred thousand others
Nap Ghost

Dirk Pitt posted:

I honestly had no clue that .net's existence was under threat. Why in the world would microsoft even entertain killing an objectively good thing?

windiv is full of maladjusted kernel jockies who think the pain of unmanaged code means it's working

Morkai
May 2, 2004

aaag babbys

coffeetable posted:

ask some solid middlin tier questions

i do most of my work in asp.net mvc, with ef doing code first. i have a unit of work per application/plug-in that wrangles a dozen or two repositories. ive genericized the repository to do only basic crud operations on any entity type and it works really well. the issue i run into is this effectively kills lazy loading, and every related entity to be pulled has to be spelled out verbosely in the initial request, which isnt terrible. what i worry about though is filtering the related entities on the application server vs sql server.

i do this:
code:

var thingWithRelated = UoW.Things.Get(t = t.Id == id, include: "OtherThing1,OtherThing2").Single();

so to do more dumb things with the associated objects:
code:

foreach (var otherThing in thingWithRelated.OtherThing1.Where(o = !o.Hidden)
{
  Butt.Fart(otherThing);
}

which doesnt seem horrible for a handfull of objects, but i may be doing something like loading 5000 associated objects to display only 4000 of them. obviously this wont scale well.

how can i work associated field filters down into the initial query?

this is my repo:
code:

 public class GenericRepository<TEntity> : IGenericRepository<TEntity> where TEntity : class
  {
    internal DbContext Context;
    internal DbSet<TEntity> EntitySet;

    public GenericRepository(DbContext context)
    {
      Context = context;
      EntitySet = Context.Set<TEntity>();
    }

    public virtual IEnumerable<TEntity> Get(
      Expression<Func<TEntity, bool>> filter = null,
      Func<IQueryable<TEntity>, IOrderedQueryable<TEntity>> orderBy = null,
      string includeProperties = "")
    {
      IQueryable<TEntity> query = EntitySet;

      if (filter != null)
      {
        query = query.Where(filter);
      }

      query = includeProperties.Split(new[] {','}, StringSplitOptions.RemoveEmptyEntries).Aggregate(query, (current, includeProperty) => current.Include(includeProperty));

      return orderBy != null ? orderBy(query).ToList() : query.ToList();
    }

    public virtual TEntity GetById(object id)
    {
      return EntitySet.Find(id);
    }

    public virtual void Insert(TEntity entityToInsert)
    {
      EntitySet.Add(entityToInsert);
    }

    public virtual void Delete(object id)
    {
      var entityToDelete = EntitySet.Find(id);
      Delete(entityToDelete);
    }

    public virtual void Delete(TEntity entityToDelete)
    {
      if (Context.Entry(entityToDelete).State == EntityState.Detached)
      {
        EntitySet.Attach(entityToDelete);
      }
      EntitySet.Remove(entityToDelete);
    }

    public virtual void Update(TEntity entityToUpdate)
    {
      EntitySet.Attach(entityToUpdate);
      Context.Entry(entityToUpdate).State = EntityState.Modified;
    }
  }

how hosed am i?

Stringent
Dec 22, 2004


image text goes here

isn't this what CoC is for?

Morkai
May 2, 2004

aaag babbys

Stringent posted:

isn't this what CoC is for?

idk man, can you explain how im deviating from that in a not good way?

AWWNAW
Dec 30, 2008

Morkai posted:

how hosed am i?

partially hosed: not so badly hosed because you've taken the time to care about performance, but kinda hosed because you're using EF and caring about performance

https://entityframework.codeplex.com/workitem/1286

http://msdn.microsoft.com/en-us/data/jj691402.aspx

AWWNAW
Dec 30, 2008

or comedy option you could split the repository calls into one per entity type, using e => listOfKeys.Contains(e.Key) as a crackhead join

Shaggar
Apr 26, 2006
i tried using entity framework but i didn't like it.

power botton
Nov 2, 2011

its called doing actual schema design and real t-sql.

A BLOO HOO HOO MY lovely ORM IS SLOW SQL WONT SCALE TIME FOR MONGO DB

AWWNAW
Dec 30, 2008

it makes prototyping real quick n easy but tends to fall on its face shortly after

we use it p much exclusively at work and even though its fisher price rubber corners to work with there ar ea llot of people who still can't get it so i dunno what else we could use that'd be any easier for them

Shaggar
Apr 26, 2006
i may try to use the EF function binder thingy cause 99.9% of the time i use stored procs.

Zlodo
Nov 25, 2006
more like mong db

AWWNAW
Dec 30, 2008

oh and one thing i wish i'd done from the start with EF was disable lazy loading

save yourself the trouble of having to go back and figure out where you abused it

Morkai
May 2, 2004

aaag babbys

Shaggar posted:

i tried using entity framework but i didn't like it.

:smith:

git clone trooper posted:

its called doing actual schema design and real t-sql.

yeah this is what i moved away from
because as much as i like to think about performance and try to word towards it at the end of the day im not working with petascale data and daddy's got deadlines


AWWNAW posted:

it makes prototyping real quick n easy but tends to fall on its face shortly after

we use it p much exclusively at work and even though its fisher price rubber corners to work with there ar ea llot of people who still can't get it so i dunno what else we could use that'd be any easier for them

at oldjob i literally put prototypes into production because boss cared more about "meeting the needs of the faculty" (meaning higher volume of projects) and didnt give two shits about correctness of code or optimizations.

i want to do better with the tools i have not go back to the "best" tool if it slows ME down.

Morkai
May 2, 2004

aaag babbys

AWWNAW posted:

oh and one thing i wish i'd done from the start with EF was disable lazy loading

save yourself the trouble of having to go back and figure out where you abused it

this is truth. i'm glad i never got in the habit of using it.

Shaggar
Apr 26, 2006
like i did this little mvc4 project and decided i would use EF cause we just upgraded to sql2012 and thats all the latest hotness right there, but it took me so long to do simple tasks cause of the retarded way it has to bind and load and save poo poo that just doing procs and using ibatis.net like i had done previously would have saved me so much time.

power botton
Nov 2, 2011

Morkai posted:

yeah this is what i moved away from
because as much as i like to think about performance and try to word towards it at the end of the day im not working with petascale data and daddy's got deadlines


working out real good for you now.

seriously t-sql is babby's first programming language and scaling comfortably to millions of records doesn't require a lot of effort.

index all the columns you join/search on and please don't join on varchar(1024) and its p. easy

also to get a quick schema just select column_name from information_schema.columns
where table_name = 'my lovely model'

Morkai
May 2, 2004

aaag babbys

git clone trooper posted:

working out real good for you now.

seriously t-sql is babby's first programming language and scaling comfortably to millions of records doesn't require a lot of effort.

index all the columns you join/search on and please don't join on varchar(1024) and its p. easy

also to get a quick schema just select column_name from information_schema.columns
where table_name = 'my lovely model'

working out loving great for me actually. i managed to leverage all of that into a new and better job.

im asking this for my own education not because i have a showstopping bug in production right now send halp.

i focus on rapid delivery of working product, code clarity and maintainability, and sperging over performance. in that order. now kindly get hosed.

power botton
Nov 2, 2011

you seem very defensive this is a non judgmental safe zone/hideout

Morkai
May 2, 2004

aaag babbys

AWWNAW posted:

partially hosed: not so badly hosed because you've taken the time to care about performance, but kinda hosed because you're using EF and caring about performance

https://entityframework.codeplex.com/workitem/1286

http://msdn.microsoft.com/en-us/data/jj691402.aspx

thanks for these links. i guess it wouldnt help anything to bring the filters down into the included properties since the orm will just pull the whole lot regardless?

Morkai
May 2, 2004

aaag babbys

git clone trooper posted:

you seem very defensive this is a non judgmental safe zone/hideout

instead of remarking on the issue at hand you embark on a quest to show me up for daring to use an orm. that doesnt sound non judgmental. i know drat well how to use t-sql for that high performance thrill. my question was specific to my orm and my continuing desire to use my orm.

AWWNAW
Dec 30, 2008

Morkai posted:

thanks for these links. i guess it wouldnt help anything to bring the filters down into the included properties since the orm will just pull the whole lot regardless?

afaik you cant define extra criteri/filters on thise includd property strings? i beleive its all or nithing

power botton
Nov 2, 2011

Morkai posted:

instead of remarking on the issue at hand you embark on a quest to show me up for daring to use an orm. that doesnt sound non judgmental. i know drat well how to use t-sql for that high performance thrill. my question was specific to my orm and my continuing desire to use my orm.

yospos bitch

Morkai
May 2, 2004

aaag babbys

ikr? like i said, get hosed

power botton
Nov 2, 2011

I'm sorry. you're embodying the spirit of the terrible programmer thread and i should be more encouraging in your quest for ultimate mediocrity in your homework or whatever you're asking about.

Morkai
May 2, 2004

aaag babbys

AWWNAW posted:

afaik you cant define extra criteri/filters on thise includd property strings? i beleive its all or nithing

that's fine i wont lose sleep over it.

Adbot
ADBOT LOVES YOU

Morkai
May 2, 2004

aaag babbys

git clone trooper posted:

I'm sorry. you're embodying the spirit of the terrible programmer thread and i should be more encouraging in your quest for ultimate mediocrity in your homework or whatever you're asking about.

terrible programmers dont already have a background in t-sql programming with enough experience to know when its right to favor ease of development over performance because theyre not writing the backend for an online banking system or the next facebook.

you just keep whining about the "correct" way to do something while i keep getting paid.

  • Locked thread