« first day (1580 days earlier)      last day (3384 days later) » 

12:00 AM
hmm, maybe I could use the bag. TryTake until false and then add them back for next iteration.
nah it would not work
Other thread could not remove stuff then
no nice syntax for readerwritelockslim right? I.e lock(_lock){...}
Maybe an extensionmethod that returns a disposable + using
 
@ReedCopsey smh... haha
 
@BradleyDotNET - Not entirely, but still a little :P "It's not my argument. (I don't even downvote...) It's an argument used by people who do this type of downvoting. Note that the answer is +68/-67 so it's very controversial. – Mysticial"
 
Yeah, and that post just went to +68/-69
 
ANyone in here familiar with ASP.NET MVC and entity frmaework?
 
12:19 AM
@JohanLarsson That's what I do, actually - I do using (new Writer(rwls)) {... and using (new Reader(rwls)) { ..., where Reader and Writer are IDisposable and wrap the enter/exit
 
then that is what I will do. Allocation for readability
 
@antman1p - yes
 
can someone please help me with powershell question? stackoverflow.com/questions/28462811/… thanks !!!!
 
12:35 AM
Woo Woo! Found my answer to my question
When creating a service from a WSDL .NET uses the default data contract serializer, which buggers up the XML
when running svcUtil.exe I had to specity serializer:XmlSerializer
svcutil QUPA_AR101102.wsdl /serializer:XmlSerializer /fault
 
Probably pretty suboptimal with lambdas. Does LockHelper make sense as a struct?
 
@Travis J I created an ADO,NET Model from a Database and I want to populate a bootstrap dropdownmenu with the values from one of the columns from a table of that database, but I'm not sure how to do it.
 
@RyanTernier lol the code we got has WSDL generated code but we're not sure where it came from so we have to manually update it when we change things
 
you don't need suppress finalize there
 
ok, I don't know what it does. Just have this snippet for disposable
 
12:45 AM
yeah, I can explain it if you want, but don't use it ;)
I'd make Read and Write methods, not properties (because they can block by design)
 
@Pheonixblade9 When dealing with auto-gen code I have a practice of always using partial classes. Makes upgrading / updatin9g auto gen easier
 
@JohanLarsson And no (on the struct), since it'd box anyways
 
Are there any differences between:
     System.Threading.Tasks.Task T = new System.Threading.Tasks.Task(....);
      T.Start();
  and
      System.Threading.Tasks.Task.Factory.StartNew;
 
Don't do the first one ;)
and, if you're 4.5, you probably should use Task.Run instead of either of those
 
Why?
Yea, 4.0 :( Might have to deploy on a 2003 box (don't get me started)
Why not the first one?
 
12:47 AM
well, there's an implicit contract with tasks that they should always be running
 
@ReedCopsey I'll read about it tomorrow. 01:47 here would just waste your time :)
 
and using new Task tends to make it easy for devs to forget to call Start
which causes lots of bugs
 
@ReedCopsey yes +1. Do you hate the lambdas?
 
I have a requirement to keep a list of running tasks (windows service), so when the service is stopped it will wait for all tasks to be completed.
 
tbh, I don't know why they even allow new Task, even the guy who created the Task class says not to do it ;)
@RyanTernier yeah, but you can use StartNew, and then WaitAll on them no problem
@JohanLarsson no, but I'd probably not use them - I'd probably do it like:
public class RwLock
{
    private readonly ReaderWriterLockSlim _rwLock = new ReaderWriterLockSlim();

    public IDisposable Read()
    {
        return new Reader(this._rwLock);
    }

    public IDisposable Write()
    {
        return new Writer(this._rwLock);
    }

    private class Reader : IDisposable
    {
        private readonly ReaderWriterLockSlim _rwLock;
        public Reader(ReaderWriterLockSlim rwLock)
        {
            this._rwLock = rwLock;
            this._rwLock.EnterReadLock();
 
12:49 AM
@TravisJ I created an ADO,NET Model from a Database and I want to populate a bootstrap dropdownmenu with the values from one of the columns from a table of that database, but I'm not sure how to do it.
 
My current code has:
ConcurrentDictionary<int, Task> //Int being the taskID,

Then inside a while loop it goes to the database (Oracle Queue) to get sometihng to do. once it gets it, it does it. It's not a batch, this thing will run forever and could complete 100,000 tasks, or 10 tasks.
 
@JohanLarsson I find that, when I want RWL, its because I'm trying to squeeze out perf, and the lambda usage just adds extra allocations (which aren't necessary)
 
When a task is complete, I have the Callback (continueWith) removing the task from the dictionary.
 
@RyanTernier I don't believe that's safe - Task IDs can recycle
 
@antman1p - in your controller, query the database for the information. return the information in a view model. populate the dropdown on the page based on the view model passed in using the razor helper.
 
12:50 AM
I'd make your own ID for them
 
@ReedCopsey - How long do they take to recycle?
 
@TravisJ don't think ther'es any guarnatee
 
@ReedCopsey Would .NET ever create multiple tasks with the same ID that are running at the same time?
 
@ReedCopsey - Could it be in terms of milliseconds?
 
@TravisJ you'd have to look at the ThreadPool beneath the Task to actually know that stuff
 
12:51 AM
I think the only guarantee is that they're unique for any running task - but when a task completes, there's nothing (in spec) preventing that ID from being used again
 
I see
Hm, I think I may use the id in one place
 
so I'd generate the ID outside of the Task, and have the continueWith use that for the keys
 
maybe a guid for it?
 
@ReedCopsey I forgot to add RwLock : IDisposable (in case someone sees that)
 
@ReedCopsey Thanks for the help.
 
12:54 AM
anybody have experience with 4x10 days?
that's an option for me, I guess. They seem not to care how/when I work as long as I get my 40 billable in per week
 
@JohanLarsson btw - this is one case where F# really shines (ie: it's OO capabilities are much nicer than C#)
ie: F# version:
type RwLock() =
    let rwLock = ReaderWriterLockSlim();

    member __.Read() =
        rwLock.EnterReadLock()
        { new IDisposable with
            member __.Dispose() = rwLock.ExitReadLock()
        }
    member __.Write() =
        rwLock.EnterWriteLock()
        { new IDisposable with
            member __.Dispose() = rwLock.ExitWriteLock()
        }
    interface IDisposable with
        member __.Dispose() =
            rwLock.Dispose()
 
very nice
 
@Pheonixblade9 I actually like 9x9 schedules, if that's an option for you (ie: every other friday off)
 
@ReedCopsey I think it's gotta be 40/week, though I can check
 
the C# classes are ~100 lines in total
 
12:56 AM
I think they mostly care about weekly hours, though maybe it's monthly.
 
4x10 is nice, but 10 hour days can be rough if you have any type of commute
 
@ReedCopsey I take the bus, it's about 30 minutes, no transfers
pretty easy commute
I just nap or read
the bus isn't super busy when I take it (I get into work at 9:30) so I pretty much always get a seat
 
yeah, but that still puts you at 11 hour days (with commute in place) - not bad if you're single, but can suck if you're trying to coordinate with other people
 
@TravisJ So the dropdown list is on the home/index view. Do you have a link to anything that can help explain this to me?
 
(especially if you have kids ;) )
 
12:58 AM
@ReedCopsey I'm still single for now ;) that may change soon...
 
@antman1p - Please don't take offense to the name of this site, it is rather educational. nerddinner.codeplex.com
 
THank you very much. LOL. Def not offended.
 
Is a thread automatically started if i do this? Thread LoginThread = new Thread(() => Result = CheckLoginData());
 
@Proton No\
 
@ReedCopsey thanks for the advice
 
1:01 AM
though, in general, you should never write "new Thread" anyways - prefer using the Task class instead
 
I did 9x9 at very internship and it was cool
 
@Pheonixblade9 yeah, if I had my choice, that'd be my preference
 
@TravisJ Do I actually need to query the db with some more code, or will it query if I call the model property for the column of the db table? I created the model from an ado.net object
 
The model is simply a map. EF needs to take the map, translate the structure to SQL, send the SQL to the database, have the database execute the SQL, gather the returned information, and then populate the map.
 
OK, unfortunately I'm not at work and I am on my mac at home. I had been working on it all day at work. I'm new to MVC.
I was struggling getting the project to build after creating the ado.net model because one of the table names was "System" I ended up having to not bring that table in. Took me all dang day... Ugh
 
1:11 AM
@ReedCopsey Added it to the gist, gonna look at it when I write null checks :)
 
@JohanLarsson You can simplify your dispose to gist.github.com/ReedCopsey/4008cf34becfe332ce08#file-rwlock-L19
and I'd also seal it
 
@antman1p - Yeah, don't use names which already exist, it will just make it hard on you :)
 
How is it possible, that i get the wrong return result if i'm using a thread and without one i get the right result?
 
@Proton you have a race condition
that's very common ;) and part of why threading is often considered hard
 
1:27 AM
what is deferral think on WindowsRT apps?
*thing
I simply did not get the idea what it is used for
 
@Proton Because threads :)
And as Reed said, you have a race condition
@Teomanshipahi you'll have to be a bit more specific
 
there is just a small example and brief but not detailed explanation
in my windows phone app background task keeps getting cancelled
 
Looks like its basically similar to Task or BackgroundWorker
 
and I am just wondering there is a relation with this deferral thing
 
just with a different name
 
1:35 AM
it does not return any kind of Action or sort of result
 
Not sure, sorry
Time for me to go anyways :)
See you all tomorrow!
 
take care
is there any real time thread watcher in Visual Studio?
 
 
4 hours later…
5:12 AM
anyone? :)
stackoverflow.com/questions/28469726/listbox-tobind-dictionarystring-object
 
5:39 AM
Good morning guys! I'm working with WPF, ComboBox-Virtualization(Performane). When the user is seeing last item in ComboBox DropDown I need to add another items. Question is how do I know that user is seeing last item in ComboBox?
 
 
2 hours later…
7:13 AM
Morning all!
 
7:42 AM
monring
 
8:31 AM
morning
 
 
1 hour later…
9:52 AM
Does anyone know where i can work as a c# developer online?
 
Hi Guys anyone knows SignalR
 
10:18 AM
o/
 
10:35 AM
@Roel Would I be right in saying that even though your EF wrapper enables transactionality, that transactionality can only be utilised in single scope without some extra work on the wrapper?
For instance if I had a multipart form, I'm asking if I would be right in saying I'd have to contain the transaction in one controller action, rather than submitting to multiple controller actions and only committing to the database in the last action
 
Each request is implicitly its on controller, so its not a trsnaction if you have multiple requests
 
@RoelvanUden Mate dat typing doe
I had a feelin' I was right, ta
Also I have a huge controller for my admin section, I've split that into partial classes but it doesn't sit right in my head to do that. If you had a lot of functionality in a small space, what would you do to split the controller up in a way that makes sense?
Just don't wanna end up with a 600 line controller :(
 
10:54 AM
Partials are bad.
 
Yeah ..
 
Why is that controller doing so much?
 
The admin section of the site is basically a database front end
Add/edit/delete for all the objects that are used on the main site
So there's a lot of actions for that stuff.
 
11:20 AM
@Sippy imho one controller per aggregate root. Where what I mean by aggregate root is the DDD sense, which I am not very good at explaining
 
@TomW Lol
 
/understanding
 
Oh
No that's easy
A bunch of domain objects that contribute to a single route pretty perfectly describes what I'm doing in the main site lol
 
So are any of these database object types aggregate roots?
 
Not in the admin controller
No
Or all of them are.
They're all singular in the admin controller though
Of their own context
But all the actions in the admin controller relate to the admin functionality, they don't fit anywhere else.
 
11:26 AM
So is this a set of CreateDomainObjectA, UpdateDomainObjectA, DeleteDomainObjectA, CreateDomainObjectB, UpdateDomainObjectB, ...?
Or are there a large number of actions that are like commands?
 
The first thing, kinda.
I've tried to cut it down
But there are currently 4 management pages, each of which has a method to load the "add element" partial and the "edit element" partial, as well as submit those two partials
And a delete action
There will be more management pages.
So 6 actions per page in total I think
 
Looking for help on stackoverflow.com/questions/28453470/… if anyone is interested or bored.
 
I am interested in p2p programming via Intranet and Internet. If someone has some experience with that and have time and will to share it please help me to start with that staff. (skype: senkovasia)
 
11:44 AM
Morning
I have a MVC project which I've added Elmah for catching exceptions. This is fine, and it is working. The issue I've got is I want to run a ASMX service (existing project) on this same site in a sub directory. Previously this worked fine. But since I added elmah it doesnt
I get this error
Could not load file or assembly 'Elmah' or one of its dependencies. The system cannot find the file specified.

Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.

Exception Details: System.IO.FileNotFoundException: Could not load file or assembly 'Elmah' or one of its dependencies. The system cannot find the file specified.
Can I configure my MVC project to ignore the directory where the ASMX service is running
 
@TomW that aggregate thing lead me to something helpful, cheers
 
@Sippy
 
yeah I fucked up, soz :P
 
glad to hear it
 
I was following that concept without even knowing what it was, interestingly.
Clearly I'm not a totally lost cause.
 
11:55 AM
hey guys
o/ Sippy
TomW o/
 
I guess the way I'd describe an aggregate root is an object that isn't a child of anything, so you need no additional context to understand its identity. So in an ecommerce model the aggregate root is a customer, and the aggregate is a customer, their order history and their addresses, for example. You don't need any other contextual information to understand that a customer is a customer, but an order is no use without knowing who it's an order of
 
How can I pass an enumerable in my controller to my view in this
 
In the context of a customer dashboard, for example. I think the customer dashboard would be called a bounded context there. In the bounded context of order processing they probably don't care who the customer is, so the order is king
 
o/
@TomW Yep exactly
This is a survey app
So I have a survey object as the root
 
@Tommo1977: Are you running the asmx in a child webapplication?
 
12:05 PM
@Gotalove You really need to use line breaks to separate code dude
So unreadable
 
It may be that it inherits the web.config
 
@scheien how do you mean child application
It is a application under the site on IIS
 
Just a folder?
 
The root site in IIS is a MVC app
Not just a folder, I had to convert it to a application
In IIS
 
there you go
an application in iis can have child applications
which then will inherit web.config
top-down
 
12:07 PM
right
Anyway around this
 
There is a way to limit the inheritance, don't remember off the top of my head though
see this post
 
haha i'm just reading that
thanks
 
np
 
@Gotalove .BS_GetAllUserInfoBioStation2()
wat.
 
Making cyborgs?
 
12:19 PM
@Sippy yes sorry I have done it like this pastie.org/9941769
was wondering how to get it as ienumerable since some parts of the models properties were assigned at different parts of the code. Coz i was used to new model{ m.id=a, m.name=b}etc.
All in continuos code
 
Use .Select
I guess
 
What is the list then?
 
someCollection.Select(m => new Usermodel { cardID = m.cardID });
i think like that?
.Select(m => new SelectListItem { Text = m.PresetValue, Value = m.PresetValue })
That's what mine looks like for building a SelectList
 
Protip: you can remove cardID = :P
 
Not if you wanna have multiple properties
 
12:26 PM
That would be on an anonymous type wouldnt it?
 
@Sippy sure you can
 
rly?
example?
 
I think
unless that's only for anonymous types
 
for anon types it will inherit the property name
 
O_o
 
12:27 PM
Morning. Has any one set up SSL in IIS before? When I add the site with https, we don't enter a host name. My question is, should I be adding the http as well to the same list of site bindings
 
new { x.Y, x.Z }
I wish C# had sensible built-in tuples
 
I should point out, my question is about redirecting from http to https (https works fine).
 
Basically, I wish C# was F# with C syntax
 
so, not c# then
:)
 
Man, Microsoft really shat all over Skype
 
12:36 PM
@Sippy am not trying to build a selectlist from it but more of a table of items
@KendallFrey the cardid want it not necessary
and since I dont have the actual device I dont know if it will display the way I expect it but no errors is a win :-P
 
@Gotalove I didn't tell you to build a selectlist.
 
1:03 PM
@Sippy I get you now
list.Select(m => new Models.Usermodel { cardID = m.cardID });
 
Mhm
 
sorry I missed the point
 
That should create a collection of Usermodel objects for you
 
but what of the iterated items gotten where i<numofusers?
my confusion was how to get them from that loop and assign them to my new model
@Sippy thats why I did
 for (int i = 0; i < m_NumOfUser; i++)
                {
                    userHdr[i] = BSSDK.BS2UserHdr)Marshal.PtrToStructure(typeof(BSSDK.BS2UserHdr));
                    u.ID = Convert.ToInt32(userHdr[i].ID);
                    u.numOfFinger = userHdr[i].numOfFinger;
                    u.cardID = userHdr[i].cardID.ToString("X");
                    list.Add(u);
                }
 
I don't get why you even used regular for loop
foreach probably works nicer.
Then again I don't know what the result object is.
Or userHdr
 
1:08 PM
exactly why I used that
its a struct
 
@KendallFrey Really? I like the new Skype looks.
 
1:27 PM
@RoelvanUden Oh, it looks fine
 
1:44 PM
gmorning
@KendallFrey @RoelvanUden @Sippy
 
@Steve
 
@Steve
 
:)
 
lookit what I made
!;0 A0 A0B1< A1C1> B0A1> B1B1< C0B1> C1H1>!/^!;(.)/$1$&/!;(.).*!$/$&$1/!(..)(.;. )../!$2$1/!>(;. .)(.)([^!]*!)(.)/$2!$1$4$3$>$`$2|$4|$'/(.)!<(;. .)(.)([^!]*!)/!$2$1$4$3$>$`|$1|$3$'/!(?=;. (..)[^!]*\1(..[<>]))/!$2
 
wow
regex for stealing nuclear launch codes
 
1:49 PM
no, that would be 0+
 
or something
oh, oops
 
@KendallFrey Regex crossword?
 
@Unihedro turing machine
 
you guys see the new "tab search" in chrome? :0
@KendallFrey what lang
your own?
 
1:58 PM
@NETscape yup, REBEL
 

« first day (1580 days earlier)      last day (3384 days later) »