« first day (1004 days earlier)      last day (4170 days later) » 

00:05
@TravisJ Hm- Odd.
@TravisJ I understand, but I don't... I'll have to read up and really have it outlined well.
@Greg - copy paste this into jsfiddle
jsonVal = { b: 5, c: { d: 50, e: "Hello" } };
and then do `console.log(jsonVal);console.log(jsonVal.c.e);`
Is the json just javascript?
The json once removed from the string is just javascript. You can do that with the .Raw approach shown above or in javascript with JSON.parse(jsonVal).
Well, that is where I don't entirely understand the Json.
Where you implement-
I understand how the Json will represent the data- It is essentially XML, but doesn't require complex mappings and it is generic object data, correct?
00:20
It can map complex objects though. It just depends on your structure. It is not that generic once created, it is very specific. However, you can create it from any object.
Hm. So you could convert an entire web page into a single object?
@Greg - Yup. Here, check out this fiddle: jsfiddle.net/zswDB
Okay.
When you run it though, it doesn't display anything.
nope, f12
Oka, so I've loaded Firebug.
00:28
I have to go, I will be back tomorrow
json is really cool, the more you work with it the better it gets
Yeah, it seems cool-
I just don't understand it at the moment- which makes it hard to grasp.
I'll catch you tomorrow.
Evening everyone :)
@Jazerix Evening.
@TravisJ Do you know of any good tutorials or books on the matter?
what's going on ^_^?
Trying to find good books on Json, understand it a bit better.
00:31
This is probably a real newbie question, but; what's there to learn :I apart from just reading and writing it? :D
Reading and writing what? Json? Or C#?
json, that is
Well, I'm not sure how it fits with several of my projects- Which is causing me to not understand it.
Ahhh, that makes sense. But isn't it just like XML, purpose wise
Purpose wise yes, syntax and way it accomplishes that is quite a bit different.
00:41
Why not just stay with XML then :D?
Because I'd like to learn Json.
theres nothing fancy to json
its just a dictionary basically
<Person>
    <FirstName>Greg</FirstName>
</Person>

{
   FirstName: "Greg"
}
{} is object, [] is array
{
   FirstName: "Homer",
   MiddleInitials: ["J"],
   LastName: "Simpson",
   Address: {
      City: "SpringField",
      State: "Vermont"
   }
}
That is how it writes it out?
well the keys are usually in quotes as well
do any of you use mvc a lot?
00:50
@Jazerix i use it a fair amount
@drch Okay, because I'm just getting started with it, and I'm looking for a good book for beginners, can you recommend any?
the mvc3 one was really good, so i assume this one is good too
I found this one.
ahh
okay
but I shouldn't go for the pro one, should i?
do you have experience w/ webforms? or any other language's mvc framework?
Well, I do quite a lot of work in php, if that counts. But I haven't really gotten into asp.net yet :(
00:54
hows your c#?
pretty good i'd sat
say*
id probably go for the pro one
its pretty extensive, but linear so it starts with the very basics
I'll buy that one then. Thanks @dr
@drch* ^^
have you used mvc in php? codeigniter or symfony or anything?
I have not, just pure php I guess
 
3 hours later…
03:27
posted on July 16, 2013 by Scott Hanselman

  I've blogged before, in fact in 2004, (!) that Windows is missing the text mode boat. There is a massive opportunity for a great, nay, awesome and pretty, command line on Windows. If someone cracks this problem, they're gonna be heroes. I love iTerm2 and its tabs, it's font handling, its simple elegance. I want this on Windows. In 2011 I found Console2, and then in 2012 I moved to Con

04:09
Someone asked me to do their coding homework for them. I made sure to put every hax I could think of in there, along with every sarcastic/mean comment to the teacher I could think of. MWUHAHHAH
        bool teacherSucksAss = true;
        // do it the lame way
        if (teacherSucksAss)
        {
            // mwuhahhaha my logic is in my gui events mwuhahaha biatches
        }
        else{}
            // do it awzum way
@CCInc You there?
You familiar with json?
A bit.
What's the issue?
<!DOCTYPE html>
<html>
<body>
<h2>Create Object from JSON String</h2>
<p>
First Name: <span id="fname"></span><br>
Last Name: <span id="lname"></span><br>
</p>
<script>
var txt = '{"employees":[' +
'{"firstName":"John","lastName":"Doe" },' +
'{"firstName":"Anna","lastName":"Smith" },' +
'{"firstName":"Peter","lastName":"Jones" }]}';

var obj = eval ("(" + txt + ")");

document.getElementById("fname").innerHTML=obj.employees[1].firstName
document.getElementById("lname").innerHTML=obj.employees[1].lastName
Why with the var obj = eval (" (" + txt + ") "); are there so many ("
I understand what it is doing, the question though- What purpose does the double ("("")") serve.
Is it to ensure both are wrapped correctly? Or something else?
hmm, odd
25
A: Why does JavaScript's eval need parentheses to eval JSON data?

KazarIt is because, putting the brackets in there effectively creates the statement: stuff = eval('return ' + data_from_the_wire + ';'); If you were to eval without the parentheses, then the code would be evaluated, and if you did have any named functions inside it those would be defined, but not r...

04:27
That makes valid sense now-
Ya - it makes it into a function
I'm trying to dive head first into this lovely language.
ah :D just remember always use var. Every time I wirte a for loop in JS, it comes out like "for( int i = ..." and I never realize what's wrong :D
I'll be back in a little bit, wife is a calling- I'll catch you later @CCInc. Thanks for that answer.
@CCInc I've done that before to. It sucks.
Indeed :D see ya later!
room topic changed to C#: Lounge<C++> lounge = new Lounge<C++>; room.Description = lounge.Description; [.net] [asp.net] [asp.net-mvc] [c#] [entity-framework] [linq] [visual-studio] [wcf] [wpf]
Someone change that when the lounge's descripion is no longer about NES :/
 
3 hours later…
08:01
anyone here??
i need to ask a dumb asp.net question
:/
08:26
I'm here but don't know anything about that asp.net
ok what's your question, you might as well would like to post a question on the q & a portion
user1125394
9 hours ago, by c x
isn't there an easier way to use parametrized mysql queries than

cmd.Parameters.AddWithValue("", foo);
cmd.Parameters.AddWithValue("", bar);
... 14 lines later
cmd.Parameters.AddWithValue("", leet);
user1125394
I'm trying cmd.Parameters.AddWithValue("", foo); instead of cmd.Parameters.AddWithValue("p1", foo);cmd.Parameters.AddWithValue("p2", bar);
user1125394
hope it doesn't fuck it
Yul
Yul
@CCInc: Hi
are you there
Hi all, I need a little help
i have a piece of ajax. It runs normal on local
but when i deploy to server, it only works on chrome. In firefox, i catch on error funtion
09:09
@Yul what's the error?
Yul
Yul
i don't know how to catch
i just add error: function(){alert('error')}
and it go there
09:33
i have a databound gridview
the columns are
<Columns>
            <asp:BoundField HeaderText="Caption" DataField="txt_caption" />
            <asp:BoundField HeaderText="Created On" DataField="dt_created" />
            <asp:ImageField DataImageUrlField="img_path" AlternateText="Image" HeaderText="Image">
            </asp:ImageField>
        </Columns>
the first two colums are getting proper data
but the image url just isn't working at all
i've tried many times
 
1 hour later…
10:38
Hey
Hi.
Codebrai are you an experienced C# user?
Document wise not.
erm.
tell me.
What do you do ?
10:56
I am a Programmer.
What's the easiest way to do browser detection in asp.net mvc?
@BenjaminGruenbaum What do you want to detect?
@RoelvanUden The actual browser.
Like, IE, Opera, Firefox. Right now I'm doing Request.Browser.Browser to get the name string, I was wondering if that's the correct reliable way
And yes, I have a good reason to do browser detection, I actually need to know what browser it is and not what features it supports.
There is limited information to be retrieved from user agent, and ASP.NET has a Browser property in the request that is filled to the best of its abilities, but it is far from perfect or reliable. Browser detection by nature is unreliable.
I'm doing this for an extension installation.
I'm delivering a browser extension, if a user lies it's their fault.
11:04
JavaScript detection is way more reliable. :)
@roel how does this site look ? www.designzoom.in
@RoelvanUden Yeah, but I'm intercepting a request from a third party :P
(Payment)
Thanks for the help :)
Ah 'kay, you're welcome :P
@codebrain Super busy.
Haha, asp classic, I needed a good laugh :)
user1125394
11:20
anyone suggesting handy mysql code? (:( ^ )
user142019
Hello.
drop database is handy mysql code
I am not sure if I should laugh or actually congratulate you that the topic actually could compile.
Stealing our descriptions, I see.
user142019
Lounge<C++> lounge = new Lounge<C++>;
room.Members.AddRange(lounge.Members);
user142019
11:23
Also, need moar var. This ain't Java.
Also you can speak now. We ain't shooting anyone.
user142019
@BartekBanachewicz We do, but only in their foots, and we will blow their whole legs off.
@rightfold This is neither valid C++ nor valid C# …
@rightfold You don't even write C++ anymore.
@KonradRudolph Wanna see it as C++?
user142019
@R.MartinhoFernandes I just wrote C++.
11:29
It can be arranged.
user142019
@KonradRudolph constexpr overload of operator++
@rightfold Nope, still not working
user142019
However, the new. :|
user142019
Well, make it convertible from a pointer.
unless of course there’s an implicit Lounge::Lounge(Lounge*).
okay, I concede that this may well be valid C++.
11:31
You can make all kinds of crazies compile in C++.
user142019
I wonder what you can do with macros here.
The good side is that you can also make all kinds of crazies not compile.
user142019
@KonradRudolph Everything is valid C++. :D
Uhm. Wait, no. You cannot overload ++ for any type which would be valid as a template argument
user142019
@KonradRudolph the result has to be valid.
user142019
11:33
int constexpr operator++(decltype(C), int) or something like that.
@KonradRudolph We did the Lounge<C++> bit a long time ago.
@R.MartinhoFernandes Actually my original objection was to the initialisation of an object with a pointer
Indeed
$ more lounge.cpp
#include "lounge.hpp"

int main() {
    Lounge<C++> lounge = new Lounge<C++>;
}
$ g++-4.8 -pedantic -std=c++11 lounge.cpp
$
Okay, I’m gonna write all my classes like this from now on
11:40
With canonical “ptr constructors” which do this: T::T(T* other) : this(*other) { delete other; }
perfectly fine C++ :D
and as long as the ctor doesn’t throw, it’s even leak safe
You can even CRTP this
… nope :/
Why is the lounge called C#?
Xeo
Xeo
@KonradRudolph Might be able to do it with inheriting ctor.
@Xeo Nope
You cannot call the derived class ctor from the base class ctor.
It's mandatory boilerplate.
Xeo
Xeo
11:44
Ah, true
how do i convert object type to System.Guid
:/
tried this
Guid uid = new Guid((byte[])GridView1.DataKeys[e.RowIndex].Values[0]);
but throws a index out of range exception
I'm going to guess it's because one of the indices is out of range.
GridView1.DataKeys[e.RowIndex].Values[0]
this is a value that im retrieving from db into a gridview
just a sec
something just hit me, imma try and report back
ok, no back to the original problem
cannot convert from object type to Guid
:/
please help
4 mins ago, by R. Martinho Fernandes
I'm going to guess it's because one of the indices is out of range.
Hello Guys
I have a main form and theres a button on it. Which shows its child form
Now in that child form theres a button through which i want to switch to that parent form ... Any suggestions
12:00
i tried to convert the object type into a byte array
cause theres guid constructor that converts byte array to guid
my guess is that the out of range was due to that conversion
the original problem?? Converting Object type to Guid??
can you tell me how??
That question makes no sense. What object is that?
it's a uniqueidentifier type field in sql
when i read it from the gridview, it says cannot convert implicitely from object to Guid
O.o
I have a main form and theres a button on it. Which shows its child form
Now in that child form theres a button through which i want to switch to that parent form ... Any suggestions
12:09
-__-"
@Sadiq You could:
1) Pass the main form itself to the child form in the constructor or as a property
2) Hold a reference to the main form as a static variable somewhere else
3) Use Application.OpenForms to find the main form through a "for loop"
Hi guys
so I have this string: "0x3C3F786D6C2076657273696F6E3D22312E302220656E636F64696E673D227574662D38223F3E3‌​C6D65737361676520786D6C6E733D22687474703A2F2F7777..." which is basically a byte array in UTF8 encoding.
How do I get the string representation of this?
I know there's new UTF8Encoding().GetString(byte[] bytes)
but how do I initialize the 'byte[] bytes' part?
@ActionHank
454
Q: .NET String to byte Array C#

Agnel KurianHow do I convert a string to a byte array in .NET (C#)? Update: Also please explain why encoding should be taken into consideration. Can't I simply get what bytes the string has been stored in? Why this dependency on encoding?!!!

12:29
Hey guy's, I ve been Tasked at looking at ways to extend the .IO namespace in our own in-house framework. I'm only a Junior Level programmer, anyone got any suggestions for things I should eb looking at?
Hm, I googled a bit and all the answers I got about MDI in WPF is Microsoft gave up on that.
So I want suggestions.
What is a good layout I could use instead of MDI and yet use multiple interfaces.
:(
13:25
Is there any way to achieve the syntactic equivalence of a constrained generic extension method> For example: public static T Foo<T>(this T o) where T : Bar { return o; }. Given the previous, new Bar().Foo() yields a return type of Bar, and o is strongly typed in it's body to type Bar.
Creating a sideways treeview?
I guess, something like generic fluent interfaces, such that a fluent method is constrained to return the type of the defining class.
And when I say syntactic equivalence, I'm referring to instance defined methods being syntactically equivalent to an extension method.
@Bracketworks What happens when you try that code?
@KendallFrey Works fine. Just like any of the IEnumerable<T> extension methods that return an IEnumerable<T>
So... what's the question?
13:37
Due to the generic constraints that can be applied, this is possible to perform with an extension method; I can apply constraints to that of a base type, and inheriting type instances will return their own type. Is this possible to achieve with true instance methods?
So essentially you want to perform generic type inference on this?
The only thing I can think of is a self-referencing generic type parameter (T) and methods that return it.
@KendallFrey I suppose, yes
The only thing that comes to mind that would work is:
public interface IAmFluent<T>
{
    T Foo();
    T Bar();
    T Qux();
}

public class Fluent : IAmFluent<Fluent>
{
    public Fluent Foo() { return this; }
    public Fluent Bar() { return this; }
    public Fluent Qux() { return this; }
}
which compiles fine, but that's alot of boilerplate.
and it's brittle because public class Fluent : IAmFluent<NoYouArent> { }
13:55
The best thing I can think of is just make it non-generic and return the base class.
So, any alternatives for MDI in wpf ?
@KendallFrey Yea, I wish it could. Rather, obviously I can, and cast it, but as you might have guessed, for the sake of syntactic simplicity, I'm trying to reduce explicit casting so it'll read like prose but keep type safety.
My boss just walked into my office, said he was in a hurry, started clicking around on my computer, and left. I have no idea what just happened...
@AndréSilva It depends what you're trying to do. What would each document be?
@KendallFrey I have 2 register window, 2 configuration window, 1 import window, 1 export window, 1 service check window and 1 manual extraction window
14:02
Sounds like you need a tab control or something.
hii all
Hm
Tab control sounds ok, should I separate each window as user control ?
@Shilpa Hi
I don't know why you would need to.
Put everything under the same xaml ?
can someone please explain a delegate
@ExcelledProducts It's a variable that contains a function.
@AndréSilva Yeah, might as well.
@KendallFrey Wouldn't that look dirty ? :(
well ill be ;)
@AndréSilva Yeah, well, maybe, but I don't have a problem with it.
It might be an indicator that you're trying to do too much in one window.
14:07
@KendallFrey Well I do, that is why I'm seeking help.
just needed to know that because I need to add nodes to tree view from different threads
So, is there a way to separate stuff so it won't get that dirty look ?
@AndréSilva -> u want to show ur windows in tabular mode?
Separate windows or pages?
like Firefox
14:13
@MRS1367 I want alternatives for mdi, I got the tab idea from kendall
If you use a navigation control you can use separate pages for each... page.
I read ur words
@KendallFrey But will that give me the freedom to roam to any page without having to switch from page 1 to page 2 until it comes to page 15..
For instance.
I guess my knowledge in navigation control isn't much but if you recommend it I will take a look for sure
In a switch statement can I do something like :
case "x"||"z":
//something;
break;
?
case "x":
case "z":
  //something;
  break;
14:15
Just do
case "x":
case "z":
Hey, where's the Marshal stuff in the room description? I thought we were interop-ing
@AndréSilva -> u want to access to some parts from every page?
@MRS1367 Yes.
u want this for an app or a website?
14:18
@MRS1367 Maybe clarity of structure?
@KendallFrey Paging look really neat.
@ton.yeung It can, for integer types. For complex types it might not make much of a difference.
u need to something like a ribbon
@MRS1367 Let me google that right now !
u can use some components for using riboon control in ur app
14:21
I don't think a Ribbon has anything to do with it.
Ribbon looks like new MSOffice, really messy
I think I'm going with navigation
@AndréSilva -> or u can use toolbars
That made me think
I'm using toolbars right now
What will be the difference between tabs and toolbars ?
I'll have to group every window in the same xaml
tabs are used for showing some related pages in the same window
F*ck tabs, back to toolbar haha
14:28
but toolbars are used for display related tools for different parts of an app
I read your definition of a toolbar as: "That is exactly what you need, use it."
@AndréSilva -> yes :)
@JLott That's rude.
14:44
@John It was... but whatever lol. Better than them complaining about something
@ton.yeung In reality they are great to work for, but I have no idea what he just did lol.
And I have been asked to lunch... several times... Men... :P
brb
@ton.yeung Ahhh, unfortunately though, it does makes a little more sense.
@KendallFrey Rarely can anyone say something like this, but PHP's self and static self-referencing class keywords would be useful here.
public self Foo() { return this; } would be typed to return whatever defined Foo, and static is the late-bound equivalent.

« first day (1004 days earlier)      last day (4170 days later) »