« first day (1472 days earlier)      last day (3482 days later) » 

12:03 AM
@OMGtechy Where are youuuu
@KendallFrey You too! Where are my favorite ppl :(
 
 
5 hours later…
5:12 AM
I dislike traffic lights.
 
5:44 AM
hello
anybody here
need a quick help
 
5:59 AM
@Jilu what do you need help witth?
 
Index (zero based) must be greater than or equal to zero and less than the size of the argument list.
I'm getting this error
at here:
splitItems = item.Split(",".ToCharArray());
sb.AppendFormat("{0}('{1}','{2}','{3}','{4}'); ", ds.InsertPlan("1", splitItems[0], splitItems[1], splitItems[2], splitItems[3], DateTime.Now, DateTime.Now, user, user, "Nil", 1));
 
I think the issue is that you're giving it 11 arguments but in your {}'s you're only specifying 5. So it doesn't know what to do with the rest.
 
any alternatives?
 
 
1 hour later…
7:19 AM
hi guys
 
7:42 AM
Am getting a strange problem trying to get data with jquery ajax call.
When I try to get data from my table users I can get it fine
but when I try to get it from my table shifts I get server 500 internal error
I think that since my table shift primary key is ID might be the problem
but am just guessing
 
Morning, how long should it take for Visual Studio 2013 express for Desktop (phew, a mouthful!) take to load a new project. I've just installed and it takes 10 minutes any time I create a new project.
I thought it should be instant?
 
8:18 AM
@James It shouldnt take that long depending on your pc specs it should be under a minute
 
Hi people
I'm learning about logging in via a website. I've got the basics, in that (within MVC any way) we can set an authcookie. My question is more about the database and what is stored in it. I guess we don't want to store the 'real' password but an encrypted version?
Is there a standard approach for this, or is it varied based upon situation?
 
@Dave One-way encryption. Even you should not get the password back in any case. Do not use weak hashing algorithms. Do use a salt and a high number of iterations. PKBDF2 is a good example, crank u the # iterations to as high as you can allow without annoying customers (~500ms is good)
 
8:34 AM
Right I see. Of course, it should be one way. This means though, in theory, they type in a password, we encrypt it and match the encrpyted password to a value in a database?
 
Yep. That's the way.
 
I see. I'm just now going to Google PKBDF2 - I know BFD2 , but no this (BFD stands for big drums, it's a music program (you can guess the F))
:)
 
@Gotalove Thanks, that what I thought. My pc is a little dated but still a Core i5 with 4GB ram. It's strange, the very first project I created was instant but every subsequent project takes 10 minutes
 
I've heard a lot of owasp via dotnetrocks actually
 
8:37 AM
I've tried restart but no improvement. Kind of reluctant to do a full re-install unless absolutely necessary.
 
I'm going to be rude if I may @RoelvanUden, you mention salt. Is this the same salt as en.wikipedia.org/wiki/Salt_%28cryptography%29
Sorry to make you visit sites to verify I've understood
 
@Dave Yes. It's purpose is to avoid rainbow attacks
 
You're doing this on purpose :) I now need to Google rainbow attacks. You see, this is a dreadful thing.
 
it's in the wiki article
"Salts also combat the use of rainbow tables for cracking passwords. A rainbow table is a large list of pre-computed hashes for commonly used passwords. For a password file without salts, an attacker can go through each entry and look up the hashed password in the rainbow table."
 
A rainbow. You see a rainbow, as a child, chances are you already love colours and the sky. The sky is blue. And yet, we have colours in the sky. You're then told there is a pot of gold underneath. How can this get any better? The most magic thing ever, and then you're told a troll lives underneath to protect it. This is child imagination at it's best, adn some one has attacked this? People have no soul :(
he he
Is the table full or passwords of the hashes?
 
8:41 AM
Both. Password and resulting hash. The salt prevents applying such a rainbow table on data, but you can still generate your own table with the known salt and iterations, but you are suddenly limited to attacking just ONE account instead of ALL
 
I get the feeling, this is going to be the start of quite a journey into this...
 
Pretty much. Cryptography is not an easy topic.
But if you stick to best practices you can at least avoid major fuck-ups
Without understanding why you're doing things that way :P
 
OK, big question, but, does one have to get that deep into it? I mean, there are lots of programmers (good programmers) who don't really understand what goes on under the hood.
I guess it's about what is the damage if some one broke in really!!
d'oh
 
You don't have to. So long as you understand the basic premise of WHY we do things that way, you can balance your own approach from ease of use to absolutely secure. That said, in .NET it's ridiculously easy to have a relatively good password storage.
 
I assume the framework takes care of a lot of the complexity giving me a nice high level overview ?
 
8:48 AM
Here, let me show you:
private static string GenerateSalt()
{
    using (var randomNumberGenerator = RandomNumberGenerator.Create())
    {
        var buffer = new byte[32];
        randomNumberGenerator.GetBytes(buffer);
        return Convert.ToBase64String(buffer);
    }
}
That's a simple function to generate a salt. Now, to generate a hash:
private static string GenerateHash(string password, string salt, int iterations)
{
    using (var rfc2898DeriveBytes = new Rfc2898DeriveBytes(password, Convert.FromBase64String(salt), iterations))
    {
        return Convert.ToBase64String(rfc2898DeriveBytes.GetBytes(64));
    }
}
So now you can hash based on password, salt and iterations. So, setting a pass:
public void Update(string password)
{
    var random = new Random();
    Salt = GenerateSalt();
    Iterations = random.Next(10000, 20000);
    Hash = GenerateHash(password, Salt, (int)Iterations);
}
And to validate a password against the stored hashed data:
public bool Validate(string password)
{
    return Iterations != null && !string.IsNullOrEmpty(Salt) && Hash == GenerateHash(password, Salt, (int)Iterations);
}
In total about 30 lines? Very simple with build-in crap :3
 
Hey guys can anyone help me figure out why this jquery ajax call returns server error 500
 
I understood the first 2 methods
the third is called update. Is that to update a password? I would have thought we'd delete the original password and provide a brand new one with a new salt?
 
@Dave It's what I use for password change or initial password set. I accept plain text password and update the database columns with new data.
 
Oh, I just didn't read the content of the method. I'm sorry
Yes, it is doing what I thought...
 
@RoelvanUden hi
 
8:53 AM
No, I'm sorry, one more question. The validation is confusing me.
How can I validate user if I generate a new salt?
Am I right in thinking that with every salt, a different hash will be produced?
So, if I log in, a new salt is created, therefore a new hashcode is made, this won't match the hash in the datastore
 
@Dave You don't generate a new salt. Iterations and Salt and Hash are the values stored in the database at that moment. So, the validation merely takes the plain text password, hashes it with the correct salt and iterations and compares it to the stored hash. If it's the same, it's valid.
@Dave Correct. Each salt is supposed to be different when you generate it.
 
public bool Validate(string password)
{
return Iterations != null && !string.IsNullOrEmpty(Salt) && Hash == GenerateHash(password, Salt, (int)Iterations);
}

I assume that Salt is a global variable
 
@Dave if you need a nugget for password I sugges simpleCrypto.Its very simple to use
 
or at least a property I should say
So, when I log onto a website, and call this class, a new salt is created?
 
@Dave Oh no, these are part of my Account class, which is a POCO mapped to a database row. Sorry for the confusion :-)
 
8:56 AM
Ahhhh. now I see. Does this mean that when we save the password, we also save the salt?
the password meaning the hash
 
Yep. Let me show you a bit:
 
This is now making more sense
 
@Dave From my database.
@Dave Or that with two values :-)
 
Wow, yes. I can now see this.
This is really amazing
 
Side-note: Both passwords there are the same. The iterations/salt have hidden that.
 
9:00 AM
Oh, I didn't make that connection...
So, even with this information, I still can't impersonate you as I guess there is no way to decrypt based upon the salt, iteration and hash?
So, even if the dtabase becomes comprised, that information remains 'secure'
 
That's the general idea. I'm pretty confident it will be hard for you to break through this even with a super computer giving you roughly a year.
 
I have an intel i7 :)
 
Of course, security is just an accumulation of effort and time required to break it
As time goes on, and technology changes, current 'high secure' approaches may become weak and trivial
SHA-1 (you probably know it) wasn't THAT bad a long time ago (it was still a little bad). Now that we can generate a billion of them per second, it's really, really, really useless for any kind of secure hashing.
 
Yes, I've heard that again on .netrocks - can't remember the guys name but he does a lot of work like this
I actually use SHA-1 or a simlar to verify files actually...
 
That's completely OK! That's what you SHOULD use it for.
 
9:04 AM
Or MD5
can't remember which now
 
It's fast and produces something to verify contents with. :-)
 
Yes, and for just ensuring that a file backed up correct was easy and reassuring!
Thank you so much for your help @RoelvanUden, and for taking the time to talk to me
It's very much appreciated, but I have now to get on with work :(
Well, meetings!
Thanks again, really, big thank you, and for sharing code
 
Haha no problem. I'm making my way through them too :-)
 
Have a good day :)
 
Same to you!
 
9:15 AM
imgur.com/rP0bCod so this is the error am getting when I try to get data from my ajax query
Why is it failing to serialise properly?
 
Completely random, but I love Intellisense! Just been learning it properly and it very helpful.
 
any idea what's the name of ^ symbol in Keys enum?
and ~ ?
 
9:30 AM
@erem ~ I think is called Tilde
 
yes, found it, it's OEMtilde
this ~ is carret, but can't see something like that in Keys enum
this ^
 
no, I don't think it's in there either having looked at it
 
Hi guys
newds
 
@RoelvanUden Help me understand why you'd ever change a server side site layout from a client
Switching to a diff one I understand
Changing one entirely, wat?
@c0dem0nkey Don't spread newds here please, you need to go to 4chan.org to do that.
 
lol that was nerds.
anyway question.
are there issues with mvc and older IIS versions
???
my app is always rendered as Page cannot be displayed when browsing via remote on iis server
 
9:59 AM
I haven't heard of that one before
 
does the server have to have mvc ?
 
I can't answer that, I'm a newb with IIS
I can just about make sites work and when they don't it takes me days to debug them lol
 
@Sippy Because you can. For example, let's say you provide SaaS for a web shop. Just altering CSS is not enough, so the client might hire a designer to change all the layouts to fit his theme, while using your back-end systems :-)
 
hai guys while binding dropdown in mvc always this error is occured why
There is no ViewData item of type 'IEnumerable<SelectListItem>' that has the key 'country'.
can anyone tell where im wrong
 
Yeah, in your code.
 
10:10 AM
@dazzlingkumar Well, to make it short, there is no ViewData item of type 'IEnumerable<SelectListItem>' that has the key 'country' in your code.
 
but i have viewbag in my code
 
@RoelvanUden Okay but that's not what the guy wants, he means letting users change the layout files, from what I understood.
Which I would class as being a really bad idea.
 
@Sippy Well that's exactly what I just described. ;-)
I don't think it's a bad idea at all.
 
@dazzlingkumar We can't help you if you don't post your code ..........
Can't just magically fix shit.
 
@Html.DropDownList("country",(IEnumerable<SelectListItem>)ViewBag.countrydrop,"Select country")
 
10:12 AM
sigh
all of it.
including the controller
 
its driving me nuts
f
c
k
 
@RoelvanUden wat
You said hiring a designer to change the code
He means CMS style
 
List<Companyregister> coun = new List<Companyregister>();
{
coun = ds.getcountry();
};
List<SelectListItem> item8 = new List<SelectListItem>();
foreach( var c in coun )
{
item8.Add(new SelectListItem
{
Text = c.country,
Value = c.countryid.ToString()
});
}

ViewBag.countrydrop = item8;
 
In pastebin
 
@Sippy Yeah well, let's say you have a SaaS CMS and provide a boring layout but a great administrative panel. Your customer might want to change the ultimate boringness to his own house style, thus, he wants to modify the layout.
 
10:13 AM
Come on man
Help us to help you
@RoelvanUden Right but in MVC that layout wouldn't BE a layout file, would it?
You'd just specify the layout of views
I see where you're coming from I guess
I would just make the layout really minimal so as only to include what has to be there on every page
The rest I'd leave to the client
 
Any idea when I am using this code
 PropertyDescriptorCollection props =
            TypeDescriptor.GetProperties(typeof(T));
            DataTable table = new DataTable();

            for(int i = 0 ; i < props.Count ; i++)
            {
                PropertyDescriptor prop = props[i];
                table.Columns.Add(prop.Name, prop.PropertyType);
            }
why it does not get any props for this input?
            customerList.Add(new Person() { contact_id = "Joe", external_id = "Black" });
 
Use pastebin
Oh it's short
 
@Sippy Depends. If you swap out Razor for Mustache, you can really allow your users to tinker with their own layouts and not have a care in the world.
 
@RoelvanUden I'm gonna read up on Mustache
I think I'm thinking in Razor mode because I've never seen another layout style for MVC
@dazzlingkumar Put your View code and your controller code neatly in [pastebin](www.pastebin.com) please.
 
@Sippy Razor is dangerous because you can invoke logic from it. Letting users write Razor is just silly. Mustache migrates this problem by not allowing any sort of logic to run on the server at all.
 
10:21 AM
@RoelvanUden Yeah that's why I'm thinking it's a shitty idea.
Was gonna get my gf a tablet for xmas, told her I was gonna get her a wikid surprise and she forced me to tell her what it was
Ended up not wanting it
gg +£180 in my bank
 
ungrateful b
 
Lol
 
Anyone got a minute please?
Having a list of objects defined like this:

var customerList = new List<Person>()
customerList.Add(new Person() { contact_id = "Joe", external_id = "Black" });
How can I make that customerList be datasource of my datagridview?
I tried to do:
dataGridView1.DataSource = customerList;
nothing in the grid :/
uhh, forgot the { get; set; }
 
@Sippy Huh, not wanting it? Dafuq.
 
@RoelvanUden Her exact words were "All I'd use it for is skyping in bed"
And I was like isn't that what tablets are for???
 
10:36 AM
Also for reading and looking up things when watching TV :-P
"Who the f... is that actor? IMDB!"
 
11:07 AM
Need help with a very simple issue! NickLarsens answer here stackoverflow.com/a/3832781/689881 - I got that code to work but now I simply want to print out the actual combination (of hands) and not just only how many there is. How do I do that?
 
@user689881 You want to print 134,459 combinations?
 
yes!
 
Is there a point in your code where there is a single combination, in string form?
Or a way to determine the combination at every iteration?
 
Well if I knew that I wouldn't be here :)
I tried using a printFunc() in the Card struct, but I get some weird results. Ideally I''d also want the four suits to be like in reality - i.e. Club/Diamond/Heart/Spade. On combination would for example look like "2c3c4c5cAd"
 
Lol
 
11:21 AM
-On +One
 
I don't have time to work that out, soz ^_^
 
no problem :)
 
What happened with Mike M the other day @KendallFrey?
 
I honestly have no idea
He must have gone off the deep end
 
Lols
Got a semantic issue, a web application user can belong to one of three groups, each of which preempt what that user can see on the index page. Best way I can think to do this is find out which group(s) user belongs to and serve partials for each match using Razor code on the view?
 
11:35 AM
use docker
idk, some guy was explaining what docker is to me the other day
 
I definitely lolwtfbbqd at that.
It's a component based cloud app development framework, it looks like.
 
I don't completely understand your situation, but what you said makes sense kinda
 
totally just coined the C-CAD framework
Or CB-CAD
@KendallFrey Neither do I man.
This is what happens when client says "We can't really give you a spec, can you just build something and see what happens?"
And boss says "Just do it man."
 
ick
were ads in Skype a thing before MS bought it?
because now it's like a freakin website
 
Nah they weren't.
MS must make a fucking killing with them.
Even though skype is getting worse and worse with time now they're running the show.
Skype on Android phones is awful.
I wish MVC authorisation included Activity based auth natively.
 
12:02 PM
Hi guys ...
Guys i am using json.net for json serialization ...
being the reason that its pretty fast
as well is mono compatible ...
now in this case ... when deployed on Ubuntu ... the serialization is hogging the CPU
what could be done to solve this ?
 
how is it hogging the cpu?
Surely it doesn't take more than a second to deserialize a single string
 
no its like i am using that into a Json RPC generic class ...
So its is being pretty much used ...
so in that case for all the api it will use Json.NET ... So it is increasing the CPU % upto 50-70 %
@RoelvanUden - Belated Happy Birthday ! May god bless you with many years of free license of Visual Studio ... :P
@KendallFrey - I dont get why is it hogging so much of CPU ...
 
Neither do I, I don't know what your situation is
Are you calling it many times?
Are you deserializing a large message?
 
12:17 PM
Have you used encog much Kendall?
 
nope, what is it?
 
I thought you played with NNs a while ago
 
but as per i tested the same, manually commenting stuff it is creating the issues ...
 
@bhuvin Lol, thanks :-)
 
@JohanLarsson yep, never got anywhere
 
12:19 PM
@KendallFrey - Yep its being called manny times ...
 
Still intend to get me a book someday
 
I'm gonna go there too :) (not anywhere)
 
@RoelvanUden - Hows ur day man ?
Besides that where do we turn up for the Party ?
 
@bhuvin Meh. Decent. Feel a bit ill. :P
 
@KendallFrey do you have a pluralsight subscription?
 
12:20 PM
(half a week later, lol)
 
Party is over and done. Next year :-P
 
@JohanLarsson na
 
or is it u giving out Bounty for birthday :P
?
ahh man tc of urself ...
Bounty -(StackOverflow)
 
@all Is Resharper useful?
 
CANT RUN MVC 4 on IIS 6 its driving me nuts
 
12:31 PM
I like it, really nice for generating boilerplate code such as equals & inpc
Useful when writing xaml also
 
@Sippy Yes.
 
@Sippy = Beware , It can make your VS dead slow ...
@RoelvanUden - Please help
Json.NET is being used in a Generic class , for JSON RPC ...
 
Anyone has idea what this could mean please?
Cannot access child value on Newtonsoft.Json.Linq.JValue.
 
My Client calls the server every few seconds ...
It works fine on Windows , but on Ubuntu hogs upto 50 - 70 % of the CPU at a point of time ...
 
@bhuvin Debug it. :/
 
12:36 PM
Already did ...
Commenting out all the code which was around it ...
Json.Deserialize , is when the CPU is shooting high by about 7 % ... on one go ...
 
Using newtonsoft?
 
yup
on Ubuntu ...
 
you're probably initialising too many times.
 
> Is there some static initialization calls that occur?
> Yes
 
best answer eu?
 
12:40 PM
consistently, or just the first time?
 
Its parallel threads going on ...
 
I'd expect consistently.
But it will likely depend how you initialise the class which contains the deserialiser
I don't think Deserialize itself will make static initialisations every time.
 
yeah but its not static ...
 
Cos that'd be fucking stupid.
 
Does anyone know of any chat rooms like this for beginner developers - places we can ask stupid and simple questions without annoying anyone!
 
12:41 PM
@James this one is fine.
 
precisely ...
 
Just make sure you think for yourself and don't vamp. :D
 
but then there are different CRONS running parallely ..
 
@bhuvin NewtonSoft static shit.
Not yours.
 
ohh ..
in the sense ?
 
12:42 PM
initialise newtonsoft class var and then keep it
Run parallels on the same object
 
Ha, funny you say that as it's kind of one of the reasons I asked. I wanted to join the Android room and they said I couldn't as I have a history of being a 'Vamp' - I figured that meant asking questions without helping others in return, right? But if that's the case then it makes it really difficult for people just starting out because you don't know enough to help anyone!
 
@James No, it's asking for solutions instead of asking enabling questions so you can reach a solution on your own.
Oct 24 at 11:29, by DPM
pls give me a solution
Don't do that, basically.
 
Guys my WPF texbox needs to accept Alt+029 char
 
or that
 
it doenst do that
any idea
 
12:47 PM
Are you a help Vampire?

Do you get more code from Stack Overflow than you write on your own?
Do you feel entitled to help from Stack Overflow users?
Do you believe in the philosophy "Just use jQuery"?
Do you spend more time looking for the right "plugin" than you likely would writing it on your own?

If you answered "Yes" to any of these questions, there is a good chance you are a Help Vampire. Sorry.
 
Ah ok, that seems sensible and definitely something I'll try and do if I haven't already (although I thought I have)
 
From JS room; spot on!
 
@RoelvanUden Thanks.
 
Anyone got a minute for Json thing please?
 
@James We will help you understand how to write code, we won't write it for you :D
If you have questions, ask away.
 
12:48 PM
^ That. Questions are perfect if you show effort. If we can google it in 10 seconds, you didn't show enough effort.
 
Also remember to Google stuff first, Google is your best friend as a programmer. Google knows everything.
 
@Sippy That sounds perfect, I don't want to be spoonfed! Not at the moment, I;'m just following the Microsoft Virtual Academy on C#, but looking for resources in case I need help with anything
 
Good idea
 
Everything so far has been fairly simply as the concepts are similar to when I learned some PhP and JS a few years ago.
 
What type of PHP did you learn?
 
12:49 PM
Programming is merely an accumulation of simple concepts.
2
 
@Marek : Man what is it ?
 
like did you use PDO or did you write it procedurally?
@RoelvanUden Yeah that accumulate into a fiery ball of hate.
I hate that.
Fire -> Fiery
l2spell, English
 
@bhuvin what does this mean please? Cannot access child value on Newtonsoft.Json.Linq.JValue.
 
@Marek I guess it means you're trying to access a child value on a JValue
 
I am doing:
foreach (var subscriber in job["_embedded"]["ngcp:subscribers"])
{
 
12:51 PM
seriously, explain what part of the message you don't understand
 
@Sippy PDO?
 
@Marek - first could u put in some of ur code
?
 
@James Gonna guess it was procedural code you wrote then, try to forget PHP :D
C# is much nicer.
 
var job = JObject.Parse(subscribers);
List<Subscriber> subs = new List<Subscriber>();

foreach (var subscriber in job["_embedded"]["ngcp:subscribers"])
{
string statusElement = subscriber["status"].ToString();

}
This is where I get an error.
 
@James PHP can use classes and whatnot, forcing you into an OOP thinking style. In C# we use the same style, so if you have the experience with that, it's so much easier.
 
12:53 PM
I think I'm retarded
Forgot how to write switch
 
To be honest m PhP experience wasn't my finest hour. I was leaerning from books and a few tutorial sites but then I hit OOP concepts and for some reason when I started couldn't get my head around it. That was maybe 4-5 years ago, then about a year ago I started doing some JS and HTML and the OOP concepts came to me much easier.
 
@bhuvin any comments to that please?
 
@James OOP is ridiculous in PHP.
It's perfect in C# :D
 
@Marek - Wait ..
 
I think sometimes when you're trying to learn you can have an idea of something being more complicated than it is which makes it tougher to learn. Then you come back without overthinking it and it clicks
That's how it works for me anyway.
So just trying to learn fundamentals atm with this course: microsoftvirtualacademy.com/training-courses/…
Extremely basic but easy to follow, clear and has a good learning curve.
 
12:56 PM
I think my mate learned from those
They're good
He's an idiot and he found it easy so
 
@Sippy Urgh. Perfect? No. Pretty good? Yes.
 
@Sippy Ha, encouraging!
 
@RoelvanUden Enlighten me, o C# deity!
 

« first day (1472 days earlier)      last day (3482 days later) »