« first day (1782 days earlier)      last day (3160 days later) » 

12:01 AM
Okay I made a tic tac toe game.
I need to learn asp .net foreal
 
Foreilz
 
12:16 AM
thanks for the correction
 
12:58 AM
0
Q: HTML5 audio element with source being audio stored as varbinary bytes from database

Lulutho MgwaliThis is a normal audio player, but if i wanted my source to be audio stored in my database how would i go about achieving this ? <audio controls="controls" autoplay="true" loop="loop"> <source src="WhiteChristmas.mp3"/> </audio> This how i am currently reading the audio files from my database...

 
1:58 AM
If I need to ask a question about a text based game should that be in stackoverfloooow or programmers
or how can we override events like a mouse click or something
 
The new Google logo is unnerving
 
2:15 AM
DDD, if I want one of my aggregate roots to stay around for a while, where would i keep a reference to him? I was thinking application layer, but I'm reading some google results that say the application layer shouldn't do that..... any suggestions
 
 
4 hours later…
5:48 AM
yay wednesday
@june1992 If it has to do with actual code, ask on SO
 
Can anyone tell me how to check TFS server version from within visual studio?
 
morning guys :D
 
morning
 
6:05 AM
Morning :)
 
Goddamnit, WP10 mail app is broken as hell.
 
Morning all!
 
31
A: Are C# arrays thread safe?

Jon SkeetI believe that if each thread only works on a separate part of the array, all will be well. If you're going to share data (i. e. communicate it between threads) then you'll need some sort of memory barrier to avoid memory model issues. I believe that if you spawn a bunch of threads, each of whic...

^ So this means individual array elements are thread safe as long as we are only reading stuff from the array?
 
6:21 AM
@deostroll thats not given any time, he says its threadsafe if every thread uses its own area in the array and is not sharing any data. Your idea may sound logical, but even accessing objects can cause a change in some value (e.g. lastaccessed)
 
@SebastianL but...my array is only to be used in a read-only fashion...
there will not be any business of updating or appending to the array...
 
6:41 AM
@deostroll I would sugest you enforce that then, by marking the array read-only or by making it private with a public getter.
once you have done that it should be fairly thread safe
 
6:54 AM
hi
 
7:10 AM
@deostroll take a look here stackoverflow.com/questions/8415545/…
@kame hi
 
@SebastianL awesome :)
 
Godo Morning
*Good
if someone has a bit of time to spare and take a look into this: stackoverflow.com/questions/32346636/…
 
@BenjaminDiele No! You should HAVE PASSION! Work for minimum wage BUT FUEL YOUR PASSION!!
 
@darksleep Can't you just flatten the lists and remove every child?
 
that's the problem, I can't remove them, I'm missing something
I get a List<TreeNode> and then I'm trying to loop it: foreach(TreeNode node in List<TreeNode>) if(node.Tag == Enumerations.FolderType.Calculation) node.Remove();
 
7:20 AM
@RoelvanUden: Passion fruit?
 
@darksleep Can you copy the whole list + every object and work on that list?
 
@scheien yes.
 
@Loetn - yes. I have the List and it contains SelectedNode + all of it's descendants ( also rootN and childN )
 
@darksleep If you need to keep the original parent+nodes, copy the whole list + every object and remove the childs from the second list
Not just .Add(item), but .Add(item.Copy()) or something like that.
And new List(originalList);
 
@darksleep Why does this sound an awful lot like homework?
 
7:28 AM
@RoelvanUden, sadly it's a stupid Business Requirement. :)
 
Ok, so, you just want to get the 'selected node' parents?
 
yes.
Exclude the nodes that have the Tag == Calculations
only have the Nodes that have the Tag equal "Folder".
 
Then that's easy. Just recurse over all nodes and return true/false depending on whether you reached the 'selected node'. If true, add self to the list and stop the func. The stack will rewind when it's reached and the list will be build.
 
@darksleep isnt that a basic flattentree (with the addition of ignoring all the leafs)?
 
boolean FindPath(Node rootNode, Node targetNode, List<Node> path) {
  if (rootNode == targetNode) {
    return true;
  }
  foreach(var childNode in rootNode) {
    if (FindPath(childNode, targetNode, path)) {
      path.Add(childNode);
      return true;
    }
  }
  return false;
}
Something like that. Add your exclusions where appropriate.
And deal with the first root node if it can be a match.
Make an overload for that or something
 
7:34 AM
@RoelvanUden I had an interview once where they asked me "What makes you lose track of time? How can we make it so that you keep on working?"
 
Uhm.. losing track of time means you're working amiright?
 
So I don't get the question. o_o
 
read it as: "how can we exploit you to work more hours than we will pay you"
 
OH!
The honest answer? "You can't. I have a 'Go home motherfucker'-alarm that will prevent me from working more hours"
 
7:38 AM
I kinda blanked at the question. "Are you really asking me that?"
 
Lol, a decent reaction too. On the other hand, I first interpreted it as "What distracts you from work and what can be do to minimize those distractions?"
Which is OK
 
is there a .net framework for handling big data?
 
@RoelvanUden yeah, that kinda question is nice to get, because it shows some appreciation and insight.
my question though .. :D
 
8:06 AM
@Squiggle yep the "big data" ^^ thanks for the article, gonna read it now
 
@BenjaminDiele: Haha, what a stupid question.
Anyone know how to get the context menu item for Add Controller... in a MVC 6 project? Do I still have to modify the ProjectGuid value in the project file (.xproj)?
Even the "Add view..." when right clicking a controller action is gone. bah!
 
8:29 AM
guys
just give it to me straight
is there a way in TFS to copy build output to a drop folder in a way that makes sense for solutions with multiple applications?
instead of copying every dll and exe to a single folder
 
@Steven Liekens - maybe using Build Definitions ?
 
well yeah but I mean using the default template
 
8:48 AM
that's just a guide to R, for C# developers. It's a statistical analysis language.
The term "big data" can be applied to loads of things. Your question was very subjective.
 
@Squiggle but it gave me some insight on how to deal with statistical data, so your answer fits my question ;)
 
9:03 AM
ace :)
@SebastianL what sort of data / what size datasets are you working with? There's always the SSIS and SSAS tools which are great for doing translation and aggregation for huge datasets, but they're kinda specialist.
5-dimensional terabyte cubes can be both fun and headache-inducing.
 
mostly financial data
 
This falls into the realm of "fun-yet-business-critical" :P
best of luck!
 
hey guys if I POST a serialized class in the example pastie here http://pastie.org/10391229

however everytime EF is inserting a new DeviceType. I have also tried getting the DeviceType object form the db and setting the model device type to be this returned type but it still is inserting a new one.
Any ideas why it would do this?
could it possibly be an issue with the foreign key relationship not existing in the database?
 
9:22 AM
Hey, do I actually need to use using in EntityFramework 6?
(In a WebAPI project)
 
That depends on how you set up your context.
 
var ctx = new Entities();
 
Then you want to clean that up, yeah, so a using block is a good choice. Consider making a DataApiController class, though, which manages the context for you. You won't have to write explicit blocks of contexts and usings that way and it all can happen behind the scenes. Or even use Ninject InRequestScope if you are of the IoC fan base.
 
Anyone have experience with MVC6 (xproj with DNX4.5.1, project.json and all that) and referencing "old" projects with .csproj file (.net 4.5.1)?
 
9:51 AM
don't you just add them as dependancies like you would in any non-DNX project
asuming you are using VS
 
Teo
Hi guys, in my MVC web application I have to send my form and a string to my Controller. If I send via $.ajax POST only the serialized form (with "Serialize" method) it's ok, but if I send also the string, my controller receive NULL form... :-(
This is the code I use: pastebin.com/VhFF3qkE

In the "data" if I pass only the object editDocumentForm it's ok... but if I pass the string and the object, the object received by controller is null:
data: {partialView: "myPartialViewName", document: editDocumentForm}
 
Hi all!
 
If you look in the network tab, what data is being send across the wire?
 
Hi all ..
 
Any body knows how can I open specific type of file with my app, for example I'm serializing file and setting extension to *.pmdata when I open this file should open with my app, I can set it from file->properties and change default open programm but I want to do it in code, maybe add to register with code, any links or suggession will be great
 
10:01 AM
Isnt that part of the installation?
 
@Alex installation of my app you mean?
 
i mean traditionally you associate your file types in the installer
not as part of you app
if it must be part of the app then i beleave there is no .net api for it so you just have to manualy change the registary your self
 
@RoelvanUden Did you ever fix your WNS issue?
 
@Alex let's say my app is Installed already, I created file with specific type and on running app I should add to registry open all .pmdata file with myapp
 
@Sippy No. I currently have support tickets open (y'know, the ones that usually cost $500). I'm essentially guessing my account is bonkers by now, because 5 minutes ago I tried to submit an app to the app store and it went totally haywire as well.
 
10:08 AM
@RoelvanUden rip
:/
 
But hey the support ticket is open so let's wait for those guys from India to respond
 
@RoelvanUden I feel for you man, its allways bad when your own SO question is the only valid search result about a problem.
 
Error

Your billing account has technical issues, please contact Customer Support Services.

If the problem persists, please contact customer support.
 
@Jamaxack ....... why would you need this, if your app is installed then your install will have already done the job, if the user has changed it again then well thats just bad luck for you
 
Bwhahahaha that's what happens when I try to pay for more stuff
 
10:12 AM
it really does sound like your account is well and truely broken.
 
@RoelvanUden You gone done broken it real good like
 
Today I realized I truly hate TreeViews in WinForms ^^
 
@darksleep most of us had that epiphany a decade ago :)
 
@RoelvanUden tried to give me an example to flatten a TreeView, so would end up only having it's structure (Parent Nodes), but nothing seems to work.
 
@Alex Hah yes :|
 
10:20 AM
@Squiggle, I think I will say the same thing about TreeViews 10 years from now on :D
 
You can’t submit apps to the Store until your account has been verified.
OH WELL THANKS GUYS.
 
@darksleep are they any better in WPF?
 
Funny bit is that I have a dev license to august 2016
 
@Alex don't know really, this project is in WinForms.
 
@darksleep shame, i bailed on winforms when my 1000s of lines of code for a expanding gridview became about 2 in WPF
 
10:23 AM
@Alex Management Decisions, our superiors have no ideea of Developing, me and my team are always struggling with these kind of problems.
 
@Alex And I bailed on WPF when I realized hundreds of lines of model binding and command delegation became 1 or 2 in HTML/JS :-D
 
and the funny thing is that the company I work is rather big in the Automotive Industry
so it's not a small company
 
@RoelvanUden Yeah 9 out of 10 times now i find myself building a WebUI for something rather than anything else
 
 
@RoelvanUden, regarding that example you have me I end up with a List<TreeNode>
but TreeNode within that list still contain the childs that have that specific Tag
god damn it.
 
10:36 AM
hi guys any ideas why a EF would insert a new element for a complex type inside my class when I send across the ID and the ID existing in the table?
i.e. I have a DeviceType (which is simple ID String table of device types)
I pass across e.g. Stock { Quantity = 0, new Device { ID=2}}
which is being bound on the api side just fine
I have even done a GET on the device ID passed and get the current dvice type and set it to the instance, but it still insists on inserting each time insetead of just setting the current ID?
any ideas anyone?
 
because you're creating a new Device each time.
Do you have a unique constraint on the ID column for your Device table?
you'd need to load the Device entity and associate it with a Stock entity before saving
 
@RoelvanUden Ok then, using it is, because from what I understand in EF5 it was OK to let GC handle it.
@user3545438 select the existing device and update it.
 
@squiggle sorry I do the following in the api
e.g. var devicetype = _Service.GetDeviceType(PassedModel.DeviceType.ID);
 
cant get used to the new google logo thing
 
which returns the devicetype (breakpoint shows this)
@alex no neither can i nor the scary hand which draws
@Squiggle and then do PassedModel.DeviceType = devicetype
but this still inserts?
 
10:45 AM
@Alex: I thought so, but it cant resolve assemblies when referencing a project. It works if I reference the assembly directly.
 
@darksleep in the method, that generates the list, clone the treenode without children
 
and your _Service.GetDeviceType retrieves it directly from the EF context?
 
correct yes
this is simply
 
@SebastianL clone it inside the recursive method and then return the a cloned list of Parents ?
 
public DeviceType GetDeviceType(int id){

using (mycontext)
{
}

}
sorry knocked return
but it returns the FirstOrDefault(x => x.DeviceTypes.ID == id);
and from adding breakpoints it is returning the object
 
10:48 AM
@scheien look into the wrap command in the tooling (console stuff) it looks like it may have something to do with it
 
but when I assign it to the model object it still inserts a new instance
 
if you cant find it just tweet @DamianEdwards he will know
 
@user3545438 is it being loaded and saved inside the same context?
 
ahhh no i dont think it will be
as the reuturn spins up a new using
as above
and then is use _Service
which would be inserting from the Stock perspective
i.e. _context.Set<Stock>();
@Squiggle just looked obviously because the injected context is from the Stock perspective I'm not sure I can just get the devicetypes
is there a way I can tell it to just link it and not insert?
@Squiggle I have posted here on stack if it helps
0
Q: Entity Passed to WebAPI 2 Method is being Inserted and linked to existing entity

user3545438I have the following classes (simplified for breivity); public partial class Stock { [Column("StockId")] [JsonProperty(PropertyName = "stockid")] public int ID { get; set; } public DateTime Date { get; set; } public int Quantity { get; set; } [JsonProperty(PropertyNa...

but i think you are right aout the context issue
 
:-]
 
10:59 AM
0
Q: How to Create NLog Day based archive?

bhuvinNLog Version : 4.1.0 I have enabled NLog to work upon the Log Archives based on "Day" and also have enabled the Compression of Files. Now, when I am changing the Date from the Calendar(manually) i.e. from [02-September 2015 to 03-September 2015] ideally it should archive the file; but currently...

 
looks like a context issue to me
 
@Alex yep i think so too
is there any way i can physically tell it to just link it?
 
@Alex: yeah, I already did. :)
 
i.e. maybe insert the entity and then alter the devicetype??
but then it would still probaly insert a new one which I would have to deal with anyway
 
best way to check would be to write a quick test function that does what ever your 2 services do inside one context and see if you still have the problem
 
11:02 AM
Guys could you help me out with above question ?
 
@user3545438 Attach it to the new context and set the state = Unchanged
 
@Loetn sorry not quite following coul dyou expand a bit?
@Alex issue i have is the context is IOC and injected to the api controller fomr the contorller context in this case stock
reason i spin a new instance is because I just want to return from the devicetype perspective
 
@user3545438 You can attach an entity to the context (context.Table.Attach())
And then add it to your Stock
 
@Alex: That seems to work if you change the framework version to net451/net452 etc, but I need dnx45x since I'm going for asp.net5 (all asp.net5 projects are DNX projects) and mvc6.
 
But I'm not certain what the state will be of the Device entity
You can change the state with context.Entry(attachedEntity).State = System.Data.Entity.EntityState.Unchanged
 
11:06 AM
isnt it generaly considered a good idea that your busness logic should be wrappen in a context then commited at the end?
 
so in this case I would have to expose the context form my service class
public class StockService : EntityService<Stock>, IStockService
    {
        IContext _context;

        public StockService(IContext context)
            : base(context)
        {
            _context = context;
            _dbset = _context.Set<Stock>();
        }
as currently _Service is just _dbset effectively
 
yeah i would normaly have higher level functions in a service
normaly i would move that code into a function in your service and then call that passing the stock to it from the action
 
@BenjaminGruenbaum Oh it may still be "okay" to let the GC handle it, but I am not sure about the connection pooling in that case. Either way, it is best practice to simply dispose a disposable after use.
 
but i am using a full on service/repo pattern
 
@RoelvanUden I never had a problem with using using and connection pooling.
 
11:12 AM
@Loetn Well, if you had read the entire conversation, you would know that this comment was not about that.
 
@Alex ok I have a base service which has basic add insert delete and then the stock basically extends this adding any bespoke functionalitys. I use Autofac to inject this context to the API controller. Its working well or was til this point lol
 
@RoelvanUden What? You were talking about using using with EF.. And also about connection pooling.
But ok, then I must've misunderstood.
 
@darksleep Of course they do. You just added a reference into the list. Make a clone without the children if you absolutely don't want those.
 
@darksleep yep basically
 
@alex @squiggle thanks guys yep it was the context
 
11:24 AM
thumbsup.jpg
 
good day everyone =)
 
@Loetn what issue?
@RoelvanUden well, in EF5 it'd return the connection to the pull after every request, now it keeps it I think. So in EF5 using didn't do much but in EF6 it might be a good idea :)
 
@BenjaminGruenbaum No issue :)
 
[random q] Does anyone know what, in Direct X, Adapter1, Adapter2, etc are? These are classes that actually exist. I don't know why.
 
11:41 AM
@RoelvanUden I think its a versioning thing
2 looks to be for DXGI 1.2 and 1 for DXGI 1.1
 
@Alex Ah! That makes kind-of sense.
 
I'd have thought something like Crossfire...Adapter1 => GPU1, Adapter2 => GPU 2...
then again, I've no clue about DirectX
or Crossfire
 
@SteffenWinkler you would then need at least 2 more for sli and more for crossfire
 
Hm, no, there are indices for that (so GetAdapter(1) gets CPU 2)
GPU*
 
ahh ok
 
11:44 AM
@RoelvanUden yeah having a class for each card would be madness
 
@Alex so it'd be well within Microsoft's area of expertise
 
12:01 PM
good morning
 
A FileSystemWatcher in C# automatically creates it's own thread. How can I allow the FilesystemWatcher's Created event to place something on my form without getting a cross-thread exception?
 
@ErwinOkken : in the sense ?
 
@ErwinOkken invoke your changing code with the dispatcher. Dispatcher.Invoke(() => yourChangesCode... )
 
Its more related to your form ..
then FSW
 
@Erwin ^ What Benjamin said
 
12:11 PM
@Erwin ^ What Benjamin said
 
@Erwin ^ What Benjamin said
 
Lol :P
 
Thanks guys :')
ALL of you. :D
 
Guys any idea Does NLog uses its own Internal clock or Depends on the System Clock ?
 
@bhuvin looks like can use the system clock, with options of using a different timesource. Not sure which is default.
^ that's the default implementation
 
12:23 PM
dos anyone here have used google charts? is it a good choice?
 
@JúlioMurta It depends entirely on what you want to do.
 
@Squiggle
That is what is confusing me ... Actually i guess my question is related to the same:
http://stackoverflow.com/questions/32350795/how-to-create-nlog-day-based-archive
weird it is ... Archiving of NLog works for Minute Hour perfectly fine ..
but Dunno what happens to it for the Day
 
It's finally (partially) working. Thanks @RoelvanUden, @Benjamin, @bhuvin, @scheien :P
 
@ErwinOkken : besides that you are gonna use FileSystemWatcher for ?
Just know real Hiccups with it so asking
 
12:33 PM
FileSystemWatcher is a POS really.
 
@bhuvin I'm not an NLog user, so I can't really help there. Looks like a right humdinger.
 
ahh .. thanks .. !
yup it is .. but its acting funny for the same ..
@RoelvanUden : Completely ..
But sometimes its all you got ..
 
@bhuvin I'm using FSW for the following: My scanner automatically uploads an image to a specified directory, and opens my program with the filename as argument. However, the software provided doesn't allow to scan multiple files. So when my program is opened for the second time, it automatically closes. The first instance has a FSW that then sees that there is a new file in that directory.
 
Be careful with :
Creates can be composition of Multiple events , So i would suggest just take it as an Event raiser , and go and check the Whole directory
Besides that be careful with the Memory buffer issues of FSW (if above not applicable)
 
@ErwinOkken just remember that fsw will give you false negatives.
If you're OK with that then good.
 
12:42 PM
Until now it's doing what it should do
Just got some other random behaviour, but that isn't FSW's fault ;p
When I drag my file into my .exe, the app crashes. When in VS, I fill in the same file as an argument, it works perfectly fine. :')
 
12:58 PM
What's the difference between dragging an image into an .exe, and cmd => "my.exe" "image.jpeg" ?
 
@ErwinOkken in C++ at least, there isn't a difference in the way you write the code
 
When I drag my image onto my .exe, the exe crashes. When I use cmd => it works. So I'm unsure about what's the valid way of testing it.

Next to that I have a case where my exe crashes, but when debugging with visual studio, I don't get a single error. How the heck can I see what's wrong then :P
 
@ErwinOkken maybe write the value of argv to a text file to make sure it is what you expect?
And for debugging in VS, if you don't get any errors, try placing a breakpoint close to but before you think the crash occurs and step through the code line by line until you hit the line that makes it explode
also, if it is a console app, I've seen people mistake the closing of the prompt after execution with a crash so make sure you pause it at the end.
 
Guys what is the best practice in asp .net mvc, to return ActionResult or to explicitlye mention the type like FileResult or JsonResult ??
 
1:14 PM
@Obviously I the case of File/Json I would return those
 
If I am doing a code review, can I point it out?
 
The return type of your action helps to express what the action is supposed to do
and what the expected outcome is
probably
 
Yep that makes sense
 
@Obviously Almost everyone uses ActionResult as return type though, because, lazy, and we don't give a shit.
 
How often can you change your username here?
 
1:21 PM
also because resharper will nag you to use the base type where possible
 
resharper will nag you to do anything in their standard where possible
 
@StevenLiekens are there any good reasons for that or just convention?
 
Convention.
 
@ErwinOkken Do you have a try/catch around the block of code you think is blowing up?
 
ActionResult is a kind of wrapper around return types
if you would return int/string in different cases
you may want to use it
 
1:29 PM
isnt ActionResult the parent of JsonResult and FileResult?
 
yes they inherited from that
lovely father ActionResult
 
@ErwinOkken I'd guess dragging gives it the full path
 
@KendallFrey Thank you again, you really helped bridge I've got an understanding to actually figure some of it out.
 
1:52 PM
Is there a difference between a Body and Parameter, a Parameter goes into the body correct?
 
looks like fun!
 
@Greg "Parameter" isn't a word I know in the context of HTTP. You'll have to be more explicit
 

« first day (1782 days earlier)      last day (3160 days later) »