« first day (1287 days earlier)      last day (3658 days later) » 

3:09 PM
@KendallFrey Question... I really want to do a `Split` for that Regular Expression; how can I account for this:

16600 SW Rosa Road<br>Beaverton, OR 97008
310 SW 8th<br>Portland, OR 97224
PO BOX 50<br>Aloha, OR 97007

That doesn't make it easy to break the values it retrieves out of the data column, to place into Properties.
 
the literal <br> characters?
You should be replacing them with newlines
And why do you say you want to split?
 
@KendallFrey Well, when I parse the html they appear and then are stripped.
Which forces them all to "connect" without a space.
 
without? ergh
 
What?
 
3:27 PM
So in the HttpUtility class... what actually IS the difference between URLDecode and HTMLDecode methods?
 
Jon
isn't it obvious
 
alright mr jon
whats the difference between URL encoding and HTTP encoding?
 
Well, the obvious is the difference: URL encoding handles special characters that you want to have in an URL, but should not have there, HTML encoding does the same, just for HTML
 
Jon
Yeah, it URLDecode specializes it into a URL query string
removes spaces, for %3 or whatever a space is
whereas HTMLDecode would keep the space
among other things
 
3:36 PM
%20 i think is a space
i mean, i think i am going to go with the URLencoding
but im not actually handling urls
 
Jon
I would imagine, you could use HTMLEncode, for URLs as well
 
its a shit ton parameters for a web method
i have a shit ton of inputs posting via soap to my web methods
 
You should not use HTMLEncode for urls
 
and i had to encode them
its not querystring parameters tho
just a big fat soap env
 
Jon
what did you do to encode them?
 
3:37 PM
but all the values are encoded.
i used a javascript method
my client is pure client stuff
encodeURIComponent() is the method
the data in the DB is encoded - and i dont want that
 
Jon
yeah you don't want to encode DB data.
 
ultimately the data fuels SSRS, and i dont want to have to decode everything there.
 
Jon
You would want to encode the data when displaying it to HTML
 
@Jon but yea - i realized i shoudlnt have encoded data in the DB anyway
 
Jon
cuz you know... XSS attacks.
 
3:40 PM
hmm
i understand the attack vector
 
mmm XSS attacks
 
but, what exactly do you mean?
@Jon how would i do that?
 
Jon
an xss attack?
 
nah, enocding the data when displaying it to HTML
 
Jon
you just HTMLEncode(data) before dumping it into a HTML
input boxes are nothing to worry about, as it is stored in attribute.
 
3:41 PM
couldnt it just be decoded? lol
 
Jon
But things like labels however, need to be encoded.
i forget which is which...
encode to me means < is changed to &lt;
 
yeah
i mean, i wrote all the html my self. i have get web methods retrieving data from my DB thru a .wsdl
so its not like im 'generating' html
 
Jon
ok, but if you display data on your webpage, you should encode just in case --- depending on the source of the data.
If it is read-only data, you technically dont' need to worry
 
sure, but couldnt someone just decode that html??
 
Jon
If they wanted to.. but that would happen after the page is rendered.
 
3:43 PM
hello sorry for disturbing, quick question: in console app how can ii write to read an integer form keyboard and show it's every third number? for example: A= 3297388765 and show 9 8 6
 
Jon
not during
XSS attack is when a page is rendered with a malicious script inserted into the page.
 
ah ok. so does xss work by intercepting the page load and manipulating it to do something different when it finally does run
oh, nice.
 
Jon
Essentially, you insert client side scripts
YOu can alter the page completely.. redirect requests to a different server
 
ie, if i added javascript here that posted your authentication cookie to my server
i could impersonate you
 
Jon
If this is done when rendering the user assumes the page is ok.
 
3:46 PM
hello sorry for disturbing, quick question: in console app how can ii write to read an integer form keyboard and show it's every third number? for example: A= 3297388765 and show 9 8 6
 
so lets say there is a SHA512 hash stored in a cookie - a password.. and another hash as the username
 
Jon
@user3313264 what have you tried?
 
could you just retrieve those two hashes via javascript
i mean, how safe are cookies?
 
@Bubbas in theory, i wouldn't care about their values. i could just take the entire cookie and put it in my own browser ;)
 
Jon
cookies are client side.
 
3:47 PM
int a = int.Parse(Console.Readline());
if (a % 3 == 0)
{
Console.Writeline(a);
}
 
Jon
If you hash+salt your password, it is quite difficult to crack.
 
yea yea
always
 
a cookie wouldn't have your password (hashed or otherwise) in it
 
well not literally
but the result of some hashing, yes
 
no
not in the cookie
 
3:49 PM
?
 
Jon
@user3313264 do you need to parse it as an Int?
 
normally its just the userid or username. no need to have any sensitive data in there
 
yes
@Jon can you help me?
 
its better if its also encrypted obviously
 
well sure
ssl you mean?
how about keeping a user logged in for x amount of time tho?
 
3:50 PM
yes as well as application-level
yeah you could add that as metadata to the cookie value as well, in case the user tampers with the expiry of the cookie
 
Jon
@user3313264 it would be easier to handle it as a char array.
 
okey thank you
 
Jon
string s = "8892734";
            int count = 0;
            foreach (char c in s)
            {
                ++count;
                if (count % 3 == 0)
                    Console.WriteLine(c);
            }
 
Jon
9
3
 
3:52 PM
rather, 93
because count incremented before check
 
Jon
correct.
 
my algo prof loves to slip us little gotchas like this all the time
 
Jon
did your homework for you
lol
 
@jon if youre going to have a count, might as well use a normal for (;;) than a foreach() ;)
 
she's a stone-cold bitch, but you will learn your shit with her
 
Jon
3:53 PM
well, i used the foreach, just to avoid grabbing the char array
but I guess you could rewrite it
for (int i = 0; i < s.Length; i++) then index the string
 
"8892734".Where((c, ndx) => ndx % 3 == 0).ToList().ForEach(Console.WriteLine);
 
Jon
He's a beginner dude :)
 
yeah so? I'm golfing ;)
 
Jon
for (int i = 0; i < s.Length; i++)
{
        if ((i+1)%3==0)
            Console.WriteLine(s[i]);
}
yeah, haha, well good show
you would need ndx+1 though
 
21
A: An unintentional-looking but crash-causing bug

Kendall FreyC# Let's just initialize a list of bytes with every byte value from 0 to 255. List<byte> bytes = new List<byte>(); for (byte i = 0; i <= 255; i++) { bytes.Add(i); } Out of memory? I distinctly recall having more than 256 bytes installed... Spoiler:

One of my favourites
 
3:57 PM
yeah
 
@KendallFrey What did you mean above?
 
Jon
@KendallFrey nice.
 
You mean "ergh"?
That's just frustration
 
Jon
its not an int... its a Byte, so when it hits 255 it increments to 0... endless loop
love it
 
@KendallFrey Oh, got ya. I really wish I could tell me project manager to just deal with not having an address.
@KendallFrey How did you do that for your "Spoiler". Where the text is hidden, then not?
 
Jon
4:00 PM
Yes. Tell us.
 
>! Spoiler
It doesn't work in chat
 
That is kind of cool, that works in Stack Overflow to?
 
18
Q: Why doesn't chat allow spoilers?

Kendall FreyStack Overflow allows spoilers in the form: >! SPOILER Example: Why doesn't chat support them? They would be quite useful, especially for rooms that are frequently off topic and often have dicussions about movies etc. Many other sites, like Arqade, would make even better use of spoilers.

Upvote this
Yes, it works on all sites
 
Cool.
 
Jon
today I learned
 
4:05 PM
today I derped around
 
If i check checkBox1, and then hide it with checkBox1.Hide(); , will the program still see it as checked?
 
thx
 
Jon
that would be shit functionality though
 
{ just asking }
 
4:09 PM
AHHHHHHHHHHHHHH
 
Jon
 
@KendallFrey Question, as a possibility could I use a Regex.Split to grab all characters up to a <br> then split at the next , and then space.
 
How to find the array length in C? do we hav any inbuilt function?
 
@SunilK strlen?
sorry, array length?
never mind me
 
array length..
 
4:11 PM
you can't
 
shouldn't you be initializing it...?
 
Jon
in c?
 
a constant?
 
yes in C
 
Jon
sizeof(array) / sizeof(int)
 
4:11 PM
you need to know the length when you create it, and thus you need to pass that value around
 
Jon
where int is the array data type.
 
unless he/she is writing a bad API and just takes in an array with no count. but otherwise you can follow Jon's approach.
 
Jon
Yeah, my approach kinda sucks... better idea is to keep track of the size
 
i m participating in a contest, thy only giv som function whr we can write the code.. the formal parametes are array like func(input1[],input2[]) ...
 
yeah, since the size of an allocated block is effectively stored alongside it (in the heap), or remembered and substituted by the compiler (on the stack).
You can use sizeof(ptr) to get the allocated size in bytes of that pointer.
 
Jon
4:13 PM
welp... lunchtime fer me.
 
However, it only works on the first address of the allocated block
Other than that, it's undefined behavior
 
Jon
later nerds @ShotgunNinja
 
Same rules as free(), actually.
 
there is no type for the parameters?
 
integer.
 
4:14 PM
To sizeof?
 
sizeof depends on the compiler....
 
Right, which is why it is frowned upon.
However, it is usable in some situations.
If an array is allocated on the stack (in the local scope), then most common compilers remember its size in bytes.
Some memory-tracking allocators provided by compilers and standard libraries track heap-allocations by prefixing them with a header before the first pointed-to address, which contains the allocation size.
In fact, it's on this basis that free() and realloc() works.
 
oh.. but how to access tht?
 
Whether or not sizeof uses that, though, is dependent on the compiler.
Use sizeof(array) / sizeof( type ).
Then test it.
If it works, you're golden (at least on that platform)
If it doesn't, try something else.
Then make a repeatable unit test out of it, so you can verify the abilities of your target platform.
Then, if you really want, wrap it in a function that uses macros or a simple conditional test to conditionally swap out behavior based on the capabilities of the target platform.
This is the wild-west engineering process for software development in cross-platform C.
 
@Greg you could replace <br> with a space
 
4:52 PM
I need to hardcode state names and codes as constants. Can anyone envision any major problems with using a static dictionary?
 
:)
 
What will you do when Puerto Rico becomes a state
 
move to russia
 
nothing
 
4:56 PM
@Shoe Business rule beyond my control.
 
How is something about your code a business rule?
 
Maybe it's dictionary software
 
WTF Stacy's Mom playing in a Cadillac commercial? lmao
 
lol really? weird.
 
Stacy's Mom has got it going...
 
4:59 PM
on
 
you have a problem with your lip
might want to see a doc
 
!!urban :3 2
 
@KendallFrey :3 A symbol meant to represent the cat face made by anime characters when they say something clever, or sarcastic, or are commenting on something cute.
@KendallFrey :3 Kinda the '~nya!'(japanese phonetication of english, kitty sound) of the internet. Used to indicate coyness, cleverness, anime-geekiness, cuteness and funny (if not questionably oafy) behavior.
@KendallFrey :3 an expression used to try to act cute, often used after something weird.
 
5:04 PM
wtf internet
that's a kiss
 
!!urban :*
 
@Steve :* An emoticon used to represent a kiss
 
that looks nothing like a kiss
 
well, the entire internet disagrees
 
That doesn't make me wrong
 
5:06 PM
yes it does, pucker your lips together, the creases make it look like a star
 
not like that star
 
a lot closer than :3 lmfao
 
no way
 
looks like you got punched in the lip and its all messed up
:3 annoys me almost as much as (:
 
5:07 PM
I've never even seen :* as a kiss, it was always :3
D:
 
every chat on the internet? facebook? yahoo, aim, msn
 
like I use those
 
@Steve looks more like kicked in the balls and really messed up
 
not my fault you're too young
:p
@JohanLarsson lol yeah, or that
 
:3 is not a kiss, and I don't see how anyone could think that
 
5:09 PM
Did someone say balls?
ಠ_ಠ
<|>
/ω\
@MikeAsdf to me it looks very much like puckered lips
 
if you only had one lip
 
wrong direction though
 
How to make it so if the text on a label is more then 30 letters then the program will make another label and continue the text... text is: Environment.CurrentDirectory
 
@MikeAsdf The whole array of emoticons is the wrong direction ffs
:) bad ^_^ good
 
at least they're mostly internally consistent
 
5:10 PM
@jyrka word wrapping
 
(_8(l)
 
morning kids
 
morning pa
 
@Shoe @@@@:-)
In the Visual Studio profiler, how can I differentiate between time spent sleeping and time spent executing in a function?
wait, how the heck does code suddenly fail to build?
 
It changes
 
5:18 PM
but it didn't
 
elves
 
sounds good
 
I made a question title: "Holy Expression Batman" and someone commented and said "What is Batman, is it a library?"
 
so have you guys called your congressman yet?
 
@Pheonixblade9 Yes.
Well, sent an email.
 
5:32 PM
email doesn't do much - call them :)
 
@Pheonixblade9 Alright.
4430
A: RegEx match open tags except XHTML self-contained tags

bobinceYou can't parse [X]HTML with regex. Because HTML can't be parsed by regex. Regex is not a tool that can be used to correctly parse HTML. As I have answered in HTML-and-regex questions here so many times before, the use of regex will not allow you to consume HTML. Regular expressions are a tool th...

Has to be the greatest answer, haha
 
5:48 PM
Most famous for sure
It even spawned an easter egg
 
Whats the easter egg
 
WHAT IS an easter egg?
 
type <[^>]*
 
<[^>]*
 
lol
that's awesome
 
5:56 PM
<[^>]*
lmfao
 
I oͮ̄̏̒ͪ͂͏͉̼ͅfficially hat*̶͑̾̾̅ͫ͏̙̤e yo̭̰̬̯̦̻ͣ̃ͪ͆̾ͅu Re̿̔̉gular Expre̿̔̉ssio̵̢͈̬̱͇̣̲͓̯͕̜̩͖̔ͬͫ͆ͨͤ‌ns, the re̿̔̉alm o͒̋͊̌ͪ̉̑ͦ͒̊̆͂̕͟҉̬̺͔̭͇̱̤͈̮̲̪̲͕̖̝̳̣͕f my sanity is dimi*̶͑̾̾̅ͫ͏̙̤nishing.
@KendallFrey Yeah, my favorite line was "Not even Jon Skeet can parse HTML with Regex."
 
what defines a regular langauge? tried googling it and the answer was:
regular language is a formal language that can be expressed using a regular expression.
which isn't very helpful
guess
sO > wiki
 
I think I broke it
oh the lag
gone now
protip: don't switch to a new tab after doing that
 
lol, easter eggs that purposely crash your machine
 
6:02 PM
@Pheonixblade9 My question is sparking some answers and comments, kind of stoked. Haven't had a question generate this much life in awhile.
 
The collection of regular languages over an alphabet Σ is defined recursively as follows:

The empty language Ø is a regular language.
For each a ∈ Σ (a belongs to Σ), the singleton language {a} is a regular language.
If A and B are regular languages, then A ∪ B (union), A • B (concatenation), and A* (Kleene star) are regular languages.
No other languages over Σ are regular.
simple
 
that doesn't say what constitutes a regular language
at all
 
it does, we just have no idea what it means
 
@Greg which?
 
yeah i'm pretty sure i know what it means
 
6:06 PM
Well, I have an idea
 
@Pheonixblade9 They changed my title from "Holy Expression Batman" which I think is why it generated so much buzz.
 
Yes, interesting titles are good at attracting attention, but distract from the real problem.
They seem to hate creativity on main
 
@KendallFrey I know, it was a good title and pertained to Regular Expressions.
 
@Greg Didn't you say that you had to scrape a different website for the address?
 
It was totally irrelevant though
 
6:09 PM
So changing the HTML to house address parts isn't viable?
 
@Shoe I'm not modifying the HTML, I'm grabbing the table and its inner contents and assigning them to properties.
Then writing them to a local file for import.
 
Right I'm saying change the HTML so the parts are easier to grab
Pretty indepth
 
Yeah, I'm reading it now.
@Shoe The only way I could modify the Html is if I clone the HTML Stream and manipulate that instead.
Plus I'm not sure how well that would pan out for the rest of my data.
 
So you are scraping it then?
 
no, he's working in a company with weird silos and a proprietary CMS.
 
6:15 PM
@Pheonixblade9 hahaha, my company is kind of weird.
 
So, I'm profiling my code with VS, and it shows 40% of the time is spent in one of my methods. How can I determine if this is primarily executing code or with the thread in WaitSleepJoin?
 
does it not show time for individual lines?
maybe it is dotTrace I don't remember
 
Well, I know that most of the time is spent in framework code
I don't know if I can view that though
 
maybe with .pdb files idk
 
FYI, it's enumerating over BlockingCollection.GetConsumingEnumerable that's showing the hot path
I'm pretty sure it's sleeping, but I want to verify
 
6:24 PM
@KendallFrey there's exclusive time and total time. you want exclusive time.
exclusive time means time spent within that method
minus time spent in other methods
 
Anyone know how to use browser protocol in C# ? i added registry entries to start my program, but how can i take a command (example kill the program) "myprotocol://kill" ?
 
sorry, inclusive time.
 
yeah, I know, but that doesn't help
inclusive time is ~0
 
@KendallFrey If it's a WaitSleepJoin, the concurrency profiler will tell you that
it'll give you the % of time blocked
 
where?
 
6:27 PM
it's in the bowels of the concurrency profiler results
 
where's that
 
but it shows up cleanly on the graph, if you zoom into that time slice
it's a separate profiler in VS
 
Ultimate only?
 
yes
I think so
 
defenestrate that then
any other way?
 
6:29 PM
how critical is this?
 
oh god my eyes this scrolling such lag
 
if it's really critical, I'd use ETW to measure it anyways
 
@ReedCopsey Not very, I was just instructed to investigate
 
and just flag the section start/stops that matter
 
what do you mean, starts/stops?
I have no access to the actual code that's running
 
6:31 PM
I wanna smack whoever wrote this shit
 
8 mins ago, by Kendall Frey
FYI, it's enumerating over BlockingCollection.GetConsumingEnumerable that's showing the hot path
 
@KendallFrey Oh, then it's very difficult
 
@Pheonixblade9 you can smack me instead
 
!!urban smack
 
@RodrigoSilva smack [Heroin]. Most frequently used in the 60s.
 
6:31 PM
!!urban confession session
 
@Pheonixblade9 No definition found for confession session
 
Hm, @Pheonixblade9?
 
it's a very circuitous C# engine built around a very circuitous sproc
I'm trying to make CurrencyCode configurable, but it's hard coded all over the place
because who would ever wanna change currency code, right? USD is only currency ever! HARD CODE THAT SHIT
 
Americans seem to be very reluctant to make internationalized apps. At least the ones I work with.
 
random thought: I've just started using bootstrap, I wish there was something similar to .NET
 
6:34 PM
@RodrigoSilva unfortunately it seems most bootstrap apps are built with PHP
 
I meant to desktop apps, sorry
I've used it with PHP aswell, just a fun project
 
there are theme libraries for wpf and such
mahapps
 
Are those the metro-style themes?
 
@RodrigoSilva Why can't you use Blender?
 
You mean Blend?
They are very different
 
6:38 PM
Blender?
 
yeah but metro and bootstrap have the same design concept
 
Also, Blend SUCKS
 
Isn't that for 3d modelling?
 
@KendallFrey Yes, sorry... I'm drinking a smoothie.
 
6:38 PM
He meant Blend
 
@Greg haha
Really, don't use Blend
It generates some terrible terrible code if you only give it a chance
 
@Shoe thing about bootstrap: there are great themes available, which completely change your UI
 
@KendallFrey But for a WPF application it could build a nice theme and template for him to use, if appearance is important.
@KendallFrey Plus there are free theme projects I thought
 
Hm, it's not important, I mean I'm not selling it or publishing it, just learning
I'm just a bit tired of the windows skin
 
I want to cry now. #expressionblend http://t.co/5lpZkjkRxK
This is why I don't use Blend
 
6:42 PM
What is that
@RodrigoSilva Bootstrap is designed like metro
 
I think I read a rule for when to create a dictionary and when to just use a list and linq
don't remember it
think it was something with creating a dict was expensive and not worth it for small lists
 
@Shoe I'll have a look into mahaps then, thanks
 
@JohanLarsson Depends on what you're doing, but dictionary creation is slow(ish), so just creating for one or two searches, especially for a small collection, will slow it down. Profiling is the only way to know for sure, though
 
yeah as always
was just fishing for some hard and fast ones :)
dictionaries reads pretty good in many situations so can be worth it any way
 

« first day (1287 days earlier)      last day (3658 days later) »