« first day (1756 days earlier)      last day (3194 days later) » 

12:08 AM
o/
 
o/
im so excited to see the republican debate, i want to hear alllll the funny shit that comes out of Trumps mouth
 
Ben
Question: Where should I go/start if I need to write a powershell script for transferring new/edited files from one directory to another, if I have never before used powershell in my life.
 
12:25 AM
68
Q: Looking for quick and complete PowerShell tutorial

BorekI'm looking for a PowerShell tutorial that would: Take about half a day to complete Would teach me about every important feature, most importantly: the basics (what is cmdlet, what is function, what is alias etc.) about the "tokens" (what is $_, $(), &"" etc.) scripting syntax (ifs, loops, etc...

 
 
1 hour later…
1:28 AM
@SteveG Got a question for you.
 
shoot
 
ok
 
What does that pattern look like.
I know the SqlContext implements the methods from the IDataContext and IDataFactory.
Anyway...
I'm trying to piece some of it together.
 
looks like a bad DDD implementation
i shouldn't say bad
just
 
1:32 AM
?
 
idk, strange
 
What do you mean?
 
the folder structure is weird, is what i mean
 
Oh, because he was mixing with several different ORM's.
The IEntity is to reference the model correct?
 
yep
well, an entity on the model
 
1:35 AM
Can you clarify?
 
it's just a way, to mark entities in a domain model
like making an IAggregate for marking aggregate roots
 
Okay, can you clarify?
 
you should read a DDD book man, thats a lot to clarify lol
 
Not what I meant.
Okay, then the IDataContext is the interface that contains all our key Crud operation?
 
you can't understand my clarification because you dont understand the DDD lingo, is what i meant
 
1:39 AM
Fair enough.
 
:)
 
Well, what about the above.
 
i didn't look at the code of your solution, let me pull it up
 
Okay, trying to piece the DDD together.
 
the IDataContext is needed
because he wants to use DI, and he needs an interface for his context
 
1:42 AM
Yes, because DI is being needed.
 
and he can only access members from the interface, so it has to have it implement some of the stuff (properties, etc) that the actual context has, so when he passes his real context in, he can access it's members
 
So, the factory is an interface to create correct.
 
looks like the contextfactory is used to create a context
let me see what implements it
 
Okay.
 
yup, thats what it does
lol
 
1:44 AM
So, the interface are the DI's correct?
 
that sentence doesn't make sense
an interface is a promise, what fulfills that promise - whether a real context, or a mocked one, it doesn't matter
 
Dependency Injection he intends to use with IDataContext and IDataContextFactory?
 
yep
he's going to inject a real context in
 
So, the concrete implementation would be the SqlDataContext and SqlDataContextFactory correct?
 
i'd use an IoC container if i were him, writing your own factories seems a little old school - not wrong
 
1:46 AM
The factory will create the concrete implementation to the SqlDataContext.
@SteveG Trying to learn the old school
 
I can't say, sorry
ig2g
 
Hm, okay.
But that is correct right?
Can you explain one thing briefly.
Well, if you can't I'll talk to you tomorrow.
 
 
1 hour later…
2:59 AM
I just posted a question here

http://stackoverflow.com/questions/31868909/getting-points-of-polygons-from-a-canvas

Can someone please see if they can answer it ?
 
 
2 hours later…
4:52 AM
 
 
1 hour later…
5:59 AM
morning guys :D
 
morning @SebastianL
FRIDAY!
 
Good morning
 
YAY Friday :D
 
6:24 AM
morning guys.
i have a webapi method which returns a websocket to a client
the client then sends a second message tot he apit to start a load of tests
this method itself then hooks into the websockets using system.net.websockets.clientwebsockets
which then tuns in a seperate task and sends messages backa s the tests complete
now i want to add the ability to for the client to poll the websocket to see if it missed anything.
 
6:38 AM
so basically i need to spin up a second task which hook into the websockets and check to receive an 'UPDATE' message
but i suppose i would need to use a session to monitor the progress
i.e. a bool where the running process will set to show it is working
then the second process will do a check to see if its still working or not?
issue i have i a: becasue it s a webapi it shoul dbe stateless (although I assume i'm not breaking any rules here am i??)
also are sessions shared bewteen tasks?
 
7:07 AM
Hellooooooooooooooooooooooooooo peoooopllleeeeeeee
 
@RoelvanUden Morning :)
 
no better way to start off a friday than fighting svn over whether my working copy is up to date
 
@user3545438 A Web API, which is a short-lived stateless paradigm, "returning" a WebSocket, which is a long-lived stateful paradigm? And you want to poll a WebSocket while it's already a long-lived stateful duplex connection? There's something going terribly wrong in your logic there.
 
@RoelvanUden y u so happy 2day? :D
 
@SebastianL I'm always happy. This is my happy face. insert grumpy face here
 
7:18 AM
:@
Do the zoidberg! :E
 
Urgh. I feel unclean.
Charger prototype finding its way to Model S. https://amp.twimg.com/v/f9b5e350-f51c-4755-aa6e-e720b07a64aa
also good morning, all
 
Awesome charger
That is the one they plan on using as public chargers ye?
 
I would expect not for public use. Yet.
besides, public charging points need to be universal. This looks kinda car-specific.
but if I ever learn to drive, I'd totally get a Tesla. Because Tesla.
 
@RoelvanUden sorry blogs.msdn.com/b/youssefm/archive/2012/07/17/… heres the blog
@RoelvanUden this is what i have so far for the tests pastie.org/10334926
 
@user3545438 Zomg that's a terrible terrible terrible idea. What a bad blog!
 
7:28 AM
@RoelvanUden the lead has specified this
 
Screw the lead. Incompetent fucking idiots deserve to have a foot up their ass.
(There, better @SebastianL?)
 
@RoelvanUden lol.
I suppose I could make eash task async so not to hold up the websocket task?
 
@RoelvanUden why precisely is it such a bad idea?
 
then when I send my message to get an update I can get a response?
 
@Squiggle You don't see anything wrong with creating a websocket in a rest api controller action? :|
That then proceeds to launch of threads and not do anything at all for the client?
 
7:33 AM
I agree it could be more elegant, but HTTP 101 exists for a reason...
I'd prefer to split the implementation across two services rather than shoe-horning sockets into WebAPI though.
 
@RoelvanUden @Squiggle what would you suggest? in the short term i need to hook this up. Long term they can refactor it
currently it is working
 
@Squiggle Look closely, he's not letting the client connect a WS, he's making a WS somewhere else and not returning anything whatsoever to the client asking for the API in the first place.
 
ah.
Ew.
 
@Squiggle: Indeed. Tesla has their own proprietary connector, as many of the other manufacturers have as well. IIRC EU has demanded a standard connector, and I think they landed on the Type-2 (not sure about that though). Atleast that are the type installed as public chargers in Oslo.
 
@RoelvanUden you mean in the CommissionDevice method
?
 
7:38 AM
@scheien yeah we have some public connectors around here as well, though I only ever see Teslas plugged in. I've seen perhaps two Nissan Leafs and one Chevy Volt swanning around the city.
Leafs? Leaves?
 
The LEAF has CHADEMO as fast charging and type-1 as normal slow charging
Dunno about the chevy
 
@RoelvanUden I was looking at the MSDN blog as an example. That it's self doesn't look so bad.
 
@Squiggle what woul dyou suggest regarding triggering the tests?
 
@user3545438 I ain't suggesting nothing.
 
They should know enough by now to be able to standardize a connector for all electric cars.
but no, they don't care.
 
7:40 AM
at least we got standard Phone chargers in Europe :)
 
@scheien It's al about the money, money, money.
 
Feel like it's the same problem as with cell phone chargers some years ago, before the micro usb became standard
 
@Squiggle It's decent enough but shouldn't be under /api IMHO. His example is quite different tho.
 
@Loetn: Sure, but having a standard connector, would probably reduce the production costs.
 
@scheien Sure, and it can be cheaper for us
 
7:41 AM
@RoelvanUden what would you suggest I do to trigger the tests then please? basically I just eed to tell it to hook into the websocket itself and run aoad of tests, sending messages as it completes/fails
 
@Loetn: Be realistic :)
 
@scheien :)
 
I drive a leaf, and it's awesome. Never tried to fast charge though
 
@scheien If my boss would let me drive an electric car, I won't have to think twice.
 
The boss being your gf?
 
7:44 AM
But yea, too expensive
@scheien No, the other boss :)
 
@RoelvanUden also rather than physically create a new socket, I tried hooking i directly by instantiating (var tests = new DeviceTestsWebSocketHandler()) but this didnt work
http://pastie.org/10335034
 
@Loetn: How can your boss prevent you from driving an electric car? :p
 
@RoelvanUden i want complaining about your happiness, i just thought it could be something amusing ^^
 
@scheien Because my boss owns the car I drive now? :)
 
aha
Company car? awesome. Bet you don't pay for gas and other stuff either?
 
7:50 AM
@scheien ;)
That was my raise.
 
there are some aweful taxes on companycars in my country :/
 
@Loetn same here
 
@StevenLiekens Belgium -_-
 
@SebastianL: yea, here too. Atleast if you want to use it outside of work.
 
sorry guys does anyone have any suggestions i'm all ears :)
 
7:52 AM
I know
 
@SebastianL They promoted company cars here
Although they want more taxes on company cars
Too busy streets and stuff..
 
traffic is pretty bad
too many trucks
 
@user3545438 if it was up to me I'd ban the phrase 'didn't work'
 
instead of didn't work your should mention what's expected and what you got instead.
you*
 
@TomW ok sorry thinking about the way doing it that way i assumed i was hoooking into the sockets wrongly. Any ideas on what I was doing wrong please. I basically want to hook intot he current websocket and then send some mesage down the pipe

its a method for performing some tests, the client hooks in and then triggers some tests, the results of which are sent down the websocket pipline
so currently the client connects to a websocket using pastie.org/10335052
I once it receives it, it then uses ajax to trigger a number of tests,
 
8:11 AM
my winform app is giving this error
The type initializer for 'System.Data.Entity.Internal.AppConfig' threw an exception
I searched on web and tried all solutions but nothing worked for e
:(
 
Freaky
probably symptomatic of a deeper issue
 
its currently working with the following
but I assumed as it was in the same solution I could hook in using other means
such as var tests = new DeviceTestsSocketHandler();

tests.SendMessage("TEST MESSAGE");

but this didnt work as I assumed I wasnt really spinning up a web socket?
 
@MuhammadSohail: Done any changes recently?
code/config?
 
the line was MedleyContext _context = new MedleyContext();
I modified the line to this:
MedleyContext _context;
and put the _context = new MedleyContext();
in a method
and problem resolved.
I don't know why.
oh... now the error appeaers again.
 
http://stackoverflow.com/questions/17585611/the-type-initializer-for-system-data-entity-internal-appconfig-threw-an-except
http://stackoverflow.com/questions/19801125/the-type-initializer-for-system-data-entity-internal-appconfig-threw-an-except
 
8:25 AM
Is it a caching issue? Confusing and unpredictable errors are almost always a caching issue.
 
i don't know
but i already tried above links
it didn't help
 
hi guys how can I run an async tack and then pass the result into a ContinueWith?
TestConnected(deviceid).ContinueWith(
                                              t =>
                                              {
                                                  currentStageComplete = true;
                                                  currentStage = Stage.Communicating;

                                                  sendBytes = Encoding.UTF8.GetBytes(JsonConvert.SerializeObject(message));
                                                  sendBuffer = new ArraySegment<byte>(sendBytes);
TestConnected returns a message?
basically I want to run this without holding the thread up and then send the result when its completed
 
@Squiggle: hehe yeah. The fun part is when devs don't think ahead, and "forget" to invalidate the cache or add the new item(s) to existing cached list and such.
 
no9
8:45 AM
ellow
 
@Squiggle confusing and unpredictable errors? I'd just assume you were using PHP/Java/Javascript/Ruby/language we're hating on this week
 
@TomW ah my bad.
yeah. $otherlanguage sucks.
 
9:10 AM
arbitrary comment about why $otherlanguage is worse than c#
 
if you dont use c# you cant c#
but in reality sadly many of us need to use things like PHP or such __languages
...
 
wot
anyone can c#
it's ez
 
@SebastianL Not in my reality.
I use C# and TS. That's it. :P
 
I am not a supporter of PHP but php isn't that bad.
 
9:25 AM
@codebrain I've never used it. I'm bashing it because lols, not because I actually dislike it :)
 
PHP is pretty awful.
Compare it to everything that's good.
 
Can someone tell me the fastest way to connect to a database in C#, and whether I should use pooling?
 
var con = new SqlConnection("user id=username;" +
                                           "password=password;server=serverurl;" +
                                           "Trusted_Connection=yes;" +
                                           "database=database; " +
                                           "connection timeout=30");
@ash :D
 
@Sippy Thanks, whats the difference between SQLConnection and MySQLConnection?
will this work with a MySQLConnection
 
@AshSimpson Former is for MSSQL and the later for MySQL
 
9:33 AM
Can I facepalm that, or?
 
@Sippy Facepalm approved
 
Facepalm completed.
 
/me applauds
 
/golfclap
 
9:41 AM
Can I ask..
what should my mysql max connections be
 
@Squiggle: yea, that's kinda cool
 
@AshSimpson The sensible amount for your specific environment and needs that doesn't crush your server but does let it work enough.
(aka if you don't have a problem don't even think about it)
 
@scheien they're tiny and nobody knows them outside Switzerland right now, but I hope they get big :)
 
I have a question and want some suggestions regarding video. Can any one help me?
 
@Roel van Uden My partner set it to some weird number, and I want to reset it to a decent amount, is why I was asking.
 
9:46 AM
I have posted my question here stackoverflow.com/q/31867044/1310540
 
Is it possible to calculate the ln with just +, -, *, / and ^()?
 
10:02 AM
@SebastianL natural logarithm you mean?
:24947006
I think any computer algorithm for calculating it will be some kind of power series. So fundamentally, yes.,
 
10:25 AM
Hahaha
> "SSMS would like to firmly remind me that it is not just some floozy, and I should treat it with respect,"
 
@Squiggle good one but some of their dance moves are funny.
 
@TomW yes
@TomW how would you approach it then? (i know its only a approximation with this ^^)
 
I don't remember how it's defined off the top of my head
 
10:41 AM
I tend not to like key and peele
But that was hilarious
And his gf is hot.
 
hello all
good noon :D
 
10:53 AM
Hi !
 
@alireza amini, hello
 
11:08 AM
hi guys
                                  message = await PerformTest(deviceid, currentStage);

                                  SendMessage(socket, message, cts);

                                  currentStage++;
                                  currentStageComplete = true;
how can i set this so that currentStageComplete is only set once message is returned?
 
you mean a reply on sendmessage?
 
@Rovak im being thick here i think but my head is starting to hurt now :(

message = await PerformTest(deviceid, currentStage);
i want to only set currentStageComplete to be true once I have the result back
is this code correct?
 
result from what, performtest or sendmessage?
 
yes sorry performTest
 
according to the current code you are already waiting for PerformTest to give a result back , you should post the code of PerformTest if that isn't working
 
11:12 AM
i thought so
thanks for clrifying
does await stop the thread?
 
should I quit?
 
@user3545438 no
 
i.e. its in a while(true) {} so will the while true still function or does it hold until await returns
@ovak ok
 
!!> Math.random() > 0.5
Damn you @CapricaSix!
 
@user3545438 which thread btw, await and async doesnt mean you are spawning a new thread
@user3545438 it just tells the task scheduler to halt the current procedure and resume any other scheduled awaits, asyncs etc. it MAY spawn a new thread if needed
@user3545438 so yes, inside the while(true) the procedure will be awaited until performtest returns a result
 
11:16 AM
@rovak many thanks for helping

basically this is handling some messages being received from a websocket. when it received certain calls it need to run certain tasks.
@rovak so basically when I dont want it hold up the thread whilst the task is been performed i.e. i want it to still receive messages
 
you could run the task with a LongRunning hint
 
@rovak pastie.org/10335328 this is the method
basically one of the processes I am trying to get is to be able to poll for an update on the test
so for example in the client code there is a timeout set, where if it doesnt receive an answer with x millisecond it willsend a "PROG" to see if its still running a process
 
@user3545438 any reason why you are not using existing libraries for websocket?
 
I am using System.Net.WebsSockets
@Joachim what do you recommend please?
 
I absolutely love websocket-sharp
 
11:23 AM
Never used it myself, but SignalR seems pretty popular
 
Always thought SignalR was for real-time messaging
 
it is
 
@sippy they dont want to use signalR
 
Oh that's what he's doing
Why?
 
@sippy they are worried about backplanes apparently
its working to a certain extend its sending and receiving but i just need to be able to poll it etc to check if a message is missed
its here its falling over
 
11:26 AM
@user3545438 Meaning what
 
@user3545438 that could be done with message acknowledgment and a simple counter?
 
10
A: How to solve limitations of SignalR in scaleout for backplane

CoreyA backplane will introduce delays in message delivery, which will not work well for low-latency work. If you absolutely must have multiple servers to handle your clients, and you absolutely must have minimal latency, then a backplane is probably not going to work for you. However, check out thi...

Albeit not a solution
But worth reading.
 
@Rovak Yeah, let's re-implement TCP!
 
lol
 
@sippy sorry i mean the messages are being sent back and forth ok
@sippy but i have been plaing around with testing the timeout check
so i put a Task.Dely of sa 10sec on the process
and a timeout of 2secs
on the client
so i would expect the return message to be that it was busy
but it keeps coming back as not running?
so something is not right and i can't see the issue
 
11:34 AM
What exactly are you trying to do? Implement your own websocket handler or trying to send and receive data across the line?
 
@user3545438 if you are blocking the process with a 10 second delay then it can't accept any new messages so the client thinks that it's not running?
@user3545438 is accepting/listening and processing being done on different threads?
	var _listener = new HttpListener();

	while(listening) {
		var context = await _listener.GetContextAsync(); // Waiting for connections
		await Task.Delay(10); // Listener is no longer accepting any messages here
		HandleRequest(context);
	}
 
@rovak no both currently on the same thread
but for example if my method is await Test1();

and Test1 is simply return Task.Delay(5000); will this hold up the parent thread?
 
depends on how the parent threads runs his child threads
a thread.join() will block the parent thread for example
 
ok all i do it
        Task.Factory.StartNew(
            async () =>
              {
and then inside that for example
await PerformTest(deviceid, currentStage);
where a test maybe
 
your pastie example is not blocking the parent thread
 
11:46 AM
        public async Task<TestResultModel> TestConnected(string deviceid)
        {
            await Task.Delay(10000);

            return new TestResultModel
            {
                deviceid = deviceid,
                steptype = "CON",
                detail = "",
                result = "OK"
            };
        }
ok so i shoudl be good then thanks
 
can anyone help me? I get any error when deleting a file...
Error deleting file 'Class_01.cs' incorrect function
 
Whoever wrote that error message is a fucking retard
2
cheers bro
@AshSimpson is this in visual studio?
 

« first day (1756 days earlier)      last day (3194 days later) »