« first day (2053 days earlier)      last day (2900 days later) » 

4:00 PM
But I guess you're asking for a best practice for generating and accepting 'something' in the request representing that claim
 
@TomW yeah, best practice would be ideal - this is something we'll need to replicate in other products soon
eh. Beer time now. I'll tackle this in the morning.
 
4:26 PM
\o/
 
I do a zip to sum to arrays
when I "sum" them up the result instead of being the first array plus the second int only gives me the values of the second
  public int [] ExecuteCommands(string Directoria, CdpsiUpdateSql Updater, CdpsiUpdateSqlparser parser, string Log)
        {
            int [] Return = new int[2];
            List<string> Paths = Directory.GetFiles(Directoria, "*.sql", SearchOption.TopDirectoryOnly).
                Select(f =>
                {
                    int version;
                    string[] parts = Path.GetFileName(f).Split('_');
                    if (parts.Length < 1 || !int.TryParse(parts[0], out version))
srry if its too much code
any clues ?
 
can anyone have a look at this question please :)
0
Q: Use MemoryStream and ZipArchive to return zip file to client in asp.net web api

Kob_24I am trying to return zip file from asp.net web api to client using The following Code: private byte[] CreateZip(string data){ using (var ms = new MemoryStream()) { using (var ar = new ZipArchive(ms, ZipArchiveMode.Create, true)) { ...

 
@Mr.Toxy you never populate Return
It's giving you the right answer
 
Return.Zip(FinalCnt, (x, y) => x + y); but Im affecting Return here
 
Wrong
LINQ methods are idempotent, they don't modify the input sequences
 
4:38 PM
can I do like Return = FinalCnt? and then zip them?
if not I already know what to do
a var for the 1st pos and a vasr for the 2nd, then I summ them up, make the array pos equal to those vars and return the array
it's not pretty but it works fine
 
What are you trying to zip FinalCnt with?
You only have one sequence of values; where's the other?
 
with Return
 
Return is all zeroes
So what are you actually trying to do?
You don't set it to anything, so what data were you intending to sum?
It's either the result or one of the two inputs, it can't be both (well it technically could, but you shouldn't, really)
 
ok I have that function that executes the SQL commands and returns a two position array the 1st the number of successful commands executed and the 2nd de number of commands with errors, it the end of the function I need to sum all those values and return them in a 2 array position hence the .zip
 
Not too obvious to do in LINQ
Zip can technically do it I think but it won't be obvious and relatively inefficient. I'd just use a normal loop and some count variables, to be honest
 
4:45 PM
my idea (not pretty) is:

var num1 += array1[0];
var num2 += array1[1];
int the end I do this.
array2[0] = num1;
array2[1] = num2;
return array2;
 
That's better, I think. It's a little ugly but at least it's clear
 
yeah its uglier XD but it works
I thought that .zip would do the trick but np
 
Yeah I think you could do it, but you'd be constantly casting to array and back to IEnumerable
 
yeah :\
I'll go with the ugly version :p
Return[0] += FinalCnt[0];
Return[1] += FinalCnt[1];
that will also qork
 
Yeah that looks fine
 
 
1 hour later…
6:16 PM
[MessageContract]
class Foo
{
    [MessageBodyMember]
    public string A;
    [MessageBodyMember]
    public string B;
    [MessageBodyMember]
    public string C;
}
This is giving me warnings that the fields are never assigned
I have another message contract that's pretty similar, but it doesn't get the warnings
Neither of the classes actually have their fields assigned.
Why does one give warnings but not the other one?
 
6:33 PM
same kind of project? Environment?
 
It's a different project
This one is a console app, the other one is a library
hmm
 
maybe it got better warning checking with .Net version upgrade
 
holy shit I think I figured it out
1 minute
hahaha wtf
it's InternalsVisibleTo
the other assembly has a bunch of those defined, so the internal class is treated as public
 
user6096770
is it easy to add a local sql database for a c# wpf app?
 
user6096770
6:51 PM
i googled with sql databases but it looks so complicated and im a complete beginner, anyone want to link me good beginner tutorials?
 
9:34 PM
I am trying to deploy my azure web application but I get this error message could somebody help me ? postimg.org/image/ing8kjs1n
 
@FluffyWuffy Are you sure you need a local SQL?
Unless you need something large, using XML will usually do fine.
 
9:55 PM
How can I use a method from a class when I click in a button from the form on C#?
Do I have to assign the class to a variable and then use that variable.method inside the button?
 

« first day (2053 days earlier)      last day (2900 days later) »