« first day (844 days earlier)      last day (4106 days later) » 

3:00 PM
But If I would take the normal code that works on a c# application, can it be used on a asp.net website also?
 
in most cases, as long as you are running in full trust yes. It depends a lot on what that "normal code" does
 
Something like this, but then to store /display on a asp.net website:
 ManagementScope objScope = new ManagementScope(ManagementPath.DefaultPath); //For the local Access
          objScope.Connect();

          SelectQuery selectQuery = new SelectQuery();
          selectQuery.QueryString = "Select * from win32_Printer";
          ManagementObjectSearcher MOS = new ManagementObjectSearcher(objScope, selectQuery);
          ManagementObjectCollection MOC = MOS.Get();
          foreach (ManagementObject mo in MOC)
          {
             MessageBox.Show(mo["Name"].ToString().ToUpper());
 
its possible tha would work yes.
again, full trust. if you are in shared hosting or similar, chances are it won't run
 
Gonna change SO tags, question shows no reason to think its asp.net, then you respond according to that, then getting a asp.net question (-_-')
 
if anyone wants to get pedantic, why do some languages (C#, java, etc) check for nulls with myVar == null whereas other languages (SQL, etc) require myVar is null rather than myVar = null? I understand the logic of why SQL would not allow you to equate the value of myVar with the "value" of null, but why does that same logic not apply to C#, Java, etc?
 
3:12 PM
see, it all depends on what the definition of "is" is
 
With settings set to A: Does not work.
Set settings to B: Does not work.
Set settings back to A: Works great.
Bug fixed.
@SteveKonves In most low-ish level languages (C++, C#, etc.) null is stored as a pointer to a fixed location, e.g. memory address 0.
In SQL, I'm guessing that's different.
 
posted on February 06, 2013 by Eric Lippert

Previously on FAIC we saw how easy it was to deadlock a program by trying to do something interesting in a static constructor.1 Static constructors and destructors2 are the two really weird kinds of methods, and you should do as little as … Continue reading →

 
is it possible to keep a process running when an appdomain encounters an unhandled exception?
 
3:31 PM
@RohanSingh No, because the process state could well be corrupted.
 
hm well that sucks
 
If you just handled the exception properly...
 
Is this what a interview looks like ? based upon this video do you think he got the job ? youtube.com/watch?v=2cf9xo1S134
 
@KendallFrey holy grail of software development
 
@noob1992 Yes, because interviewer is wearing jeans XD
 
3:39 PM
What ?
 
3:51 PM
hey, this is not fully C# related but...I still need your help: I'm currently translating a program and got a question that I'm not sure how to formulate in english. What I want to ask the user is, if he wants to open all of the filtered items if the amount of filtered items is higher than a configured value. Could someone help here? What I got is something like "There are more than {0} items, are you sure you want to open them?" But I don't think that's proper english...
 
doesn't sound bad, wy do you think it does
 
CSharp is an awsome name! Can I name myself CSharp2 ?
 
I don't mind, "free" world
 
@SteffenWinkler Sounds fine to me.
 
I have to wait six days
 
3:56 PM
hmm okay...I just have a strange feeling about it and usually when I've that feeling, something is wrong with how I build the sentence.
 
What if "Their" sounds better than "There"
 
are you talking to me @noob1992?
 
It's wrong but the sentence you have sounds correct
 
noob what do you mean lol, the sentence is correct
 
Because 'their' wouldn't make sense there, it's personalized. It's like...her/his but for a group of people. (Their computer -> his/her computer)
 
3:59 PM
and you wouldn't use their for responding to a user
 
This is not even C# related
Where is your user story ?
 
It's UX, which is related to software development though.
 
you would say Your, ==> Your total of selected items is larger than... are you ..
 
sort of, the program I'm translating is written in C#... @noob1992
 
you are === you're
 
4:01 PM
Whats the language you're translating from?
 
also there are a lot of english speaking folks in this channel, so I thought I could ask away
@CSharpStudent German
 
@noob1992 You obviously don't know much about English grammar.
 
Haha I like german, it always sounds like you scream XD
 
@noob1992 but you're != your
 
^
And their != there
 
4:02 PM
let him be, noob in the name for a reason
omfg I feel stupid
I thought I couldn't edit my chat message because the edit pen didn't show
()_()
 
if(your == you are)
{
Console.WriteLine("true");
} else
{
Console.WriteLine("false");
}
 
@KendallFrey I'm not even a native speaker of any of the variants of the english language but I cringe everytime someone confuses their/there and you're/your.
 
@noob1992 Epic noobieness right there.
 
@noob1992 'false'
 
the output would be false
 
4:04 PM
Console.WriteLine("your" == "you're"); // Win
 
if("you\'re" == "you are") { Console.WriteLine("true"); } else { Console.WriteLine("Idiot"); }
 
I been speaking English since I was 2
 
@KendallFrey uhm, that's wrong
 
How so?
 
you are == you're
your != you are and thus your != you're
 
4:05 PM
My first word was C++ hahahaha jk
 
You've been writing it wrong, speech != writing
 
@noob1992 That doesn't make you good at it.
 
Grammar nazi chat? xD
 
kind of
what have I done?
 
@SteffenWinkler How does that make my code wrong?
 
4:06 PM
But you some what understand what I mean .... or else you would not be able to understand what I am typing out to the screen@KendallFrey
 
@noob1992 "I've been speaking English since I was 2."
 
Just like in programming =)
 
@noob1992 I can understand you, but I can also see that you're wrong.
 
@noob1992 "But you somewhat understand what I mean, otherwise you wouldn't understand what I'm typing."
 
:o
 
4:07 PM
@KendallFrey oh, I missed the two inner "...well so your code returns 'false' and you commented Win behind it...how is false a win?
 
False isn't a win. Turning a seven-liner into a one-liner is a win.
 
@KendallFrey ooooooooooooooh
 
Hahaa
 
I've learned to speak english by playing games, watching movies and seeing grammar nazi corrections! You can't beat me!
 
4:13 PM
Haha me to!@CSharpStudent
I am the Best Programmer Alive !
B.P.A.
B
A
P
 
totally winning another tournament
 
ok, thanks for your help. I'm off again
 
4:36 PM
hi all
I am a programmer on web technologies. I know a two programming language(php, C#) and two databases(MSSQL,MySQL) and two php frameworks(Zend FW and CI). I need to devise subject of theme for Master's degree. Master's degree is consisting of Scientific Research Work and description of that. Can anybody help me to find something for subject or something what can be a subject of my Master's degree? I want to learn and work on something new, on something useful and something on web :)
 
@mrakodol Erm, you're in the wrong place.
 
XNA users ?????
 
where I can ask for help?
 
@mrakodol Your question in itself is bad. Who would want to help you write your Master's degree?
@Oddant What's your question?
 
4:49 PM
No, I do not want someone to help me to write a master's degree I just find a subject, something what is good to work
 
@Oddant I've posted an answer.
 
wtfs++
stupid work shit, pay me no mind.
 
@KendallFrey hi how ru doing today
 
@KendallFrey I just did something with my application of TCPListener and I got HTTPS working. but yet it has minor error, as I know I am doing something wrong with the certificate. will you please look at it?
 
5:02 PM
Only if you ask a good question.
 
sslStream = new SslStream(client.GetStream(), false);

sslStream.AuthenticateAsServer(_certificate, false, SslProtocols.Tls | SslProtocols.Ssl3 | SslProtocols.Ssl2, false)
here, _certificate is created by using makecert utility private key is associated with this
thats the reason, the AuthenticationAsServer Succeeds.
However, When a browser makes a https request, browser (IE) Gives warning saying that the certificate that is presented by the website is not valid. where am i going wrong
?
 
Not valid or not trusted?
 
it says Not valid.
 
Can you view the page properly?
 
Yes!
also i can login and work properly
the reason behind this I feel is that, I am creating certificate by my own , it is not presented by server.
but still pages are loaded well, i checked it with my own bank site and yahoo. login succeeds
so i have achieved what i want, but i know its not right. as I am presenting the certificate that is produced by me as the certificate of the website .
 
5:07 PM
Your problem is that your certificate has not been signed by a trusted authority.
Any hacker can make a certificate.
But a signed certificate means it's legit.
 
i see
but what i tried is, i wrote a code to download the certificate from the website first and then use it for authentication, but i could not do it
actually my code is providing the certificate crated by me as the certificate of the website that client is trying to. how to avoid it?
and if i use sslStream.AuthenticateAsClient(remoteUri); then i get this exception "A call to SSPI failed, see inner exception", and inner exception says "The message received was unexpected or badly formatted"
only this is my problem @KendallFrey , rest all is working fine
 
I don't know. I think you want to forward the certificate instead of creating a new one, but I don't know how.
 
@KendallFrey hmm..ok
 
Just installed ReSharper - Ctrl+E+F in VS does code clean up on single line. Resharper wants to do this for the whole page (i.e. what Ctrl+E+D does) how can I change this behaviour?
 
@dav_i what are you trying to do dev?
 
5:17 PM
Basically I guess the question is - can I pick and choose individual shortcuts do VS default or what RS wants in ReSharper?
 
Look at how people make geniuses waste time
-1
Q: Comparing and finding how much greater than other value

user2047808I m trying to write program below is our requirement Ex: a=1;b=5,6,---etc; c=? First i will take value b=5 then i compare to a=1; i have to find b=5 value how much greater than a=1. I need out put as c=4; Thanks Advance

 
Not much time wasted in downvoting that.
 
user142019
Good evening.
 
@Zoidberg h'lo
 
Have you considered using the - operator? — Jon Skeet 12 mins ago
 
Ell
5:30 PM
hi guys
I have an enum for cell colours for a puzzle game. Yellow, Blue, White, Empty. Should I change it to just y, b & w and use Nullable?
 
Ell
why not?
 
Because Yellow Blue, etc are better?
 
why would you? spelling out the names follows convention and is more readable/maintainable
 
What if in future you want Black?
 
Ell
5:37 PM
well the puzzle only consists of 3 colours, and it will stay that way (I'm only modelling an existing puzzle)
Sorry, I was unclear, let me clarify
 
Always assume you want more
Especially with something so simple as an enum
 
Ell
enum CellColour { Blue, White, Yellow, Empty }
CellColour c = CellColour.Empty;
enum CellColour { Blue, White, Yellow }
Nullable<CellColour> c;
 
Why make it ugly and worse?
 
When you append linq critiera to an existing linq query, it becomes an "AND" ... is there any way to append an "OR" to an existing query?
 
@Ell The first one.
The second one just adds an unnecessary special case.
@quip Explain?
 
5:40 PM
say you have a query "from d in data where d.StartsWith("a")" (data is a list of strings)
then later you realize you also want "where d.StartsWith("c")"
you only want to execute the query once ... so can you append the second where to the first query but make it "OR" so that you get StartsWith("a") OR StartsWith("c")
 
@quip where d.StartsWith("a") || d.StartsWith("c")
 
If you have a query that returns certain results, you'll never be able to get more results from it by any query operation.
You need to go back to the data source and query that.
 
@BinaryTox1n ... the first part of the query has already been defined ... say in another method
 
@quip you can union the two datasets
 
You can't make a query return more results without making a new query.
You may want to use Concat to combine two queries.
 
5:44 PM
i was hoping there was a way ... since the query hasn't really been executed yet right until it is enumerated?
hmm concat sounds promising
 
5:58 PM
I think I created a wmi monster xD
checking each property name & value from +- 650 win32_ classes
 
@KendallFrey do you know of a case when JS setting a field fails for no apparent reason?
 
@RoelvanUden Wrong file committed to the webroot? Browser caching issues?
 
Nah I have just this bit..
console.log(parsedRelated); // Shows a nice array.
// Set the related material.
media.related = parsedRelated;
console.log(media); // Shows the media obj with related being null.
I don't get it.
 
THanks guys, concat did the trick! I ended up creating an IList<IQueryable<MyType>>. Then as I found criteria that I wanted to selected, I just added a new query to the query collection
 
JS does allow custom getters and setters.
 
6:04 PM
Then I was able to concat the queries together in a foreach loop into a master query. and then run the master query to a list. One SQL was run and got my data. Thanks for the help!
 
Try logging media.related and see what you get.
 
@KendallFrey media.related is undefined.
Setting it ... it becomes null.
 
I can't believe I'm installing Blend...
@RoelvanUden Are you sure parsedRelated isn't null?
 
@KendallFrey I am 100% sure. I even log it just before setting it.
 
Can you provide a fiddle or something?
 
6:07 PM
Unfortunately this is all part of a larger node/mongoose scheme.
 
Is there documentation for the media object?
 
Perhaps I can reproduce with a simple mongoose script.
 
I'm suspecting this ain't a vanilla problem.
 
Media object is a mongoose object I pulled or created.
It complies to a scheme where related is..
// The related material ...
related: {
// ... with adaptions ...
'adaption': [{ref: 'Media', type: mongoose.Schema.Types.ObjectId}],
 
I'm guessing that has something to do with it.
 
6:08 PM
parsedRelated is { adaptation: [ 51129941a3e0e5780f000002 ] }
 
Hm.
What if you create ObjectId's in adaptation instead of whatever it is now?
Or is it an ObjectId?
 
It is an ObjectId directly pulled from the db.
 
hm
OOC, what does ref: 'Media' do?
 
It tells mongoose I can populate the object ids with instances of Media model.
Media.findById(id).populate('related.adaption').exec
 
With instances, or object ids pointing to instances?
 
6:11 PM
In the database it stores the object ids, and pulls them like that. You then tell mongoose to retrieve the actual objects and replace the object ids with that through populate()
 
mm
lol I only now realized it's adaption and not adaptation. WTF is adaption anyway?
 
OMG!
... Fixed. Thanks @KendallFrey for noticing such oblivious things :D:D
 
LMAO
double LMAO. Did you mean "obvious"?
 
LMFAO (currently playing...)
 
Well! Mongoose at least acted correctly, I was just being a dick.
@KendallFrey I meant oblivious this time :D
 
Ell
6:15 PM
hmm. is there a retry for for loops in c#?
actually nvm
 
retry?
 
@Ell Why would there be a retry? Loops don't fail.
 
@RoelvanUden It doesn't make sense. You are oblivious. Your problem was obvious.
 
Ell
I actually meant redo, sorry, but nvm, I can just set the counter to 0 anyway
 
@KendallFrey Aye, I was oblivious. It was obvious, but.. I completely missed it. A fresh pair of eyes does wonders so thank you very much for looking and spotting the issue ^_^
 
6:16 PM
redo?
 
@Ell Where is the redo concept from?
Visual Basic, perhaps?
 
Also, my grammar is plummeting. I blame being tired.
 
never head of it
 
@RoelvanUden identifier highlighting does wonders ;)
 
Ell
ruby, "Restarts this iteration of the most internal loop, without checking loop condition. Restarts yield or call if called within a block."
 
6:17 PM
@Ell Oh. Ruby.
We don't speak of that in here.
 
You could just use a goto.
2
 
Ell
It doesn't do what i want anyway xD I'm just not thinking today
 
@KendallFrey Yeah, don't have that in this situation though.
 
Ell
I thought of goto actually :P
 
I say that with all seriousness.
 
Ell
6:17 PM
@ShotgunNinja heh, why not?
 
@Ell It burned down my village.
 
Ell
oh dear :O
 
I vowed, from my childhood, to one day take on Ruby and beat it into obsolescence.
 
Guess what? I got VS Pro today!
 
@KendallFrey Woo~!
 
6:19 PM
you've been using express this whole time?
 
No, Notepad++.
 
WHAT.
 
ouch
 
No, seriously.
Not for C#, though.
2
 
Notepad for C#? Are you out of you..
ah.
 
6:19 PM
oh. heh
 
hah
Yeah, I use VS 2010 for C#.
 
@RoelvanUden Notepad++, you mean.
 
We switched to using VS for JS months ago.
Everyone but me.
 
@KendallFrey wat
 
I forget why.
 
6:21 PM
What is the added value of VS for JS?
 
typescript or something?
 
Moar stuffs, I guess.
@ChadRuppert Hell no.
 
thats the only win i can think of with using VS for JS
 
It probably just lets you do Intellisense-style lookups for functions and stuff.
 
The installer sure isn't going anywhere fast.
 
6:21 PM
not even that well
 
sigh
 
@ShotgunNinja Autocomplete for JS is pretty bad in every IDE :P
 
Ell
it's dynamic after all
 
In Notepad++, there are no flaws whatsoever in autocomplete.
 
@RoelvanUden Well duh, with people like rlemon and you guys hacking around with JS, jeez.
 
6:23 PM
That's true, Kendal..
 
@RoelvanUden you have a fightbot?
 
@ShotgunNinja Well.. yeah.. I do hope TypeScript becomes more awesome.
@JohanLarsson No. :D
 
TIL Walmart uses Node.js.
 
but why?
 
I want to see autocomplete for a Lisp IDE... All of the drop down options are combinations of end-parentheses.
 
Ell
6:24 PM
lol
 
@JohanLarsson I have fight bots for MMOs :P
 
I have Stack Overflow bots. 1 |2 73][ 1337357
 
Dude, the parentheses characters are very task-expensive to press... You have to move your left hand (or right pinky) to the shift-key, then you have to move your right hand (or right index/middle finger) up to the top row.
 
My product key doesn't work! Waaahhh.....
 
doh, that blows
 
6:27 PM
Microsoft is supposed to come up with a Surface Pro with a haswell chip in it within this year :D
 
WTF is haswell
 
the one after ivy bridge
Haswell is the codename for a processor microarchitecture under development by Intel's Oregon team as the successor to the Ivy Bridge architecture. Using the 22 nm process, Intel is expected to release CPUs based on this microarchitecture around June 2, 2013 according to leaked roadmaps. With Haswell, Intel will introduce a new low-power processor designed for convertible or 'hybrid' Ultrabooks, having the Y suffix. Intel demonstrated a working Haswell chip at the 2011 Intel Developer Forum. Design The Haswell architecture is designed specially to optimize the power savings and perform...
It is a tock so it keeps 22nm
I read the Anand Tech review for the surface pro and it seemed pretty tepid
 
Ell
but an x86 tablet is awesome
 
derp-de-derp
private string admissionsRepresentativeColumn = "<Field ID=\"{C4B785D7-70D2-4482-A168-7B66549E28C7}\" Name=\"gcu_oit_AdmissionsRepresentative\" DisplayName=\"Admissions Representative\" Type=\"Lookup\" Required=\"FALSE\" Group=\"Ops Inquiry Tracking Columns\" ShowField=\"gcu_oit_TeamMember\" List=\"{0}\"></Field>";
^ that causes string.format to fail
 
Kyle, I am so lost...
 
6:36 PM
protip, escape literal curly braces in your string.formats
 
hmm code format aint working
 
that is ugly
 
@kush that xml snippet, when passed into string.format gives the error "input string was not in a correct format"
the problem is the guid id
the curly braces need to be escaped
protip: escape them by using double curly braces
FYI
 
@KyleTrauberman so I would need to do some processing before passing it in?
If there is a brace, add another brace?
what if the sender sends two braces?
 
just do this: <Field ID=\"{{C4B785D7-70D2-4482-A168-7B66549E28C7}}\"
idk
 
6:39 PM
I would want to correct it at the sender if I can, right?
 
you'd probably want to handle it somehow
in my case, I was just getting an error, thought you guys might like to know about it
 
if there are two {{ do nothing. If there is one { add another one?
Yes, I always like to know how people solve problems
 
string.Format(admissionsRepresentativeColumn, admissionsRepresentativeList.ID.ToString())
that's what I'm trying to do. the guid was making it fail
string.format ignores {{}}
so adding the double braces fixes the error
 
so you are going to add some other function that returns a string like string.Format(admissionsRepresentativeColumn, SomeOtherFunctionThatReturnsAString()) ?
 
nope. I'm using that xml as a literal
so I just needed to add the double curly braces
 
6:43 PM
so you need to call whoever is serving you that xml and tell them to fix it?
oh you're handling both sides yourself
 
10
Q: string.Format() get Input string is not in correct format

Mr.RendezvousWhat do I do wrong is here?? string tmp = @" if (UseImageFiles) { vCalHeader += ""<td><img onmousedown='' src= '{0}cal_fastreverse.gif' width='13px' height='9' onmouseover='changeBorder(this, 0)' onmouseout='changeBorder(this, 1)' style='border:1px solid white'></td>...

yes, i control both sides
 
174
Q: How to escape brackets in a format string in .Net

Pop CatalinHow can brackets be escaped in a C# format string so, something like : String val = "1,2,3" String.Format(" foo {{0}}", val); doesn't throw a parse exception but actually outputs the string " foo {1,2,3}" Is there a way to escape the brackets or should a workaround be used.

@KyleTrauberman nice
byee
 
I'm just adding a lookup column to a SharePoint list, which can't be done declaratively, because you need the list id, which is generated at list creation.
 
hello @ all
short question: I implemented unit of measurments and do some matematical operation +, -, * etc. and convertion between e.g. metres and nanometres. Should I use decimal or double?
 
Depends whether you need EXACT results when converting between, say, metres and nanometres.
converting between metres and feet shouldn't matter.
 
6:52 PM
@CSharper Decimal = super duper manly awesome precision at the cost of some performance. Your Physics teacher will be proud.
 
Decimal is only better when doing sensitive calculations in base 10.
 
@RyanTernier thanks. That was what I thinked about.
 
For all other situations, double is better.
NEVER use decimal for physics.
 
why?
what do you mean with physics?
 
@KendallFrey Because a few clock cycles translates to 5 metres of difference at 3/4ths the speed of light.
 
6:54 PM
decimal was designed specifically for monetary calculations. double is designed for general-purpose calculations, especially scientific.
 
mhm ok.
 
^ this
 
So, should I use double.
 
IMO, double is the way to go.
 
double System.Double Yes 8 Approximately ±5.0 x 10-324 to ±1.7 x 10308 with 15 or 16 significant figures
decimal System.Decimal Yes 12 Approximately ±1.0 x 10-28 to ±7.9 x 1028 with 28 or 29 significant figures
 
6:55 PM
ok
 
Ell
has anyone played puzzle pirates before?
 
thanks
 
for regular math, use double
 
Put it this way. Do you care about the difference between 1 and 1.00000000000001?
 
for calculations that involve getting down to the milimeter (for say GPS calculations where you need to take the curvature of the earth into question) use decimal
@KendallFrey Sometimes, yes.
 
6:56 PM
@Ell I may have, though I don't recall it ATM. The name rings a bell.
 
@RyanTernier Not just curvature of the earth; you also have to account for relativistic differences in reference frames due to the fact that satellites are moving at speeds where that becomes significant relative to the earth.
 
Ell
@KendallFrey I'm trying to think of a way to represent the sailing board: puzzlepirates.com/content/images/Sailing.jpg
 
@RyanTernier This is why I wish C# had a quad type.
 
@KendallFrey Some satellites do; I believe IEEE 754-2008 does have specifications for handling quad-precision floating-point numbers, but I don't think C# supports them natively.
 
DOes F# have a quad type?
going to make an Octo type and sue the octo mom!
 
6:58 PM
The reason C# doesn't have a quad is that the underlying hardware doesn't support it, IIRC.
 
you need 128bit processors for quad
 
Last I checked, most computers have 80-bit floating point math.
 
Okay, I go with double and hope all goes correct
 

« first day (844 days earlier)      last day (4106 days later) »