« first day (1502 days earlier)      last day (3429 days later) » 

12:08 AM
Hi @BradleyDotNET
I have a situation which is quite confusing me
thought you might be able to point me to the right direction
I receive an error using this line
AllPartsCollectionView.Filter = value ? p => ((EditPartViewModel)p).HasErrors : null;
and from what I researched, casting in one or even both sides of conditional expression can fix this situation.
However, I honestly don't know what to cast the conditions to
Oh sorry, this is the error "Type of conditional expression cannot be determined because there is no implicit conversion between 'lambda expression' and '<null>'"
There is very few help on Filter on MSDN and from all I know it gets or sets a method.
 
@Mehrad Probably whatever type Filter is
 
@KendallFrey this is my first time using filter, so a bit confused.
The filter is applied to a collection of this type
 
But what is the type of the Filter property?
i.e. what does it return?
 
        this.AllParts = new ObservableCollection<EditPartViewModel>(allpvms);
        this.AllPartsCollectionView = (ListCollectionView)CollectionViewSource.GetDefaultView(this.AllParts);
I would actually like to understand it a little bit more
 
12:17 AM
I was using observable collection and since I am doing filtering on the it i've been advised to use CollectionView. so I am putting the parts of the puzzle together
@KendallFrey exactly
is 'Predicate<Object>' is my answer?
 
probably
 
I wasn't actually thinking of what the actual Filter prop itself returns
 
I echo @KendallFrey's sentiments
lambda needs to cast to the expected delegate type
quite possibly Predicate<Object>
 
Nice
working on the it's syntax
would I cast the whole delegate?
AllPartsCollectionView.Filter = value ? (Predicate<Object>)p => ((EditPartViewModel)p).HasErrors : null;
 
Yes, though I doubt that syntax would work
you would need at least one set of parenthesis around the lambda
 
12:24 AM
sorry forgot the parentheses
            AllPartsCollectionView.Filter = value ?  (Predicate<Object>)(p => ((EditPartViewModel)p).HasErrors) : null;
:D
 
That seems likely to be fine
 
Thanks again guys...
As always very helpfull
powering through C#. everyday has a crazy learning curve...
I am not sure I am learning these concepts in the right way. I mean getting in the situation and then learning how to do them. I might need to do a bit more background work with my knowledge instead of bothering you guys for basics.
 
Thats exactly how you should learn
You could argue about how to do the research (versus asking us)
 
fascinating ... it works like a charm
 
but I wouldn't do it any other way
 
12:28 AM
That's true
I honestly try to read as much as I can before firing away a question
 
Thats great!
 
but there is one point which it gets really sticky and hard to push forward ...
 
Honestly, there are two things that experience get you:
 
Thanks for your time @BradleyDotNET
 
1. You *sometimes* know the answer
2. You know what to read to *get* the answer
 
12:29 AM
and what would those two be?
 
The second comes into play a lot more
 
That's really true.
the more I get familiar with the concept the easier I find resources
it's like AI :D
 
Even on SO 95% of my answers are "I know basically how to do this, let me go look up the docs for that". Then I can actually post something that makes sense
 
my machine is getting better in finding ways how to get better
 
Indeed
 
12:31 AM
Very interesting.
 
Just so you know, the ternary-typing trap is very easy to fall into
And not always obvious whats going on (the error message is OK, but by no means the easiest to figure out: "I know what type it is, why the error?"
So you don't need to feel as bad about it :)
 
I can't agree more.
 
Also, asking is always ok once you've exhausted the research. I have 10 or so questions here too :)
 
In this case found that casting was my answer. and I had the answer on front of my eyes when checking FILTER's help. however, since I am unfimilier with <object> it didn't occur to me that could be my answer.
but getting better...
I also want to thank you for how you react about questions.
 
I try, and could be better, but thank you for the compliment
 
12:35 AM
I have been criticized about the level of my questions. and I believe it comes to my background as an electrical engineer and not the software engineer.
the C we do in electrical is extremely basic
but I love to learn C# and I accepted to do more than I might have a knowledge.
really appreciate it.
 
Thats the only way to do it :)
 
Thanks for listening :D I bet you got better things to do
+1 for @KendallFrey on the suggestion as well.
 
Meh, This doesn't take much of my time
 
we appreciate it anyways
 
 
5 hours later…
5:33 AM
HHey guys. I have a question about my assignment for college. We've been asked to build a static website [based on a topic of our choosing]. Keyword being static. But I've been building sites for 10+ years. I don't want to create a static site. I want to put a little C# in there too, just to keep me motivated and interested. I'm thinking they would say that it's not static but when I think about it, server-side code gets processed on the server and all that is
returned is basically HTML. So even if I use C# it's still static, right?
I guess it depends on what I'm doing with C# that makes it static or not? Well, as part of this assignment we gotta grab data from an XML file and display it on the page. I could use JavaScript for that, but there is no mention of JavaScript and so I want to use C#. If I use JavaScript, then that means it will be non-static, right? Since it will be dynamically loading content at runtime?
 
 
1 hour later…
6:57 AM
morning all
@jay_t55: Do you provide the hosting for the assignment? What if the teacher don't have VS/IIS installed, and cannot run you application? He/she could refuse to grade your assignment. You could roll with a XSLT on top of the xml, but that tech is really really boring. :)
@jay_t55: In my experience it was better to do the assignment as it was specified and just make it a bit better without dragging in other different tech, which in turn has a lot of dependencies.
@jay_t55: If the assignment is as you described, then it's missing a lot of details. What does the teacher mean when he/she says "static"? Is it without animations, no js/ajax magic, no server-side code etc.
 
8:07 AM
@jay_t55 Static means no server-side processing. C# is inherently server-side, so, no, it is not allowed. JS is questionable too. They probably mean for you to use XML transformations to render the page.
 
We had joy, we had fun, we had XML transformations on the run, the transformations didnt last, because the client wasnt fast.
 
Uhm.. XML transformations are really powerful, do not cost any kind of server processing power, can be exported by anything, and do not require any server dependencies. It's a really valid technology that is useful for a lot of different purposes.
 
indeed
used that a lot at my former job
mainly transforming / mapping crappy data from customers to more readable / usable /importable formats
but I hate it nontheless
:p
 
Agreed, it's not fun.. but a skill you should at least have the basics of after Uni!
 
8:23 AM
true true
blizzard ran some xslt on some of their pages earlier iirc
That was a couple of years ago though.
 
8:36 AM
It makes sense if they put XMLs on a CDN or smth to off-load server crunching :)
Just serving statics and dynamic data is a great way to utilize server power. :)
 
i want to implement apple push notifications from c#
how can i do this thing?
plz guide me any body
@RoelvanUden @scheien @jay_t55
is there any Api for c#
?
i need free Api
i want to send push notifications for all devices like iphone , android and windows mobile
using c# how to do this thing?
what api we need to use?
plz send me any tutorial
 
@scheien and all others: sorry I just got back home from shopping. @scheien yeah they can't really see the page properly if they're not using VS or WebMatrix to run the site since I am not hosting it. there is no definition (in the assignment) of static, so I am assuming the old definition you'll find in web design books applies; just a boring old html page - no js and no server stuff. and thanks for that one liner too lol.
 
@BradleyDotNET @KendallFrey @Pheonixblade9 @Rovak @jay_t55
 
@user3419311 Search SO, if nothing, make a PROPER question. Begging won't help.
Pinging everyone is considered rude. Please don't.
 
8:50 AM
@user3419311 what you are looking for is basically "platform independent push notification api C#" so put that in google and you'll find quite a few results. here's one: api.shephertz.com/apis/push_notification.php I know nothing about that though so I can't help any further.
 
9:03 AM
pong
 
Would using CSS in a basic HTML page to change font size and font family be considered static still?
Our "Learning Guide" is telling us to change the font like this:

<!DOCTYPE html>

<html lang="en">
<head>
<meta charset="utf-8" />
<title></title>
</head>
<body>
<font face="Arial" size="2">Hi there</font>
</body>
</html>

And I feel that this is not good. I mean, they didn't even use a <p> I've been making websites for years but I've only just decided to get qualifications to prove I can do this stuff and I feel like I'm taking a leap backwards.
 
@jay_t55 Sure, everything is static that doesn't need server-side code :P
(or JS, really, consider that disabled)
 
@RoelvanUden awesome. Well atleast it's crystal clear now lol. I spend so much time doing other things that I forget even the most basics of things quite often.
 
You can do awesome things with css3 :>
As I see it, you can go with html5 and css3
 
So basically the way I understand it, @scheien is that it can be considered static so long as it does not require have any dependencies that don't already come with most browsers.
But with JS you can call server-side code from it which would break that rule. But I don't need JS for this assignment anyway so lack of JS isn't an issue.
 
9:14 AM
If you say that, you can use JS
:p
 
yay
 
if you are really hardcore, you can say that css3 animations are not allowed, since theyre.. animated
:p
 
yes, true that is lol
should I also disable scrollbars so the page cannot move up and down lol
 
I would say that in the static context, you would be allowed to use html5 and css3. You would not be allowed to use JS, since you can manipulate the DOM.
hehe
 
If you use static as most do, then even JS is allowed. :P
But yeah, rather not do that.
 
9:16 AM
yeah, i think i'll play it safe.
no fun stuff
yet...
ok i should stop talking now need to finish this lol
thanks all
hmmm, since we're using HTML5 and I know that the tutor's computer is using an older browser, and I need to make a static website, does that mean that I can't use the html5shiv (to make the html5 site work properly in their older browser)? I should ask him actually...
I'll just put it in there anyway if he says no i'll comment out the line
 
@jay_t55 I think you're massively over-thinking this. Aren't they beginner courses?
 
It's a Diploma in IT (Web Development). I've done the privacy and copyright unit, the WHS/OHS unit, the first html unit, now i'm on to the next html unit. it's a pretty simple course yeah.
 
9:31 AM
So don't worry too much. Just spend minimal effort required to get the paper.
 
kk thanks
 
 
1 hour later…
10:45 AM
hi everyone
any server side product with high memory usage develop in c#/.net
 
What? There are plenty.
 
11:31 AM
ohaio
Pretty strange request Royaan ..
"I wanna utilise ALL MY MEMORY!!!"
 
12:03 PM
@Sippy Error: Program cannot run in 1KB. You need more memory.
 
All your memory are belong to us.
 
Schizoheimers
 
:D
Picking up my new car tomorrow, that will be awesome!
 
 
Yep, it's that one
With Clarkson in it
 
12:08 PM
lmao
gnite everyone i'm off
 
nn
 
Byebye
 
That one is better.
 
haha, the P45
 
the definition of awesome
 
12:10 PM
it begins with my name
 
Hahahaha
Most awful machine ever made
 
no that would be the Manhattan project
 
Is that considered a machine?
 
@scheien sure, why not?
 
dunno, just wondering :)
the machine reference is to the factories and such?
i got caught up in the product
:p
Like how the "im getting a new car" can be turned into the worst shit in history, besides holocaust.
 
12:21 PM
@scheien Manhattan project isn't Manhattan, just fyi lol
Oh you know.
 
ye, it's the freaking bombs
 
:D
 
:)
 
Not really, the Manhattan project is the reason that we have Nuclear energy at all.
Good and bad.
 
intentions were bad
 
12:22 PM
You sure?
 
:p
 
Yeah
The manhattan project didn't necessitate that they dropped bombs on Japan lol
Part of it was nuclear reactor research which spawned nuclear reactor tech we have today :)
The nuclear holocaust shite was just murica being insane.
Because murica.
And explosions.
 
an guns an liburrtee
 
lol
:p
 
nono
liburrdee
They can't pronounce Ts
 
12:24 PM
einstein would never participated if he knew the outcome :p
and by holocaust, i meant the WWII hitler shit
 
Yeah he would, just not willingly.
 
hehe
 
The Americans would've just threatened his family.
The nukes on Japan was equally genocidal.
 
"lets end this"
 
Truman should've been tried as a war criminal for authorising the use of nuclear weaponry.
But w/e
The way he justified it made it sound a lot more like revenge than anything else.
 
12:29 PM
It's really terrifying that people can be like him
and other sick crazy people
 
@coddey hi
 
@Sippy I find that funny coming from a Brit
 
Fight!
 
@KendallFrey Lolololol
I found a song by a british band called The 1975 hold up
I had to listen so hard to figure out what they were saying xD
!!youtube The 1975 Chocolate
 
12:38 PM
See if you can hear anything other than gun, petticoat and chocolate.
 
@CapricaSix fuck'n'ell, that song plays on the radio here
Also, that's a good example of how Brits can't pronounce Ts
 
1:00 PM
Yep!
Hahaha
 
1:47 PM
using System;
using System.Collections.Concurrent;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading;
using System.Threading.Tasks;

namespace AdvancedForms.Core.Patterns.Parallel
{
    public abstract class Actor<T> where T : class, IDisposable
    {
        private bool _isActive;
        private readonly AutoResetEvent _resetEvent;
        private readonly Thread _workThread;
        private readonly ConcurrentQueue<T> _queue;

        public Actor()
i made a very simple actor which handles messages in a new thread, i was wondering if there are any suggestions to improve this, i'm aware of the task parallel library as an alternative. For this i wanted to use manual threads
 
@Rovak BlockingCollection<T> does all that without manual events and shit.
 
@RoelvanUden thanks, i was not aware of that class
 
The GetConsumingEnumerable can then be used to read and block.
Effectively making it easy to make a Task to do that, and enqueue stuff.
 
hi guys
can I ask something?
 
yes
 
1:57 PM
I'm a fresher in asp.net, what should I do to make my knowledge more strong in this field?
 
Practice.
 
would you suggest some sites for that?
 
Honestly, I'd tell you to invest in a book; apress.com/9781430265290
 
    public abstract class Actor<T> where T : class, IDisposable
    {
        private bool _isActive;
        private readonly Thread _workThread;
        private readonly BlockingCollection<T> _queue;
        private readonly CancellationTokenSource _tokenSource;

        public Actor()
        {
            _workThread = new Thread(InternalDoWork);
            _queue = new BlockingCollection<T>();
            _tokenSource = new CancellationTokenSource();
        }

        public void Start()
something like this, not tested
i think the while isactive is not even needed if GetConsumingEnumerable waits for incoming items
 
hello, do you apply same naming conventions regarding abbreviations to other objects like folders? For example if I have a class IisConfigurator (this is just an example), would you put it into Iis folder? or IIS folder?
 
2:03 PM
@Rovak You won't need the isActive check in the thread; but do CompleteAdding during dispose, then join, and then dispose of it. Also, in the dispose, check if isActive is not already false.
@username Usual convention, folders == namespaces, so put them where logical
 
thanks, I figured the answer the same moment I asked it
 
@RoelvanUden thanks
@RoelvanUden is the cancellationtoken needed if i use CompleteAdding?
 
@Rovak Nope.
 
@RoelvanUden maybe i should base IsActive on the cancellationtoken.iscancelled
 
@Rovak Rather, I'd make a IsDisposed and use it only for Dispose checks
 
2:12 PM
@RoelvanUden agreed, cancelling and disposing should be 2 different actions
 
2:46 PM
ahoy.
 
Hello hello
 
Hi. I have a really stupid question. Is the data stored in static classes shared with other sessions (people) using a web application? (I'm having trouble searching for this question)
 
@Dave A browser submits a session identifier cookie to the server, which is then used to find the associated session state on the server. Essentially, the session pool is one big 'thing' with lots of smaller things inside (one for each user session). Does that answer your question?
 
I think so. That's what I thought. So as long as each person is using a different session, they aren't sharing any data held in classes? (as long as they aren't file based)
 
@RoelvanUden I don't think it does. The question was about static classes. They're one per AppDomain but how an AppDomain maps to sessions varies, IIRC
 
2:51 PM
Oh, like that. Listen to @TomW @Dave, a static class lives once in each application domain (typically one per web application per sever). So if you store stuff inside a static class (that is, not a session), then it is indeed share across all requests.
 
@RoelvanUden Ok. you are the second person to tell me that. I guess it must be true.
 
You can of course give it a try.
 
Perhaps I can further prevent sharing data by adding a unique ID...
 
Good morning @TomW
 
Not necessarily. An application pool can spin up multiple worker processes. Each of these I think has a separate AppDomain
 
2:55 PM
At the moment we do not have fancy AppDomain, we have just one IIS server, but I still want to do it right.
 
so you may have N instances of a static class in existence at a time, per application, and which one the request sees is down to some scheduling algorithm in IIS
 
public static class IllBeDamned {
    public static int Hits;
}
public class HomeController : Controller {
    public string Index() {
        IllBeDamned.Hits++;
        return IllBeDamned.Hits.ToString();
    }
}
You'll see it increment regardless of who hits it.
And indeed, as @TomW said. I didn't even consider the pools...
 
@RoelvanUden Thanks for that example, it clears things up completely.
 
Then again, @TomW, if you use in-store memory it will work regardless of which pool worker you'll hit. I think it still has only one app domain, no?
 
according to stackoverflow.com/questions/14105345/… they are separate processes
never knew that
 
3:01 PM
They can have multiple processes, but a worker can have multiple threads, too. So, configuration dependent I presume. Seems like we use a single worker per site per server with a truck of threads for our company apps.
 
@RoelvanUden SaveChanges() not saving changes. Is there a large number of reasons for that?
 
@Sippy Pretty much. Usually will throw if failed.
 
@RoelvanUden It's not failing
 
checking if the model isValid first?
 
I'm trying to enter a 'date modified' in the controller
It just isn't saving.
It's saving other fields, just not that one.
 
3:14 PM
Is it attached to the context?
 
till.ModifiedDate = DateTime.Now;
Yea
 
sup
 
    if (ModelState.IsValid)
    {
    	till.ModifiedDate = DateTime.Now;
    	db.Entry(till).State = EntityState.Modified;
    	db.SaveChanges();

    	return RedirectToAction("Index/" + (int)Session["siteid"]);
   }
 
yay a session
fantastic
 
Old code
 
3:15 PM
@Sippy Till comes from model binding?
 
Don't cry.
 
u no what bro
 
@RoelvanUden Yes
 
the fucking identity is so broken
i had to use a session
to keep my user connected
so im with ya
 
@Dave Trrrrrrolololololol
 
3:15 PM
srs as fuck
 
Cba to change it.
 
Identity uses sessions too. Just sayin'
 
yea i guess
just sayin i didnt understand the fucking beast
seems just fine and easy to work with if youre using a standard mvc app
 
I'm having difficulty with HttpClient - When making multiple PostAsync calls to a Web API, one call will throw an IOException. The API creates an account on a server, and returns the account information, including the account ID. When I check the server after the IOException, all users have been created
I can't get the account ID from the response on the call that throws the IOException
Basically wtf lol
 
@JamieLester my best guess so far is as I said yesterday, there is some problem with serializing the response on the server. IOException implies that something happened on the transport level that the client wasn't expecting - so I blame the server, at the moment
If the process handling the request throws an unhandled exception, that would probably close the connection immediately - it's not like you're receiving a few bytes of the response and then it aborts - it's no bytes.
 
3:27 PM
Hmmm this is true
 
I'd be looking at whether there's anything significant about the content of the requests and responses that fail
it could even be something dictated by the content of the request that happens after the account is created
even something like logging successful completion that relies on some field that isn't always present could do that
 
There shouldn't be anything wrong with the requests, since the user is created. And the only difference between requests is the username
I use a base username like "111abc" and append a number from 1-n to it
Everything else in the request is the exact same
* n being the number of calls I make to the API *
 
Well, as I say, intermittent unhandled exception on the server is my guess. Probably up to you to find out where from
 
More sleuthing lol
Thanks Tom
 
I'm the only one in on my team today.
I'm uncertain which parts to refactor while I can..
 
3:39 PM
@JamieLester did you say it was a linux server?
if it was windows, I'd encourage you to try windbg. I only have a vague idea of how to use it, but one of the things it can do is break on unhandled exceptions and sit there until you're ready to look at it
like debugging in VS but without putting VS on a server
 
@MrDoom REFACTOR ALL THE THINGS!
 
@RoelvanUden Going for the low hanging fruit of getting the visibility correct. Making so many things internal.
Next comes rewriting some methods.
 
3:59 PM
Sorry @TomW, I was afk. I do believe it is a Linux server
 
4:36 PM
Well, I suppose there must be lightweight debuggers for linux. You're probably going to need one
 
@RoelvanUden pls halp
ef, y u no save date
 
How can I round a value from 56.7878797 to 56.78?
I think I Can use Math.Round but how do I round to only show 4 digits?
 
....
Can you not google that?
There's probably a bunch of native functions you can do that with.
 
nvm got it
 
 
2 hours later…
6:16 PM
hi guys
 
Hi @Pheonixblade9
 
sup @Pheonixblade9
Anybody here like Joel on Software ?
 
@Nathvi It's quite good
 
I think so too
Just started reading it
@KendallFrey, what was one of your favorite things on there?
 
6:31 PM
I don't remember much
There was a cool checklist for 'grading' software companies
 
6:43 PM
The Joel Test?
 
yeah
 
we get 8-9/12
 
we get 11/12
:v
 
Hey all. More PRISM questions. And this one is really annoying. I created an app that loads the bootstrapper and shell window in a separate appdomain then modules are loaded. This is all done in a separate class. Everything seems to work great except there are no regions that ever get registered with the region manager. If I use the exact same code but load the separate class in the original appdomain, everything works fine.
 
^ look at me im so cool
 
6:54 PM
Just really looking for things to check out at this point. Random stuff to try.
 
Probably shouldn't be doing random stuff to try
Probably should know exactly what you are doing.
If you code by coincidence, you are going to get errors you don't understand, because you didn't understand what was happening in the first place.
I would break down your assumptions, even if they seem like they should work, test them. Obviously there is something in your understanding that is wrong, and unless you are willing to question yourself, you aren't going to make any progress.
 
Hello Guys, I'm trying to do the following using MVC
I need to root the url so I can make it as the following: "localhost/politics/2014/11/26/politics article.html"
anyone can help me just to know where to look ?
 
7:16 PM
@Nathvi I don't disagree with any of that. What I am trying to get at is that I don't know what it is I don't understand.
I feel like I have gone as far down as I can and I'm not understanding why it's doing what it's doing. I'm not sure if it's an aspect of the way I am creating my app domain, instantiating my class, or if it's the way the PRISM RegionManager words.
works*
 
meta is kind of like drinking.. at first it seems fun, then you think everything is amazing, then you get a headache and just want to throw up
5
@Nathvi - my favorite Joel article is the Architect Astronauts
 
7:31 PM
@BrandenBoucher, ok
@TravisJ, I love / hate meta
 
I posted an answer with 30 upvotes but still feel like removing it
Have you read that article by Joel before?
 
No, but I'm going to
after work
Looks amazing
 
What made SO work really well, in my opinion, is that Joel was a great thinker, and Jeff was a great doer.
lol js amuses me sometimes, this person took 19 lines to fail at what should have been one statement
 
Can you elaborate more on what you mean by thinker and doer?
 
7:49 PM
@Nathvi - Joel is very good at coming up with best practice and design. Jeff is very good actually coding and implementing design and best practice.
Joel isn't as good at the actual implementation part, Jeff isn't as good at the big picture stuff.
So they make a good pair.
 
Makes sense.
By decoupling the focus, there is little overlap, making a better system.
 

« first day (1502 days earlier)      last day (3429 days later) »