« first day (1614 days earlier)      last day (3333 days later) » 

12:07 AM
posted on March 17, 2015 by Scott Hanselman

So I got locked out of an Ubuntu VM that's running in Azure  Long story, but an employee left and some now the "admin" user I had access to no longer had "sudo" powers anymore. I needed to run apt-get update && apt-get upgrade but literally had no user available with admin on the box. If the machine was local, I could perhaps boot into recovery mode but this

 
anybody good with CSS media queries?
 
12:29 AM
yay, I officially have a responsive design
 
 
2 hours later…
 
3 hours later…
5:27 AM
morning
 
it's 10:32
PM
 
oh good night to you Phoenix
its 8.33 am here
 
hey all
need some help
what is command injection as a security vulnerability?
 
5:45 AM
morning!
 
morning
Any web designers/web developers online right now?
I kind of need a little advice. I'm job hunting right now... I've never had a dev job before, but I have tonnes of experience. I've made over a hundred sites over the years, I've made apps/desktop apps/mobile apps. All of my sites are responsive sites. I know how to integrate payment systems and implement secure member's area type things. I'm competent in more than a few languages and frameworks. I know I'm not the best out there. But I'm far from the worst...
... yet I still get knocked back everytime I apply for a web dev job. Even those jobs that only want experience and don't care about qualifications.
I'm almost finished a Diploma in Web Development.
I'd like to know what it's like for you guys... How did you get work? Did you need qualifications? How the heck to employers decide who to ignore, who to respond to, who to interview, who to hire? Because what I've been told my whole life is: 1) You need qualifications; and 2) Qualifications don't matter, experience matters. But neither of those match up to what actually happens out there...
I have experience, yet the ones that want experience ignore my applications or reject me. I almost have qualifications now, but will anything really change once I get them? Will a Diploma make it any easier?
 
6:02 AM
@Jase Which part of the process are you most often cut at? Do you get a phone interview?
Do you think you interview poorly? If you're not hearing back from anyone at all, then I'd worry about how you present yourself on paper, and the lack of a degree or diploma might be a factor
But if long as you're communicating with a human being at some point, I wouldn't worry about credentials.
 
6:29 AM
@Jeremy thanks for getting back. I never used to have any issues getting interviews. I originally worked as a laborer right after school, then I did sales for a while. Then Production Analyst, then Personal Assistant. I went onto programming while I was a PA, and that was about 10 years ago. But whenever I apply for dev job most of the time it's online because they just tell me to apply online if I call them or visit them. So they either don't respond to my online application or they just reject
...
me... They usually say that I don't have the experience they're looking for. But when I match my experience with what they say they're looking for, in most cases I have more! But even though that's included in my application, they don't seem to realise it.
 
7:00 AM
Morning!
 
 
1 hour later…
8:06 AM
 
8:37 AM
chat ded
 
morning guys :D
 
9:19 AM
fssdfsd. Apparently there's a 'feature' in IIS called 'rapid fail protection'. This causes an app pool to recycle if there are N unhandled exceptions in M minutes.
This is entirely useless for hosting a WCF service since SOAP expresses an error response as 500 internal server error with a fault body, and you do that in WCF by throwing a FaultException
So basically, I can't respond with 'you made an erroneous request' without triggering an occasional spontaneous app pool recycle. By default, anyway.
 
9:33 AM
I just made a start with sqlite (coming from BinarySerializer), but should I make Factories now that has all data, to fix all references? (Product.category = ProductCategories[id] or something?
 
Aurgh that map angers me
Dear Chat, you're not going to get any work done today and I apologise for that in advance. Here's why: play.elevatorsaga.com
3
 
9:49 AM
@Squiggle Lol
Fuck that game!
 
@Squiggle Such a fun game!
 
isn't it?
I got to level 6 before I needed to refactor
 
:P
Mine got really complex after level 6
 
Battling complex requirements today. "Must be able to select one or more dates, date ranges and/or recurring dates."
 
10:04 AM
Ouch. Recurring dates is going to be a major pain in your behind.
 
If you don't need to act on it on the server-side, sure? If you need to act on 'Recurring event every Friday except the first of the month at 9:00' then you're in for a world of trouble.
 
No times, just dates, thankfully
and no "excluding X"
it's a sort of business calendar
 
hello ,
 
thought about using the iCal spec, but that's probably overkill
 
10:09 AM
i have web service that worked fine on visual studio
but it can't be work when i host on IIS
Error-500.19
 
500 is an internal exception. What's the error message?
 
@squiggle error seem to related to configuration , i will post it here , 1 min
The requested page cannot be accessed because the related configuration data for the page is invalid.

<section name="scriptResourceHandler" type="System.Web.Configuration.ScriptingScriptResourceHandlerSection, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" requirePermission="false" allowDefinition="MachineToApplication"/>
 
10:27 AM
@Bassem Your IIS server is up-to-date with .Net versions? the web.config is valid XML?
I've only ever seen that error when my web.config is malformed or it can't locate a handler
 
@squiggle , it is worked fine on Visual studio so i think web config has no problem
 
10:44 AM
@Squiggle this is awesome :D
 
:D
 
@squiggle
error changed to be
The type 'BassemWCFServiceFor3._5Framework.Service1', provided as the Service attribute value in the ServiceHost directive could not be found.
 
sounds like you might be missing one of your own dependencies. Did you deploy properly?
 
Ew at that namespace
 
i build my solution
 
10:56 AM
yeah that is one seriously ugly namespace you got there
 
hi, i found in SO that i have to use #if DOTNET40 some code `#elif DOTNET35 etc .. to target the code for different .NET versions. and that's Ok. this is for a class library. but i want to write a console application as an installer that detects latest .NET in the client machine and will install the assembly in GAC.
how do i build this from a console application any hints ? link
?
 
@someone in what scenario would you ever want to do such a thing?
 
it's a COM library
 
/me voms
 
how installers do this ? when you target your application to multiple .NET versions ?
is there a build tool that i need to use ? i found /p:DefineConstants="NET40" MSBuild but i have no idea how to use this in my case
 
11:41 AM
@someone I'm still not entirely sure I follow. You want to build two different libraries, one for .Net 3.5 and one for .Net 4.0, with specific logic that differs between framework versions?
I'm not so familiar with installers, TBH, but the code/build process is as you suggest, using compiler symbols is the correct approach.
But it's a nasty approach.
One thing to consider, though, is if your library has any dependencies on other assemblies, and what version they are.
 
12:13 PM
Sounds like a problem waiting to happen :)
 
12:28 PM
 
I have a list like this:
listNumber = sendingList.Select(kvp =>kvp.Value.DeliveryCustID).ToList();
and I would like to add more items such as kvp.Value.DeliveryAdrID and more but when i put them in the select area its say kvp does not exist in the current contest
ups pressed enter to early
how can I add more items without getting this error?
 
12:48 PM
@MishMish you could try SelectMany, which takes a Func<TSource, IEnumerable<TResult>> IIRC
kvp => new[]{kvp.Value.DeliveryCustID, kvp.whatever, ...}
 
I have a question regarding SourceTree. I have a repository that I checked out and mearly want to remove it from my sidebar. How do I do so?
I am afraid to do anything because I do not know if this will delete the files in the repository
if its just removing them from my computer than that is fine
anyone familiar with sourcetree?
 
Does it have documentation?
 
i was reading here answers.atlassian.com/questions/65053/… but the issue is that there are 2 side bars
honestly....I just don't want to be the guy that deleted the shit
I fixed it.
 
1:03 PM
@Skullomania Remove Bookmarks looks like it does what you want
 
I figured it out
 
but git won't just delete files unless you tell it to, and even then it won't commit that unless you tell it to
 
I watched a c0deporn tutorial earlier and followed all the steps with git
 
:22163361 Thanks alot it actually works that way, still I have an issue here when i databind this to a gridview the data are shown verticaly and not horizentaly,

 List<string> listNumber = new List<string>();
            listNumber = sendingList.SelectMany(kvp => new[] { kvp.Value.DeliveryCustID, kvp.Value.DeliveryAdrID.ToString()}).ToList();

            GridViewData.DataSource = listNumber;
            GridViewData.DataBind();
 
@KendallFrey the trouble I have now is that I can't figure out how to delete the folder from my disc after I committed the clone changes
 
1:06 PM
just... delete it?
 
deleting the folder does not work...it says that it is in use
 
by what?
 
windows never says
win 7
 
do you have it open in SourceTree or git, or Visual Studio, or what?
 
the example I posted earlier was source tree
 
1:07 PM
?
 
the youtube tutorial suggested that I install and use Git
 
do you have any of the code files open?
or maybe a command prompt in that directory?
 
i deleted the repository in that directory
but the actual directory that I cloned is still there
 
I thought you said you couldn't delete it
 
it was from github
 
1:08 PM
oh
do you have the directory open in a command prompt?
 
the repository I deleted...but the actual folder that was cloned I cannot
 
we have a third party service, and somebody threw an interface on it in case we switch out, i'm listening to this one guy tell this other guy, that thats a bad idea
 
I can...do you want me to open command...or the git promp
 
no
I'm just trying to get you to figure out what has the directory open
 
i'm just like, lmao.
 
1:11 PM
that was the tutorial
 
lmao only a savant could learn git in 20 minutes
 
^
 
im a Obadiah
 
@Skullomania looks to me like there are files in it, I thought you said you deleted them
 
i did
it still will not let me delete them
 
1:13 PM
all of them?
is the folder actually completely empty?
 
yes
 
did you also delete the .git folder?
 
it's a hidden folder
 
What are CSS media queries? I am
 
1:14 PM
i am showing hidden files and folders...I had to in order to delete the git folder
the .git repository
i even deleted the one created with git init in the tutorial
 
In my ApplicationUser model I have a FilePath object. Why ApplicationUser usr = db.Users.Find(id); makes usr.FilePathnull?
 
the mcdonalds hashbrown is there way of kicking you in the teeth for breakfast
 
but ApplicationUser usr = db.Users.Include(i => i.FilePath).SingleOrDefault(i => i.Id == id); is not null. Why??
 
@LifeH2O Do you honestly expect an answer to that?
@Skullomania Is the folder open in any program?
 
no sir
 
1:17 PM
I see you do have a command prompt open in the background, is that related at all?
 
@KendallFrey I don't exactly know the behavior of LINQ. I was not expecting it NULL
 
no...this was from the source tree question I had earlier
 
@Skullomania what were you doing with it?
sourcetree isn't a commandline app
@LifeH2O I can't read your mind, I have no idea what your code is
 
I was looking at the difference between the source tree terminal and the git terminal...trying to see which one I liked better
 
I am posting it as a question
 
1:20 PM
@Squiggle im stuck at level 7 without my code going to complex :(
 
@Skullomania what folder is the command prompt currently in?
@LifeH2O I hope you're going to actually provide details
 
the source tree terminal is currently in documents tmsf-web (master)
 
the... what?
I'm talking about the command prompt
 
yes...thhats what you saw behind the box
 
Yeah, well, something is open in that folder, and I don't know what
 
1:22 PM
How can I stop the "Tabify", "Untabify" warning from coming up in visual studio? any ideas? This is VS2012
 
@abhi fix your tabs and spaces
@Skullomania you know you can use git from the Windows commandline too...
 
@KendallFrey I do that each time I open the file.
So I am wondering what is happening to the file.
 
i try that...it will not work
 
@abhi does it use tabs or spaces? Check whether it contains the wrong one anywhere (NP++ can do that well)
 
1:25 PM
thats why i installed git
 
@Skullomania It will, as long as git is installed correctly
 
i can use git bash and it will open git
on a new or existing directory
 
I just use cmd
 
How do you get files from git onto your local drive?
 
excuse me?
 
1:31 PM
I know this is a very basic question
I am able to do this using subversion easily.
So how does this work with github
 
Level 9 now.
 
@abhi github or git?
It's very unclear where you are getting the files from
if you have gone through any basic git tutorial, you should be able to elaborate on your question. if not, it will probably answer your question
 
that was a very basic tutorial
there is no learn ANYTHING in 20 mins or an hour
not for me at least
 
@Skullomania Really? That must suck.
So when some child comes running up and goes all like "Press this button and I'll make a sound!" you'll need at least 20 minutes and 1 second to figure out what he means. Weird.
 
@RoelvanUden quiet you!
 
1:40 PM
0
Q: LINQ without Include returns null

LifeH2OWhy LINQ without Inlcude returns null for reference to another model? Models public class ApplicationUser : IdentityUser { public FilePath FilePath { get; set; } public async Task<ClaimsIdentity> GenerateUserIdentityAsync(UserManager<ApplicationUser> manager) { var userIdent...

 
@Skullomania Sorry, I'll continue with my work now. ADD ALL THE CONTRACTS!
 
Contracts (programming) <3
Contracts (freelancing) <3
Contracts (assassination) ...less good
 
CodeContracts: Checked 1906 assertions: 1906 correct yay. finally.
TIL: Don't neglect your contracts for a full week of rapid development. It will hurt.
 
Roel puts the 'pro' in 'programmer'
 
I'm a pro in grammar
@Squiggle That was a terrible pun tho :D
 
1:56 PM
:D
Level 10!
 
If I do => observableCollection.ToList(), is it still a reference then?
 
@ErwinOkken ?
=> indicates a lambda expression
.ToList() converts an IEnumerable<T> to a list
 
And if I change something in the new list, is it also changed in the "old" list?
 
that question is unanswerable
 
:') Why is that
 
2:01 PM
I can answer questions given context
If you have a question about actual code, I can give you an actual answer. If you have a question about hypothetical code, I can give you a hypothetical answer.
 
@ErwinOkken the answer is probably "usually, yes, but it depends"
 
@KendallFrey I haven't gone through any tutorial. I expected git to work like subversion and it did not
so I was kinda disappointed.
That's about it.
 
@abhi that's because git is distributed, not centralized
 
I am trying to hookup to github to get files. I understand it uses git.
 
what do you mean by "change"? The list/enumerable/collection/whatever will store references to objects. If you change something on the object, anything else that references the object will also see the changed object.
 
2:03 PM
you know there are instructions right on the github page on how to get those files, using two or three different ways
 
All I got were a bunch of folders and hidden files. So I am OBVIOUSLY DOING IT WRONG!!!
Yes. i was able to get them after getting the zip.
 
@abhi you got them from what?
 
Clone Desktop option.
a zip file.
 
um
which one
 
huh
 
2:04 PM
my dream of hooking up Visual Studio 2012 to github lies shattered.
 
ObservableCollection<Customer> Customers;
Customers.Add(new Customer() { Name = "Kai" });
List<Customer> newList = Customers.ToList();
newList[0].Name = "Chantall";

// What name does Customers[0] have now? :P
^ Is that concrete enough? :P hehe
According to what I've heard, I would've think "Chantall", (I also hope so)
 
@ErwinOkken It is updated, it's the same object
@abhi Why?
 
But the list is different right? So when I add something to the List, it (obviously?) won't be in the Dictionary.
 
dictionary?
 
meh observablecollection
sry :p
 
2:05 PM
@ErwinOkken you are correct. Also, naming it "newList" is a misnomer.
 
@ErwinOkken no, it won't
 
This is an example ofcourse :P
Good, that's exactly like I hoped it would be :D
 
@Squiggle but it is a new list
 
Hahahahaha
 
2:08 PM
what do you mean "sort of"?
in what sense is it not a brand-spanking-new list?
 
ToList is a method from IEnumerable. Calling it on a Collection<T> is different from calling it on an DbSet<T>...
 
different how?
 
Is there also a way to make a reference from/to a list?
 
Collection<T> will already have an evaluated set of data. DbSet<T> will evaluate.
it's a moot point here, though
 
@Squiggle That has nothing to do with ToList...?
both ways, a new list is created
@ErwinOkken uh, yeah, a list is an object
 
2:10 PM
yeah, it will.
removing an item from that list will not remove it from the previous collection
so yeah it's a new list
 
The "previous collection" is not a thing, because ToList is a method on IEnumerable
 
The Hating Game, Good read about not being a jerk
 
class Factory<T> where T : BusinessData
{
public ObservableCollection<T> Items;

public Factory(ObservableCollection<T> items)
{
Items = items;
}


^ Will that be the same list/reference?
 
@CharlieBrown Nice article.
 
I think it will be a reference
 
2:14 PM
will what be the same list ref?
 
implement a copy constructor maybe?
 
Items will point to the same location on the heap as the original, if thats what your looking for
 
The Items in that class, and the "items" that I give it
 
@CharlieBrown We are all that guy from time to time.
 
No, I need an actual reference
 
2:15 PM
@ErwinOkken Yes.
 
Your passing the in the value of a ref, and assigning that the value of another reference
 
every type except simple types are passed as reference
 
so, yeah, same
 
@ErwinOkken that's dangerous, because calling code can then modify the collection, and if your code doesn't expect that, stuff blows up
 
@gemGreg incorrect, everything is passed byVal in c# unless using the byRef keyword
 
2:16 PM
only for simple types
 
ref, not byRef
 
like int bool string
 
I don't get it. Some say it is a ref, and some say it isn't? :P
 
@gemGreg all parameters are passed by value, but some parameters are references in themselves
@ErwinOkken it is
 
everything is passed by value even reference types
 
2:16 PM
if I pass object of my class its a reference
 
no, its not
 
@gemGreg yes, you pass a reference, but you pass it by value
 
correct
 
I want a generic (I called it Factory, probably wrong :P) class that adds something to an sqlite database, and after that, setting the "ID" in my C# code. (The ID that Sqlite gave it to the tuple)
 
but an object is a reference to the oryginal
 
2:17 PM
ref parameters are a reference to a variable, and can change that variable
 
the diff is subtle, but its huge
 
@ErwinOkken hmm, you want your class to send some sqllite query and then modify ID property in your class ?
I dont know everything you want to do I joined not long ago. Maybe I dont unserstand your problem
 
@KendallFrey
 
@SteveGString
 
:)
 
2:25 PM
mmmm
 
@gemGreg I'm still a student so my experience with programming is bad :P. To update / delete a customer, I need the ID. But when I add a customer, I don't decide what ID it has, in the code, that's the responsibility of the database, right? So after adding, I need that ID back in my customer.
^ If that sounds really retarded, just let me know :P I can handle it haha
 
@ErwinOkken thats common. The solution is to do the update, then return a select from the update statement
 
2:28 PM
insert query can return ID
atleast in mysql
 
Or, just return identity
 
Yes, something that I said wasn't retarded! Achievement earned! :D
2
 
so your objects can add themself to sqllite. It seems there is no ref problem as its all happening in the same class
 
have a star
 
you star not this msg ;P
 
2:30 PM
OH. OH. OHHHH.
> We will release a cross-platform runtime for Linux and Mac OS X. When released, this runtime will enable you to develop and run .NET apps on Mac and Linux devices. We will work closely with the Mono community on this effort. Until its release, you can use the Mono CLR for cross-platform development.
 
you should star his question ;D
haha
 
ASP.NET team will release their own runtime for Linux/Mac. OWN. RUNTIME.
 
separate from the .NET CLR?
I thought vNext was going to run on Linux all along
 
Apparently. Or maybe it's come kind of official .NET for Linux.
It was sure, but that was using Mono.
Apparently they will have their own runtime after a while. Which is epic.
 
2:38 PM
its kinda pseudo code so you got a star
;p
 
@ErwinOkken This works in SQL Server

create table dbo.mytest(myid int identity(1,1), myval nvarchar(10));

insert into dbo.mytest (myval) values('HOPE//');
select SCOPE_IDENTITY()
 
I have no clue what it does, lol. But with sqlite i can just get the ID back, isn't it?
 
it returns the last created/inserted identity for this scope
 
if its 1 client only app its ok, if there are few clients working on the same base its risky
 
its by sesssion + scope, it will return correctly everytime
this is the same method used by all major ORM's
 
2:43 PM
Correct @CharlieBrown
 
oh didnt know
nice to know
so if its 1 thread only app ^_^
its ok ;p
 
sql session/scope, not application session/scope
its determined by the client id on the connection, and by the session id when the client begins the query
 
so even is someone insert some rows between your insert ans select it doesnt matter
?
 
@gemGreg what do you mean between them? there's nothing between them
 
correct. there are other methods that return identity from different combinations of scope and session, but this method gurantees the correct identity.
 
2:46 PM
personally I use postgresql and there is build in mechanism for returning ID in insert
 
for example, @@Identity will return from the same session, but not the scope. So if you have a trigger on the db, you might get a different id returned
 
imagine your app insert row of id 2
then you select last id - 2
 
Morning everyone.
 
its not a traditional select, all operations in sql are atomic
 
other case: you insert row of id 2
someone else inserts row id 3
you select last id expecting to be 2
 
2:47 PM
if that could happen, databases would be worthless
 
but it will get you 3
 
@gemGreg but it's one query, so the select happens at the same time as the insert
 
think of it like function scope, it returns the last identity for YOUR QUERY
 
you could use transactions
insert into dbo.mytest (myval) values('HOPE//');
select SCOPE_IDENTITY()
those are 2 querries
 
you could run 10,000 simultaneous queires like that, and you are guranteed the correctd result
 
2:49 PM
@gemGreg no, it's one operation
two statements, but one operation
 
I don't know mych of a sqllite maybe its that minimal and simple so what you say its true
 
its a basic tenant of all databases, operations are atomic
 
@CharlieBrown You wish
 
In my app I have large txt file with many postgresql querries
 
2:52 PM
I'm pretty sure I've heard people complaining about mongo
 
and I run it all atonce
 
that it's not issues like that
 
but they are seperate querries
someone could inject something between
if its not all in big transaction
 
All sql operations occur within a scope. You can execute those statements separatley as different operations, then you will get diff results
But if you send them in the same SqlCommand() from .net, they execute together in the same scope
 
if not you could create large time killing querries and everyone using this base would have to wait your querries to end
 
2:54 PM
It is almost noon! :-)
 
@gemGreg Selecting scope identity is based on the session scope. You can't end up with the value of another scope.
 
@KendallFrey Are you saying mongoDB is not atomic.
 
If you do SqlCommand("INSERT ... ") and then do SqlCommand("SELECT IDENTITY") its not going to work
 
@abhi there is something like that
 
But, if you do SqCommand("INSERT... SELECT IDENTITY") they execute in the same scope
 
2:56 PM
youre saing sqlcommand puts transaction above your querries?
 
SCOPE
 
it seems its the same thing
:P
 
all commands you send to sql server have scope
scope can not be rolled back
 
I wander if there is such thing in postgres
 
there is
same with mysql
 
2:59 PM
oh, not quite with mysql
MyISAM does not support transactions.
 
depending on the postgres version you can use the returning statement, or you can do LastVal()
 
@TravisJ But it has scopes to get the last_inserted_id
 

« first day (1614 days earlier)      last day (3333 days later) »