« first day (1410 days earlier)      last day (3548 days later) » 
00:00 - 21:0021:00 - 00:00

12:00 AM
Well, it will vary. Based on TextFileLogger, EventFileLog, and other items.
 
no, what is the content?
that you're passing into here...
 
@ReedCopsey ?
 
public void LogMessage(params string[] content) - what are you passing in as "content"?
because right now, the output of this makes no sense - I don't think it does what you want ;)
 
Date, Title, Priority, Message
 
just those words?
or one string like that?
as I said, right now, you're just writing a bunch of booleans to the file :)
 
12:04 AM
Title: Some Area
Date: January, 19th, 2014
Priority: High
Message:
Some content data, and etc.
 
as one string?
like that?
 
I finally convinced my lead to do some pair programming for a day or two until these two problems are resolved
 
No, it is broken down. That is why I have them as separate properties with the anonymous type.
 
what you have makes no sense - the output you'd get would be garbage
this uses the same output, but you probably want something more like:
oh, oops
 
?
 
12:07 AM
internal class LogItem
{
    public DateTime Date { get; set; }
    public string Title { get; set; }
    public string Priority { get; set; }
    public string Message { get; set; }
}

public class LogToTextfile : ILogger
{
    private BlockingCollection<LogItem> queue = new BlockingCollection<LogItem>();
    private bool running = false;

    private void Start()
    {
        var th = new Thread(() =>
        {
            var filename = ConfigurationManager.AppSettings[@"TextLog"];
            foreach(var log in queue.GetConsumingEnumerable())
forgot something :)
 
..?
 
0
Q: First group header not displaying properly in Listivew

DemCodeLinesI am working on a Windows Phone 8.1 app in XAML and C# and when the data loads, the listview doesn't show the group header for the first group of items. Here is my code: Player.xaml <Page x:Class="TestApp.Player" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xml...

 
@ReedCopsey I'll analyze that, how was my overall approach?
 
Edi
@KendallFrey I made it
thnx anyway
 
@ReedCopsey Can you explain your code for me, line by line?
 
12:20 AM
tomorrow, if you want
but need to leave :(
 
Okay.
 
It's always nice when you check your bank balance and it's more than you remembered.
aaand then you pay the bills
 
Anyone?
 
 
1 hour later…
1:44 AM
Oh goodness, what do when you walk away from coding for months and come back to errors.
I'm not even sure what the hell I was doing here.
 
2:35 AM
@KendallFrey Miss me buddy?
 
 
6 hours later…
8:10 AM
Hai.
Does anyone know the reason why this class is inheritable but totally unusable? referencesource.microsoft.com/#mscorlib/system/io/…
I mean, the darned buffer is private.
 
I don't suppose you have any tips for resolving a reference conflict? I can't work it out to save my life.
 
Explain a bit.
Do you mean, like, referencing two versions of the same assembly?
 
Yeah
That is what it is saying
 
Under what context? Desktop app, ASP.NET, etc.
 
I have my solution split into three projects
It's complaining about Razor, MVC
 
8:14 AM
Hm.
 
I had access to my computer remotely until about a minute ago and now I've lost connection sigh
 
I've hardly used ASP.NET, but, as far as I remember, references are in web.config, right?
 
Found conflicts between different versions of the same dependent assembly that could not be resolved
It is suggesting that it adds some redirects automatically, but that sounds like a copout to me
 
So a solution would be explicitly declaring the version you need, wouldn't it?
If that is even possible - that I don't know.
 
I have opened the CSPROJ files in notepad to take a look and the projects did reference a different version of 'system.web.mvc' so I just copied and pasted so that they were all the same
 
8:17 AM
In one of my desktop/mono apps, I actually load into the appdomain plenty of versions of the same assembly.
Most common, mscorlib.dll, because it needs more than one version of .NET sometimes.
So the runtime itself has no problem with multiple versions.
 
hmmm
I need to get access to my comp again and then I'll have more info
 
Is it even legal to copy methods from Microsoft's reference code?
My classes are literally useless due to their messed up access modifiers.
For the binary writer, I got away with creating a new buffer for personal use, but reading is a totally different business...
 
lol you've lost me now :(
 
8:35 AM
Look. The method to fill the buffer is protected, but the buffer itself is private.
 
 
1 hour later…
9:58 AM
posted on August 26, 2014 by Scott Hanselman

A few years back Phil Haack wrote a great article on the dangers of recurring background tasks in ASP.NET. In it he points out a few gotchas that are SO common when folks try to do work in the background. Read it, but here's a summary from his post. An unhandled exception in a thread not associated with a request will take down the process. If you run your site in a Web Farm, you could

 
10:40 AM
Anyone here familiar with enabling Traces on WCF please? Used this code: msdn.microsoft.com/en-us/library/vstudio/… read/write profile on Application is enabled. Full trust as well.
 
10:56 AM
hey guys, i need a little help from you =]
i have an executale file on my website, and i want to load that into the memry of my application
on the internet i founded only with local "file path"
it useless, cus i dont want ti download the exe from the web
i want directly load it into the winform app
can someone help me?
 
@KraziiKiiD You have a WinForms app running locally, and you want to load an external EXE/DLL that sits on a remote site?
 
@AvnerShahar-Kashtan yes
i wrote only this 2 lines:
byte[] exeBytes = webClient.DownloadData("site.com/file.exe");
MethodInfo entryPoint = Assembly.Load(exeBytes).EntryPoint;
 
Ah, ok, for reflection. That's what I was going to ask.
 
yes, but after i dont know what to do
 
What do you want to do with the executable?
Instantiate an object defined in it?
Run the Main() method?
 
11:04 AM
run the main
 
Now you have a MethodInfo. You can call Invoke on it.
Since it's a static method, you don't need to pass any value for the first parameter.
/afk
 
ok
if you come back, tell the right parameters, cus i remember i got a example from a website, and i was stucked in entrypoint's paramether when i invoke
 
Try it.
Run it, see what happens.
 
but i cant just write entryPoint.Invoke();
 
Main() expects one parameter, a string[] of the command line arguments.
 
11:16 AM
but im not in a console app
ok hold on ill choose console app
 
@KraziiKiiD Why not? It takes two parameters. The first is the instance on which to invoke it - it's static, so pass it null. The second is the parameters passed to the method. In this case, an object[] containing one value, the string[] that is passed.
@KraziiKiiD The remote EXE is not a Console app? If it isn't, your EntryPoint isn't really useful.
 
the remote exe is a windows app
and the one i want load load it in is console
 
Is there a reason you don't want to simply execute it?
 
yes
and i find it more secure my app this way
if you load the byte's from it into "and empty" console app
so this way, how can i load into the assembly?
 
WinForms or WPF?
 
11:19 AM
winforms
i load from winform into a console
 
@KraziiKiiD It's not "secure" in any way. Don't kid yourself in that area.
 
@RoelvanUden but it's secured than other things i've done
 
I have no idea what kind of language that broken sentence is supposed to represent. Or more plainly: what?
 
So make your host program a WinForms project as well. In your host's Program.cs, rather than calling Application.Run(new Form1), instead invoke your guest EXE's Main() method.
 
@AvnerShahar-Kashtan my host program is windows form
 
11:23 AM
Didn't you say it's a console app?
 
console app is the one i want to load in the host program
:18495716  static void Main(string[] args)
        {
            var client = new WebClient();
            byte[] exeBytes = client.DownloadData("site.com/program.exe");
            MethodInfo entryPoint = Assembly.Load(exeBytes).EntryPoint;
            entryPoint.Invoke(null, );
        }
something like this i suppose
 
Wix or powershell ? okay, wix seems to be a bit user friendly but powershell is powerfull and flexible is what i heard.
can you guide me some link where i can start >? i have a large win form app, web applications and windows services to be deployed as single package and multiple installstions..
 
@shakthi Powershell isn't an installer tool. Is that what you're trying to use it for?
 
@KraziiKiiD entryPoint.Invoke(null, new object[] { new string[] {"my", "commandline", "args"}});
Although it might fail because a WinForms app doesn't have a console window associated with it.
You might need to call Win32's AllocConsole: pinvoke.net/default.aspx/kernel32.allocconsole
Ooh, I just saw that the indexed-property syntax proposal for C# (myobj.$property) was withdrawn.
At least for the coming version.
 
11:47 AM
@AvnerShahar-Kashtan but my commandline args, what do you mean by that?
 
@KraziiKiiD You're running a console app, right? Console apps expect args. If you have none, pass an empty string[].
 
@AvnerShahar-Kashtan yes ok
 
11:59 AM
@TomW Any experiences with configuring IIS 7.5 ? Im currently trying to consume it's webservice WCF on my localhost asp.net app and it works just fine. When I upload the asp.net to server 2008 and try to consume it through that website it says BAD REQUEST. It seems that it cannot access its own WebService.
 
i get this error An unhandled exception of type 'System.Reflection.TargetParameterCountException' occurred in mscorlib.dll

Additional information: Parameter count mismatch.
entryPoint.Invoke(null, new object[] { new[] { "" } });
 
@Marek I'm at work so I can't spend long
what do you mean by 'upload'?
i.e. what's your deployment process?
 
@TomW I created website on IIS.
 
is that it?
 
Yes.
Same proccess as on IIS 8
I think it cannot access its own WCF through website that is deployed on same server.
 
12:11 PM
@KraziiKiiD What's entryPoint? Look at it in the debugger. How many parameters does it have?
 
@AvnerShahar-Kashtan i dont see
 
@KraziiKiiD What's the method name? Does it correctly point to Main? If you call GetParameters on the MethodInfo, what does it return?
 
@AvnerShahar-Kashtan entryPoint.GetParameters(); it doesn shows what is returning
 
12:26 PM
@KraziiKiiD It returns an array of ParameterInfo. Open it in the QuickView window to see the values.
 
@AvnerShahar-Kashtan and at the return parameter?
 
Are you sure this is a .NET console app?
 
@AvnerShahar-Kashtan of course
 
Oh, you were looking at the ReturnParameter.
ReturnParameter is void. It's irrelevant.
it's the void in void Main(string[] args)
Drill down into the base, which shows you the properties that the MethodInfo inherits from MethodBase.
 
12:41 PM
I'm guessing it's obfuscated.
And if you call GetParameters() on it? In the QuickWatch window just call entryPoint.GetParameters() directly.
 
12:56 PM
ok
@AvnerShahar-Kashtan it says: System.Reflecton.parameterInfo[0]
 
@KendallFrey stop abusing the system
22
A: The automated Stack Exchange / Feeds user is now participating in chat

Marc GravellIf you mean this one: The important thing there is the deleted message immediately before it, which was: translate: H4XX0RD! So, try typing: translate: チャットは今翻訳をサポートします。 The "post a translate message, then delete it" is arguably abuse of the system. If people don't get over that, I will ...

 
@KraziiKiiD In that case, your main method expects no parameters, so you can safely pass it null for the Invoke method.
 
@AvnerShahar-Kashtan you mean: entryPoint.Invoke(null); ?
 
1:13 PM
entryPoint.Invoke(null, null). The first parameter is the object instance, the second is the parameters passed to the method.
 
Hello all
any one here have worked on sending push notification to iPhone ?
 
did you just curse?
 
@JaiSoni why not go to the iOS chat room?
 
@NETscape I hv to write server side code.. for sending notification
 
1:20 PM
@JaiSoni right, and the iOS room will know more about how notifications work than we do
 
@NETscape thank you.. I will try my luck there
 
@NETscape I wasn't abusing it. I was testing it
4
 
2:09 PM
@ReedCopsey Why do the select not make sense? Isn't that being used to siphon data out of the params string[]?
 
2:24 PM
@Greg this is kinda straight forward. The thread will spin until a new item becomes available in the BlockingCollection. It's appending a message to the file. @ReedCopsey can correct me if i'm wrong
 
@NETscape That makes sense, I didn't know that. So what would be the correct way to take the items out of the params string[] then to place into that internal model?
 
using params string[] doesn't sound safe... someone could pass you anything in there, it might have data you expect and it might not.
Why not have a public void AddMessage(LogMessage[] messages) or something
 
Well, I'm using DI so I'm specifying the data for the log.
 
@ReedCopsey was saying what you had didn't make sense because you're using .Contains("___") which returns a bool
 
@NETscape Oh.
@NETscape What should I use to find then?
 
2:40 PM
give me an example of what you would call to LogMessage(params string[] content)
 
Well, it would be:

public class SomeMethod
{
       private ILogger logger;
}

So when I actually call.
So I would be declaring which implementation I'd want to pass to it to build out params.
 
2:59 PM
@ton.yeung whuh?
oh, a merger
 
Can anyone tell me how to get Visual Studio 2013 to skip from a web page to a backend web-service? It appears to be skipping my breakpoints.
 
Are the breakpoints actually loaded?
If they appear as a hollow circle while running, that means the symbols aren't loaded.
 
Yeah, they are. The problem is, he has this dumb approach to push data straight through JSON to a web-service in my solution. But it doesn't show it hitting the service load at all.
The service is called at Page Load, but it isn't called when you press his buttons.
@ton.yeung Yeah, the Page_Load apparently calls the service when certain line items are added to the cart, but when you press button it isn't triggering the call to the service.
Seriously, who thought it was a good idea to build an entire shopping cart with fucking Javascript!
@ton.yeung Yeah, he is doing an ajax post to the other page. From the button it doesn't trigger correctly.
@ton.yeung Well, I found a bad call through the process order with Javascript.
 
3:35 PM
@Greg for DI, you should have multiple method signatures like
void AddMessage(DateTime date, string info, int severity, string extraInfo);
void AddMessage(DateTime date, string info);
void AddMessage(DateTime date, string info, int severity);
 
@NETscape Yeah.
@ton.yeung So here is the problem he used jQuery, which the page doesn't use.  Only vanilla Javascript:

orderObj.push(new Array('International', $("#chkInternational").is(':checked').val()));

orderArray.push({ 'Property': 'International', 'Value': $("#chkInternational").is(':checked').val() });

How can I fix those two commands?
@ton.yeung Should I just call it as a function to return true or false for either or then just have it put that in there instead?
@ton.yeung Looks like we are on the same page, you see what I'm maintaining :(
Because it will break some jQuery Money library they decided to use.
But it is saying those lines are undefined.
 
In the words of my son "Good Morning, butt"
 
4:12 PM
@NETscape I should of been using where rather then select probably?
 
@Greg you show me an example you would pass the the function
LogMessage("Title = An error 1 Priority=5 Messages=Something Bad Happened",
"Title = An error 2 Priority=1 Messages=Something Bad Again",
"Title = An error 3 Priority=2 Messages=Something Bad, nevermind")
or is it:
LogMessage("Title = An error 1", "Priority = 5", "Messages = Something Bad Happened");
 
4:29 PM
The first one.
I'm collecting and passing to the method.
 
why not just do LogMessage(string title, int priority, string info)?
because LogMessage(params string[] content) is more like a LogMessages (plural)
or LogMessages(List<ILogMessage> errors)
 
Well, I'm wanting to pass more than one Log Message, adding a plural to the method isn't a bad idea.
 
5:26 PM
0
Q: A little bit of string cast

GregI've got some code I'm maintaining, the code was poorly written but in apart of my refactor I came across a ToString() attached to an ExecuteScalar. My question would be, does the usage of ToString() equate to: (string)command.ExecuteScalar(); Or would it represent this: command.ExecuteScala...

 
Anyone ever do XML Schema validation using tools like Schematron/ Relax NG?
 
jon skeet with an answer
 
Jon Skeet is the answer
 
@ton.yeung Done.
Someone actually down voted the question.
@ton.yeung The reality of it is, you really shouldn't use ToString() on the scalar if your expecting data to be returned.
 
I have never seen it done that way
@Greg what does the code actually look like
 
5:34 PM
I forget - if ExecuteScalar returns DbNull.Value, that isn't seen as null by as string is it?
@Pheonixblade9: Quite possibly, depending on context. – Jon Skeet 27 secs ago
SWOON
 
Well, the person had it like this:

                using(SqlCommand command = new SqlCommand(query, connection))
                {
                    connection.Open();
                    command.Parameters.AddWithValue("@BillingEmail", bEmail);
                    command.Parameters.AddWithValue("@ShippingEmail", sEmail);
                    id = command.ExecuteScalar().ToString();
                    return id;
                }
Which always breaks if the two parameters don't exist in the table it queries.
So I was trying to see what it was similar to:

                using(SqlCommand command = new SqlCommand(query, connection))
                {
                    connection.Open();
                    command.Parameters.AddWithValue("@BillingEmail", bEmail);
                    command.Parameters.AddWithValue("@ShippingEmail", sEmail);
                    id = command.ExecuteScalar() as string;
                    return id;
                }
 
well if a query requires params, that makes sense. What's the query?
 
That is what I thought was correct, as the (string) would also throw an exception.
string query = @"SELECT [AccountID] FROM [Account] WHERE ([BillingEmailID] = @BillingEmail OR [ShipEmailID] = @ShippingEmail);";
Should I add that to my question?
 
@Greg i generally use a data reader on a select...for inserts i do something like:

 using (SqlConnection conn1 = new SqlConnection(connection))
            {
                SqlCommand cmd1 = new SqlCommand(@"command", conn1);
                cmd1.CommandType = CommandType.Text;
                conn1.Open();

                string Value1 = txtValue1.Text;
                cmd1.Parameters.AddWithValue("@value1", value1);

                string Value2 = txtValue2.Text;
                cmd1.Parameters.AddWithValue("@value2", value2);
i wonder if he was trying to insert while returning the scope identity for later use
 
Not sure, but the code doesn't work.
@Skullomania @ton.yeung Is that better?
@Pheonixblade9 I modified the question.
@ton.yeung :( Is that good or bad?
Well, how could I keep the same question with the proper context.
 
5:47 PM
@Greg In the original code is he using an insert?
or select?
 
SELECT
My refactor to as is correct approach then.
 
@Greg it looks as though it would work...I would test with a response.write just to see what you get back
say you guys had to make a survey that asked the same 6 questions about 40 departments. is it possible to build the table in sql so that you only had to do one insert?
if so how?
Fruit|Do you like this fruit|Sweetness|Sour factor|
--------------------------------------------------
apple|
orange|
lemon|
 
I changed the question, what do you think.
 
now on the questions the user would need to rate 1-5
 
@Skullomania dont forget using(SqlCommand) as well as its IDisposable
@Skullomania 1 insert for the questions or the answers?
 
6:04 PM
@ton.yeung I have one table for departments....so its a lookup for the table for results
 
lol, just do (PK, METADATA) for columns and insert ('{ questions: [], answers: []'}
boom. done.
or use a database thats better suited like mongo
looks interesting
graph is all the rage these days... next year its gonna mesh or something. kills you to keep up almost
they (people smarter than me) should just build one called "thedatabase". it can be relational, document, graph, mesh, a mix, everything all at once
 
@ton.yeung what do you mean?
 
morpheus lied a lot
 
oh. my boss thinks all that stuff is BS. He would rather I work on projects than tests
 
he really should have said, knowing how to learn shit on the fly makes you the good engineer... cuz no one got time to learn anything these days
and the script kiddies dont bother
oh, but we keep hiring the idiots anyway
 
6:12 PM
I should rephrase
Being a good engineer is not knowing the latest tools. It's about knowing what tools are out there and being able to select the right one for the job.
 
"Did you learn html yesterday?" "Yep" "Welcome to company. Your our tech lead for a million dollar a year website now"
 
Trying to know every tool out there is useless. There's a new random framework out every day. Just be able to learn the tools and select the right ones
 
@Pheonixblade9 ditto
 
using the morpheus meme just makes me sound like a pretentious asshole
(like most Morpheus memes)
 
morpheus believed
i dont think he knew anything
however since we are on the subject of the matrix...did any of you watch the animatrix?
 
6:19 PM
@Pheonixblade9 That's what my uncle would say about cars. He is an expert mechanic... if the vehicle doesn't have wires in it.
 
@Skullomania That was the weird one that didn't belong, right? I did
 
@ton.yeung it was...i liked it...i do have a couple of issues with it didn't really explain how that kid woke himself up
@KendallFrey the guy who was running?
 
The Animatrix (アニマトリックス, animatorikkusu) is a 2003 American-Japanese-Australian best-selling direct-to-video anthology film based on The Matrix trilogy produced by The Wachowskis, who wrote and directed the trilogy. The film is a compilation of nine animated short films, including four written by the Wachowskis. It details the backstory of the Matrix universe, and the original war between man and machines which led to the creation of the Matrix. == Plot == The plot-summaries of the shorts are listed below in the order that they run in the DVD release, which is not the chronological order....
 
I don't remember it, I basically tried to forget it.
 
thanks bot!
it tells the story before the war...how it started
its actually pretty good..but it leaves holes
some of them made no sense
any cooks here...im trying to eat a beet. and it taste like it don't want me to eat it
 
6:28 PM
// thoughts on Get routes... search by level:

// only debug
?level=debug

// debug and higher
?level=debug+

// debug and fatal
?level=debug,fatal
 
@CharlieBrown + is usually reserved for a space in a query string
that or %20
 
yeah, i need a valid character for "and higher"
?level=>=debug is valid, but ugly as sin
 
@CharlieBrown why does it need to be a character?
?level=debugplus
 
That makes me nauseous
 
@Pheonixblade9 doesnt need to be, but it needs to be a character that wont be used as a level name
?level=[debug,]
// multiple
?level=debug,info,warn

// range
?level=debug:warn
?level=:warn
?level=debug:
 
6:44 PM
If you have a long code base, and you don't use using for your database is it possible a command declared above could still have a reference on a lower command?
 
 
1 hour later…
7:50 PM
Is no one actually here?
 
What if nothing is real?
 
No, actually no one
@RodrigoSilva How Can Mirrors Be Real If Our Eyes aren't Real?
 
#jaden
 
8:40 PM
Think i started a new trend at work... lunch time counter strike:P
 
"new"?
 
@RyanTernier I think I started a new trend at work. Lunchtime gin and soda. Oh wait. That's just alcoholism.
 
on a serious note... you consider a gin and tonic at lunch alcoholism? My dad used to have 4-5 fingers of Rye a night after work with his inner circle.
 
@RyanTernier I was also joking :D
 
Is there an easy way to navigate to another page with Javascript and automatically login to that page? Or even C#
 
8:54 PM
@Greg not really, it can be challenging. Often people use headless browsers to do that for scraping or something similar
 
00:00 - 21:0021:00 - 00:00

« first day (1410 days earlier)      last day (3548 days later) »