« first day (2559 days earlier)      last day (2388 days later) » 
02:00 - 13:0013:00 - 23:00

mr5
2:03 AM
o/
\o
\o/
@TheFootClan yes
 
 
3 hours later…
5:12 AM
posted on October 18, 2017 by Scott Hanselman

James Clarke from the Windows team rolled into a meeting today with two Surfaces...but one had no keyboard. Then, without any ceremony, he proceeded to do this: Now, I consider myself a bit of a Windows Productivity Tips Gourmand, and while I was aware of Miracast and the general idea of a Wireless Display, I didn't realize that it worked this well and that it was built into Windows 10. In

 
mr5
5:23 AM
no
 
5:44 AM
Morning.
 
Good morning @AvnerShahar-Kashtan
 
6:43 AM
megabots vs suidobashi happened!
And it sucked.
Servus sharperinos
 
sudo bash?
 
There's this epic encounter in a big warehouse. Two huge mechs face each other. The encounter everyone waited for for over 2 long years.
Megabot on tank treads, each arm has a huge weapon on it that makes people think the pilots might be better off having a good life insurance.
Kuratas on 3 wheels, has one huge arm and one smaller, agile arm, that might aswell hide a minigun.
The fight starts - Kuratas points the small arm at megabot, accelerates, turns his bigger arm towards megabot - and hits him before megabot can even start to act, tipping ihm over.
 
Hello @Metallkiller Good morning :)
 
Morning @mark333...333...333
 
6:59 AM
By the way I'm having some issues in file upload hosted in my IIS. But it's weird because it's working in my local development machine
:)
 
Shutdown your firewall then
Also since you're donig htat right now: How do I configure FTP on my IIS so my brother can use it with a, account I made for him to upload stuff?
I put his name into "FTP authentication" or something, and neither his nor mine (which was there automatically) work.
 
gooood morning :)
 
It's an azure vm. Got a domain name. Getting a login window for ftp when I go there. Credentials dont seem to wor.
Morning @SebastianL
 
I already turn off my firewall @Metallkiller :)
but still it doesn't work
morning @SebastianL too :)
 
How does it work on your local machine?
 
7:11 AM
I have my code for saving it to my local folder inside the project. The name of that folder is, "CsvFiles" inside the Content
when I host the application, I also included the CsvFiles folder inside the Content so everytime the user use the upload feature, all csv files will be saved there.
It's working on my local machine but after I host it, it doesn't work
 
How does the upload work?
http? ftp? smb? Some other thing i cant tink of?
 
http @Metallkiller using <input type="file" /> in html
and in my controller, it's HttpPostedFileBase where inside the method, there's a Server.MapPath and SaveAs method
 
Try to rebuild the process, with a s little extra clutter as possible. Just the bare upload process.
 
string filename = CsvFile.Filename
string targepath = Server.MapPath(“~/Content/CsvFiles/”);
CsvFile.SaveAs(targetpath + filename)
Everything is working properly in my local development machine.
 
GoOoOoOoOoOoOoOoOoOoOoOd Mornin' neglecterinos!
 
7:19 AM
I also restarted the server, still it doesn't work
Good morning @Nerdintraining :)
 
mr5
maybe ~/Content/CsvFiles/ doesn't exist in server
 
Morning @Nerdintraining o/
 
It's inside my project
and also in the published project
 
@mark333...333...333 Put logs everywhere. Does the path exist? Is it valid? Is the filename valid? Is the targetpath ok?
Also actually: which wpart doesnt work? .SaveAs?
Which part of saveas?
I bet it has more than one line of code inside.
 
In server, I have no idea which part where it doesn't work.
 
7:24 AM
Install VS, attach debugger?
 
But in local development app, the file is saving in my local machine.
 
@Metallkiller shouldn't you be working on your project? :P
 
@Nerdintraining I am multitasking :P I could also ask you the same :D
@mark333...333...333 Did you put it on your local machine and upload from another machine? Or did you upload from your own local machine to itself?
 
@Metallkiller I have physical server here and it is Windows Server 2012. So whenever I publish my local project in my machine, I paste the published project in that physical server. :)
 
7:30 AM
@mark333...333...333 I think you misunderstood my question :)
When you test it on your local machine, what exactly do you do?
 
Since I have access remotely in the machine, I just copy and paste it and run it in the IIS of that physical server
Oh Sorry. When I test it on my local machine, I just simply run it and try to upload files. @Metallkiller :)
If there's a problem, I also use break points
 
in your local browser?
 
In my local browser, if there's javascript involve, I check the console.
But I'm using action result submit so I directly go to controller if the value is null or not.
Inside the IIS, i check the log file
I really have no idea why it doesn't save in IIS :(
 
It's always the fault of JavaScript.
Always
 
good morning
 
7:45 AM
good morning
Can i pass type arguments as params[] like: GetLog<T1, T2,..> ?
 
@MohamedAhmed yes you can use Tuple :)
 
@mark333...333...333 in C# 7?
 
I'm also learning C# everyday :)
 
but I need to use it in VS 2013
 
yes it's working there
 
7:49 AM
@Metallkiller i am not uspporting anyone on the c# chat, so i am working on my project :D
 
Hey all. I'm running an application on IIS at mydomain.com. How can I run a different application at mydomain.com/subdir/ ?
 
mr5
you don't run to it, you listen to it
 
Whatever. You understand my question :)
 
are you using IIS as well @mr5? :)
 
I have this generic method:
public class GetLog<TItem>(..)where TItem:IHasSerial
{
     var list = new List<TItem>();
     //fill list
     List<IHasSerial> listSerial = list; //cannot convert
}
 
mr5
8:05 AM
@mark333...333...333 nope. I once use Node.js and PHP before :P
 
@MohamedAhmed oh how i miss generics in lotus script
 
8:23 AM
0
Q: How to pass undefined number of type arguments to generic method?

Mohamed AhmedI have a generic method that that takes two type argument the first is a class that has a list of items that I pass its type as the second parameter: public static TJCls GetComplexLog<TJCls, TListObj>(int logIds) where TJCls : ISplitList<TListObj> { //here I deserialize the string from DB to T...

 
Pass object[]
Read object[]
First object is a type, seconds object is its value. THird is type, fourth is value. And so on.
You now have a method with infinite object of different type.
 
morn
 
8:38 AM
So StreamWriter(String, Boolean) initializes using default encoding, but Streamwriter(Stream) initializes using UTF-8. Where's the continuity here?
 
8:56 AM
@Kieran heyho, we got chicken dinner yesterday
almost twice in a row
 
noice noice noice
 
Aswell I remember
What happend that you had a car accident
i hope nothing serious
 
Tom
9:33 AM
Question
Let's say I have multiple projects that depend on each other (mvc project, web api project, business logic, models, ...). In multiple projects, I want to read configuration values I put in web.config or whatever. Whats a good solution so solve this?

Right now I put my settings in web.config of the mvc project and read them via a Config class. The problem is, that I need a copy of that Config class in my business-logic-project. Otherwise I would have to reference the mvc project and have a circular reference (mvc proj <-> business logic proj)
I could also get rid of the Config-Class and just access the ConfigurationManager.. but using my Config class, I don't have to remember the settings-keys and also have validation when reading from the web.config.
 
What if only the business logic has the config class?
 
Tom
Damn, true..
how are you managing settings?
any best practices?
 
9:57 AM
Lol not in my company
Need some ideas.
Is there ANY reason you would go oneString = String.Format(otherString); ??
 
depends
but mostly, no
if otherString comes from a configuration file for example
where many strings come from
and in this case, you just dont have variables to inline
you still might want to have consistency
because now, all your configuration strings are equal
if you didnt use the String.Format, then in this case, you dont escape the curly braces
which is not forwards compatible (assuming that you might want to add a variable later on)
and breaks consistency in the configuration
that is one example
but yet again, it depends on how you use it
there is very little that doesnt have a meaning at all in every case
 
I don't understand
Does the string.Format do anything to curly braces within a string?
And yes, one of these is a connection string, albeit not from a file.
They just go
				connectionString =
					@"ImaReallyAConnectionStringImJustCensored";

			_connectionString = String.Format(connectionString);
Why they're setting a parameter and immediately assign to another variable is not my concern right now
 
10:15 AM
String.Format is the equivalent of string interpolation on runtime rather than compile time
it converts ("foo: {0}, bar: {1}, baz: {0}", 1, false) to "foo: 1, bar: false, baz: 1"
this does mean that you cannot use curly braces by default
as they are meant for interpolation purposes
iirc, the escape sequence is a double curly brace
aka, "foo: {0}, bar: {{0}}" would result in "foo: 1, bar: {0}"
I wonder if "foo: {" would throw an exception that the string is in an invalid format
 
no
but $"foo: {" wont let you compile
 
I dont find that odd
 
afaict, only string.Format and $ care about curly braces
 
the {" starts a new string
I mean String.Format("foo: {"); would throw an exception
because it isnt valid
String.Format("foo: {{") would be valid
 
THat's right. When you do that, Visual Studio warns you about not closing a curly brace in a format string.
But of I have a str str="ImaConnectionString";, why would I go string str2 = string.Format(str); instead of just str2=str; which is shorter, clearer, and omits the string.FOrmat?
 
user7538827
10:22 AM
Goodmorning
 
Morning
 
System.FormatException
 
user7538827
do you know a way to reduce the size of an image with c # having its link? (I mean the size in megabytes of image )
 
@Metallkiller again, I dont know what the reason is
or how the code looks
or how smart the person was that did it
or what the code was before it was like this
 
Ok so I will never have a reason to use string.Format instead of just assigning the string?*
*given that I don't actually wanna format the string
 
10:25 AM
it does provide a security check :D
 
It does?
 
if you have single curly braces in your string, it will throw an exception
System.FormatException
 
Oh, right
 
its a very bad way of doing such checks, but who knows what he was up to
 
Now I get what you meant^^
There were about 5 people working on this over the last ~3 years, and after some time there were always more important things (patching our actual product), and it got delayed. Not it's my project to complete.
 
10:29 AM
if you want to see code of which I have no clue why it is there, just ask :D
im sitting on a project of another developer as well
even non=programmers are like "wtf is that?"
 
lol. Get it in here already!
 
Phrasing
 
if (a)
    return x;
else
    return y;
return z;
if (1 == 1)
    {stuff}
shit ton of ref parameters
and using them as out
 
I found a if(true==true) too :D
Why do people do that-.-
 
if (true) is in some cases nice
but why 1 == 1 instead of true ???
also... 8k line function
 
10:33 AM
@Wietlol Maybe because people are used to it from languages where there isn't a built-in boolean literal.
 
2k line try block
with an empty all catch
 
Why do if(true) though?
 
switch cases op
that one is actually not able to be converted
that function reads out an xml
and has foreach -> if -> foreach -> if -> foreach ...
 
um
why no else if
only else do another if else do another statement else do another statement
who programmed this
 
just because he thinks this is more readable
 
10:36 AM
Had that too, but with 3 layers only. Can you make it a recursive call or something?
 
wtf
 
@Kieran why no else if? why no switch? why no any number of better practices?
 
on what fucking planet is that more readable
 
Go switch -> recursive
 
The cyclomatic count on this thing is through the roof.
 
10:36 AM
@Metallkiller not really, should either be a recursive call with xpaths or all different functions
 
In fact, try to get VS to calculate it for you, see what it says.
 
user7538827
@Wietlol
but you do not need to use a case switch
 
The only thing its going to make me do is stop whatever the fuck made me come to this method
so i can re-write it
 
Maybe R# can minimize it into a single linq or something :D
 
10:37 AM
also...
half of the variables are inside an xml
 
run
run away and never look back
 
which is passed all the way across this program in a string
 
RUN @Wietlol
 
3 guesses on how he gets the values from the xml
 
Maybe build a mapping dictionary and simply use that for a lookup.
I can think of various ways to improve it.
The question is, should you bother?
@Wietlol REGEX!
 
10:39 AM
nope
luckily not
but close
wait... worse
2 guesses left
cmon you can do better than regex
 
String.IndexOf?
 
Ḋ͈̙͓̫̬̣͈͠Ȍ̆ͅ ̮͔̠̤̅͞I̫̯̤̹̪̻͑̋̋̌̾͒Ţ̮͍̱͙͔̞̩̓̇̅
 
JUST
Ḋ͈̙͓̫̬̣͈͠Ȍ̆ͅ ̮͔̠̤̅͞I̫̯̤̹̪̻͑̋̋̌̾͒Ţ̮͍̱͙͔̞̩̓̇̅
 
File.ReadAllLines(my.XML);
 
DON'T LET YOUR MEMES BE DREAMS
 
mr5
10:41 AM
Http.ReadAllText(Facebook.Com)
 
Oh, lordy.
IT'S 1998 ALL OVER AGAIN!
 
This method can be made static
I C UR R#
 
user7538827
goodbye
 
I use Rider
so ofc I have R# :D
 
Tom
10:57 AM
@RiccardoPirani You can download the image and process it with Image Processor (imageprocessor.org) for example. Like resizing it or reducing the quality. For reducing size with nearly no visible quality loss, I use TinyPng API. But I'm not very happy with it, since the API seems to make problems pretty often.
 
@Wietlol Please god, no, please, no, no, no.
Shoot that person
 
11:13 AM
@Wietlol Am I wrong to say that this will only find the first instance of any tag?
 
@AvnerShahar-Kashtan Nah. After processing the first tag, they just delete that part from tha string, and go again.
 
That's still ridiculously broken
 
@Metallkiller Sure, why not. Forward-only once-only processing. Blink and it's gone.
 
Is a chicken egg an egg laid by a chicken, or an egg that hatches a chicken?
 
both
 
11:20 AM
It's a cowardly egg.
 
@Metallkiller If you find an example of an egg laid by a chicken that hatches something other than a chicken, we've got bigger problems than word definitions
2
That said, it's an egg laid by a chicken
 
So the hen was first then
Glad we have that cleared up
 
There was no first
 
Well of course.
 
Well, technically the chicken came first
it just evolved into the modern day chicken
from fuck knows what
 
11:22 AM
Roughly said:
There was a dinosaur, it laid an egg, and that hatched a chicken.
 
@Metallkiller Egg was fisrt,
Dinosaurs laid eggs aswell
 
+ the new "hen" had to mutate first to become an egg
happnes mainly through reproductions -> egg always first
 
@Metallkiller Very roughly. So roughly as to be meaningless. There wasn't a single egg that can be pointed to that has a meaningfully non-chicken parent and meaningfully chicken hatchling.
 
OH shit a hen mutated and became an egg?
 
11:23 AM
@Kieran A bird, duh
@Metallkiller That still happens every day
 
@Kieran just meme it?
 
How can a hen become an egg
 
@Metallkiller With a time reversal machine, of course.
 
@Metallkiller By being named Metallkiller, of course.
 
@Nerdintraining always meme it
 
11:54 AM
@AvnerShahar-Kashtan ow it doesnt even matter at all
it works right?
so its fine
 
I've just created a console application to get the output of some logic of 2 classes. Now I want to create a webpage without all the crap that a MVC project gives me. Just a page, combined with C# (.cshtml?). How can I do this? I created an empty project but it does not accept the .cshtml file.
 
@ErwinOkken Maybe just a dead simple WebForms page?
If you're just looking for output you wouldn't even need a proper page, just return a string from a Web API method.
 
@Metallkiller i think i am like almost finished with my project
 
@KendallFrey Until now I have only worked with WebAPI and MVC projects. But I want the most simple configuration possible, while using C# inside my page. I tried "Blank project" but that's too simple then I guess.
 
IIRC WebForms is really simple
 
12:08 PM
Is the Empty project template then being used for just HTML/CSS/JS without C#?
And .cshtml is not supported then? :)
 
I have no idea which template you're referring to
 
Visual Studio -> New project -> Website -> Empty
:P
Even with WinForms I get all sorts of crap for logging in and stuff
 
WinForms?
 
Web*
 
Tom
Go a static class in my business logic project named XyzDataReder. It reads data from the db, puts the data into models and returns the model.

I also want to put logic there to update/insert data. How to name the class? Or how do you structure the project?
 
12:22 PM
@ErwinOkken search for "selfhosted owin webapi" this way you can use any project you want
 
@Nerdintraining Damn. I got maybe like 20%, max.
 
@Metallkiller welp my programming part should take like 5 days
it's narrowing down to 3 at this rate
 
12:46 PM
Nice, that means next week you can come here and help with my project? :D
If you don't tell your boss, I wont tell mine
 
I'm referencing my console-application from within my winforms-application. The console-application has a public class League. VisualStudio recognises the League class. But when I start the winforms-app and visit the page: The type 'League' is defined in an assembly that is not referenced. What could this be?
^ Oh, that only works with class library. :')
 
@ErwinOkken No, it should work. EXEs are basically DLLs with some extra headers an a default entry point.
The only issue might be that the WebForms' Publish action doesn't copy the dependency to the bin folder.
 
@AvnerShahar-Kashtan That could be. However, it works if I select a class-library so in this case I'm fine with the result :)
 
@ErwinOkken It also makes more sense for it to be a class library here.
 
02:00 - 13:0013:00 - 23:00

« first day (2559 days earlier)      last day (2388 days later) »