« first day (2607 days earlier)      last day (2359 days later) » 

mr5
4:38 AM
 
mr5
5:36 AM
halo
 
user8397869
servus
 
6:24 AM
I am seeing this notation sqlDataReader["BookNumber"] What kind of object is SqlDataReader that it can have such a square brackets syntax with a string in the square brackets?
 
6:57 AM
I'm reading this e-book : "Parallel programming with microsoft.net" by colin campbell. There are exercises at the end of each chapter for which i'm curious to know the answers.
Where could I find them?
 
7:09 AM
@Sadiq The publisher's website?
@barlop Any object can have an indexer, as it's called.
@barlop It's a property called this that takes a parameter: docs.microsoft.com/en-us/dotnet/csharp/programming-guide/…
 
@AvnerShahar-Kashtan thanks
 
@AvnerShahar-Kashtan Let me re check if its there
 
Holla
 
ohayou
 
@Sadiq it usually says in the book where you can find the examples and solutions online. Check the intro page
 
7:19 AM
@AvnerShahar-Kashtan Thanks i got it
@KamilSolecki Yes .. But i can't access the link provided on the page
@KamilSolecki this is the page parallelpatterns.codeplex.com/releases/view/50473 containing access to answers at the link : "Answers to end of chapter questions"
 
good morning :)
 
 
1 hour later…
user8397869
8:31 AM
I have in a ListView the content of 2 different csv columns. Column 1 and Column 2

What I want now:

the ListView lines SimpleListItemMultipleChoice which only affect column 2 from the csv should be highlighted in red. Not for the rows In the ListView with the data from csv Column 1

Does this work without CustomListView?
 
What UI framdwork is this? WPF? ASP.NET MVC? UWP?
 
WINFORMS? :D
 
Borland OWL.
 
user8397869
Xamarin.Android
 
user8397869
.Net
 
8:39 AM
It's amazing how often people ask questions about UI code here without specifying their UI framework. It's like, when you're working in WPF, it never occurs to you that anyone might work with anything else. :)
 
@AvnerShahar-Kashtan borland delphi was my first
I was 7yo iirc
and my father was writing an application
He would teach me how to light up a graphical 'lightbulb' by pressing a button
I was so proud of myself I did it then :P
 
8:57 AM
@AvnerShahar-Kashtan "I'm doing it this way so everyone else must be too!"-syndrome
 
@RoelvanUden -Boss*
 
9:19 AM
g'day
 
9:34 AM
good morning
 
Is there a non-recursive lock in C# and if not, how would I go with implementing one
just learned that lock(syncRoot) where syncRoot is private readonly object syncRoot = new object(); is recursive
 
@milleniumbug What
 
lock(syncRoot) { lock(syncRoot) { } } doesn't deadlock like I expected it to do
 
Oh, yeah. I see what you mean now.
I'm happy it does it that way, but I can see that there are situations where it doesn't apply.
 
9:51 AM
@milleniumbug It's re-entrant, yes. By design.
13
A: Lock aqcuired and further attempts to lock do not block: are C# locks re-entrant?

Hans PassantThe Monitor, Mutex and ReaderWriterLock classes maintain locks that have thread affinity. The ReaderWriterLockSlim class lets you choose, it has a constructor that takes a LockRecursionPolicy value. Using LockRecursionPolicy.NoRecursion is an optimization, a fairly big one if your locking is re...

This implies that the ReaderWriterLockSlim class lets you choose.
 
 
1 hour later…
10:55 AM
why are there still people preferring String over string?
oh. I remember
last time we discussed, if You are emphasizing on the type, than You are using String. Or something like that...
I will continue to search and replace it to string
 
Resharper can do it for you, on a per-file, -folder or -project level. :)
My last project I had a guy who regularly used String and Boolean (though not Int32, oddly).
That was the least of his code's idiosyncracies, though.
 
^^^
btw yeah. I used resharper for that too :D
 
11:56 AM
@ntohl Because Java.
 
12:07 PM
HoloLens emulator is fun
 
 
2 hours later…
C4u
1:41 PM
Hi guys.
Short question: If I call a method that has an await inside, will that call wait for the method to finish? It should, right?
 
await will block the execution in that method. Not in the caller of the method
 
C4u
private void somewhere()
{
    checkSomething();
}

private async void checkSomething()
{
    await Task.Factory.StartNew(() => { /*...*/ };
}
So checkSomething() won't wait?
 
will it compile?
 
C4u
Well this is an example. My code compiled without any problems. So if there's no typo in here the answer stays yes
@ntohl This anyway should've answered my main question.
 
that's why checkSomething is defined async...
 
C4u
1:50 PM
Just got it.
Thanks :)
 
This is a long shot, but: Does visual studio have a keyboard shortcut or anything that will find all un-braced if blocks in a selected region, and add braces to them?
 
C4u
STRG + H
And some nerdy regex pattern.
Well maybe that won't do it.
 
I have about thirty unbraced ifs in this function, and I need to add an additional line to all of them, and I'd rather not have to manually add braces too since it's very tedious
Just to verify: this won't work, right?
//changing this:
if(foo)
    bar();

//to this:
if(foo)
    bar(); qux();
I assume qux will execute unconditionally even though it looks like it's inside the if
 
yeah it won't
 
1:59 PM
Oh well, I'll just add braces manually then. Thanks.
 
C4u
Well STRG + H IS working
 
My keyboard doesn't have a STRG button so that's a non-starter I guess
 
C4u
CTRL I'm sorry
It's the search and replace dialog
There's a regex switch
 
Ah, gotcha.
Writing a regex seems real tricky since everyone says Zalgo will appear and devour you if you try to match arbitrarily nested balanced parenthesis pairs. So I don't think I can write a regex that performs flawlessly in all situations.
"Well maybe your conditionals all happen to have no nested parentheses, in which case it's easy?" you may think. Alas, I do have nested parentheses.
 
C4u
Yeeeeeeah. Maybe
Search for `(if.*?\(.*?\).*?)\r\n[ \t]+(.*?)$`
Replace with `$1\r\n\t{\r\n\t\t$2\t}`
Couldn't be more dirty I think ^^.
Well the tab-stops can be improved
 
2:06 PM
Ok, I'll give it a shot, and even if it mangles some of the more complicated lines, I can just fix 'em by hand. Thanks :-)
 
C4u
But me
Search for: ((^.*?)if.*?\(.*?\).*?)\r\n[ \t]+(.*?)$
Replace with: $1\r\n$2{\r\n$2\t$3$2}$2
 
I see
 
C4u
This should first pick up the tab-width and the values and set them up correctly again with brackets
Funny. Seriously working.
@ntohl Yeah. Never noticed that behavior. Thanks for helping out!
 
2:31 PM
-1
Q: Why does my site return http instead of https when I remove the action and controller from the url?

SkullomaniaMy site is set up behind a netscaler which has the ssl cert installed on it. In days past when someone pulled up my site they would only need to type site.domain.com and the server would force https:// as the prefix and since the user request was invalid to be past along to the default in the rou...

 
2:49 PM
Hmm, my plan of making a popup-like control by overlaying a transparent gray div across the entire screen and giving it an onclick: "dismissFakePopup()" attribute has gone awry somewhat. Clicking on any of the elements inside the div also dismisses the div.
Which makes it rather hard to select the text inside the TextBox element
jsfiddle.net/5fgoqbtc If anyone's curious but I expect not since I've now drifted from C# to regular old HTML
Oh well, I guess my clients will just have to use Print Screen and OCR if they want to transcribe the text
 
3:13 PM
@Skullomania do you have a default path in the web.config?
 
can I do that with individual user accounts? usually the login goes in the webconfig for forms authentication. I have a default for the errors but not the login
Here is the only way that I have seen it done

https://msdn.microsoft.com/en-us/library/xdt4thhy.aspx?f=255&MSPPError=-2147217396
@juanvan is there a way for individual user accounts?
 
Would need a catchall for them to forward to the correct controllers
 
Well that is the interesting part. The actions redirect to the login page as expected in test
using the same code. something changed on the server. I have no idea what
code just doesnt stop working unless the environment changes. noone else has access to it
 
Don't think anything changed on the server, unless the URLRewrite was updated in the IIS Settings
Depending the version of Webserver you're using
 
do you have zoom, I can show you what is happening
 
3:26 PM
I signed up can take a look
 
3:37 PM
yes
let me figure out how to send a meeting request...lol
im starting it up now
 
ok
 
user7480455
4:28 PM
Hi all!!
 
user7480455
4:45 PM
HI All I would like to ask someone if they know Entity framework and the mvc well to field a question on add search feature to forms
 
5:46 PM
@Skullomania It looks like you have a routing error. Check your route table.
 
6:26 PM
@TylerStahlhuth I have done that
@juanvan I am back buddy, there was a situation at my sons school that I had to deal with
 
@007 What's the Q, agent 007?
@Skullomania I have some experience with Forms Authentication, individual user accounts. What are you trying to do?
 
@SeaCharp There is some server issue that occured that is stopping my application from rerouting non-authenticated request to the login, instead it times out on the server and forces the page out of https
I am having a ton of trouble figuring out why
 
6:42 PM
Someone mentioned the web.config. Are you configuring the login page url there?
Do you have it set to require ssl in the web.config forms authentication section?
@Skullomania ?
 
Are you using a redirect or URL rewrite scheme?
 
the ssl request is being handled by the netscaler
 
@Skullomania I'm not familiar with netscaler.
 
the netscaler WAS forcing any request to be https
imagine you are at the bank, there is glass between you and the lady
the lady is your server your site is hosted on, the glass is the netscaler
 
6:45 PM
OK.
Routing and security,, load balancing?
 
security and enforcing https mostly
as well as load balancing so yes
 
So your web.config...
<authentication mode="Forms">
<forms name=".ASPXFORMSDEMO" loginUrl="logon.aspx"
protection="All" path="/" timeout="30" />
</authentication>
 
no, the authentication mode is not forms
would that still work?
the authentication mode is identity
forms is AD no?
 
No
 
I will try this, I will have to VPN to my work desktop
 
6:49 PM
I have used the old Membership system as well as Identity. You're right, now that I think about it it doesn't use Forms Auth in the same way.
Let me go look at a project I worked on recently, brb
 
@Skullomania You're on WebForms or MVC?
 
mvc
i have forced myself out of webforms. I hope never togo back
it gets tricky as well, when I try to force a user to https in the global.asax I get to many redirects error
 
Does this help?
https://docs.microsoft.com/en-us/aspnet/web-api/overview/security/working-with-ssl-in-web-api
 
thats the thing ssl is required via the netscaler. The server does not need it installed
I have added the binding
 
7:19 PM
Maybe you need to configure CORS?
https://docs.microsoft.com/en-us/aspnet/web-api/overview/security/enabling-cross-origin-requests-in-web-api
 
7:38 PM
Has anyone ever seen an issue with MVC actions that return a form sometimes having the form element removed? Anyone ever tried binding a derived class to a base class? What I am seeing baffles me.
 
Did you specify the form elements in the action method?
 
It is able to bind a derived class that has more members, but on a derived class that is just an implementation of a base class, it tries to create the base class and removes the form element for some reason.
@SeaCharp The form element is getting inserted via ajax.
Then posted back with the rest.
Honestly, I think both should fail however one works perfectly fine.
Let me get an example
public class Base
    {
        int Id {get; set;}
    }

    public class Impl1 : Base {}

    public class Impl2 : Base
    {
        int AnotherField {get; set;}
    }
Now, both Impl1 and Impl2 have partial views with all the members. They get added to a form with ajax. The full view model contains the Base class. When I submit the form using Impl2, it binds without issue. If I use Impl1, it tries to create an instance of the Base class.
Honestly I'm not even sure how it figures out to create Impl2.
Probably should have thought it through before coding, but I had the entities made already and didn't want to mess with it too much.
 
@TylerStahlhuth Should you be using a partial class? Sorry if I'm not being helpful, MVC is not my forte, and though I've done a lot of work in C#, I'm currently in VB. And the culture here isn't very object oriented.
 
@SeaCharp Not a partial class, a partial view. Different concepts.
Partial views are pieces you can use to build full views. Partial classes are more about splitting up declarations.
 
user7480455
Hi I wanted to know of there was a way to have a search field be able to search for more than one item
 
7:54 PM
@TylerStahlhuth I guess I meant should you be using a partial class instead of an inherited class.
 
user7480455
I currently have <input type="submit" value="Search" /> and it works with one item
 
user7480455
but I was wondering if there was some way to get it to use that field for more then one search item...
 
@007 can you be more specific? What do you mean more than one item?
 
user7480455
let me look through the code I have to see if I can form a better question for this
 
The class method you use to perform the search can do whatever you want with the phrase you pass through to it, and return whatever you want .
 
7:57 PM
@SeaCharp Can't. Using TPH in Entity framework and didn't want to have to build a separate view model class for it. I might end up doing it anyway. Still, partial classes wouldn't make a difference. They all get merged into a single class anyway.
@007 You can have multiple forms on a single page. Forms can have multiple input elements. You could have a model for the search value that gets posted back with all the search elements.
@SeaCharp Never mind, I was seeing something that wasn't actually happening. Neither actually work -- like I suspected. One of the cases just didn't even try to create a class. Therefore, no crash.
 
@TylerStahlhuth K
 
Ehh... I shouldn't post questions that I had last night while fried.
Still don't know why one of the forms is removed however. That still baffles me. Though that is jQuery so whatever.
@SeaCharp Thanks anyway!
@SeaCharp If I can ask, what do you mean by the culture not being very object oriented?
 
8:23 PM
@TylerStahlhuth I mean that there's no emphasis here on using object oriented code. They pass data around in datatables, for example, and avoid using EF or LINQ. Kind of old-school VB mentality. Nice group of people though, I wouldn't trade it for my last position!
 
8:36 PM
@SeaCharp Fair enough. I moved on from that. It has it's advantages in some cases, but I'll stick to the new hotness.
 
@TylerStahlhuth Yeah, I'm working with C#, MVC, EF, etc today on a personal project because it's a slow day. Trying to keep up my chops.
 
Slow days are the best days
it's raining like all heck out here
 
9:14 PM
I have 3 slow months. so i picked up mixed reality, Cortana holotoolkit
 
@Sakthivel Nice, I just installed all that myself as well.
 
@SeaCharp How is it going ?
 
@Sakthivel Well, it's, uh, installed!
Worked with my kid in Unity a couple months ago for an hour or two but not much else.
 
IT will be exciting.
 
Unity mmm
 

« first day (2607 days earlier)      last day (2359 days later) »