« first day (1406 days earlier)      last day (3534 days later) » 

12:47 AM
Should 2 services know about each other?
Having a logging service, should any of my other services use it? Or should I add "an intermediate"?
 
 
7 hours later…
7:47 AM
Morning, all.
 
Morning. ;-)
 
morning
guys any idea why input for file is null in this code to upload image in mvc pastie.org/9493640
I have tried to make it as close as this
0
Q: upload image in server folder and save path in Sqlserver using entity framework mvc4

user3780510I am rizwan and i am new in mvc 4. I am trying to save picture in folder and store path in Sqlserver 2008 using entity framwork. My code is saving all the data in database except picture and picture path. My model is { using System; using System.Collections.Generic; using System.C...

 
how are you uploading it? Via ajax?
 
solutions offered but don't know where am going wrong
no ajax
@Squiggle this is my code pastie.org/9493640
 
ah sorry didn't see the other bit
 
7:52 AM
its alright
 
This is frustrating - I know I solved this issue over a year ago myself :P
 
@Squiggle I tried so many solutions yesterday.Initially was trying to upload to db then decided to upload to folder after numerous attempts and fails
 
@GotalovePHP You don't want to get paths to a temp file. At least copy the file somewhere.
 
@RoelvanUden is that what this does?
string ImageName = Path.GetFileName(comp.Logopath);
                    string physicalPath = Server.MapPath("~/images/" + ImageName);
                    Logopath.SaveAs(physicalPath);
 
Did you even try just getting the file in your controller w/o the other crap?
Yes.
 
7:58 AM
is that a temp file?
 
Depends on your configuration.
It's either the path from the POST
 
And you can see the file being posted in Developer Tools network traffic?
 
Or the path to a temp file in asp.net
Usually, the default setting, is the former. Then you just need to accept the stream and write it.
 
@Squiggle haven't tried checking that
@RoelvanUden I created an images folder in my project thinking thats where it posts
@RoelvanUden @Squiggle let me have a look at this and your suggestions then consult you so I dont waste your time
0
Q: MVC Gets NULL Path of the Image

Ruhi GoktasI'm trying to upload images into my App_Data folder.I've used HttpPostedFileBase, but it always returned null for some reason. Here is my Create method: [HttpPost] [ValidateAntiForgeryToken] public ActionResult mkCreate(HttpPostedFileBase file) { if (file.ContentLength > 0)...

 
Well, no. It doesn't. ASP.NET just hands the request to your action and that's it. You need to read the file stream yourself.
file.InputStream is where the magic is.
 
8:22 AM
@Squiggle in the post method image is there imgur.com/Ym2i4Cq
@RoelvanUden I cannot get it into inputstream because in model object passed to controller it is null
 
What...? Don't make a model for a file o_o
 
@RoelvanUden I have created string logopath in the model.
Is that fine
?
public ActionResult CreateCompanyDetails(Basic.Models.CompanyDetailModel comp, HttpPostedFileBase Logopath)
I assume logopath here is image gotten from
<input id="LogoPath" title="Upload logo" type="file" />
and in model I have this
public string Logopath { get; set; }
Is this going to conflict?
 
Yes.
Stop adding all that crap and fix your focus first. That is, files.
Make that work, then add more crap around it.
Or are you one of those that builds the entire 80-page product specification in one long month stretch, without ever compiling or testing, and then begins pulling hairs when it doesn't work as intended? ;-)
Always build in small, controlled, testable, bits ...
 
@RoelvanUden okay but with current code minus the other crap such as email etc it should work as is?
 
I dunno. Try it and find out.
Once you've compressed it to a small thing, others can start to begin reasoning and helping too...
 
8:33 AM
you have a good point though let me do that +1
@RoelvanUden
 
I can not seem to get colour schemes working on Coda 2 for .c files. Any ideas?
 
@eXtremiity I think you have the wrong room mate.
 
That's usually the response I get ;D
 
Well.. C# is not C. Nor Mac-focused. :P
 
8:48 AM
@RoelvanUden Roel, hello
im just wondering if you can help me a bit with a yesterday problem..
i still couldn't solve it...
my tcp client needs to send: string + image
and server needs to receive this, skip the string and take the image an show it
 
9:01 AM
Ok. And?
 
the client sends
byte[] toSend = BitConverter.GetBytes(str.Length).Concat(str).Concat(ms.ToArray()).ToArray();
but the server receives before all this data
\b\0\0\0
@RoelvanUden a solution?
this is the receiver part:
int imageLength = BitConverter.ToInt32(data.Skip(8).Take(4).ToArray(), 0);
var imageData = data.Skip(12).Take(imageLength).ToArray();
 
@RoelvanUden managed to get it to upload an image now to wire up the rest.Thanks for the help your tip though simple was very important on working up small bits at atime
 
@KraziiKiiD What the hell? Use simple prefixing. Send int length, then image. Receive int length, then read length. Done. Don't concat and shit.
@GotalovePHP Yep you're welcome; live and love by those rules :P
 
:18432100 i changed somethin, and it says: An exception of type 'System.ArgumentException' occurred in System.Drawing.dll but was not handled in user code

Additional information: Parameter is not valid.
 
good lord
i spoon fed you the solution like 8 hrs ago
 
9:16 AM
@drch Yes my servant?
 
=] roel
 
@drch im not very good in bytes, and im stucked on this length and image
this is my final client sender:
byte[] str = Encoding.ASCII.GetBytes("Command|");
byte[] toSend = str.Concat(ms.ToArray()).ToArray();
and on the receiver:
 
Unbelievable. You often get solutions here and completely ignore them.
 
you told me to send the length and the image bytes
 
10 hours ago, by drch
your client code is sending str + image
 
9:18 AM
but i need to concat the string too
 
10 hours ago, by drch
your server code is expecting: str + imageLength + image
 
i know, ms.Length is the imageLength
but i need to concate that too in the middle
or after the command's bytes
i have no idee how to send all 3 of them
byte[] toSend = str.Concat(ms.ToArray()).ToArray();
this is str + image
the length if is ms.Length, where to concate it?
i tried this way:
byte[] toSend = BitConverter.GetBytes(ms.Length).Concat(str).Concat(ms.ToArray()).ToArray();
 
@KraziiKiiD do you know what this does: BitConverter.GetBytes(ms.Length) ?
 
it get's the bytes from an integer
 
ok
so if you want to do the same for the length of the memory stream, what would you do?
 
9:24 AM
but the length of the memory is ms.Length
 
yep
 
so here im getting the bytes of it, so is good BitConverter.GetBytes(ms.Length)
 
looks ok to me
except
how you've changed what your client is sending
 
so would be: str.Concat(BitConverter.GetBytes(ms.Length).Concat(ms.ToArray());
 
byte[] toSend = BitConverter.GetBytes(ms.Length).Concat(str).Concat(ms.ToArray()).ToArray();

that sends:
imageLength + Command + ImageData
 
9:26 AM
yes i wrote above the oder order, is it that ok?
 
What is a weakly typed collection (vs a strongly typed collection). Is List<T> weak (as it's of type T) where as List<string> is strong (Since we explicitly declare the type)
 
Good question.. I know about weak typed languages, but I still consider C# strong typed even with List<T>. The only thing I could call weak typed is ArrayList etc (non generic)
 
Ah, I see... I assume (I'm not familiar with ArrayList) but an ArrayList is effectively an Array of objects? @RoelvanUden
 
List<dynamic> maybe ;)
 
@drch i was sending it like this now
byte[] toSend = str.Concat(BitConverter.GetBytes(ms.Length)).Concat(ms.ToArray()).ToArray();
 
9:32 AM
@Dave It's effectively, List<object>, thus pretty much everything allowed.. :-P
 
but at the server at: Image image = Image.FromStream(ms, true);
 
@KraziiKiiD aren't you writing the client and the server?
 
it says: An exception of type 'System.ArgumentException' occurred in System.Drawing.dll but was not handled in user code
Additional information: Parameter is not valid.
 
Is that, weak typed, as in the absence of type checking? No. But little constraints. Depends on your definition of "weak typed" then.
 
Cool, thank you @RoelvanUden .
Weak typed as in first point from http://msdn.microsoft.com/en-us/library/dn169389%28v=vs.110%29.aspx
`X DO NOT use weakly typed collections in public APIs.`
 
9:34 AM
@Dave Ahh, in that context, they mean that you should not use IEnumerable<object> etc, tell us about the ACTUAL object.
 
@drch i dont understand why it says that.
 
You mean probably it means IEnumerable<T> is bad, but IEnumberable<string> is good?
or that it's bad if it's object (or any base class for that matter)?
My head is totally spinning from reading that article now!!
 
IENumerable<T> would be fine
because T would mean something
it's saying don't use some base T when the implementation is something different
public ICollection<Animal> Animals { get; private set;}
this.Animals = new List<Dog>();
 
Right, I understand what you mean @drch
 
To confirm, ^ that. :-P
 
9:46 AM
HI GUYS
Been at work for an hour and still not looked at this web forms app
So I'm still happy
 
Wow, that is amazing. Keep up the good work sippy! :-D
 
hahaha
 
he he, thank you again @RoelvanUden
 
@RoelvanUden Thank you sir!
 
and thank you @drch
 
9:53 AM
@GotalovePHP Did you fix your thing?
 
@Sippy I got to upload file
but not on the one with problem
working on it now
 
Ah
 
@Sippy @Squiggle it isnt sending image in network developer tools
 
> Usually, the controller is implemented in the view
Wat.
 
cut/copy/paste, File Saving, undo, networked data -- these can be expressed
just on the model which simplifies things
I don't really get what that even means.
 
10:07 AM
@RoelvanUden when I add the other crap in it doesnt send the image data in post when I view network tools imgur.com/qfsTDBc @sippy check out this pastie->http://pastie.org/9494041
 
10:20 AM
@TomW i think that's accurate in mvc for gui applications
altho maybe not :P
but its more of a 1:1 relationship with controller and views
> The primary difference between this design and the more traditional version of MVC is that the notifications of state changes in model objects are communicated to the view through the controller. Hence, the controller mediates the flow of data between model and view objects in both directions.
 
@RoelvanUden "Incremental backups" ............ doh.
 
10:54 AM
@Sippy Lol what? :-D
 
Yesterday when we were talking about backups
Although even with incremental you'd want a number of copies of it.
But then that's just RAID right..
so
 
Oh, yes, you want backups of your entire system. Files or not. Databases can do incremental backups so you can restore an entire snapshot at some date by taking the base and all the deltas. You can just synchronize those deltas to another location to have the redundancy..
Once a month or so you could start with a new full database dump, and then keep daily deltas again. Pretty easy, comfortable, and highly redundant and consistent.
 
11:12 AM
See
Learning erey day.
 
also - make sure you attempt recovery at least once
recovery fails more often than backups ;)
 
11:46 AM
Microsoft releases their own document database
http://azure.microsoft.com/en-us/documentation/services/documentdb/
 
@Sippy @RoelvanUden found the problem a rather unexpected one in my input before <input id="Images" title="Upload logo" type="file" /> changed to <input type="file" id="Images" name="Images" />
 
Wondering about use of document database in practice - what if your model changes and old records don't deserialize properly anymore?
Is the solution:
- don't do that
- write translation code
- design the application to be tolerant of 'no data' everywhere?
 
well you can also change the deserialization code
the important thing to remember
 
don't know if its the order or the use of title
 
I suppose when you use an event store kind of model, the definition of an event doesn't really change that much - it happened, and this was what was relevant at the time
obviously not everybody implements an event store
 
11:58 AM
@TomW either with versioning or with data migrations, same as one must do with model changes in a sql db
 
well if you want to be a .Net Hipster you need an event store
 
and in both scenarios, its nice to have a policy where all db changes must be backwards compatible with the prevoius version so a) that those 2 steps can happen asynchronously and b) you have a quick roll-back plan
 
lets do some CQRS with a ES
I read some blog about how cool it is
 
 
1 hour later…
1:03 PM
omg.
I finally figured out why the hell this webforms thing wouldn't update.
Or not even figured out
I had to ask the old developer wtf was going on
To allow it to change the UI there has to be a trigger on the god damn table that updates the ref table in another ref table and sets it as changed
WAAAAAAAAT
 
hahaha now you been stressing for nothing @Sippy
 
Such a retarded way to update a UI.
 
Webforms....
 
1:18 PM
tgif!
 
1:29 PM
Happy Friday!
CQRS with ES ? @DavidDV
 
I'm just joking :p
 
:)
what's ES?
 
Event Sourcing / Event Store
 
Is that what you read?
:P
!!doge cqrs,es,most interesting
 
   wow
            so cqrs
                            very es
such most interesting
 
1:43 PM
CQRS is great when you do RDD
Btw that article is pretty bad
 
I just googled cqrs es cos I've never heard of either of them lol
 
woo woo
The “?.” operator is now implemented in the latest CTP of Visual Studio “14”.

For links to details about this and other new C# language features, check out this CodePlex post:

https://roslyn.codeplex.com/discussions/552378
Please try out the feature, and see how it works for you!

Thanks again for great input, and the many many votes!

Mads Torgersen (MSFT)
C# Language PM
 
hi anyone using GWT /Sencha GXT ? Want some opinions...
As per my understanding they are Java to JS compilers
 
@RyanTernier "Ryan Ternary"
 
Is it "best" way to build web apps...despite of the fact that many do use it. I felt its better to code in JS directly....do MS ASP.NET MVC use any similar approach, I mean coding client side logic not directly in JS?
 
1:54 PM
ASP.Net MVC is for programmers who want to do as little JS as possible
btw GWT is being replaced by Dart
 
@DavidDV Not really, only if you're lazy. You can still add a lot of augmentation with JS to MVC stuff.
Especially to those awful tables.
 
Well talking about Web Applications, I don't see any reason to choose Asp.Net MVC instead of angularjs
 
lol
I don't see any reason not to choose (shiny new tech that applies to one type of problem) for every problem!
 
@DavidDV Wouldn't really be able to comment on that :) Never used Angular before.
 
yeah lets all follow the Microsoft way of building things \o/
 
1:58 PM
@DavidDV Because of of use, that's why.
 
Asp.net MVC with WebApi and EF Code First, oh lala
 
Let me scaffold my way through the ever changing business rules, thank you very much. Let me use those fancy grids with IQueryables and sorting, filtering, etc, without ANY effort whatsoever; thank you very much.
 
pick the tech appropriate to the project
and picking a very opinionated frontend js framework should be evaluated
 
@RoelvanUden Fancy grids?
 
1:59 PM
Oh fuck this.
 
lets just pick the MS-standard it's safe :D
 
A godsend. Filtering, sorting, paging, all there with very little wiring.
 
I quit.
I built
In raw js
 
Anyway I just know A LOT of .Net developers who want to do as much as they can in C#
 
That fucking grid
 
2:00 PM
and who are scared or don't like Javascript
 
@DavidDV That's good practice though. The more shit you have everywhere the less maintainable it is.
 
Why?
 
Bwhahahaha a perfect grid in a few lines of awesomeness.
 
Just uses page model?
 
It just eats my POCO
Which is IQueryable<POCO> and wires up to EF
 
2:02 PM
pffff fluent interfaces are so 5 years ago ;)
 
So everything is free for me, entire DB grids... no effort.
 
Fuuuuuuuuuck
Keeping hold of that
 
"I want to filter on name". Okay. Filterable(true).
Done.
 
Gonna need it .. a lot.
 
<- not impressed
 
2:03 PM
@DavidDV You want to do everything yourself, I know.
 
Why is it not impressive?
 
I like the total ease.
 
It looks suave too
 
is that a library then?
 
Similarly, why ASP.NET MVC for data models? Well, data annotations for validation rules. They are automagically translated and checked on the client-side... unobtrusive. No effort again, all wired up full model binding according to all business rules. In one place.
Why ASP.NET MVC + EF? To reduce effort. That's why.
 
2:04 PM
data annotations suck
I use angularjs + Nancy + Linq2Db to reduce effort
why else
 
I know you like the bare metal stuff. Not everyone does.
 
its not bare metal
 
linq
lolz youre still using a relational db?
 
Linq is pretty bare.
As bare goes.
 
what a noob
 
2:05 PM
Hahahaha
 
sometimes relational db is the way to go
 
no elasticsearch no care
 
isn't that like a shiny new technology :ppp
 
2:25 PM
H4XX0RD!
 
:O
 
Lol
 
this is interesting @DavidDV
 
?
 
as you know, I have moved from EF to linq2db because EF was failing Insert, due to SCOPE_IDENTITY being null, thanks to a INSTEAD OF INSERT triggger
Looking at linq2db, it does same thing, but does not fail
 
2:35 PM
Argh. Linq2db is not the same thing as EF. Don't try to sell it like that.
 
lol
 
It's dapper with Linq; that's it.
 
no doubt
 
I am not
 
its not the same thing, its much better ;)
 
2:35 PM
switch to mongo
 
Oh, sorry my bad
EF was failing on second insert, one, where I don't care about InsertWithIdentity
damn my memory
linq2db allows me to proceed, where EF was fialing
 
well yes
 
but I am not confused @RoelvanUden
every tool has its purpose
and linq2db kicks ass in some departments
 
the problem is that you spent time learning EF, and every little thing that is holding you back you can choose to spent more time learning EF, or choose another technology, but then all that time spent learning EF is "wasted"
 
not wasted
 
2:38 PM
Escalation of commitment was first described by Barry M. Staw in his 1976 paper, "Knee deep in the big muddy: A study of escalating commitment to a chosen course of action". More recently the term sunk cost fallacy has been used to describe the phenomenon where people justify increased investment in a decision, based on the cumulative prior investment, despite new evidence suggesting that the cost, starting today, of continuing the decision outweighs the expected benefit. Such investment may include money, time, or even — in the case of military strategy — human lives. The phenomenon and th...
 
Edison did not waste time when he created 999 lightbulbs which did not work
 
and yet you blindly recommend angularjs for every project?
 
he learned how not to build a lightbulb
same with EF
 
kind of a contradiction, no?
 
you learn when it is no-good
 
2:39 PM
I recommend angularJs because I really really Like it
And I hate big frameworks
 
Recommendations are worthless if they aren't born of experience.
 
I love AngularJS
 
@DavidDV and you're in the .net C# chat room?
 
but then again, Hot Towel is equally cool
 
I could recommend that you buy a Ferrari because I've heard they're good, doesn't mean I have any idea.
 
2:40 PM
AngularJS <3 <3
 
you can use C# with angular :)
 
.but .NET is one of the largest frameworks...
 
STOP LIKING WHAT I DONT LIKE
 
the thing I also dislike about Asp.net MVC and Web Api that its Convention based frameworks
 
@DavidDV you also like WinForms ;)
 
2:41 PM
I've been doing WebAPI/AngularJS for 4-5 months now. It's lush.
 
I have no choice but WinFroms :|
 
YOU LIKE WHAT/
?
Oh win forms
 
convention over configuration was a design choice
 
I thought that said web forms, carry on
 
and everything is extensible if you don't like it
 
2:42 PM
I don't really like WinForms, I just like it more then WPF ;p
 
David: freak.
 
@DavidDV i like how you make an opinion and then within 3 messages, contradict it
 
For my applications WPF is not fast enough, I have colleagues in the US who went to WPF and came back to winforms because of performance problems
drch?
What I also like about angular is that it works with normal javascript objects
instead of ember / backbone
 
they were probably not using WPF correctly... not WPF's fault
 
came back to winforms b/c of perf problems AKA we didnt know how to do wpf
 
2:45 PM
It is WPF's fault if it is to hard to use it correctly
 
its most developers fault that they dont rtfm before doing wpf
 
Well we have to show a lot of data
bullshit
 
we are doing 1million points on a 3d projection of a high temparature surface in wpf just fine
 
And I have to show tables with 8000 rows / 900 columns with all sorts of data
 
data collection from thermal cameras happens in the background and shuttles data to the ui, all done in wpf
 
2:46 PM
I fixed a slow-performing WPF app because someone was binding UI elements directly to lazy-loaded EF models
 
I've basically only used designer for WinForms and I've been on straight WPF for 2 years now. I bet if I went to WinForms I'd say its too hard to use WinForms correctly
 
WPF performance is absolutely stunning, indeed. Millions of elements are no trouble at all. It's called 'Virtualization' in WPF, @DavidDV :-P
 
900 columns...no human can effectively use 900 columns on screen
 
I never had WPF performance problems btw, since I never used it
 
that's what virtualization is for.
 
2:47 PM
our issue was 200 rows = 4000 aggregate EF queries
 
@CharlieBrown yes they can don't assume too much about the things I make
 
:-/
 
telerik's (of all companies) silverlight demo loads a billion cells in like 1 second.
 
i love when business says, we need all 74 columns in our datagrid... who the f can use 74 columsn wide
make some analytics or reports over that junk
 
2:49 PM
Good day all!
 
amen Charlie
 
yes amen Charlie
really
 
though i'm showing something like 1million datapoints on a graph right now :(
 
@NETscape A US billion?
 
watch that exchange rate
 
2:49 PM
haha
 
That program is not some CRUD program
there is a lot of data in the pharmaceutical sector
and they want to see it all and play with it making graphs / filtering
 
that always happens... some business idiot thinks he can manually filter data and come up with some insight, instead of using actual statistics
 
they also run statistics
 
but you need all the data to do that
 
2:53 PM
though I think that's referring to something else i've missed @RodrigoSilva
it's not WPF that loads the data (if we are still talking that)
 
stats is not something humans do by playing with column filters... feed the data into some fancy new bigdata provider and let it find trends (if you believe the commercials)
 
@NETscape It takes way more than 1 second here :P
Am I doing it wrong?
 
Well why don't you come and tell that then too all these chemists
Would be entertaining
They want it, and I can give it to them without problems
 
applying for something to the government that has some unknown process time and receiving an auto-reply email that says "please don't email us about the process status of your application" makes for stressy days after a few weeks
 

« first day (1406 days earlier)      last day (3534 days later) »