« first day (909 days earlier)      last day (4265 days later) » 

21:00
It is pretty sweet
I also like generics and reflection though
user142019
C#'s generics are kinda limited if you're used to C++. :)
:) my boss just asked me to manage the interns this summer. Should be fun!
I like C++, I am not sure how it is has changed since I used it, but I grew tired of having to explicitly manage stuff all the time. C#'s generics are very tightly controlled by microsoft's outlook - sometimes it requires sidestepping.
user142019
Explicitly manage stuff all the time?
Memory
user142019
21:03
Resource management in C++ is fully automatic.
user142019
Don't use new and delete.
user142019
Problem solved!
lol
@Pheonixblade9 - yay coding seminar
user142019
@TravisJ I wasn't joking. :v
edc
edc
my company actually doesn't hire interns at all for programming positions
user142019
21:05
If you do C++ the right way, resources are bound to the scopes of objects. No need for garbage collector nor manual resource management.
user142019
Kinda like using using (dat pun) everywhere, but implicit.
And how do you instantiate objects to create scope?
user142019
type name;
that will call the constructor?
user142019
Yes
user142019
21:07
type name(arg1, arg2, arg3); if you want to pass arguments to the ctor.
It has been a few years since I C++
user142019
It's quite simple.
I remember enjoying it.
user142019
The destructor will be called when the object goes out of scope.
user142019
{
    int* ints = new int[42];
} // leak!
{
    std::vector<int> ints(42);
} // no leak!
user142019
21:09
The problem with new and delete is that, besides deletion being manual, it's exception-unsafe.
user142019
int* ints = new int[42];
delete[] ints; // fine

int* ints = new int[42];
some_function_that_might_throw_an_exception();
delete[] ints; // whoops, not guaranteed to be called!
is there no finally in c++? I suppose that would be a lot of try catch going around though, not best partice
user142019
No.
user1125394
can Lookup contain real duplicates: same key same value?
user142019
Instead, the destructor will be called when an exception propagates.
user142019
21:11
In C# it will invoke finally block if present.
@TravisJ coding seminar? lol
@Pheonixblade9 - look at the message history
Still don't understand, but whatever lol
you said you got to manage the interns :) so naturally it is keg party coding seminar time
hahahaha
well last year the interns were cute girls
this year, it's interns I found... and they're all geeky guys, hahahaha
21:13
different this year?
lol!
I actually went on a couple dates with one of them. Ended up breaking it off though. She was too traditional Indian
compared with my hedonistic lifestyle of hookers and blow
I'm gonna supervise a girl who is going to do her thesis in ergonomy, she starts on Monday. Do you think I should shave her head as initiation?
At least she probably knew of some good Indian restaurants in that area though?
if my div has id of ticker is this valid
 $('#ticker').text=message;
21:15
@TravisJ she knew quite a few that I still go to! :)
We have crazy tasty vegetarian restaurants around here
@Zoidberg - A C++ playground! fun
In MVC4 and SignalR
user142019
In C# you'll need using and IDisposable.
user1125394
men Lookup? can it have full dups? it's long to try it..
$('#ticker').text(message);
or use html(message)
or use $('#ticker')[0].innerText=message;
i could go on :P
21:17
is indexer optional @TravisJ
?
user142019
@TravisJ Don't use innerText. It's non-standard.
so .text(message)?
@Rrazor
Razor
user142019
Use textContent instead of innerText.
.textContent?
@Darek - The indexer returns the matched element from the jquery object.
user142019
$('#ticket')[0].textContent = message;
21:18
So that is how you would access the plain JS API
user142019
Use jQuery. :v
textContent is only ie9+ compatible
so I can't use it
user142019
$('#ticket').text(message);
user142019
Then jQuery, it will be.
K
trying
21:19
Darek was doing this, .text was the first thing I suggested
but there are many ways to assign text
user142019
(Use jQuery anyway. :v)
user142019
[0]. is ugly.
well, if u need to use [0] you should probably use document.getelementbyid
[0] is however faster than .get(0)
user142019
That matters once you start profiling.
user142019
Good quality code comes first. Performance comes later.
user1125394
21:21
jLinq
user142019
The basic stuff of LINQ (select/where) in JavaScript is .map and .filter on arrays.
Unhandled exception at line 20, column 13 in localhost:6676

0x800a138f - JavaScript runtime error: Unable to get property 'tickerHub' of undefined or null reference
:(
user142019
Your code is bad and you should feel bad.
My first try at SignalR
Hmm connection is undefined
user142019
Define it!
user1125394
21:25
@Darek what do you need it for (SignalR)?
$.connection.NAME needs to match your class name which inherits :Hub
public class TickerHub : Hub
I am just experimenting
user1125394
you want to push data on browsers?
I'd like to have a server side events bubble up to all client without refresh
Yes
push data
user1125394
if you(re not forced to do it in this language, I advise you github.com/extend/bullet as an amazing way to do it
21:27
@Darek - Are you sure the script is being included in the page?
Thanks @c'c but I'd prefer SignalR as a learning expereince
(sorry starting from the outside in here)
edc
edc
hmm trying to play with the [HandleError] attribute, and I set customErrors mode="on" in web.config already, but it still gives me YSOD
user1125394
well good luck it seems massive, for a simple stuff
<script src="/Scripts/jquery-1.7.1.min.js" ></script>
<!--Reference the SignalR library. -->
<script src="/Scripts/jquery.signalR-1.0.1.js"></script>
<!--Reference the autogenerated SignalR hub script. -->
<script src="/signalr/hubs"></script>
21:28
/signalr/hubs isn't a valid source
side note: always reference the .min js file because it has been minified
posted on April 12, 2013 by Scott Hanselman

I have a "whenever I get around to doing it" Newsletter of Wonderful Things. Why a newsletter? I dunno. It seems more personal somehow. Fight me. You can view all the previous newsletters here. You can sign up here Newsletter of Wonderful Things or just wait and get them later on the blog, which hopefully you have subscribed to. Email folks get it first! Here's the MOST RECENT newsletter, delay

that is really strange
because it seems from the tutorial and from another couple links I looked at they use signalr/hubs as a source
hm
I wonder if using the jquery version 1.8 is a requirement because of some dependency
does it matter than my sample is inside _Layout.cshtml?
21:34
nope
i know that connection is comping from the JS
so why would it be null
Not sure, did you register the class in global.asax.cs?
MapHubs()
RouteTable.Routes.MapHubs();
is this in mvc?
Yes
4
21:38
I was considering using the url.content reference, but realized that your jquery is being hit just fine
hm
however
I did not have the 1.8.2 version referenced in the article
only 1.7.1
yeah, I wonder if that is an issue
you might also want to try to register the route before your default routes
@Darek Problems with SignalR?
21:39
Yup @LewsTherin
@Darek - Like this:
RouteTable.Routes.MapHubs();
RegisterRoutes(RouteTable.Routes);
What's it saying? I had the same crap 2 days ago
Oh btw, any experience with Knockout Travman? I know Roel does, but he isn't here
nope, haven't worked with knockout
@Travis, before or after filters
I tend to code my own js frameworks
21:40
Lol, why?
@LewsTherin connection is undefined
@Darek - either is fine, just as long as it is before registerroutes()
@Darek Oh, I didn't get that. Are you sure nuget downloaded all SignalR references?
Unhandled exception at line 22, column 17 in localhost:6676

0x800a138f - JavaScript runtime error: Unable to get property 'tickerHub' of undefined or null reference
Yes, I used the AspNet.SignalR package
Can I see you Hub class?
Just the class declaration
21:42
using Microsoft.AspNet.SignalR;

namespace AlmScoreCard
{
    using System;
    using System.Reactive.Linq;

    public class TickerHub : Hub
    {
        //public void Hello()
        //{
        //    Clients.All.hello();
        //}

        public void Send(string message)
        {
            Clients.All.broadcastMessage(message);
        }

        public TickerHub()
        {
            Observable.Interval(TimeSpan.FromSeconds(1)).Subscribe(delegate
                {
                    this.Send(DateTime.Now.ToShortTimeString());
Oh.. that's why
Try:
[HubName("tickerHub")]
public class TickerHub : Hub
I think it should be fine then
compiling
I'm wondering whether to use SignalR, Meteor or Knockout for an assignment. So far I've only got SignalR working
Unhandled exception at line 22, column 17 in localhost:6676

0x800a138f - JavaScript runtime error: Unable to get property 'tickerHub' of undefined or null reference
connection is still undefined
Oh :(
Can I see your script includes?
21:44
<head>
<!--Reference the jQuery library. -->
<script src="/Scripts/jquery-1.9.1.min.js" > </script>
<!--Reference the SignalR library. -->
<script src="/Scripts/jquery.signalR-1.0.1.min.js"> </script>
<!--Reference the autogenerated SignalR hub script. -->
<script src="/signalr/hubs"> </script>
<!--Add script to update the page and send messages.-->

<title>@ViewBag.Title</title>
<link href="@Url.Content("~/Content/Site.css")" rel="stylesheet" type="text/css" />
@(Html.Telerik().StyleSheetRegistrar().DefaultGroup(group => group.Add("telerik.common.css").Add("telerik.metro.css").Combined(tru
Oh.. that's probably why
Is this ASP MVC 3?
Mmmn.. so signalr/hubs must be generating fine? Or are you getting errors with that?
If so.. I confess I am lost
actually, can't find that damn file
It is generated at run time
Check console to make sure it is not giving some error
21:47
debug console?
can the file be anything
Yeah, Chrome's console or FF's firebug
ie /hubs?
I don't know.. but I will stick with /hubs
I have /signalr/hubs
but no such folder
No, but when you call your page.. is it getting the script fine?
Or are you getting 404 status?
21:49
it stops in debug at var ticker = $.connection.tickerHub;
<script type="text/javascript">
            $(function() {
                // Declare a proxy to reference the hub.
                var ticker = $.connection.tickerHub;
                // Create a function that the hub can call to broadcast messages.
                ticker.client.broadcastMessage = function(message) {
                    // Html encode display name and message.
                    var encodedMsg = $('<div />').text(message).html();
                    // Add the message to the page.
And the console window? Any errors?
right click -> inspect element -> console
page loads fine
Dang.. definitely not that then
but does not initialize the connection
connection should have been bound :S
Let me check my js file
21:52
is this valid ?
if ($.connection === signalR) {
            $.connection = _connection;
        }
what the heck is ===
"really really equals"
Strict equals.
:P
@RoelvanUden Were you here all along?
And then ==== means that the two objects share the same soul
21:53
var x = 0, r = x == null; // r is true
var x = 0, r = x === null; // r is false
0 and null is not the same thing for strict.
@LewsTherin I just popped in :D
@Darek Did you include json2.min.js? Tbh, I am not sure how important that file is. I will try and include it though
@RoelvanUden Ah fair enough. I need to ask some Knockout questions.. no code though
no
@LewsTherin Go ahead :)
did not come with SignalR
@RoelvanUden Does Knockout use websockets implicitly like Meteor? Or does it come with its own backend?
@Darek Nope, it doesn't.. but I think you need it because Hub sends messages in json
21:55
should I
yo yo
@Darek Yeah
@E.LDunn Hey hey!
@LewsTherin Knockout is a binding framework, it provides all the utilities you need for MVVM. It does not come with connection/communication classes or anything, you're free to model that yourself.
how goes it lews
Also, meteor (the framework) is a terrible idea.
21:56
install-package json2 ? @LewsTherin
@RoelvanUden Why?
@E.LDunn Trying to start my javascript assignment. Spoilt for choice :(
@Darek Let me find the download link
did you get your site sorted in the end lews
<script src="/Scripts/jquery-1.9.1.min.js" > </script>
        <script src="/Scripts/json2.min.js" > </script>
        <script src="/Scripts/jquery.signalR-1.0.1.min.js"> </script>
where did johan go ??
@LewsTherin The concept of meteor is fine, the synchronization being taken care of and having 'real-time' for the client- and server with no line of code. The downside is the massive resource hog and the terrible security considerations; Meteor is more or less accepting arbitrary code on the server and that is never a good idea.
21:58
@E.LDunn Yeah, it is finished.. and it is a nightmare I never want to look at again :D
rofl
@Darek Like that.. so fingers crossed. But I doubt it'd work :(
connection is still undefined
@RoelvanUden Arbitrary code or messages?
@Darek Where did you add your own code?
21:58
what creates the connection object?
@LewsTherin Arbitrary code.
And it executes it?
Is that not vulnerable to script injection?
Yep.
It is.
There is your terrible idea.
I added the sample from asp.net/signalr/overview/getting-started/… to _Layout.cshtml
@RoelvanUden Oh, ok that is a skip.
21:59
@E.LDunn woke up, slept for a while, gonna sleep again now I think

« first day (909 days earlier)      last day (4265 days later) »