« first day (2508 days earlier)      last day (2442 days later) » 
06:00 - 18:0018:00 - 00:00

user7480455
6:13 PM
thanks
 
@juanvan Hi @juanvan. In data.stackexchange.com/stackoverflow/query/edit/715250 the LocationName is something like united states. Or you can also specify a city but not a zip-code.
 
So I ran MVC pennsylvania and comes back with 0 results
and HTML
MVC with united states 0 results
same for HTML
 
try now again
apparently all the tags should be small letters not CAPS like HTML but html, thats the accepted terms on STackOverflow
 
Boston worked for me
 
but I have modified the code to accept anything and now it would work whether the input is caps or small
and if you guys like it then do play around and let me know
and if possible please also star it as well. I know I am being cheeky here ;) :P
 
6:21 PM
html returns mvc does not
i'll play around with it see what I come up with
 
I am apparently rank 108 for C# in Boston.
 
nice
 
@mikeTheLiar Out of how many?
 
you can tell when it gets results
 
You can also see your top % user (in percentile) as well, not just rank
 
6:22 PM
@Hypersapien 526
 
@Hypersapien 108 out 0f 109 may be (just kidding :P )
 
Cool
 
user7480455
What does that mean Mike>?
 
Nothing, really. It's just an interesting tidbit.
 
user7480455
Your rank that is
 
user7480455
6:24 PM
ahh ok
 
I'm in the top 20.4% of C# programmers in my city on Stack Overflow in terms of reputation.
 
user7480455
Will a tip of the hat to you all the same
 
Which itself is really a meaningless statistic but still.
 
guys ....if possible, don't forget to click that STAR on the top of the query if you have liked it ;)
@mikeTheLiar I agree
anyway IMHO stack overflow rank or reputation does not truly show the credibility and skills of a developer but still a nice statistics to have....
 
Ya it's nice to see who is in your area tho
one problem it has is if 2 towns are the same
Like Dallas, TX and Dallas, PA
but it took wilkes-barre and there are only 3 towns with a - in the name in all of the USA
 
6:29 PM
its because you the location in the users table of Stack Overflow allow any based on the user. SO if you want specific then you have to provide a more specific location such as type in Dallas, TX and you would only get result for that area and not others
whereas only Dallas will fetch any and all location which has the string Dallas in it....
 
It also assumes that people are providing accurate information.
And assumes that people actually are providing this information.
 
@mikeTheLiar yeah true. but sometimes we, users, don't. One of the edge case probably.... Stack need to do something about it
 
Case in point.
 
ROFL
 
His "about me" is a treat to read.
Welbog, Super Mario Land
45.2k 7 86 107
 
6:33 PM
we need to send this screenshot to Marc Gravel....developers at Stack Overflow need to do something about this.. or else we will soon find a developer from Namek :P
 
That is one hell of a Bio
 
I get the impression that he likes lasers.
 
and F
 
yellow
 
There a way to create a trigger that will automatically create indexes on a table
 
7:11 PM
Has anyone here ever had to allow the user to create dynamic queries based on unknown fields to be run in your DB? And how would I avoid SQL injection?
 
whitelist everything
 
user7480455
is it just me or is c# source code formatting not very good
 
user7480455
if just formats if logic in a very illogical way
 
@Vap0r how are you going to let them query the db?
 
@milleniumbug yeah I plan on it. I was thinking of having three main args for each "query": FieldName, Comparor, Args
 
7:15 PM
have them VPN in and use a client? or via the web?
 
@juanvan via web.
Those fields will be drop downs, FieldName will come from an excel file they upload.
Comparor will be the operations (AND, OR, IN, BETWEEN [I think that's all I'll have])
Args in most cases will be a single input, but could be multiple depending on if it's a BETWEEN operations or an IN
 
ok so that is not too bad
easiest way is to limit the length
 
limit the length?
 
ya of the input
 
Are you sure that's the way it should be done? I feel like I can use whitelists for the first two fields I'm taking in, and then parameterized queries would be the best way to go about the argument insertion.
 
7:19 PM
Anyone develop with Visual Studio on a mac?
 
no, in addition to whitelisting
it's to prevent Denial of Service attacks
 
user7480455
is there a way to turn on indent lines on C# like you have in Vb.net
 
seem like the best way is to limit their use of '
 
"ban apostrophes" is blacklisting, and it's risky
 
@juanvan that's not what that link says though... programmerinterview.com/index.php/database-sql/… is what is linked as the best way
@milleniumbug and is a great way to get SQLi if they're handling numerics
 
7:21 PM
if you can whitelist instead, please do
 
ya whitelist is better then, keeps you in control
 
@milleniumbug I will. I'm going to have an Enum whitelist from the dropdown for the first two. Won't be able to whitelist the the third Args field(s) since those will be truly dynamic
But those can be inserted using SQL parameterization because they're SQL values
 
Would anyone be able to help me get github working with my visual studio for mac?
 
Hello
I need to write code to output the name of a color given an HSL input. I have ranges defined for what values each color's H, S, and L can take. Is the simplest approach the obvious one, writing a bunch of nested if statements to discern the color by an input's H, then S if H is underdeterminitive, then L if H and S are underdeterminitive (then a special trick in the one case where two colors could share all three)? Or is there a better solution?
 
8:16 PM
Bunch of nested if's... smelly
Why not use something that is already made?
The bottom one has a good writeup on HLS if anyone wants to know - I had no idea :P
Bottom one is what you're probably looking for @user10478
 
Okay, I'll check out the links, thanks.
 
9:04 PM
oo
 
user7480455
Hi all is there an easy way to add paging in a partial view?
 
user7480455
I have read a few of the post on the web about it.. but they all seem difficult...
 
user7480455
just wanted to know if there was some visual studio wizard of this type of thing
 
user7480455
I found this one... but I don;t have the api
 
9:18 PM
@mikeTheLiar Wizard!
 
user7480455
I guess that means no
 
user7480455
I do miss the old controls that you have with webforms...things like this are so easy
 
user7480455
with controls
 
9:22 PM
"I miss Webforms" - no one, ever.
 
user7480455
did you work with web forms mike?
 
user7480455
before mvc?
 
God help me I did.
 
Easy, as long as you don't get any ideas of your own about what you want the form to do.
 
user7480455
yeah so you know that it is a true statement
 
user7480455
9:23 PM
that their are things that were easy to do in webforms
 
user7480455
that is grounds for missing them in my book
 
user7480455
the form did what it needed to do
 
user7480455
hyper..
 
Code-behind as a concept lends itself to bad code.
 
user7480455
I understand that someone may wanted extended functions
 
user7480455
9:25 PM
all code is bad code guys
2
 
I'll give you that.
 
user7480455
at the end of the day it is all bad it is all a mess
 
user7480455
complexity makes bad code
 
!!quote add 38887367 goodcode
 
@mikeTheLiar I will cherish this memory for the rest of my life
 
9:25 PM
!!xkcd 844
 
user7480455
i am am looking at that example I found it is just not worth the effort
 
user7480455
Ii will just limit the database selection to the top 5 and call it solved
 
9:44 PM
    Console.Write("Would you like to add another filter? (Y/n) ");
    bool again = !Console.ReadKey().KeyChar.ToString().Equals("n");
Is that the right way to do that? That Y/n evaluation feels dirty
I mean Y is default, but should x really be the same as Y?
 
Well that's really up to you. How do you want your program to work?
 
I mean, what I really would want is for it to ask again if they entered the wrong input
But for empty input to mean Y
so Y as default but not catch-all (like I currently have)
 
NH.
well, you could do a switch on Console.ReadKey().KeyChar.ToString(), have a case for "Enter", and set again to true
and the default case could give an error
 
What about a recursive function to keep on asking but eventually return a string?
 
9:48 PM
why not?
 
I don't think .NET implements TCO
 
TCO?
 
TCO is the least of your worries when dealing with user input
 
tail-call optimization
so such attempt will result in people being able to DoS your app
 
NH.
recursion probably isn't dangerous in this case, but why in the world would you need it?
 
9:49 PM
That said, recursion here is slightly silly in a language with non-recursive loops
 
NH.
what Kendall said
 
@NH I don't, I'm being an idealist when this is a console app to test what will end up being webserver-based functionality
 
NH.
oh, then definitely don't recurse
 
@Vap0r sorry got interrupted by work. Just change your prompt to say "Enter N (or whatever character) to stop"
 
NH.
and definitely don't have Y/N based prompts for whether to continue lists
 
9:51 PM
@mikeTheLiar I like the pragmatic approach :)
 
But if you want it to prompt again just do something like
 
NH.
you should accept a JSON array of "filter" objects instead.
 
while(input != "N" && input != "Y")
 
@NH nah not really
 
or rather do { /* prompt for input */ } while(input is valid);
 
NH.
9:52 PM
@Vap0r why "nah"? what kind of webservice would need y/n based prompts?
 
But I think if you just want there to be a quit/stop flag just say that
 
@NH sorry, that was meant to be in response to your JSON thing. At the end of the day, I will be getting them as objects, but the objects are going to be exceedingly simple
I'm avoiding using JSON in this approach because the exceedingly simple objects could end up looking like this: [{1,4,1,4},{1,2,"food"}] etc...
And that's all well and good on the server, but I won't be messing with the JSON there because I'm using Web API to receive that as a type.
 
NH.
oh and C# is closed-minded about serialization? I know the feeling, bro.
 
Yeah, at the end of the day I'll probably have a lot more of a visual "proof of concept" on this console application because I'm mimicking part of the work performed by the front end, but that's also why I'm building a menu type interface for building this data rather than specifying it all as a JSON string at the beginning of the program
 
NH.
speaking of serialization, I'm having a weird issue pretty much the same as stackoverflow.com/questions/27005254/… or stackoverflow.com/questions/44094603/…, but there is no satisfactory answer.
I was commenting, but thought I'd move the chit-chat here.
Stream doesn't have any documentation indicating failure of the getter either
I don't always get the exception (I'm able to serialize to a MemoryStream in a ConsoleApp I use for testing, just not in situ), and of course M$ makes it a pain in the butt to track down where the error is really occurring.
 
10:29 PM
That property (along with read, position, length, etc) will throw an exception unless its corresponding ability property (CanTimeout, CanRead, CanWrite, etc) is true
 
 
1 hour later…
NH.
11:30 PM
why would CanTimeout be sometimes true?
(or is it only sometimes trying to access the property?)
no, I'm debugging in the console app and CanTimeout was false, but it still serialized successfully.
so it is either intermittently trying to access the timeout property, or @borrrden is barking up the wrong trail.
 
That's the only piece of insight I can provide given the extremely limited details
I can't speak to what it is or is not doing
The message in your second link is very clear though -> "Timeouts are not supported on this stream."
 
NH.
yeah, but I don't WANT timeouts!
 
That means that the stream said it cannot time out but the property was accessed anyway
 
NH.
This is Microsoft complaining at THEMSELVES!
anyways I'll have a look at it again once the server is back up. maybe it will magically be fixed.
or maybe a custom class will fix it.
 
It's probably an issue with the XmlSerializer implementation
 
NH.
11:42 PM
again, Microsoft
 
Which means you cannot do anything about it except notify Microsoft
 
NH.
jinx
 
Actually it looks like there are some auto generated methods in the second link
I don't know that much about ASP
 
06:00 - 18:0018:00 - 00:00

« first day (2508 days earlier)      last day (2442 days later) »