|
Luigi Thirty posted:I'm going out so I'll harvest some answers while I'm gone replace foreach(var foo in butts){...} with Parallel.ForEach(butts, foo => {...}); if you don't want to spawn a lot of threads (eg if you know it's going to 100% a core or something) you can set an upper bound: ParallelOptions options = new ParallelOptions { MaxDegreeOfParallelism = /* number of threads, eg */ Environment.ProcessorCount - 1 }; Parallel.ForEach(butts, options, foo => {...}); that args order might be backwards but w/e
|
# ? Oct 2, 2014 23:18 |
|
|
# ? May 10, 2024 10:59 |
|
prefect posted:it takes too drat long (~20min) to create a new vm on our hardware we autoprovision build slaves from docker images now, it works pretty well
|
# ? Oct 2, 2014 23:35 |
|
Bloody posted:replace foreach(var foo in butts){...} with this, and make the max thread count somewhat low, most browsers only hit a server with 2-8 concurrent connections max. doing all of them at once will probably trigger flood limits or whatever.
|
# ? Oct 2, 2014 23:42 |
|
Uncomfortable Gaze posted:this, and make the max thread count somewhat low, most browsers only hit a server with 2-8 concurrent connections max. doing all of them at once will probably trigger flood limits or whatever. I've done it in Python, I just don't know the c# way. one time I accidentally hit the api with 500 concurrent connections from a python script and tf2 items were down for an hour
|
# ? Oct 2, 2014 23:44 |
|
Luigi Thirty posted:I've done it in Python, I just don't know the c# way. one time I accidentally hit the api with 500 concurrent connections from a python script and tf2 items were down for an hour nice, did anything happen cause of it?
|
# ? Oct 3, 2014 00:09 |
|
Uncomfortable Gaze posted:nice, did anything happen cause of it? I emailed and asked if what I was doing was causing undue load on their server and they said they'd contact me if it did and they never have so of course I'm e-friends with the guy who writes the community pages so that probably helps
|
# ? Oct 3, 2014 00:12 |
|
Bloody posted:current hack solution: store the binary blobs on a network drive, send the path to the blob to use, call it "good enough"
|
# ? Oct 3, 2014 00:20 |
|
MononcQc posted:As long as the blob is guaranteed to be stored and stable until consumed, that should be good enough indeed. You'll quickly see if you hit limits and the old scheme of resource-based systems based on some form of 'universal resource locator' has worked well enough for the web so far.
|
# ? Oct 3, 2014 00:33 |
|
MononcQc posted:As long as the blob is guaranteed to be stored and stable until consumed, that should be good enough indeed. You'll quickly see if you hit limits and the old scheme of resource-based systems based on some form of 'universal resource locator' has worked well enough for the web so far. host centric networking
|
# ? Oct 3, 2014 00:43 |
|
tef posted:host centric networking Named Data Networking is interesting, but somewhat scary in that random nodes owned by whoever could decide to advertise what they want and deliver it how (slow) they want, without necessarily having a good way to say "I want that high-quality host".
|
# ? Oct 3, 2014 01:10 |
|
i made a distributed computing application and it didnt even take me that long
|
# ? Oct 3, 2014 02:22 |
|
Bloody posted:i made a distributed computing application and it didnt even take me that long i hope your system works what happens when a machine fails? or the filesystem lies and is out of sync across machines? are actions on the filesystem atomic? what happens if it fails for a moment
|
# ? Oct 3, 2014 02:40 |
|
tef posted:i hope your system works what happens when a machine fails? or the filesystem lies and is out of sync across machines? are actions on the filesystem atomic? what happens if it fails for a moment machines send a keep alive message every minute; the server times out a machine if it doesnt talk for 10 minutes and adds its work back to the queue the binary blobs are copied from the shared folder to the local file system and renamed to a guid before they're used (i was getting file lock bullshit otherwise). not brilliant because it recopies them every time it gets a new work unit, but copying ~100 megabytes locally is trivial compared to the time of the processing the file system is read-only to the network. work unit results are only tens of kilobytes, so they are sent as messages to the server. the result logging process isn't atomic in that the server may log multiple results at once, but each result gets a uniquely named output file if something fails for a moment (or even a while) like in terms of network connectivity i dont really know what happens but 0mq seems to handle it pretty gracefully. like i can turn on a client, wait a while, then start the server and the messages the client was trying to hit the server with zoom on through. if the server reboots i have bigger problems for a variety of reasons. biggest probably being old work gets duplicated because it isn't saving its work unit queue anywhere. if it's ever a problem i'll probably bandaid it by looking at which work units we have results for and removing them at server startup. on the whole this has been a kickass learning experience
|
# ? Oct 3, 2014 02:44 |
|
nothing is atomic and someday your system will lose power in the middle of handling another failure
|
# ? Oct 3, 2014 02:45 |
|
JewKiller 3000 posted:nothing is atomic and someday your system will lose power in the middle of handling another failure luckily that doesnt matter because this is small scale monkeycheese
|
# ? Oct 3, 2014 02:46 |
|
nothing is atomic, everything is permitted
|
# ? Oct 3, 2014 03:21 |
|
tef posted:nothing is atomic, everything is permitted but enough about your parents ah ah ha ha
|
# ? Oct 3, 2014 03:32 |
|
you know from reading that blog a bunch it doesn't seem like windows is undocumented arcane weirdness as 20 years of bullshit stacked on top of bullshit required for compatibility with more bullshit that miraculously results in an occasionally functional operating system thank god I don't have to do c++ windows programming quote:Windows defines many data types of the form pointer-to-X. These usually have the prefix P- or LP- in the name. For example, LPRECT is a pointer to a RECT, where RECT is a structure that describes a rectangle. The following variable declarations are equivalent. Luigi Thirty fucked around with this message at 08:59 on Oct 3, 2014 |
# ? Oct 3, 2014 08:55 |
|
tef posted:i hope your system works what happens when a machine fails? or the filesystem lies and is out of sync across machines? are actions on the filesystem atomic? what happens if it fails for a moment i think tef's just jealous and trying to hold back progress; he sounds like the people who are always talking poo poo about my perpetual-motion engine
|
# ? Oct 3, 2014 10:24 |
|
prefect posted:i think tef's just jealous and trying to hold back progress; he sounds like the people who are always talking poo poo about my perpetual-motion engine my car that runs on water i have found the fatal flaw: so .net is easy and winrt is easy but nobody uses win8 or the store! like my brother's been using win8 for a year and didn't know the store existed. i've been canvassing my steam friends to get them to install it and tell me what they think but they all run windows 7!
|
# ? Oct 3, 2014 20:05 |
|
c distributed system s: its whirring along beautifully i wish i'd made the server better though no logging, just console output no database-backed work unit store no way of adding new work units to the queue oh well
|
# ? Oct 3, 2014 20:12 |
|
if i was actually confident i could reboot the server without frying the network then it wouldn't be so bad but i'm not that confident
|
# ? Oct 3, 2014 20:13 |
|
IM FLYING
|
# ? Oct 3, 2014 20:19 |
|
I'm really wishing I had the insight two weeks ago that this data structure should be flipped from how I implemented it originally because trying to flip it now is a pita
|
# ? Oct 4, 2014 00:15 |
|
tef posted:nothing is atomic, everything is permitted hail eris
|
# ? Oct 4, 2014 02:24 |
|
Luigi Thirty posted:my car that runs on water weird because win8 is up to 30% penetration on steam hardware survey
|
# ? Oct 4, 2014 04:15 |
|
~Coxy posted:30% penetration
|
# ? Oct 4, 2014 04:49 |
|
~Coxy posted:weird because win8 is up to 30% penetration on steam hardware survey
|
# ? Oct 4, 2014 08:27 |
|
is it weird that when Raymond Chen started complaining about games from a particular publisher using a dos extender that tried to gently caress with the gdt and gave cryptic errors when it wouldn't work I got it on the first try (it was origin and their stupid loving dos extender that never worked right)
|
# ? Oct 5, 2014 02:25 |
|
i'm trying to represent this bideo jame data in a database using EF. I have a model with a bunch of fields:code:
code:
Luigi Thirty fucked around with this message at 08:20 on Oct 5, 2014 |
# ? Oct 5, 2014 08:17 |
|
If there's a 1:1 relationship then there's no need to have a separate foreign key at all, both models should have the same key. Is there actually a many:1 relationship going on? If so, in what direction?
|
# ? Oct 5, 2014 09:06 |
|
I don't have a copy of visual studio handy, but theres a GUI representation if you click on your EF models in the object browser and you should be able to delete the FK somewhere around there. they don't have migrations tho, do they? so you will probably have to load up ssms and also delete it from your current ables
|
# ? Oct 5, 2014 12:08 |
|
Jabor posted:If there's a 1:1 relationship then there's no need to have a separate foreign key at all, both models should have the same key. no, it's 1:1. the problem I'm having is when I make id the key, it auto assigns it when I save the database entries and overwrites what I assigned to it for some reason. db.GameItem.Add(item) <-- id of 0 db.GameItemCapabilities.Add(item) <-- id of 0 db.Save() <-- both now have ids of 1 in the inspector! db.GameItem.Add(item) <-- id of 1, exception because now there are too many items with an id of 1 Luigi Thirty fucked around with this message at 16:48 on Oct 5, 2014 |
# ? Oct 5, 2014 16:34 |
|
Luigi Thirty posted:i'm trying to represent this bideo jame data in a database using EF. I have a model with a bunch of fields: 1) ORMs suck and EF sucks as an ORM 2) if your database has autoincrementing pks, then its the db that controls them, not the application and you shouldn't have the application rely on things being at certain ids so who cares if its 0 indexed. if you want to control all the ids, turn off auto-increment. Luigi Thirty posted:no, it's 1:1. i hate ef so i don't use it much, but I think you need to create the item with the ef create method it should have built for your entity. if you're doing a code first thing then its probably lovely and a pain in the dick like all code-first approaches. the add method is to put an existing object into a new table. my guess is the first call to add also handles creation of the entity (which includes id assignment) and then when you call it again it fails cause it already exists. this is poo poo design and it should give you an error on the first add instead, but w/e. if you want to update an entity you have to use the modify method. and all this is going on in this lovely bizarre in memory context that doesn't do anything until you save it, but it still throws errors if you try to do invalid calls which is awesome cause you cant tell if it came from EF enforcing the contracts it knows about or if it came from the database itself. EF sucks hardcode Shaggar fucked around with this message at 18:16 on Oct 5, 2014 |
# ? Oct 5, 2014 18:06 |
|
what and write prepared sql statements like a barbarian I mean I can do that but I figured in TYOOL 2014 there would be a better solution.
|
# ? Oct 5, 2014 18:18 |
|
write procs in your db and call the procs from ur code. EF will let you use them as function imports which works ok but is not great.
|
# ? Oct 5, 2014 18:19 |
|
the core problem with EF is it tries to maintain its own in memory version of the pieces of the database you're working with. That's the entitycontainer and where the entity in entity framework comes from. Its a way to abstract the concepts of entities in your code from however you store them, but the reality is everyone uses sql so the abstraction is pointless and adds a layer of confusion and boilerplate. like orms suck in general but ef sucks even more than most.
|
# ? Oct 5, 2014 18:22 |
|
Luigi Thirty posted:what and write prepared sql statements like a barbarian nhibernate
|
# ? Oct 5, 2014 18:24 |
|
create table item capabilities ( id int identity primary key ... )
|
# ? Oct 5, 2014 18:30 |
|
|
# ? May 10, 2024 10:59 |
|
well yes the whole time I was doing it I was thinking "this would be so much easier if I just used SQL to do this poo poo since I know exactly what I want the database to do" so I'll just go and do that instead
|
# ? Oct 5, 2014 18:46 |