« first day (1655 days earlier)      last day (3310 days later) » 

4:00 PM
So i have a zip code field, i am calling an api to get city, state and country based on that zip code. How to know if the zip code is canadian or usa?
 
what class am i going to want to use to write ushorts out in little endian?
@Obviously no letters in USA postal codes?
 
@NETscape BitConverter
 
ohhh
aweasome
what about mexican
 
user862319
@Obviously Will the API return on either country's zipcode?
 
user862319
@Obviously If its USA only and returns a 500 or something, I would just use that exception response to indicate the zipcode is either invalid or not in the USA.
 
4:02 PM
there is nothing that takes a ushort[] that will write to file in such manner?
 
@Obviously impossible
@NETscape BinaryWriter
 
user862319
@NETscape IPAddress.HostToNetworkOrder() :D:D:D
 
Ah
when user enters a zip code, i want to get city,state, country from the api
 
user862319
WHY DOES THAT METHOD TAKE A 16 BIT INTEGER?
 
user862319
What madness is this!?
 
4:05 PM
@Obviously You can't determine country form zip code alone
 
user862319
"sure guys... heres my IP: 232.12"
 
@Bob I'd be worried if it took a 32-bit ushort
 
You are right I guess
 
user862319
@KendallFrey fixed D:
 
Hey there. I seldomly come here but I would like to know if an edit I made on a c# question really was wrong. stackoverflow.com/revisions/29917444/2 It seemed to upset op who said my edit was wrong. Would anyone confirm/infirm that I in fact did not change the meaning of the question?
 
4:14 PM
@FélixGagnon‐Grenier - Some people are just defiant by nature. I would ignore them and move on.
 
@TravisJ apparently. That I will do, thanks for the info guys!
 
@TravisJ - NO! I refuse!
 
Oppositional defiant disorder (ODD) is defined by the DSM-5 as "a pattern of angry/irritable mood, argumentative/defiant behavior, or vindictiveness lasting at least six months as evidenced by at least four symptoms from any of the [defined] categories and exhibited during interaction with at least one individual who is not a sibling". Unlike children with conduct disorder (CD), children with oppositional defiant disorder are not aggressive towards people or animals, do not destroy property, and do not show a pattern of theft or deceit. A diagnosis of ODD cannot be given if the child presents with...
 
Welp. My company didn't get the contract. I officially have nothing to do.
> The cause of ODD is unknown, but it is believed that a combination of biological, psychological, and environmental factors may contribute to the condition.
Are there any other factors left to consider?
 
@SpencerRuport - Exposure to sunlight could be a factor, as it was observed in nearly every diagnosis.
 
4:20 PM
Wouldn't that be environmental? ;D
 
Bah, I guess so :(
 
I finally saw interstellar last night.
 
The face was palm.
 
It was a lot different than I expected but I really enjoyed it.
Sci-fi is hard to get right.
 
Yeah
Where is Gene Roddenberry when you need him
 
4:21 PM
:O
 
@ton.yeung - LOL
 
@TravisJ - Despite my reservations and all the lens flares I've been pretty happy with the new Star Trek movies.
Hopefully JJ does a good job with Star Wars too.
 
I didn't like the wrath of Khan as much
I cannot wait for Star Wars
But I fear botch
 
Needs more lens flare.
@TravisJ - I feel like he was somewhat shackled by the previous movies for that one so I was willing to let some stuff slide.
 
4:24 PM
Much better.
The farther away he can get from the original story line the better I think.
 
Is it good practice to have a timer task in a WCF Windows service. Basically when the service is running I want it to ping the remote service every 30 seconds to test connectivity
@ton.yeung Actually my Wcf Windows Service will be making the Ping call to a 3rd party web service, which might not be Wcf
 
haha
@ton.yeung - It gets into it though, just a little intro you have to get through
lol
 
@KendallFrey basically I have to write a "header" to a file which is XML. then I have to write in little endian using that BinaryWriter, I'm writing a ProjectParser... what should be the parameters of the ctor for ProjectParser
 
I don't know what a ProjectParser is
 
<!-- header comment -->
<Xml> (stufffffff) </Xml>
------------
<Tag>
Binary
</Tag>
@KendallFrey I mean ProjectWriter... its the class that will write the file
 
4:32 PM
I think you need to elaborate on your question
 
Too tired, missing something here jsfiddle.net/foat3vu4/1
 
ProjectWriter(Stream fileStream) ?
basically I have to switch the Stream's "writing" mode
 
what do you mean by the stream's writing mode
streams send bytes. that is all
 
the header will be ascii, the body is little-endian
 
little endian what?
 
4:33 PM
doh, nevermind -_-
i'm rtrd'd
 
@CharlieBrown - What is happening that was unexpected?
 
@TravisJ tests fail
Its a pager, generates the range of pages, but no more than 5 at a time, with the current selected page in the middle of the range
 
@CharlieBrown - There are only 4 pages available in the range of 27-30. So checking that against .length of 5 fails
 
current page index of 27, 30 total pages
 
"no more than 5 at a time" should be .length <= 5 perhaps
@CharlieBrown - Current index of 29, 30 pages total. It drops to pageLimit/2|0 which is -2 so 27. You clamp. Still 27. Range 27,30 = .length 4
 
4:39 PM
?
Right, I want 5
 
But you prevent it from getting to 5. How would it get 5 there?
 
thats the problem, I dont want to prevent it
 
I can only think of hax
Or refactor
 
@CharlieBrown - Hey I forget the name of the Orson Scott Card book you recommended. I didn't realize he has written so many o_o
 
@SpencerRuport Pastwatch
 
4:42 PM
Awesome thanks. :D
I just finished Wild.
 
@TravisJ i can rewrite the whole thing, dont matter to me
 
@CharlieBrown - hax jsfiddle.net/foat3vu4/5
 
i know ive written this before a bunch of times
 
while(max-pgLimit < min) min--;
 
@ton.yeung - I think that might be this one. The summary says it's about Christopher Columbus
@CharlieBrown - Thanks I'm looking forward to listening to this. :)
 
4:47 PM
heh, fictional writing about history... it tends to be very insulting
Especially when you have people that don't study history
 
Its a go back in time, what if style
Basically, what if we went back and changed where columbus landed in order to prevent something in the far future... and what it we werent the first to do it?
@ton.yeung Society, people as a whole
 
@CharlieBrown - Yeah, but it is written from someone with no comprehension of how any of the history played out nor what impact it had. So really, it is conjecture with no basis. I am sure it would get freaking ripped apart if it was actually of any stature.
 
@TravisJ To start with, its fiction. But also, its written by Orson Scott Card, who is a highly respected author. I'm certain he takes liberty with the history for the sake of the story, but I doubt "no comprehension of ..." is a correct label
 
@CharlieBrown - He is skilled with grammatical composition. That has no bearing on historical knowledge. I realize its fiction, but it is also going to be wildly inaccurate and when you have someone who is so eloquent describing history it tends to be believed by many readers.
 
I'm still going to say 'its fiction'. I would imagine readers do not believe "I, Robot" as fact wehn reading, either
 
4:54 PM
@CharlieBrown - I would stand by that label. Maybe if he had more education other than high school. I find it amusing that he states he spent a year in a phd program when really he was just advising while working on a project with the university.
@CharlieBrown - I, Robot doesn't misconstrue historical events :) I happened to really enjoy that movie lol
 
I never graduated high school myself, but I would like to think that my work (code) isnt dismissed b/c of that fact
 
Did you not attend college?
 
How did you learn to code?
 
Books
 
user862319
4:57 PM
@CharlieBrown Sometimes that is the best way... Our public education and even most institutions of "higher" learning are still incapable of producing semi-decent developers. 99% of what I know I learned from practicing on my own time.
 
Bought every c# & js book at Barnes and Noble
 
So you stopped going to high school to pursue a coding career?
 
I dropped out and joined the military
 
Ah, well that is different though
 
it's funny to read articles written by people who don't know wtf they're talking about... itworld.com/article/2901453/…
 
4:58 PM
Didn't they make you attend classes in the military?
 
In hindsight, a really stupid decision...but I was young
 
user862319
I learned more from one book than I did in 4 years of computer science/engineering.
 
user862319
 
You can only enter the military w/o a high school diploma if your asvab test scores are high enough
 
I think joining the military is noble
 
user862319
4:59 PM
Replace first 2 semesters of a compsci program with that book and you are on the right track.
 
"if you concatenate a string a bunch of times, it's slow" no shit, try using a StringBuilder
 
@Bob - lol
 
"if you append to immutable data types in storage, it's slow" lol
 
user862319
"If you do stupid things, sometimes it sucks"
 
user862319
Also, I am pretty sure the compiler internally converts any string concat operation into a stringbuilder.
 
5:04 PM
@Bob why would it do that?
 
user862319
15
A: Does string concatenation use StringBuilder internally?

Darin DimitrovNo they are not correct, it won't produce the same IL: static string StringBuilder() { var s1 = "s1"; var s2 = "s2"; var s3 = "s3"; var s4 = "s4"; var sb = new StringBuilder(); sb.Append(s1).Append(s2).Append(s3).Append(s4); return sb.ToString(); } static string Conc...

 
user862319
I guess its more complicated then.
 
god it's fun when I get nothing but HTTP500's from this API we're paying for
 
user862319
user image
2
 
@Bob Omaigawd that is hilarious
 
5:14 PM
hilarious :D
 
serious geek humor
:D
 
user862319
fucking comcast business trying to charge me 12.95 for my own modem
 
user862319
what a bunch of clowns
 
@Bob HTTP status code jokes are hilarious
 
@bob: you have a 409 with comcast?
 
user862319
5:24 PM
The hell is a 409
 
user862319
GODDAMNIT
 
user862319
I guess today is HTTP status code day
 
user862319
wow 450 is a real status code. How retarded.
 
Hi guys
 
409 part of a DOS attack?
 
5:27 PM
Someone already have problems trying create a nuget pack from a custom control in XAML?
More specific: how enable design in a custom control (xaml) from nuget?
 
"baby are you magic the gathering? because I could see myself spending a great deal of money and the better part of my 20's on you."
 
ever make a trigger Instead Update from an ADO rs.UpdateBatch?
 
@juanvan you mean a SQL level trigger, or something else?
 
ya sql level
 
please don't do SQL triggers
they're like a landmine waiting to drive a dev insane
 
5:34 PM
production sucks too many users are updating a table - please see rs.UpdateBatch
this is a temp fix we are in the middle or a write
 
@Pheonixblade9 I've suggested triggers to various people at various times on this project. Mostly they just smile (akwardly) and nod. I'm sure they're getting sick of the database noob
 
temporary fixes are never temporary.
 
It is usually phrased as "Would a trigger work for [problem]?"
 
@TomW triggers have their place. When absolutely nothing else will work
 
and that is where we are at
 
5:36 PM
they're just very hidden and are difficult to test and if you don't have the tribal knowledge that they are there, they can drive you nuts when you're trying to debug a problem
use an ORM or a sproc instead if you really need that behavior
 
production user lever UsLever > 5 - admin
 
just use a batched sproc?
 
can't update prod - and it calls rs.UpdateBatch
 
I mean, if it's an emergency patch, do it, but trust me. temporary is never temporary unless you kick someone's ass to make it not so
 
it then does sp_executesql -and I can see the @p values
how would I make the trigger for more then one?
ya very temp - the sql version has to come off for PCI compliance
 
5:38 PM
what do you mean trigger for more than one?
 
and they made an Address type, I guess you could in MSSQL before 2000
if they update more then one record set
 
you can have a trigger that reroutes inserts, deletes, updates
 
going to be update
 
a trigger works on every operation, it's not like a sproc. it's automatic
 
Ahh
 
could do that? could I check a user table in it?
 
data manipulation language trigger. fires on UPDATE, INSERT, DELETE
 
not sys.user dbo.user
 
you can do anything you want
 
Triggers are... fun.
 
5:40 PM
ya been a while.. like college
 
you can execute any SQL in a trigger, I believe
triggers are a great way to muddy up your business logic
 
ya!!
well the alternative was...
 
Split some of the business logic into each tier, even the actual data store.
 
They made ODBC connections with new usernames and then applied setting to the tables they wanted only certain users to update
Yep trigger are better then That..
what ever that is
 
uhm
the correct way to do that is via roles and groups
you should not be checking that stuff yourself, it's built into SQL Server
 
5:47 PM
var unicorn = new Unicorn("Larry");
var service = new MagicCastle();
var service.OpenDoorsFor(unicorn);

function void OpenDoorsFor(IMagicalCreature creature){
   TriggerSomeMagic(creature);
   // do other crap
}
 
ya that is how the new apps do it - this is a Very old app
 
to replace triggers with OOD
 
I bet Larry the unicorn has some awesome magic abilities
 
How long have roles been part of SQL server?
I'm guessing as long as SQL server has existed
 
user862319
@TomW Yes
 
user862319
5:49 PM
Granted, there are a bunch of new roles now vs the first version.
 
Can anyone help me with this error?
'Could not load file or assembly blah blah'
 
So doesn't matter how old your app is, roles have always been the right way to do access control
 
@AshSimpson you probably have it open elsewhere.
 
or it does not exist
 
Or any of its dependencies don't resolve
 
5:51 PM
It only happens when I debug?
A first chance exception of type 'System.BadImageFormatException' occurred in Coding Speed Test.exe
 
user862319
@TomW Elaborate on your assumption? You are talking about locking application access down to certain databases/tables?
 
Additional information: Could not load file or assembly 'Database Manager, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null' or one of its dependencies. An attempt was made to load a program with an incorrect format.
 
@Bob I'm responding to @juanvan saying that his app uses triggers for access control because it's old
 
badimageformat is built against wrong architecture isnt it?
 
@scheien I bet when you tell Larry BlowFireBreath() it says Null
 
user862319
5:52 PM
@scheien Yep. probably built the DLL on 64 bit and trying to load on 32 bit.
 
user862319
@TomW Ah ok. Didn't see that. Pizza keeps distracting me.
 
It works in my other solution just fine..
 
@TomW you are correct, but in prior NT there were no roles
 
user862319
@AshSimpson Im like 99% sure its something in your build configuration with wrong system architecture specified.
 
Holy moly that is old. @juanvan I withdraw my objection. God speed, sir.
 
5:54 PM
ya its very old - when could you make custom datatypes in sql?
 
user862319
@juanvan Since you could serialize to blobs :D:D
 
2005 it shows - the new way so it was before that
 
6:16 PM
Can somone help understand the differences between thse two
void Main()
{
List<int> plans = new List<int>(){1,40,3,4,5,6,7,8,9};

// What is the performance/memory differences between these two?
plans = Enumerable.OrderBy(plans, o => o).ToList();

plans = plans.OrderBy(o => o).ToList();

}
 
Can I ask, what is better than Queue's? In C#
I'm using it to disconnect a list of sockets and dispose all their information when a socket becomes null.
 
user862319
@VictorioBerra Isn't List simply an in-memory implementation of IEnumerable?
 
user862319
I dont think there would be a difference.
 
yes
I see
I can see clearly now the rain is gone
 
user862319
@AshSimpson Do they have to be disconnected in any particular order?
 
6:22 PM
@AshSimpson No, you can't ask that, you need to provide specifics about what you're using them for, and what you want them to be better at.
 
user862319
If you are just trying to maintain a collection of objects that can all be disposed in some random order, you could use a HashSet or a List
 
@VictorioBerra They are identical, both should generate the same IL.
 
user862319
HashSet would give you o(1) performance, but has some additional overhead, so List is faster for the first 20 objects or so.
 
@Bob That's a bad statement to make, you need to say what you're measuring to be O(1)
list provide O(1) performance too
 
user862319
@KendallFrey For adding and removing items it holds true that HashSet is constant-time and List is logarithmic. For iteration, its constant for both.
 
6:27 PM
List is amortized O(1) for adding
 
user862319
shenanigans!
 
O(n) for inserting and removing
not sure where you got log from
 
user862319
shit you are right
 
Yum.
I'm so hungry arg.
You're evil.
 
mmmm, cake
 
user862319
6:31 PM
@AshSimpson tl;dr - Use a List.
 
user862319
@ton.yeung wow. I almost wish I didn't eat all of this tasty pizza just now so that I could go buy one of those.
 
@KendallFrey is it? List is an array internally, right?
 
user862319
 
user862319
mmmm
 
That gets resized i.e. copied to a larger array, when the number of elements in the list exceeds the size of the array
Doesn't that resize operation grow the time-complexity?
Ah. Maybe it happens less often the larger the list grows. Is that where the amortized comes in?
 
user862319
6:35 PM
@ton.yeung But yet here you are posting pictures of ice cream cake monstrosities...
 
Not being able to digest it says nothing about how it tastes...
 
user862319
I am unclear on how this rule doesn't apply to the pizza in question
 
^
 
user862319
I hate having to carry windstorm insurance :(
 
user862319
Shit is expensive
 
6:39 PM
Where I live, cheese is 25% of your diet
 
user862319
@CharlieBrown Do you get hurricanes where you live?
 
i have a class, and i want to get the XML representation of it.
how do?
 
@NETscape serialize it
 
user862319
@NETscape Are you using the built-in xml comment things?
 
@Bob nada, snowstorms, tornadoes
 
user862319
6:41 PM
There is a build option to output an XML copy of your classes+comments
 
i serialized it, but that sends it to a stream
 
user862319
I use it to auto-document web API
 
i want the string before i serialize it
 
@NETscape use an xmlserializer
 
i am using that
 
6:41 PM
@Bob This comic is sadly missing a 418 joke. 4/5 stars.
also, hi
 
yarrr
 

« first day (1655 days earlier)      last day (3310 days later) »