« first day (2558 days earlier)      last day (2376 days later) » 
01:00 - 12:0012:00 - 23:00

mr5
1:35 AM
halo halo negloterrorinos!
!!> Array(16).join( 'wat' - 1) + " Batman!";
 
@mr5 "NaNNaNNaNNaNNaNNaNNaNNaNNaNNaNNaNNaNNaNNaNNaN Batman!"
 
mr5
!!> 'wat' - 1
 
@mr5 "NaN"
 
mr5
lol
 
@mr5 "BatInfinity!!"
@mr5 "Bat-1!!"
 
mr5
1:44 AM
!!> ['Bat','w'-1,'!!'].join('')
 
@mr5 "BatNaN!!"
 
Im a Student so don't laugh to much if this is a stupid question but I am trying to get the file path to my Application in the .net Framework. I found Environment .GetFolderPath but when I try and use it It says it does not exist under Environment. Problem is Im staring at it under the Object Browser. Why cant I call it?
 
mr5
what happens when you put absolute path instead?
 
what path do you want exactly? the path for the executable file that you are running?
 
I want the file path for the install location so I can create a log folder and log files
 
1:52 AM
Are you wanting "C:\Folder\File.exe" or "C:\Folder\"
 
C:\Folder
I have
string strDirectory = System.Environment.GetFolderPath(System.Environment.SpecialFolder.ApplicationDat‌​a);
 
Never used System.Environment.SpecialFolder before..
 
mr5
afaik, when you create files without specifying a path, it will be relative to the file executable itself
 
Just a stab - I think this page dictates what you're looking for in better terms - msdn.microsoft.com/en-us/library/…
 
Im sorry, Im an idiot. I forgot I was programming within one of the dlls which is .net core not .net framework lolol
Can a .Net Core DLL be accessed by a .Net Framework application?
 
2:04 AM
You'll want to google that question; first result should give you the answer you need.
 
 
2 hours later…
mr5
3:58 AM
wake up guys!
 
4:19 AM
im awake
:D
but that doesnt count ussually
 
 
1 hour later…
5:48 AM
posted on October 15, 2017 by Scott Hanselman

  You may have had a mentor in the past. Often these are more senior/elder people who are further along in their career. The presumption usually is that if they are "ahead" of you that they likely have something profound to offer you in the areas of advice or strategy. This is a classic mentor/mentee situation and while I think it has value, it has a few problems that are worth pointing

 
6:05 AM
Good morning.
 
Morning
 
mr5
good morning guys
 
Am now trying to get HttpClient to run on top of OpenSSL instead of SCHANNEL. Wish me luck.
 
mr5
6:30 AM
zooey deSCHANNEL?
 
Yes. She will be replaced with Zooey DeOpenSSL.
 
mr5
poor schannel.
why did you guys even use that in the first place?
 
SCHANNEL is the built-in Windows SSL stack. Whenever you use HttpWebRequest/HttpClient to connect to an HTTPS service, it uses SCHANNEL.
 
mr5
oh
 
I'm not even sure I can replace it.
 
mr5
6:34 AM
another standard
I thought OpenSSL is alone in his field
 
Servus Sharperinos!
 
OpenSSL is the primary one used on unix. But Windows has its own implementation.
And there are others as well.
I'm sure there are many bad implementations hidden inside firmwares everywhere.
 
mr5
pro tip: when comparing floats, convert it to string first so that you will be able to use the == operator
...without warning
 
@AvnerShahar-Kashtan What's the motivation for this?
 
6:46 AM
@mr5 lol
 
@RoelvanUden A 3rd party service we need to connect to, running on Apache on linux, uses a set of ciphers that aren't supported on the fully-patched Windows 2012R2 server we're using.
Apparently a known limitation.
One solution is to edit Apache's ssl.conf file to reorder the ciphers to put the supported ones earlier, but getting the client's IT department to agree to it is a problem.
 
TIL stock market hours APIs are all paid
 
Since they don't know if that will affect other clients.
I'm probably going to give up on that approach and instead spawn a new process running a one-line python call to get the data and return it to my C# process. Python's stack is based on OpenSSL, so it just works. :-/
 
Right. :-/
 
very nice duct tape
 
6:51 AM
The finest.
The longer-term approach will be to rewrite the whole C# class in python, which is a direction the project is already taking - keeping the core in C#, but write the extension points and connectors to external services in python.
It allows for more flexibility at a client site to tailor connectivity to their environment.
 
if I may ask, how do C# and Python parts communicate?
 
Process.Start, passing the parameters in either as command-line args or (if too complicated) into the STDIN stream.
Output is retrieved from STDOUT.
 
oh, so pipes. I get it
 
7:11 AM
Shouldn't a SQL view be updated after I altered the related table.. I changed a column from null to not null, but still null in the view?
 
7:29 AM
good morning
 
@AvnerShahar-Kashtan It's a fine solution, except that it's Python.
Nobody likes Python.
 
I'm fine with Python. But we're checking a different approach now, more IT-oriented.
Apparently the error only occurs on specific machines. On my dev machine, the Apache server and .NET client manage to fallback to a mutually compatible cipher suite.
But on fully-patched Windows 2012 server machines, it fails.
There might be a specific security update on the server that causes it.
 
mr5
7:49 AM
how would you refactor that code?
 
@AvnerShahar-Kashtan Quite possibly. We've also run into these kind of restrictions in the past. I'm not sure why, server manager changed the settings to be less restrictive in its cipher requirement and it started to work.
 
Unfortunately, that's not an option. As a software vendor, it's problematic to tell our customers that they have to change security settings on a different 3rd party application.
 
Ah, you sell software for on-premise hosting?
 
Yeah.
Well, "me" for the next week and a half.
 
You leavin'?
 
8:01 AM
Moving on to a new project.
Since I was a contractor to begin with.
 
I see.
 
GoOoOoOoOoOoOoOoOoOoOoOd Mornin' neglecterinos!
@mr5 the squiggly brackets have to go on a line for themself!
 
mr5
@Nerdintraining NOOO!!!
I do it in Jaba way
 
@mr5 NOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOO‌​OOOOOOOOOOOO
!
 
@Nerdintraining That didn't make much sense. Maybe you meant: 3, d, y, !, ^, π, ?, א
 
8:13 AM
Jabba
 
mr5
8:25 AM
36 mins ago, by mr5
user image
 
I need some help with my project structure
 
mr5
help me hir plz. it's ugly AF
 
We have a solution, with 8 projects in it
I'm working on one of those project for the next two weeks.
How do I generate an extra solution file for that project only?
Lots of results on google, for the opposite direction. Not so much for this direction.
 
mr5
unload?
 
@mr5 Fallbacks will be ugly. That's life. You can write some wrappers around it, but then the wrappers will be the ugly bit. At some point, you're going to have a try/catch inside a try/catch.
 
8:27 AM
@mr5 Feels like a workaround. And I did that anyway the moment I started working on this solution.
 
@Metallkiller Does that project have dependencies on the other projects?
 
@mr5 Are AndroidHttpPostAsync and the other one your methods? Can you make them return null or an errorcode if something goes wrong within?
@AvnerShahar-Kashtan Nope, completely standalone project. Just same category as the others.
 
@Metallkiller So just create a new solution and add the existing project to it.
Or, in VS2015 and higher, you can right-click the project and Scope To This, to not see the others. They'll still be loaded, though.
 
@Metallkiller can't you just create a new solution and add an existing project welp it seems avni already said that
 
OHAYOU
 
8:33 AM
Trying to right now. I expect strange stuff to happen.
 
@Metallkiller A solution is simply a wrapper around a bunch of projects. It doesn't have much magic in it.
 
@AvnerShahar-Kashtan Yeah but last time I tried to make a new solution to add to TFS, for some reason VS always put it into C:\Users\Metallkiller\Documents\VS2015\Projects, even though i told it to put into C:\TFS\Company\Xperimental\Metallkiller\Stuff
 
Ah, yes, TFS sucks because it expects the projects to be under the solution folder. Just put the new solution in the same folder as the existing .SLN.
 
mr5
@Metallkiller I prefer to make them throw rather than return null cuz timeout
@AvnerShahar-Kashtan I can't sleep in the night knowing I made some ugly AF code
and so, this just happened
the reason I made MSHttpPostAsync is because I'm suspecting the Android one is behaving erratically
 
must be cheated by his fellow feminine chip.
every living and non living thing behaves erratically when they receive a data they were not expecting and never wanted to receive such type of data.
^ bull-good-shit.
 
mr5
8:46 AM
it happens randomly though and I can't seem to find a pattern. I'm sure I have made enough validation before going through that loc
 
@AvnerShahar-Kashtan Our structure here is: \Inhouse\Main\Sources[Here lies the big .sln]\Project#\Project#[And possibly Packages]\project#.csproj
So i just had to put the new solution into \Source\Project#\
 
@mr5 it usually connects. try checking the host side you are connecting to? if you didn't change anything?
 
The new-sln-and-add-project worked :D thx @AvnerShahar-Kashtan
 
@Metallkiller how do you kill metal?
 
8:49 AM
Now I jsut gotta find out how to get those roslyn packages
 
@mr5 If it throws an exception but you always catch it and retry, you're not really getting anything from the exception.
 
mr5
@ARr0w lol
 
@ARr0w With jetfuel usually
 
@Metallkiller (y)
 
mr5
@AvnerShahar-Kashtan I'm getting the message
 
8:50 AM
You can't kill the metal:
 
mr5
27
Q: java.net.UnknownHostException: Unable to resolve host "<url>": No address associated with hostname and End of input at character 0 of

ReshmaI've created an app that loads a question from my web services, and it works fine. But, sometimes it crashes and I do not get the reason why this is happening, especially because I have also given it the required permissions. It works fine, but at random, it crashes and gives me this report. pri...

^ THIS
it's the effing WiFi!
 
> java.net
i think i need some sleep
 
"Emo tried to kill the metal, but Emo killed itself."
kek
 
mr5
why is your profile half loaded, nerd?
 
Oh no, not you aswell^^
Ask meta, they can fix and so
 
8:57 AM
may be he showed stackoverflow management that their thumbnail logic is bullshit?
 
mr5
 
why is your profile half not-loaded, nerd?
 
mr5
I'm no kidding
 
yup, its 25% loaded
shows same here.
 
@mr5 everyone has that
 
8:57 AM
@Nerdintraining you just showed Stackoverflow whose boss
 
its a special image that unloads if you make it smaller
 
i know, i see it liek that swell
But when the messages is 3 messages+ long
like this
 
owww
you hacker!
 
it's normal
 
mr5
maybe nerd, cancels it abruptly while his profile image is being uploaded "oh no! I forgot something!"
 
mr5
8:58 AM
cancels abnormally
 
"ah its a nerd who would waste time loading a nerd"
or may be, it is bullying him ^?
even by the machine.
:(
 
mr5
gonna post a question about y nerd profile is half not-loaded. wish me luck
 
is there an attribute that indicates that a method is not pure?
I found [Pure], but no [NotPure] or [Pure(false)] or w/e
 
I think the idea was to default to not pure.
Since the language itself doesn't reinforce purity, the only thing a contract-based solution can do is add explicit promises. So a C# method is, by definition, not guaranteed to be pure.
 
but Resharper marks my method as pure
because it thinks it is pure
 
9:13 AM
So?
 
then I get a warning "return value is not used"
 
Then use it? :P
 
ill try
 
Does it have side effects that Resharper is missing, or are you just not doing anything with the return value and it doesn't do anything?
 
it does do stuff
its a simple foreach with an action in it
where the action is given by an argument
 
9:26 AM
So yeah, that can't realistically be Pure.
 
When is a method pure?
 
> A pure function is a function where the return value is only determined by its input values, without observable side effects.
string.ToUpper() is pure, for instance.
Being assured that method is pure is very useful. For instance, its return value can be memoized and not recalculated every time.
 
yawns
Avner is the guy!
 
A guy, yes, last I checked.
 
That...is a missing link I didn't know how to articulate. I pretty much diverted towards static for that purpose. Nice.
 
9:31 AM
@AvnerShahar-Kashtan that is an odd description to me
 
So can I mark a method as [Pure], and VS (or R#) will tell me where I might trigger sideffects?
 
looking up the definition... it is right, but just sounds odd
 
It gives VS/R# extra metadata to use when doing static analysis.
As you saw, it can warn you if you're not using the return value, because a Pure method should be nothing but input and output, so if you're not using the return value, why call it?
@Wietlol Feels OK to me. How would you define it?
 
iDunno
 
Isn't that also the definition of functional programming?
 
9:34 AM
something like "a pure function returns a value without modifying any existing values or doing some...thing?"
public string Stuff(string input) { return ""; }
that is a pure function
but its return value is not determined by its input
Log(); is supposed to have no observable side effects (depending on what you call observable
 
@Metallkiller Functional programming relies heavily on pure functions, yes.
 
but it shouldnt be pure
 
printing a log entry is quite observable IMO
 
Since Log() doesn't just process an input into a return value, i isn't prue, right? It writes something to...some stream.
 
@Wietlol Sure it's observable - it adds a row in a DB or a text file. That's a side effect. If you call it once or twice or 10 times, the results will be different (the file will grow), whereas a pure method should be idempotent
@Metallkiller Exactly.
Idempotent = performing exactly the same regardless of how many times it's called.
 
9:38 AM
Can we just call functional programming idempotent programming from now on?
 
Only if you don't want to be clearly understood, sure.
 
I'm not clearly understood anyway, so that's ok.
 
mr5
how about int random() { return ramdomizer.Next(); }
 
@Metallkiller you can call it "robert" too, if you'd like
 
in any case, not using the return value of a pure function should make the call unnecessary
@mr5 not pure :D
 
9:39 AM
@mr5 there's state inside "randomizer" which changes
and influences the return value, therefore, not pure
 
int random() { return 4; } this is pure.
 
@Wietlol Yeah, the compiler or JIT might be able to take advantage of [Pure] definitions and optimize out calls to pure methods where the return value isn't used.
@RoelvanUden Pure, idempotent, and even random! Generated with a random die roll.
 
mr5
@milleniumbug how about int random() { static Random randomizer = new Random(); return randomizer.Next(); }
 
!!xkcd 221
 
9:42 AM
 
mr5
iDunno if static is possible in c#
 
@mr5 Same applies. State changes. Not pure
 
@mr5 the Random() is accessing Environment.TickCount as a side effect
you aren't getting it from the input arguments
(oh and if you pass in Random r, the r gets modified by r.Next() so it's also not pure)
 
9:56 AM
@milleniumbug but that shouldnt change the behavior or state of Environment nor TickCount
yes, it does use values other than its input values
but that doesnt make it non pure
 
So once I work on a project in VS2017, I can't go back to pre-2017 because of the new structure.
Can I have a solution with both 2017 and pre-2017 projects, and still open that solution in pre-2017 (and hten, of course, only work on the older projects in there)?
 
28 mins ago, by Avner Shahar-Kashtan
> A pure function is a function where the return value is only determined by its input values, without observable side effects.
 
@Metallkiller I use VS2017 on a solution created in VS2013. Works fine.
 
then what are functions that do use other sources?
i thought that pure functions are just functions that give you a value
without any other effects
 
dunno how they're called
 
10:00 AM
The formal definition I've seen is that pure functions are also idempotent - DateTime.Now isn't pure, because it doesn't return the same value.
 
afaik, the use of pure functions was that you can tell when you are not programming right
 
I usually distinguish between functions that do read-only side effects (for example, you use DateTime.Now), write-only side effects (like logging) and the ones that do both
 
like
string s = "bla";
s.Replace("bla", "foo");
s.Replace("foo", "baz");
dont tell me you never have seen someone do that
 
Idempotence, however, doesn't require purity - a method like EnsureDirectoryExists is idempotent, because you can call it any number of times with the same effect (regardless of whether the directory exists beforehand or not), but it's not pure.
 
string is pure
int isn't?
 
10:03 AM
ints are immutable because you can't change an int variable without assigning to it
 
string is immutable
 
immutability (of a class/struct) and purity (of methods) are concepts that go hand in hand.
 
but they are different terms
an immutable class/object can have non-pure functions
 
Different concepts, yes.
But that go together. "Modifying" immutable objects usually returns a new immutable object - string.Replace, string.ToUpper, etc - which will often be pure, because they just return a transformed object.
Ooh, lunch is here.
 
@AvnerShahar-Kashtan Did smeone try to work on that same solution with an older Visual studio version? That's my problem - I don't want to make it impossible to use an older VS to work on the other projects in that solution.
 
10:15 AM
any ideas how to get the Server from a context where "Current" is null?
or, is HttpContext.Current ever allowed to be null?
 
AFAIK in a background thread it is null
Although I'm not sure of your arcitecture, that's just how ours works
 
could be
a lot of multithreading going on
I potentially use the MapPath for all file paths
 
I made an IContext (our own frameworks interface) reference, set that in the main thread when spawning the new thread, and then use that reference in the background thread.
 
10:40 AM
-_-
ConcurrentBag<T> is not an ICollection<T>
 
23
Q: Why doesn't ConcurrentBag<T> implement ICollection<T>?

Doron YaacobyI have a method which takes an IList<> and adds stuff to it. I would like to pass it a ConcurrentBag in some cases, but it doesn't implement IList<> or ICollection<>, only the non-generic ICollection, which doesn't have an Add method. Now, I see why it can't (maybe) implement IList - it's not an...

you can always .ToList()
 
no, I cannot
because List is not concurrent
also, I have extension methods for contains and add
which mean that they can have an implementation
which mean that the statement in the SO answer is incorrect
ICollection<T> should not state "If Contains() results false, you can safely call Add()"
imho
also... ConcurrentBag allows duplicates iirc
"If Contains returns false you can safely call Add knowing it will succeed."
if contains returns true, it should also succeed
 
Help, I'm a little confused, if I have table T1 with many to many relationship with T2, the joining table is T12, how to get the related records from T2, giving the Id of the record in T1, using EF and LINQ?
 
both List<T> and ConcurrentBag<T>
so, I still dont see a reason not to implement the interface
 
what I'm doing is :
var listIds = oContext.T12.Where(x => x.T1Id == id).Select(x => x.T2Id).ToList();
then:
var theList= oContext.T2.In(x => x.Id, listIds).ToList();
I think, this is not how it should be queried !
 
10:51 AM
@Wietlol nice
 
the point is rather that .Contains is mostly useless on a ConcurrentBag
still, the interface could be implemented, but I don't see why would you need that
 
@milleniumbug I was more aiming at AddRange
there is an extension method that takes in an ICollection<T>
as "this" parameter
 
@Metallkiller Most of the team use VS2013. I use VS2017 because I'm a rebel, yeah.
 
yes, I admit AddRange as an interface method could be useful
 
I couldnt figure out why it didnt find the method
now, I have to use a foreach
(which is not that bad, but) AddRange or AddAll would have made it much more readable
 
10:54 AM
ObservableCollection<T> could override it and wouldn't need to call the notify events for each added element
 
@AvnerShahar-Kashtan Nice.
 
@milleniumbug I have a hack for that. A class that temporarily suppresses raising CollectionChanged events to let you make many changes, then restores it.
 
@AvnerShahar-Kashtan I dont use Visual Studio, hell yeah
 
wait what
what do you use then, Rider?
 
notepad++ all the way down
 
10:56 AM
oh, ok
 
ok, thats not true
I do use Rider :D
 
Notepad++. Ha. We just echo lines of code into a source file.
 
I still facepalm when Js programmers, Php programmers, or any programmer that uses a language that doesnt have to be compiled to run, uses Np++
@AvnerShahar-Kashtan in simple terms, you dont write a program
your compiler writes a program
and you just tell the compiler what it should write
 
notepad++ is nice, but quite barebones so no autocompletion and shit
 
10:58 AM
@Wietlol Compiler? Ha! We just use a voice recognition program to input MSIL opcodes into a DLL.
 
it has autocompletion
per language you can specify a set of words that should be autocompleted
 
built-in or through some plugin?
 
it also adds the words that are already written in the file
i think built-in
it does have a bug though :D
 
Notepad++ is pretty good, but I usually prefer an IDE over it.
Even a lean IDE, like VSCode.
 
if you write a word, and then set the cursor half way though
then that word that you are currently writing in is also added
when you make it autocomplete, it finishes the word so you end up with the word + the stuff that was after your cursor
 
11:01 AM
sup nerds
 
@Kieran you late.
+ your profile is normal again
 
I had physio this morning
 
mans got them dank whiplashes
 
@AvnerShahar-Kashtan my current approach is subclassing ObservableCollection<T>. Can I avoid inheritance with your approach?
 
11:16 AM
@milleniumbug Yeah, my code is an extension method over INotifyCollectionChanged, with some reflection hackery inside.
using (list.SuppressCollectionEvents(false))
{
    list.Add("one");
    list.Add("two");
    Assert.IsFalse(eventFired);
}
SuppressCollectionEvents creates a new IDisposable object that, in the ctor, disables the event, and on Dispose reenables it, optionally throwing a single CollectionChanged event in the end.
 
@Kieran what evs that is
 
this could work nicely, thanks
 
@milleniumbug Want me to send you the code? It's a bit hacky, but has been working fine for us so far.
 
sure
 
Uninstall EF...
"...failed to uninstall. Restart VIsual Studio to finish the processs."
Restart VS...
"...failed to uninstall. Restart VIsual Studio to finish the processs."
Restart VS...
"...failed to uninstall. Restart VIsual Studio to finish the processs."

Wtf visual studio?
 
11:23 AM
I wonder, should I just toss it into a github repository? Maybe open a general tools repo? Just dump it in a gist?
 
whichever is most convenient for you
 
@Nerdintraining evs? wat
 
evs as in ever
 
ohhh
whiplash?
that you get from a car accident
 
11:31 AM
ohh it has to do with your neck right?
 
yeahyeah
tl;dr my neck is all of the fucked
 
fyi i gogoled it and the it only gave a litteral translation
 
@MohamedAhmed or just use include of the T2 reference, that EF generated
 
11:34 AM
pahaha
yeah, its because of a survival reflex or some shit
your body tries to lock the muscles in your neck in anticipation of more trauma
 
0
Q: Getting records from many to many relationship with their order in the joining table using EF?

Mohamed AhmedI have a table T1 with many to many relationship with T2, the joining table is T12, I want to get the related records from T2, giving the Id of the record in T1, using EF and LINQ, I'm doing it like so: var listIds = oContext.T12.Where(x => x.T1Id == id).Select(x => x.T2Id).ToList(); //then va...

 
thanks ntohl
 
Select(x => x.T2Id)
should be
Select(x => x.T2)
which would result in an IEnumerable<T2>
assuming you have your foreign keys set correctly
 
so it should be like T1.Include("T2s").First(x => x.Id == T1id).T2s
I believe EF just uses many-to-many relations. No need to query to join table at all
except if there are some attributes of the join table. Than You need 2 many-to-one relations, and need to query that join table.
 
11:59 AM
A surprisingly large chunk of my day has been spent staring at server performing Windows Updates.
This particular server has been at it for 45 minutes. When it's finally done, I will know if I need to rewrite an HTTP Client on top of OpenSSL or whether simply updating our server will do the trick. *sigh*.
 
01:00 - 12:0012:00 - 23:00

« first day (2558 days earlier)      last day (2376 days later) »