« first day (901 days earlier)      last day (4272 days later) » 

14:03
@KendallFrey Using IEnumerables to allow safe consumption of data from serial? Brilliant.
Should the beginning and ending 126 bytes be included in the packet?
yes :D
I updated the question with my own code that fails
As a recommendation, I'd say no; they're only supposed to be there to verify proper transmission, so client code shouldn't need to see them, right?
well I dont mind seeing 126's in the final result
Yeah, though generally, when I've written serial handlers, I tend to strip out any remaining "safety bytes" and just give the client code the payload data, whenever possible.
14:07
if anyone is good with facebook sdk I have 150 bounty here
1
Q: what is gr:get:User in Facebook Graph Api? Application Limit Reached Error

Scott SelbyI have an app using facebook's javascript and c# sdk. One day I was getting the error 4 : Application request limit reached. In the facebook app dashboard I see this. Too Many Calls - 1 hour, 50 minutes Method Fraction of Budget gr:get:User 115% gr:...

It makes the client code cleaner, since they don't have to deal with reading from *(a+1) or whatever.
Also, I'd put in a filter pass to decode those 126 values.
But again, that's just me.
What is this for, if you don't mind me asking? Business, academia, design project?
Well its academic
IEnumerable<IEnumerable<byte>> GetPackets(byte[] data)
{
	bool packet = false;
	for (int i = 0; i < data.Length; i++)
	{
		if (data[i] == 126)
		{
			packet = !packet;
			if (packet)
			{
				yield return PacketEnumerable(data, i);
			}
		}
	}
	yield break;
}

IEnumerable<byte> PacketEnumerable(byte[] data, int index)
{
	yield return data[index];
	do
	{
		yield return data[++index];
	}
	while (data[index] != 126);
	yield break;
}
IT WILL CRASH if there an odd number of 126's.
hmmm as I said the buffer length is 256 and there is no guarantee how many 126 will be there
To get an array of packets, do GetPackets(data).Select(p => p.ToArray()).ToArray()
You need to stitch buffers together?
14:12
no I just check for presense of the packet in buffer whenever the event rises that buffer is full
You only want one packet?
yes in each time the buffer fills up, I want the packet that is the most recent one, thats near end of the buffer
there is also a chance that there is no valid packet every once in a hile in the buffer
Is each buffer independent, or can packets be spread across multiple buffers?
you guys will not believe what just happened... I submitted an answer on superuser and it got accepted within like ten minutes :)
I believe it.
14:17
gratz.
well in case there is no packet in the buffer its just better to skip to the next buffer
so its not important to join buffers to figure out the packet
This spec is above my head. At this point I'd look at your code to try and debug it, but you haven't given any indication of what's wrong.
@Sisyphe thank you :)
you're very welcome.
that was free
@KendallFrey I just checked your code, it seems to work but why I get a multidimensional array that is being repeated?
14:20
It's an array of packets, each of which is an array of bytes.
here is the screenshot
ok array of packet, you mean the packets that were found in a single buffer?
so there was like 16 packet in the buffer?
and the lat one is the most recent one
correct?
I guess.
If you only want the last one, there are more efficient ways than getting them all.
:D such as ?
yeah in my own code I was trying to get the last one
Starting at the end, and stopping at the first packet you find.
thats why I checked for the last index of 126 in the buffer
and try to find the 126 right before that index
but it failed bugtime
edc
edc
14:35
I just learnt about Configuration-Based Activation for WCF last night
pretty neat stuff
Wow, am I stupid.
So I got the documentation for a new script event that's being programmed. And I went in to try and use it without updating the program. Of course it didn't fire.
Mmmm chocolate....
14:52
mmm code!
your test is successful
woo
lol, chat.stackexchange.com is HTTP 500'd
assemblyVersion = "$(current).$(current).$(current)." + (BuildDetail.SourceGetVersion.Replace("C", String.Empty))
...Cannot assign from type 'System.Object' to type 'System.String'
What the hell VB?
beautiful
15:07
How is that anything other than a string?
Hi All, someone knows how to retrieve data from a Jtextfield using c#? I am not able to see this field with any UI inspector.. any idea?
@MikeF Um, duh?
@Mike probably you declare assemblyVersion as a type
try doing this string aassemblyVersion = "$(current).$(current).$(current)." + (BuildDetail.SourceGetVersion.Replace("C", String.Empty)).toString();
It's declared earlier; I'm working with TFS workflow crap.
Is that VB? Doesn't VB use & for string concatention?
15:11
It can use both & or + apparently.
Yeah.
Maybe + is doing something strange I don't know about.
Does Replace return a string?
replace return a string i think yeah
What the hell VB?? Visual Basic?
because -> &
Or maybe I have something weird where it's not updating my process correctly.
sorry to barge in, I'm writing log data to a file and prefixing it with a timestamp. Which format should I use to make it easier to read latter (from different languages and whatnot)? I'm currently writing like this: DateTime.Now.ToString("yyyyMMddHHmmssfff", System.Globalization.CultureInfo.InvariantCulture)
15:17
1. Do you need humans to read the date later?
2. If so, why?
1. Probably.
2. For "manual" debugging.
wait, manual should have quotes. I'ts really manual.
So, human readable and computer readable.
I use yyyymmdd all the time and don't have a problem with it.
I supose that to read in C# I should use DateTime.ParseExact?
What would you sugest if it didn't have to be human readable?
I'd suggest what you have now.
15:25
you're welcome
16:02
hi guys
I have dev, prod, and QAS environment.....I am writing a console application...How to test from which environment the file path is....( some files are placed in folders in each servers..i want to grab those files) how to do that...
edc
edc
check machine name maybe?
Is there some good method to get an entire HTML page via HTTP and parse it as DHTML, to get acess to methods such as doc.getElementById() etc? I was testing with the webbrowser control, but that thing is slow and executes stuff like javascript. I only need the actual HTML file, not all of the pictures and ads on the page I am referring to
The only hard part is parsing the HTML.
66
Q: What is the best way to parse html in C#?

LukeI'm looking for a library/method to parse an html file with more html specific features than generic xml parsing libraries.

@KendallFrey Clearly, use a regex.
Oh... right.
Anyways, HtmlAgilityPack looks cool.
16:09
@KendallFrey strange thread, two almost identical link answers with such high vote count
@KendallFrey I found out about the HTTP stuff myself, and thanks for the tip
HAP is basically the way to go.
Yeah, HttpWebRequest will take care of getting the actual HTML.
and of course closed as not constructive
HAP looks cool
and also, I LOVE references
they completely stomp C++ includes with libs, and .h and...
installing a package is done within seconds
all of those haters can go to hell
however, there is a typo in the HAP. the function GetElementbyId is not named identically to the DHTML one
I would change that, but nvm
Anybody here know the internals of making new VS items, maybe as a template, so that like names can be auto-generated based on timestamps?
Have you looked at the built-in templates?
So, I'm trying to verify I'm looking in the right place for C# stuff
Normally I do MVC or the like, so I'm only web focused, so I'm looking at:
C:\Program Files (x86)\Microsoft Visual Studio 10.0\Web\WebNewFileItems\CSharp
I'm also using R# and I've got a basic T4 lined up, is what it boils down to
why does it take ~10 seconds to download the HTML from a page that is loaded within 5 seconds in any browser (including pictures!)
what is wrong there
16:36
@CBenni comcast injecting stuff?
@Pheonixblade9 lolwat
you mean the american media provider? I highly doubt so
as I am european
@CBenni It may have something to do with proxy detection.
mmh. Can I circumvent these issues?
Try setting HttpWebRequest.Proxy to null.
because firstly, it is highly annoying for testing
I am using WebClient instead of manually using HttpWebRequest
might that be the mistake?
16:39
I don't know what that is.
I use webrequest.
I found that in an Answer on SO
37
A: How can I download HTML source in C#

CMSYou can download files with the WebClient class: using System.Net; //... using (WebClient client = new WebClient ()) // WebClient class inherits IDisposable { client.DownloadFile("http://yoursite.com/page.html", @"C:\localfile.html"); // Or you can get the file content without saving it...

however, the proxy tip helped alot
client.Proxy = null;
fixed it. Thank you @KendallFrey <3
HttpWebRequest request = (HttpWebRequest)WebRequest.Create("http://foobar.com");
request.Proxy = null;
HttpWebResponse response = (HttpWebResponse)request.GetResponse();
StreamReader responseStream = new StreamReader(response.GetResponseStream());
string responseText = responseStream.ReadToEnd();
response.Close();
Mah code.
`using (WebClient client = new WebClient())
{
client.Proxy = null;
String str = client.DownloadString("http://mypage.com"); }
Looks OK
meh, how do I enter code here in chat?
I figured clients have a nicer syntax
I dont know about benefits of either
16:43
Ctrl+K, fixed font button, or 4 spaces.
ok, too late to change that now :(
no big deal
sup yall
A freaking ceiling.
ah, expected that answer ;)
16:47
gtg now. Thanks for you help, kendall
So, if I want to step into a method during debugging, but it just plain steps over, although it's a project in the same freaking solution... what's the issue then?
Did you press F11 to step into?
yes, yes I did
Is it a method or a property?
or an operator?
16:50
well, it's a method from an object which itsself is set as a property within global.asax
You could set a breakpoint inside the method to be debugged.
I did that, but it doesn't hit that breakpoint
So it's not just a stepping over problem!
Both are C# projects, right?
yes
I set the breakpoint at line 1 of the method I was about to step into
But as I said: it doesn't hit
How did you add your reference to the project?
As a DLL reference or a project reference?
16:55
oh... good one
let's check
(this is a SEC project, or Someone Elses Code :P)
oh :P
Hate dem.
How can I check if it's a DLL or project?
"project"
Try selecting the reference, and check the Description in Properties.
it doesn't say anything in the Description, but it does say 'Assembly' in the File Type
16:59
Check the Specific Version property.
it doesn't have that :P
Yeah, it looks like a project reference.
it has a 'runtime version' and 'version' property though
Yeah, they're not important right now.
wait brb
17:04
Hi
i had a problem in windows service...
How can you ignore a Task.Run() await warning in an async function?
what warning?
my windows service is fetching files from C:\windows\syswow64
is it possible to change it
?
@KendallFrey "Because this call is not awaited, executing of the current method continues before the call is completed. Consider applying the 'await' operator to the result of the call."
17:06
Yeah, so when you call the method, put await in front of the call.
error number plz?
I just want to look it up
1 message moved to recycle bin
@KendallFrey I think it would be CS4014
@KendallFrey Ouch, not even gratified with a response.
hi
@KendallFrey why?
17:08
double-posting, apparently.
@Bhuvan Set the working dir.
> you can suppress the warning by assigning the task result of the call to a variable.
Do that.
But I don't need a variable :(
Using a pragma should be a last resort.
Just make a junk variable. No big deal.
17:10
Async methods expect you to generate a Task around them by calling them with the await keyword. Capture the Task, and just do nothing with it.
@Roelvan thank you do you mean like this Directory.SetCurrentDirectory(path) ?
@Bhuvan That works.
That was a legitimate question only if he didn't know what terms to search for on Google.
i did this in onstartevent of windows service... but one of my third paryt dll accessing the C:\windows\syswow64 folder
do u think am i fool to ask a legitimate question here
@shotgun
17:13
Not able to do this
any help guys
Maybe you should .. you know, read. And learn. It can help.
2
What is the fastest container for an undefined length of headers?
List<string>?
Probably.
@Johan - Did u see v2?
I just about broke my ankle last night so I get to hang out at home today yay
@Roel - Couldn't you use an IEnumerable with yield return to build? How are you getting the headers.
17:29
damn women
anyway @Kendall I'm back
blarg, deploying production website over FTP, one file at a time, with non-automated backups that need to be made.
If something goes wrong with this deployment, I may be here for several hours extra.
This should not be that hard. It's only 17 files.
Fucking work, and their lack of actual productivity tools...
shoots self
@TravisJ yep saw v2 made a minor edit, sry to hear about the foot
Do you like the new format?
I will make the edit interface nicer next
17:33
And perhaps a more friendly user interface for kendall :P
Yes please.
lol you are a kind man
Ah I found the issue Kendal
It still isn't very wiki-y.
17:34
WHy are you complaining? You're willing following a broken process? WHy not create a better one?
Back up files through FTP , ZIp first. FTP Files up, RDP into the server and then deploy.
@TravisJ I think I would prefer the guidelines higher up as they are the most important
It never ceases to amaze me how many people spell my name Kendal.
This property which contains the method isn't set yet when I call it. It's kind of a Singleton pattern. During initialization it throws an exception
What would make it more wiki-y? I looked at a handful of other wikis before making it
Kendalllllll
17:34
Kendoll!
@TravisJ Dunno. Heh.
@RyanTernier Yes, Mr. Turdier.
@Johan - I am not sure how to make them show higher. I tried to make a play on the stackoverflow q and a format, and even here it is hard to see the answer when you first arrive at a question
@Johan - Would you want me to remove white space, rearrange some elements, or do you have an idea how to get them higher? I could scroll you to them when the page loads or have it load to that specific area
@TravisJ I was thinking maybe skip the q&A and go straight for guidelines but idk
but no biggie
Yeah, the question part seems just a bit cheesy.
Yeah, the text can be rewritten. I just wanted something unique.
Everyone else's wiki starts with DON'T ASK QUESTIONS ABOUT OTHER STUFF and then goes on to rant in sections with caps or varying levels of bolded text
17:41
@TravisJ My issue with it is that is uses a lot of screen, using crappy low res laptop and have to scroll to see the guidelines
also the top row uses a fair amount of pixels
@Johan - Scrolling will always have to happen though. Not really viable to have it all on one page without scrolling. What is your resolution?
not being like 'that' here, really appreciate the effort and it is nice
No its fine, I like the feedback
As long as it is constructive
1366x768 pretty low end (gf's laptop)
Hm. A regular expression to match a slash and content without a space behind it, I believe it would be like this, \/([^ ]+?) but that does not seem to work. What obvious mistake did I make?
The content is optional.
17:44
blergh. Just deployed code onto the (very busy) live server...
Waiting for complaints from the users.
@RoelvanUden You want + instead of +?
@RoelvanUden why +? and not * as for the other not sure but try [.^ ]* (guess x2)
Actually, make that *
+? is not an optional +
17:46
forgot to upload a page
@Johan - hm, the resolution I use is 1024*768 so it should be pretty similar
Ahh. @KendallFrey, @JohanLarsson, thank you :)
+? is a non-greedy +. Which means it won't match more than one unless it has to.
You think it would look better with the question part completely removed?
+ is 1..* and * is 0..*. Hence, what obvious mistake did I make :D
But thank you :D
17:48
Let me see if I can remove some white space
@RoelvanUden you could also match on word boundary think it is /b
What if he has non-word symbols?
idk. lol
@KendallFrey then it is not ideal
My protip: \s will match space, tab, and newline. If you want that.
17:50
Protip accepted
^^' thanks, good catch
is \S anything but whitespace?
yep
lol I never use those. Maybe I should.
@RoelvanUden I use this extension for regex, nice integration in vs
did not use it now cos no vs :D
Is chocolate habit-forming?
@Johan - okay, I removed some whitespace
17:54
@TravisJ maybe my thinking was that if a user just clicks through it he should be exposed to the guidelines
@Kendall - I supposed the caffeine in it could be
Yay! I'm an addict!
@TravisJ Guidelines fits on crappy laptop now
High blood sugar must be why these days are going so slow.
17:57
the puppy was ballistic tonight 3.5 hours of indoor galloping just ended
var Match = null as Match; look, C#-ala-VB!
That is wrong on multiple levels.
I count 3 WTFs
Match m = null?
It is funny because the compiler goes "Sure bro, I'll compile that ugly shit."
18:01
did you threaten him?
@Darek new session tonight?
The last one was pleasant :D
yes indeed
18:20
welp, screwed up big time
bad deploy to a production server
massive database errors running rampant
because there's no central documentation about the condition and history of each server. Gee, maybe we should move away from CVS and FTP...
oh, I feel your pain
18:38
guys I'm off, finally
and now I just reverted the site back to the most recent versions of all the files, and there's still an error being generated. It's even worse than it was when I broke it.
Just in one spot, though; everywhere else is back to normal.
That feel when you fix a bug and it ends up broken worse.
That feel when your coworker is stuck on a problem, you come over, reduce it to basic math theory, and then find that LINQ already does everything you wanted, because you reduced it to basic math, and then R# converts it to a single method chain.
aka magic
@jcolebrand code?
ok I cleaned up the user interface a bit
18:53
TravisJ how long before your foot is ok?
also is there a place for
I hate it when this happens.
3 weeks

C#

General discussions about the c# language, Squirrels | gist.gi...
I hear a message box, but it doesn't appear.
somewhere to the right
18:54
You mean the activity bar?
meh my multi message failed pretty hard
don't know the name for it
Unfortunately stackoverflow does not offer an api for the chat rooms and I did not want to scrape their site every time our wiki had a request
ok but maybe the thing can move to the right?
Sorry I was away for a while. What's are you asking about @Johan ?
My chat with @Steve ?
from yesterday?
@Darek just fishing for another session like the one last night :D I enjoyed reading it
18:57
That was FUN!
Unfortunately I did not get to meet Uncle Bob
I enjoyed that too
Anyone knows Erlang around here?
that's what tehy showed last night
@Johan - Do you want it on the other side of the title, or do you just want it more centered
But I am soooo lost
Dear AVG AntiVirus,

Please do not ask me to restart my computer in the middle of the day.

Seriously,
Kendall Frey
18:58
Never heard of Erlang :(
How about Modula-2?
@Darek I can ping a guy in c++ room for you and ask him to come
Nah
It will be a weekend project to figure it out
@TravisJ I was thinking move it to the right column

« first day (901 days earlier)      last day (4272 days later) »