« first day (790 days earlier)      last day (4166 days later) » 

9:00 PM
I'm trying to figure out how to set the picture without involving WinRT. :-)
 
oh, without WinRT?
unpack SetAccountPicturesAsync and then look for the specific line of code that sets the image I guess
 
Man, only time will tell if the "await" keyword is seen as the pinnacle of event-driven programming, or as just another unnecessary hassle of the C# language.
 
await is awesome. I have implemented the await functionality a lot with workarounds, I wish I had just the simple one word approach
 
It keeps complaining anytime I try leaving await in
I take it out and no more errors =/
 
are you using async?
 
9:01 PM
Oh god, I've worked around it in Flash/AS3, and it was terrible. All of my design patterns were destroyed.
brb, soda run
 
@TravisJ "unpack"?
 
Yes
 
@TravisJ you do realize WinRT is all native code?
Well, that is apart from the CLR-compatible metadata
But drumroll Reflector doesn't work any more!
 
also, my company is awesome.
 
The hell? StorageFile imageFile = await StorageFile.GetFileFromPathAsync("some/path/here.png"); "await can only be used with async methods"
 
9:05 PM
@Nexion Have you marked your method with the async keyword?
await is a contextual keyword
 
They have Sprecher's Root Beer, Red Bull, and Miller High Life in the vending machines.
 
Bitch that is async!
 
Means your method will have to be "public async void Foo(...)"
Because the C# team likes to keep backwards compat
And await used to be a legal variable name in C# 4 and below
Hence, specifically make people mark the methods with "async" where "await" is a keyword, not an identifier.
@TravisJ TPL was pretty helpful with the async stuff even before the compiler magic.
 
@Rytmis saves the day once again.
 
I'm going off the reference from Microsoft
 
9:07 PM
Also, I'm a total C# geek.
 
Then this is the best place for you.
 
I'm no Jon Skeet. But few people are.
@Nexion yeah, if you only get snippets, they won't include the async keyword. But if you get examples with entire methods, they'll have it there.
Also, I've shipped an app to Windows Store already, so I know a bit of what I'm talking about. :)
 
class JonSkeet : IChuckNorris { }
 
$('.message .content').each(function(el) { this.textContent = this.textContent.split('').reverse().join(''); });
 
partial class JonSkeet : IKnowEverything { }
 
9:10 PM
the rest of your day just got better.
 
lawl rlemon
 
Mwah
 
Also When I just have "StorageFile img = StorageFile.GetFileFromPathAsync(location + "grad_hat_lighting.png");" I get "Cannot implicitly convert type 'Windows.Foundation.IAsyncOperation<Windows.Storage.StorageFile>' to 'Windows.Storage.StorageFile'
 
nomelr lwal
 
What up rlemon
 
9:11 PM
Found another piece of the MVC Portable Area puzzle: it's loading the wrong page because it can
 
@Nexion that's because it doesn't really return a StorageFile
 
wat @Lindsay
 
can't find the other page.
 
ntm, friday, procrastinating work.
 
@Nexion it returns something that will return a storagefile eventually
 
9:11 PM
I hate when microsoft's examples are convoluted and dont actually help if you copy them
 
It doesn't load one of the portable areas. So it can't find it and would normally load the wrong page, but I hard coded the area so now it throws an error.
 
@Nexion That's what the await keyword does. It forces a wait on the IAsyncOperation<>'s completion.
 
@Nexion you're missing the async keyword from the method signature, is all.
 
See my updated question for a clearer explanation: stackoverflow.com/questions/13132334/…
more clear*
 
Can I add it to it somehow? Isn't that in the Storage library?
 
9:12 PM
@Nexion no dude. Your method signature. The part that says public void DoSomething
It should say public async void DoSomething
After that, you can use await within the method.
 
Oh wait, I'm a huge dumbass.
Sorry.
 
I just wrote a long-ass explanation of why this is the case a few lines back. :)
 
No I see that now, I was just confused on what you meant
I thought you were referring to the method declaration itself.
 
It's threefold.
(1) Have `async` in the calling method signature.
(2) Have `await` in front of another `async` call.
(3) The call following `await` should also be marked `async`.
 
'await' requires that the type 'Windows.Foundation.IAsyncOperation,Windows.Storage.StorageFiles.' have a suitable GetAwaiterMethod. Are you missing a using directive for 'System'?
 
9:19 PM
Yeah, I think that's from an extension method somewhere...
 
I have no idea what that error means lol
 
What that means is that before the compiler can work its async mojo, there needs to be a GetAwaiter method defined for the type you're awaiting for.
Since the type doesn't have one, it's most likely implemented as an extension method in some namespace you haven't referenced.
I'll fire up VS and look it up for you.
 
^ like a bro
 
C# has a lot of black magic about it.
I'm just not using to working in async land, its odd
 
Indeed, Daniel Jackson.
 
9:23 PM
Magnets!
C# is a very incremental language, so you have to understand the old features before the new ones make sense
@Nexion The namespace you're missing is System.Runtime.CompilerServices
 
anyone know why a portable area would randomly stop being loaded?
 
OK so if the Method that I'm calling all this in has to have the async modifier on it
I'm trying to just call it in Main, but its complaining that Main cannot be marked as async
 
That's not something you need to do.
Hmm.
Sorry, misunderstood you for a change
Missed the "in"
 
pastebin.com/qPYE6Wvy
 
adios folks
 
9:34 PM
Thanks for your help Ninja
Peace
 
Whoops, accidentally left the room for a moment
So extract all the async stuff to a method you'll call from Main
And then call it thusly:
YourMethod().AsTask().Wait()
AsTask wraps the awaitable stuff into a Task which has a synchronous Wait method.
Can't remember if that's the proper way to do it with IAsyncOperations, but at least it should work.
The implementation of user profile pictures is weird
There's a directory with files in it, but it also has a bunch of zero-byte dat files.
 
Operator '.' cannot be applied to operand of type 'void'.
www.pastebin.com/vpPsg1wt
God I feel dumb with all this.
I swear I'm not this bad of a programmer in Java, lol
 
It's cool. C# has grown to become quite a complex beast.
 
@Nexion were you following Rytmis' example?
 
Change the method to return Task instead of void.
And then you can skip the AsTask
 
9:43 PM
@TomW Yes.
 
I'm not at my sharpest right now
 
I still have that GetAwaiter error
 
@Rytmis @Nexion exactly. If the method returns void, how can you call a method on the return value?
 
@TomW Fair, lol. Like I said, little sleep currently
 
Doesn't help that he's getting pointers from me, and I seem to be full of stupid.
 
9:45 PM
this.chains.length = 0; Assuming this.chains is an array that has values, shouldn't that empty the array?
 
Are we talking about js here?
 
@Rytmis I guess you could say that they're... null... pointers?
 
rimshot
 
@Billdr what do you mean by 'empty' it?
 
Rofl.
 
9:46 PM
@Billdr - Nope, that is just going to break the iteration ability of chains.
 
self.chains.push(oldElement); //array has one item
self.chains.length = 0;
self.chains.push(newElement); //array has two items
 
@Billdr - What you probably want is
delete self.chains;
or
self.chains = []; to reset it
 
or just self.chains = []; ?
 
ugh, this is js isn't it
where an array....isn't, apparently
 
I can't create a new instance of the array.
 
9:47 PM
why not?
 
I need continuity for knockoutjs to work
 
hoo boy.
 
you knocked out your functionality :P
 
I'm about to defenstrate this laptop
 
asp model binding > knockout model binding
 
9:48 PM
or I can just find a way to delete elements from an array.
@TravisJ Not according to my lead.
 
@Billdr use delete
 
I have the correct calls, I have the appropriate includes
 
@Billdr - Bummer, guess he has the final word for you.
 
Thanks @TravisJ, I'll read up on it.
 
array.splice(0, array.length) might work
 
9:48 PM
I tried that, same issue.
 
morning ladies
@Billdr Did you punch your CEO yet?
 
@Sean No. However our paychecks are being delayed a few days due to "cash flow issues." So once I get my hours in I'm updating my resume.
 
@Nexion what references did you do to get the compiler to recognize the references?
 
8 months of professional experience... that's going to be a tough sell :(
 
@Nexion I'm asking because I've never tried referencing WinRT from a non-WinRT app :P
 
9:53 PM
Just Windows
 
Huzzah, demo with our VP of product went well :)
 
I followed this hanselman.com/blog/…
 
@Billdr Wow that's stupid. I find it amazing that companies still run on monthly cycles these days, especially ones that sell services like mine.
@Pheonixblade9 Conga-rats
 
Yea, we're SaaS too. I don't know how the hell they can screw it up unless we're operating at a huge loss.
I understand a lot of our clients are ours by trade.
I know I can get a job at the local code farm, but I'd really rather not.
 
!SLEIGH
 
9:56 PM
@Sean thanks :) I ended up running the meeting... with my boss, my boss' boss, and my boss' boss' boss :P
 
Kendall, where were you? We were worried sick.
 
On the road...
 
@Billdr You so funny =']
 
@Pheonixblade9 Oh yeah I love it when that happens. That's why I hide at the back.
 
9:57 PM
Thanks @Sean. I'm here to entertain (for stars).
 
@Billdr Have a star. Now no more until you've done your chores.
 
Now if there were a star -> rep conversion I'd be in a better position to get a new job.
 
Isn't that exactly what I have @Rytmis
 
I saw an interview with some developer boss dude and he said he wouldn't be sure of hiring people with a massive SO rep cos he wanted people doing his work not others
He sounds like a twat
 
@Nexion very few changes. Changed the "void" to "Task" in your method and removed the "AsTask()" call.
 
9:59 PM
Yeah I did that already
 
@Nexion that is to say, fixed the errors I made when I first told you what to do. :P
Ah
 
Still the same thing.
 
@Sean no, I don't mind running meetings, just intimidating when you have to interrupt a VP and say "we need to finish our demo, please hold your questions"
 
So... what, compiler error?
 
The GetAwaiter issue is still present
 
10:00 PM
Because that compiles for me.
 
@Pheonixblade9 Oh yeah I have no spine. The demo wouldn't get finished
 
And if it compiles, it obviously works ;-)
 
await requires that the type blah blah have a suitable getawaiter method
 
Aha, I've got references you're missing.
 
Direct copy pasta of your code does not compile
Which?
 
10:01 PM
I just had an idea..
 
System.Runtime.WindowsRuntime.dll
That makes the difference.
I tested. :)
 
That burny moment when you open the fire and it's like you're in a steam engine.
 
I dont have that one >.>
 
I like fire.
 
@Nexion

C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\.NETCore\v4.5\System.Runtime.WindowsRuntime.dll
 
10:04 PM
So, it's a little crazy, but instead of using out to return extra values from a method, what if you could return an anon type..
 
Well it compiles!
Finally!
Thank you.
 
@jberger What C# really needs is automatic unpacking of tuple results ;-)
 
Didn't apply the changes it seems though.
 
@jberger Oh you want to look into dynamic
 
F# does that
 
10:05 PM
FRACKIN RUNTIME ERRORS
 
@Sean I though dynamic doesn't have strong-typing..?
 
you actually want dynamic with an ExpandoObject
 
An unhandled exception of type 'System.AggregateException' occurred in mscorlib.dll
 
@jberger It doesn't but var does which would mean you would be restricted to one type
 
dynamic objects are still strongly typed
 
10:06 PM
The canonical way to do that is... by introducing a class!
 
it just delays the error to runtime
 
@Rytmis what you mean by "auto unpacking"?
 
@zneak @jberger I stand corrected
 
@Rytmis indeed, but most ppl are so lazy to create a new class..
 
well, sit, but that's beside the point
 
10:06 PM
you can also return an anonymous type
 
@zneak as long as it doesn't cross assembly borders
 
why even have anon types if you can just create a class..
 
@Sean get a spine! it's important for engineers to have business sense.
 
So I get one of those annoying emails from this site I visit every once in a great while. "Oh, look, and unsubscribe link!" So, I click it, it brings up the unsubscribe form. I enter my email, click the button. "You are not subscribed." THEN WHY THE FUCK ARE YOU SENDING ME EMAIL?
 
@jberger I mean you can do things like "let val1, val2 = func()"
 
10:07 PM
@Pheonixblade9 But I prefer my shell! I do know what you mean though
 
@jberger, anonymous types are mostly used locally
like within a linq query
 
Also, linq projections without anonymous types would really suck
 
they aren't really suited for return values, I'll give you that
 
@zneak precisely, and anon method returns are to break up long algorithms
 
otherwise, you can use a Tuple
 
10:08 PM
facedesks why wont this just work
 
@Nexion You're doing something that's both unsupported and barely documented. :D
 
@zneak "item1" "item2".. not very readable.
 
I'm so tired. I just want to go home.
 
I had finals this week, I haven't stopped moving or doing or anything in the past 2 weeks
I've had maybe 2 hours to myself all week
 
10:09 PM
So did you look at the details of the AggregateException?
That's what async exceptions are wrapped in
 
you could also just define a private struct within your class and use the new {} syntax to assign properties
 
Additional information: One or more errors occurred
 
Is it ever a good idea to have an out parameter in a void method?
 
BECAUSE THATS SO HELPFUL
 
@Nexion yeah, the details are in the InnerExceptions property
 
10:11 PM
private new{Sum, Median} Calculate(int[] stats){}
 
private struct Foo
{
	public int Bar;
	public int Baz;
}

return new Foo() {
	Bar = 4,
	Baz = 5
};
 
How would I get at that?
 
Maybe I'll just try and run your code...
 
@zneak trying not to intro classes. we've already got anon types, just need the syntax to allow them in methods.
 
Wait a tick.
Er, nvm
 
10:12 PM
@KendallFrey, when I want to return more than one value, I'll usually have multiple out parameters and a void type
 
Ah. Access denied.
 
@jberger, that syntax doesn't exist. Your pick.
 
@Rytmis SYSTEM ERROR 5
 
??
 
lol
 
10:13 PM
okay, apparently ko.observableArray does not have a foreach method, so I can't use delete. This is not as handy as I was lead to believe.
 
@Nexion running that code in the debugger reveals, for me, an access denied exception.
 
@Billdr It never is..
 
@zneak That makes sense. What about if you have one value that you want to return that really doesn't make sense as a return value?
 
I'm not sure I ever designed something like that
 
It errors out trying to open the file.
 
10:15 PM
The image or the exe?
 
if you feel it's totally unrelated as a return value, I guess you're a grown-up (or almost a grown-up) and can chose for yourself
 
The image.
WinRT is very limited when it comes to file access.
 
No, I still a minor. Plz choose for me.
:)
 
I'll decide myself.
 
10:16 PM
it's 19 in Ontario right?
 
I wasn't sure if doing that would really turn someone off, so I thought I'd ask.
 
Okay, so its just a permission issue?
 
@zneak Maybe. Depends what it's for.
 
Not really. Hang on a tick. I'm going to try and code around it.
 
I think 19 sounds right for booze.
 
10:17 PM
is it 18 to vote and 19 to drink?
 
Which reminds me...
 
@KendallFrey Are you a secret alcoholic?
 
lol no
 
Hahaha
 
Aww, ok
 
10:18 PM
 
Silleh woman
 
I can kinda see your situation happening if the main task of your method was to operate on internal data structures and the out parameter would be a count of operations or something
but in that case I'd really expect that out parameter to be facultative
 
@zneak
private new stats{ Sum, Median } Calculate(int[] numbers){
stats.Sum = ...;
stats.Median = ...;
returns stats;
}
 
@zneak The framework does this all the time, for example Stream.Read()
 
it's not unrelated though
 
10:20 PM
Oh yeah.
It's ok to ignore me cos I'm stupid =]
OMG A SLEIGH
Bye @TomW
 
@jberger, does that work?
 
no, lol
would be cool, though
 
yeah when I noticed there was no field type I felt stupid for asking
 
err, i guess i just assume that it doesn't
 
@jberger Use object
 
10:22 PM
object sucks for retrieving fields
 
oh
another ignore moment
 
don't think "new" would be the keyword, though. (method hiding)
 
        private struct IntermediateState
        {
            public double Sum;
            public double Median;
        }

        private IntermediateState Calculate(int[] numbers)
        {
            return new IntermediateState()
            {
                Sum = 42,
                Median = 42,
            };
        }
what's un-pretty about that?
it works as is
you can even stick all the type declaration on a single line: private struct IntermediateResult { public double Sum, Median; }
 
Can I include the image in the project resources and use that?
 
hassle.
 
10:25 PM
the only difference with your suggested syntax is that the type declaration is on another line.
 
true, "all on a single line"
 
@KyleTrauberman Still awake?
 
@Nexion Try this: pastebin.com/qha94mWv
 
jsfiddle.net/HpGTx <---I need to engooden this. Any insight would be appreciated.
 
anyways, good luck with coming up with anything better
 
10:26 PM
dafuq is that file path lol
 
gotta justify my pay
 
@Nexion Replace it with your real file path
@Nexion that was my example. Facebook photo ID. :P
 
ah
 
@zneak i think the syntax is solid. also, the thing i don't like about the (current) struct solution, is all the extra "junk"
 
@Nexion Point is, use System.IO.File to read, then write to a WinRT-known location, then read again from there.
 
10:28 PM
foreach field: "public {type}"
 
@Nexion Doesn't seem to work for me though, but that might be cos my account is a Live account, not a local one.
 
What library is the File object in? Didn't update your usings =P
 
System.IO
 
Have an error on outputstream = await imgFile.OpenStreamForWriteAsync
wait nvm
had a typo
And again, aggregateexception
 
Interesting. That ran to completion for me.
Oh, oh
The file needs to be in the folder where you run the app
That, or you need to provide an absolute path
I did the former
 
10:33 PM
I have it in the same folder
 
Hmm
 
Would help if I spelled the file name right =(
 
You think? :)
 
=P
But it runs to completion now!
No change in picture hmm
 
I need help with what to name a table. I want to pick a more clear name that better shows the hierarchy/relationship.

ApprovalSummaryN ... > ApprovalSummary2 > ApprovalSummary1 > DataEntry1 > DataEntry1Items, DataEntry2 > DataEntry2Items

LocationN ... > Location2 > Location1 > Unit > Ward

UserNA, UserNB --> LocationN
User2A, User2B --> Location2

Each user must approve the "ApprovalSummary" at his/her level. Each set of approvals is for a given week.

What is a better name for the ApprovalSummary table? To clearly show the relationship to DataEntry.
 
10:37 PM
Can't you embed images into executables? Like in the resources section?
 
Yes you can, but if you can't get it to work like this, you won't make it work with embedded images either.
 
Wait, when you actually call the SetAccountPicturesAsync, doesn't that need the exact path to the Documents folder?
 
anyone here ever done model binding in mvc to a dictionary?
 
I was actually just reading on that
you need to create a bunch of hidden or text inputs with a specific name
 
@Nexion It gets a StorageFile that we've just created and populated.
 
10:45 PM
Does the reference get updated to the new copy?
 
@Lindsay - I am trying to do it with a dropdown helper.
 
I think, I know that's how it works for lists of both simple and complex types.

Article: http://haacked.com/archive/2008/10/23/model-binding-to-a-list.aspx

I found I always had to include the index
 
The whatta whatta
 
i'll let you know how it goes
 
var imgFile
 
10:47 PM
actually if you're using a drop down, see this post: rundevrun.blogspot.ca/2011/11/…
 
After it creates the copy, does imgFile then reference the new copy in the documents folder?
 
I couldn't copy the code... it was an image -_-
the article I showed works best for hidden list values
 
@Nexion At that point, it references the file that will become the copy.
 
Any takers on my table name question from earlier?
 
But doesn't technically directly reference it because its async and it waits until it becomes said reference, right?
 
10:48 PM
Er, no.
We await for that call, so we block until it actually gets created
 
@Lindsay - hm, was pretty easy, just had to do this:
m => m.MyDictionary[key]
and then it binds the input to the value
 
And the input file is read via System.IO.File which is synchronous anyway
 
sweet
 
Imma go to sleep now.
Night, folks.
 
Thanks so much for all your help Rytmis
Very much appreciated
 
10:54 PM
using the @Html.DropDown helper?
 
yes
 
so this just happened:

Me [2:51 PM]:

hey <product manager>, is that email I typed up ok?

<product manager> [2:51 PM]:

Congratulations. You're on the screen at Amazon.
 
That moment when you wish you hadn't flamed Amazon?
 
@Pheonixblade9 You [2:59PM]:

Hi Amazon, can I have a job?
 
@TravisJ I didn't flame Amazon
@Billdr HAHAHAHAHAHA
@Billdr I actually interviewed with Amazon, they turned me down after 3 painful phone interviews with terrible interviewers
 
10:58 PM
I'd believe that. What do they run on? LAMP?
 
hahaha
some derivative of CGI, actually, on the back end I think
it's weird
they generate PHP with C++
 
That is weird.
 

« first day (790 days earlier)      last day (4166 days later) »