« first day (1411 days earlier)      last day (3532 days later) » 

5:58 AM
and here i am again
hi all
nerds :)
 
Hi, nerd.
And others.
 
6:36 AM
sup
 
Digging MVVM.
Can't get shit about templates and commands and stuff.
 
im just into MVC
anything MV is unknown to me :P
besides MVC that is
 
Well, just 9 months ago I knew nothing about programming. Well, almost nothing. So MVVM seems quite unusual for me atm.
Isn't MVC similar to MVVM?
 
in a way yes.
like mvp
mvvm etc
 
Like you got a DataModel, visual appearence (View) and sorta controller.
By the way, how many people code using WPF in here?
 
7:09 AM
WPF not me.
 
i need help regarding system context menu (right click menu).
i need to create an custom entry for my application with icon
and need to select multiple files to invoke my application
i have searched it over, but found all solution written in cpp i need any help class which is written in c#
 
 
1 hour later…
8:32 AM
Hello, anyone online that can help?
 
Do you know if it'd be bad to have tons of instances of a class? E.g. like 500+, 1,000+? By class, I mean a custom-written class that processes data received from clients on a server asynchronously(each client already has a trhead, but not a class).
Thread*.
 
It depends, as many things do.
Do you instantiate all of them in advance? Do you create them on the fly?
Do they have a heavy/slow constructor?
Do they hold resources that need to be freed?
Not enough information. :)
 
On the fly. Each class is created as a client connects to the server. The constructor is pretty simple and not processing intensive.
Each class holds 2 buffer classes(custom: 512 bytes each of memory) and a TcpClient class instance.
 
Wait, you have 500-1000 threads active?
 
8:38 AM
No. It's a possibility though, depending on the number of connected clients.
 
You'll probably run into problems with oversaturation of threads before your classes start being a problem.
 
Ah.
 
@FatalSleep 1000 threads is what is going to kill you. Class instances are not a problem, you can have millions.
 
So it'd be better to merge threads to cut down on the amount of them?
 
There isn't any universal problem with having thousands of instances of a class. There might be a problem if the constructor's buffer allocation is slow (shouldn't be) and then you can try to reuse connection objects, but I'd wait until you see there's a real problem.
 
8:41 AM
Ah, okay. :)
So then the only large problem is thread count.
 
Just don't allocate a thread for each connection ;-)
.NET 4.5 makes it really easy to return a Task to the pool.
 
Thought so.
 
How are the clients connected?
WCF?
 
Anyone has already implemented 3d visualizations into asp.net ?
 
The clients are connected by using AcceptTcpClientsAsync() in the TcpListener to create each TcpCLient.
After that I have each TcpClient manage itself in a custom class.
 
8:44 AM
@FatalSleep You create a new Task to handle the TcpClient and then wait for the next connection, right?
 
Yeah.
 
Then if you have a Task inside your 'custom TcpClient class' that does await for data, the thread already returns to the thread pool. It's not used, unless something is being received ;-)
Isn't .NET 4.5 absolutely brilliant? :P
 
Yes. :P
 
So you already have performance equal to the best threaded implementations :P
 
Ah.
 
8:47 AM
In my current project I do the WPF/C# client-side, while the server-side is Java on Linux. We have a bit of good-natured banter between us, but there are a couple of issues, specifically async/await, where they really couldn't argue about C#'s superiority here.
 
I need to rethink this a bit.
 
:18515527 Pretty much, but I recommend to stick to the newer Task.Run or Task.Factory.StartNew (prefer to use the former), instead of the older threading stuff. I don't think using ThreadPool.Queue.. would be an issue, but I'm not sure.
 
Ah, will do then.
Task is a newer thing over ThreadPool?
 
Yeah. Task.Run() will give you what ThreadPool.QueueUserWorkItem does, and a lot more (since you get a Task object you can monitor and control later)
 
Ah.
 
8:51 AM
@FatalSleep Yeah, it's a layer of abstraction over threading and task-management that gives you a lot more control:
 
TPL and Linq are like, the best thing ever, totally missed if you move to language x.
 
Yup. In my previous project, the rest of the team were mostly C++ and some C# 2.0 devs. Had to work a bit to get them to get used to LINQ and lambdas.
Some of them resisted to the end. Some took to it quickly.
 
Hmm... a bit skeptical about this. So my TcpHandle() function is always running, until a client disconnects at least. So won't each client thread always be running until the client disconnects?
Sorry if I am not getting this, 2am. :P
 
@FatalSleep Async/await allows your code to use completion ports. Basically, quite simplified, your application is telling Windows "Hey, I want to be notified when something happens, so I can respond", and then stops with dealing that connection. At some point, something is happening in the Windows kernel and it knows your application requested to be notified, so it goes "Hey, application, wake up; this connection did something". Your application uses a thread (or spins one up) and deals with it.
 
The network socket doesn't require an active thread listening to it. The OS notifies when new data arrives, which pulls a threadpool thread to handle it.
 
9:05 AM
But if I have a while( true ) loop in the thread, it should keep the thread active regardless? For example I have one await operator in the function that is contained within the loop, ".. await Stream.ReadAsync( ..." This isn't exactly an asynchronous function that'll take long to process, so if the thread returns to the threadpool, it'll be really, really short...
This is the function: pastebin.com/R0xSRLfY
(Well the old version...)
I thought I knew about threads at the time I wrote my server application. Now that I am rewriting it I am starting to question my methods.
 
If you have 1,000 concurrent calls to ReadAsync, they'll all share the same 30-odd ThreadPool threads, rather than creating a different thread for each. The code after await will execute on an available threadpool thread.
If none is available, it'll wait for one (same as the *Queue*UserWorkItem)
 
Ah.
So no issues here?
 
Of the top of my head, no, there shouldn't be.
 
Awesome.
So just needless worry.
 
Needful, needful worry. Worry is good. :)
 
9:10 AM
Good point. :)
Is it possible to increase the threadpool count from 30? If so, good or bad idea?
 
I wouldn't unless you can clearly see (and measure) performance problems caused by incoming data that's queued too long.
There are performance counters to help you monitor it.
 
Okay, awesome.
Thanks for the help, I should be good to go now. :)
 
You're welcome.
 
@AvnerShahar-Kashtan Unless it's about your health :P
 
@RoelvanUden Ah, yes. Worry about your code is good. Anywhere else, blissful ignorance!
 
9:16 AM
Haha.
Hmm... kind of a pain to not have access to ref in async methods.
 
Ben
anyone have any experience using watin?
 
@FatalSleep I never use ref, why would you need it?
 
I only use ref when calling COM objects.
Because they suck.
 
COM?
Well ref is great for accessing lists.
 
Yes, COM.... let's not go there.
@FatalSleep Huh?
Example?
 
9:19 AM
E.g. accessing a list in another class so that the list isn't copied over.
 
Lists are reference types. Only the pointer/reference is copied, not the list itself.
 
A list is a reference type, passing it around doesn't cause copies.
 
Ah, yeah just remembered...
I need to keep up on my C#.
Haven't used it in a while because I've been messing with C++.
 
That's one of the bigger differences between the two languages. In C# whether an instance of a class is a reference/pointer or a local copy is decided by the caller, whereas in C# it's decided by the class's author.
Gave me several headaches when I found myself doing some C++ a few months ago.
 
Yeah, it's a pain to switch between the two.
Just to clarify 100%, if I do: "Function( class ClassName , class ClassName , etc. )" the class own't be copied, rather referenced.
Pretty sure I am right, since lists etc. are also classes which we just discuessed.
Discussed*.
 
9:24 AM
Yes.
Structs and primitive types will be copied. Classes will be copied by reference.
 
Thank god.
 
And to make you more confused, a string is not a primitive type. It's passed by reference, but cannot be mutated, so if you concat stuff to it, a new string is made.
 
Ew.
I totally never knew that. Thanks for the info.
 
A little confusing at first, but thank --god-- MS for the ease of strings in C#.
A total nightmare in C++
 
Ikr? I've always hated C++ strings.
Got a bit used to it though because I wrote my own buffer class which can handle strings in C++.
 
9:37 AM
And then hope it handles UTF-8, Unicode, SomeWeirdEncodingHere, Chinese, etc..
 
Pretty much. .___.
Strings are evil, let's just leave it at that. :P
 
In C# strings they are really sweet and kind, a little shy, yet adorable.
 
I must agree. :)
C# makes everything so nice to handle.
Except for C# DLLs.
Had some issues with those.
 
If they are native, then yes, it's a bit of a pain. If it's .NET, it's eaaasyyy
 
"Disassemble the DLL in order to tell .NET we wanna export our functions to the WIN32 platform." That was the issue.
 
9:43 AM
Expose C# to C++?
 
Nah to another program, GameMaker.
Otherwise GameMaker couldn't call anything from the DLL lol.
 
In order for a non-.NET program to call .NET classes and functions, they need to be exposed in a way that's non-.NET. Usually that means COM.
But it's always a pain to get two separate environments to communicate between them.
 
Yeah, it is. Everything has to be so complicated...
 
Stay in .NET-land and everything is peachy. :)
Win32 was designed in different times under different constraints.
 
That it is haha. C++ is nice too, but it takes so much longer to do things.
 
10:02 AM
Well guys, thank you so much for the help! I'm out.
 
Good night.
 
10:55 AM
Hi Guys !
 
11:41 AM
Hello Iam trying to consume WCF that is deployed on Windows Server 2008 IIs 7.5 and consume it on another web site. I get error: Invalid path or file name in System.Web.Services.Protocols.SoapException: Invalid path or file name.
When I consume it from localhost it works just fine..
 
Can anyone tell me which method is best to calculate the value of given percentage
Z = (X  * (P / 100);
or
Z = (X  * P) / 100;
 
Z = (X * P) / 100; P first then D
 
12:14 PM
why it should be ?
suppose X=32700 AND P=80% then (X * P) = (32700 * 80) = 2616000. So it will be out of 16bit int value. but, if we calculate using second method then values will be like these
(32700 * (80 / 100)) = (32700 * 0.8) = 26160... it is less than 32767
@juanvan so, my question is that does both method effects on virtual memory?
 
@Shell Are you sure you should care about micro optimizations? Better look at the best possible precision in your scenario and go for that.
 
So, should i go with the second method (x * p) / 100?
Im asking that because i am retrieving data from sql server with this formula and the data can be large
Select ((Col1 * Col2) / 100) As MyValue From Table
so, does it take any effect on execution time ?
 
You're asking about a SQL query...?
 
yes
 
Hi. I would like to redirect my page to Default.aspx when entering base URL such as. www.myurl.com how could I set please? My website is on IIS 8.
 
12:31 PM
@Shell there should be no effect, but you can check in the sql manager when the query executes
@Marek Administrative Tools-> IIS Manager -> You Server Name -> Your site name -> Under HTTP features -> Default document -> Add MyDefaultPage.aspx
 
@juanvan It is there but it does not redirect :/
 
you are going to set it directly why do you want a redirect to the default page
www.google.com/badurl -> redirect www.google.com -> defualt.aspx
 
Yes. that is what I would like to do.
 
yeah @juanvan i think i should read more about Execution Plan..
 
store the number you are going to use the most - and the parts to make that in case you want to use them later - if - database size is not really a requirement
 
12:36 PM
@juanvan I set up what you recommended but it does not redirect. Any idea?
 
Set the error page to the default page and this will cause the redirect
 
Morning everyone!
 
@JLott Hey, we were talking about you yesterday
 
Creepers...
What about me :)
 
How you're never here
 
12:50 PM
I'm sorry :( I am a lot busier these days
But I still drop in every now and then.
I just bought a house so all of my spare time goes to getting it all setup how we want. We built a bunch of shelves last night.
 
You should bring more girls with you to this chat :P
 
Simple question in ASP.NET Web Forms how do I redirect from www.sample.com to www.sample.com/Default.aspx please?
 
Just make default.aspx your index page. much nicer
 
@KendallFrey -_- There are not very many of us
You would just scare them away anyhow
 
@KendallFrey hwo can I achieve that please?
 
12:53 PM
@JLott gee, thanks
 
:P You know I love you all
 
@Marek I don't know how except with apache
 
Can't you just right click it and do "Set as Start Page"
Or something like that...
Right click it in the explorer @Marek
 
@JLott I also have that but it is deployed on IIS 8 and just simpyl does nto redirect from root to defult.
 
What appears on your root page?
404?
 
12:57 PM
Server error
500 - server error
 
have you setup the defaultdocument in your configuration?
 
I believe I didnt
I also use this part:
  <authentication mode="Forms">
      <forms loginUrl="Default.aspx"
        defaultUrl="Data.aspx" />
    </authentication>
It is in the web.config
 
Here is a site with the code that I was talking about: dantor.com/support/misc/…
Not sure if it is the issue you are having WebDev is not really my thing
But it probably eventually will be... bleh
 
Well I got an error, bleh
I put
<defaultDocument enabled="true"> <!-- this line enables default documents for a directory -->
<files>
<clear/> <!-- removes the existing default document list -->
<add value="Default.aspx"/> <!-- foo.htm is now the default document -->
</files>
</defaultDocument>
into the config
and nothing appears.
The requested page cannot be accessed because the related configuration data for the page is invalid.
 
Is Asp turned on in your windows features?
What is the error number on that
 
is there a way to take back your flag on a question??
 
Please help me
with above question
 
1:30 PM
@JotDhaliwal If you read the answer you can apply the same solution to your own project.
That dude linked you to the perfect answer... use it.
 
I am on that but have not find solution
as i have three tables
 
Did you even read what the problem was?
 
Yes
I am fresher
 
Does cbCheckbox.Checked always equal True?
 
so have not much knowledge about concepts
 
1:33 PM
@JotDhaliwal Do you know how databases work?
 
can you please please please hep me
yes sir
i know
If you get with both questions (my and that was linked by james)
 
Then you know you can't have multiple cascading paths and code first attempts to do exactly that. Just disable one cascading path or otherwise fix the rule and conflict.
 
How to disable the cascading path
 
Read the answer that friendly dude linked to you.
 
ok, but sir if you get with the solution than please help me
please
 
1:36 PM
No. If you can't be bothered to read/learn, go bake burgers or something.
5
 
:(
this is critical situation for me
please help me
@RoelvanUden
please help me man please
 
Sigh.. just use the fluent solution from the answer. You've now learned nothing.
 
please provide link to fluent api
yupieeeeeeeeeeeee
solved
thnx man
for your time
@RoelvanUden
 
Do you know what you did, and why you did it? What are the implications of your change just now? ;-)
 
2:04 PM
Of course you don't.. you got the copy/paste and left. Ignorant assholes. :-/
 
brogrammers
 
girls are hogrammer
 
2:40 PM
midgets are lowgrammers
 
@SpencerRuport @JLott Is often idle, but she is getting married and purchased a home. So she is incredibly busy at the moment.
@JLott I watched that video on your post, sadly is is true.
 
Evening
How is it going with everyone?
 
@Greg ! Yeah that video is my life lol.
@Rijnhardt Very well
 
That is always good.
So, 3 Dimensional Packing problem? Any ideas? I am thinking pixelate the edges and use them similarly to the way you use Tetris blocks.
 
@JLott Yeah, how is life treating you?
 
2:49 PM
@Rijnhardt, Genetic algorithm?
Anybody ever deal with runtime compilation stuffs?
 
@Nathvi, compared to?
 
@Greg It has been good. Things are hopefully going to setting down soon. How have you been?
 
@Rijnhardt, Im assuming you're asking for methods to optimize volume for a given space given some number of 3D objects. Is that what you're looking for?
 
@Nathvi, yes. Just ideas on how to approach it.
 
Is the space digital or real? ie, are you dealing with real shipping, or a very well defined simulated space that you provide or are provided
 
2:53 PM
@JLott Really busy, I've got a new job. I started a consulting business. Renovations, I just installed a new front door, screen, porch light, and started tiling most of my house.
 
@Rijnhardt, it comes down to search, I would look up different ways to do that
 
@Nathvi, real. The diagram/output will be sent to the CNC dept for cutting.
Need optimal way to arrange in a 3d space
 
@Rijnhardt, just to make sure I understand, you:
You are making objects via cnc, which then need to be fit optimally into a space.
 
@Greg Awesome!
 
the objects are known -- sizes that is, then I get given a space to optimally place those items in so that the least amount of raw material is wasted.
so to answer your question, yes - I think?
 
3:00 PM
@JLott Yeah, so when you coming to Portland?
 
Ok, for instance, you make three cups, and have a box, you need to figure out how to place the three cups in the box to minimize wasted volume in the box.
 
@RoelvanUden I'm deciphering someones code, it constantly throws a This stream doesn't support seek operations. So it throws an error, when they do a HttpWebRequest, with a WebResponse, Stream, and StreamReader.
@RoelvanUden It doesn't look out of the ordinary.
 
@Nathvi, yes - as long as the cups do not touch each other or the cups aren't in one another.
 
@Greg well, you might changing position in stream, seeking it, etc.
 
@Rijnhardt, ok
@RoelvanUden, what if, the objects you have are 3 boxes, the first is slightly smaller than the original box, so it fits perfectly, and so on for each successive box? Does that violate anything?
 
3:10 PM
@Nathvi what the hell are you asking me about all of a sudden
 
@RoelvanUden, sorry, I meant to @ @Rijnhardt ! :p
@RoelvanUden, are you ok? do you need tissue?
 
@RoelvanUden So this developer may have made an error in location in the stream?
@RoelvanUden The way he coded it, was kind of eh.
 
@Greg No, it might just be a non-seekable stream. You can't seek in a network stream, for example. So: it depends.
 
                string postData = "&city=" + Request["city"] + "&shipCost=" + shipcost + "&zip=" + Request["zip"] + "&cart=" + Request["cart"] + "&returnTotalTaxWithShip=false";
                HttpWebRequest request = (HttpWebRequest)WebRequest.Create("https://www.url.com/service/ShipTax.svc/getTaxes?dt=" + DateTime.Now.ToShortDateString() + postData);
                request.Method = "GET";



                //get response-stream, and use a streamReader to read the content
                using (WebResponse response = request.GetResponse())
That is the code he wrote.
Always errors at the stream.
 
@Nathvi, if I understand what you are saying - yes. The objects cannot be inside one another. Have a look at this for example: paginas.fe.up.pt/~esicup/viewer/png/albano_3.png -- Does that maybe help?
 
3:15 PM
@Greg calling GetResponse twice looks a bit suspicous
 
Oh android... how I loathe thee...
why must thy bluetooth stack sucketh so?
 
@Rijnhardt, hummm... I guess I would need a more specific problem to be of any help. I would suggest general search algorithms to optimize
 
@Greg Haha I don't even know the next time I will have a free weekend
 
@Nathvi, hmmm. Thanks. Will look into it. Thanks anyway
 
@Rijnhardt, look at, en.wikipedia.org/wiki/Genetic_algorithm, might help
I would try an combine it with en.wikipedia.org/wiki/Tabu_search
Does anybody know, why referenced assemblies for run time compilation would work in debug, but not opening it from the bin as an .exe?
for example:
parameters.ReferencedAssemblies.Add("something.dll");
won't throw errors in debug, but when running exe, will say "something.dll cannot be found"
 
3:24 PM
@drch Yeah, couldn't he migrate the `stream` like this:

using(var stream = request.GetResponse().GetResponseStream())
@JLott Hm.
 
using (var response = request.GetResponse() {
   using (var stream = response.GetResponseStream()) {
 }
}
 
Wouldn't this be better?
    if (request != null)
        using (var stream = request.GetResponse().GetResponseStream())
        using (var reader = new StreamReader(stream))
            plattcomResult = reader.ReadToEnd();
 
Morning.
 
@drch Or would I really need the response?
 
I have two questions:

1. If I have method that uses `lock` on different instances how exactly will it block threads while one thread operates on it. For example, ThreadA executed method and method locked SyncRootA, at the same time ThreadB executed method but method tried to enter monitor on SyncRootB. Will, SyncRootB entered and method continue processing or will it still wait for SyncRootA?
2. How can I unit-test this behavior?
I'd ask these questions on main site but I think it's kinda broad.
For better understanding of problem, here is really basic sample what's going on.
 
3:38 PM
Hey Guys
Take a look at it:-
-3
Q: How to search html tags with different Attributes in Gecko Web Browser

yashi am working on windows form application i which i attached a gecko Web browser. Now i want to search html tags by specific Elements. Example is as follows:- <div class="or_team1 hovrbl most_pop_team1 parentView1x2Bets " bet-id="25907367" ett="Atletico Rafaela v Newell's" btt="Match Odds"...

 
Why would I look at a question with 3 downvotes?
 
To add dv and vote to close since it's really unclear.
 
@KendallFrey please if you can solve this problem this will be a big help for me
 
Just you though @KendallFrey only you can solve it.
 
@yash, I was going to but...
 
3:45 PM
But? @Nathvi
 
@yash, I can't because only kendall can
 
oh...I see @Nathvi
@KendallFrey you there?
 
@yash, your question sucks.
you need to be more clear
 
i am using Gecko Browser in winform app
i want to find and click on a div by its bet-id
But i can't find way
@Nathvi
Is there any way to search divs by using 'bet-id' or some other attributes?
@Nathvi @KendallFrey
 
3:50 PM
@JLott We should get together though at some point.
@RoelvanUden I modified it a bit, it works now. Weird error though.
 
HELP VAMPIRE! EEEK!
 
@Greg C# Chat Room conference!
 
@EvanL, don't worry, if you ignore it, it will go away
 
@JLott Yeah, that would be cool.
 
Well, I came up with this test. It confirms the behavior I expected. Question goes down to is it good test-case?
 
3:58 PM
@ton.yeung I didn't
What's up?
 

« first day (1411 days earlier)      last day (3532 days later) »