|
Nicolas Légaré wrote: Perhaps my code isn't optimized, but that's besides the point. Show us the code. Parallel code is hard, and an inefficient implementation will always be slower. Task switching has it's overhead.
Nicolas Légaré wrote: I have noticed performance is actually better when avoiding running threads concurrently on certain processors. Windows uses threads a lot, so I'd expect it to be quite optimized. What processor are you seeing this on, do you have an example app that reproduces the problem?
Bastard Programmer from Hell
If you can't read my code, try converting it here[^]
|
|
|
|
|
Hi Eddy,
Thanks for replying.
I have since fixed up my code, it had issues with terminating threads. It's much faster now with both sides of the core running.
As an exercice though, how could I detect which logical processing units are part of one core? I was able to run a CPU stress test to test two CPUs at one, the results can tell me which two CPUs make up both sides of each core. This test takes a while to run, it'd be nice to have a simple API to call to get this.
Thanks
Nic
|
|
|
|
|
Hello everybody!
Im trying to do a Form Designer on C#, looked all over the web for this...Found an project using a custom dll, but i just want to know how to put the snaplines (that lines who helps a lot to align controls like in Visual Studio) on my form with my dinamically controls.. Someone could help me?
thanks!
Rafael
|
|
|
|
|
This is unclear, are you hosting the Windows Forms designer and you want to know how to show the snaplines?
Or...
Are you trying to design your forms runtime and you want to show snaplines?
Or...
Are you using custom controls in Visual Studio and you want your controls to participate in snaplines?
|
|
|
|
|
Sorry Ron..
Im making a form designer that uses dinamically created controls..like a textbox... In this form the user can move the controls like he wants.. And i want to put these snaplines to make alignment easier...
regards,
Rafael
|
|
|
|
|
I apologize but its still not completely clear... Are you making your own form designer, or are you hosting the Windows Forms Designer? Its an important distinction because one supports it out of the box and the other does not. Snap lines are a function of the designer, not the text box (well, not entirely). If you are hosting the Windows Forms Designer its easier, but if you are making your own form designer then its a lot more difficult.
|
|
|
|
|
im making my own form designer...
|
|
|
|
|
This will have to be a custom solution then. It really depends on your code, but what I would do is to get the ControlDesigner from the TextBox and see what the offsets for the snap lines are. These lines are then drawn on the main form when the X or Y approaches (within some number of pixels) another control on the form.
There really isn't a "simple" solution to the problem when implementing your own designer. Its really a lot of work to determine if the form is in design mode, get the control designer, get the snap lines properties, find out where the control is in relation to other controls, read their snap lines properties and then draw the lines on the form.
|
|
|
|
|
I want to develop multiplayer game online and I plan to use SQL Broker to notify user when it is turn to play, or which technique you suggest me to use.
Regards
|
|
|
|
|
Why SQL Broker, simply to inform someone it's their turn?
Bastard Programmer from Hell
If you can't read my code, try converting it here[^]
|
|
|
|
|
I want to develop tic-tac-toe game online for two users and
SQL Server I will use to save players move and broker i will use to notify when soneone's turn to play, or should I use another way to notify user when is turn to make a move.
Thanks
|
|
|
|
|
It sounds like a bit overkill to have a paid version of Sql Server to play a tic-tac-toe game.
cdpsource wrote: should I use another way to notify user when is turn to make a move. There are multiple ways to inform a client of a change; if it's a small turnbased game between two players, I'd expect direct communication between those players, without the need for a server.
Bastard Programmer from Hell
If you can't read my code, try converting it here[^]
|
|
|
|
|
We can't really answer that as is: there are far, far too many options.
One mans "multiplayer online game" is Halo4, another is Sims3, or Scrabble!
They need very, very different approaches, and trying to decide that you want "SQL Broker" to sort it all out before you look at how much data needs to fly around, and where and when it needs to fly is like deciding you want a 5.2l V8 engine, before you chose the curtains!
The only instant messaging I do involves my middle finger.
English doesn't borrow from other languages.
English follows other languages down dark alleys, knocks them over and goes through their pockets for loose grammar.
|
|
|
|
|
A simple publish subscribe mechanism should suffice.
|
|
|
|
|
I have a textbox control in my page i need to insert control values in single row with four columns. on every insert on textbox i need to store value in every column with particular cells
if 1st insert i need to insert data on row 1st column
on 2nd insert i need to insert data on row 2st column of same row
-----
With Thanks
ram
|
|
|
|
|
Is this an ASP.NET question ? If you are speaking of simulating columns in a TextBox, I suggest you don't try it. Even if you use a monospaced font, and tabs, you're still going to have a problem with alignment at some point, I predict. Use a grid, a ListView, etc.
Google CEO, Erich Schmidt: "I keep asking for a product called Serendipity. This product would have access to everything ever written or recorded, know everything the user ever worked on and saved to his or her personal hard drive, and know a whole lot about the user's tastes, friends and predilections." 2004, USA Today interview
|
|
|
|
|
OK, this is standard stuff. I take it you know nothing about SQL??
Google for "C# parameterized queries" and you'll find all kinds of information on how to do it.
|
|
|
|
|
Hi Ram,
It seems that in your case you are using same textbox for multiple inserts and also your table design limits it to 4 inserts on that textbox.
Although this type of design is not recommened (as per normalization guidelines) but the
solution for your case is
1. for 1st insert you have to execute insert statement for inserting value to 1st column in a new row.
2. for other inserts like 2nd, 3rd, 4th you have to run update sql statement, and for that you would be needing some primary key from the step1, if you don't have any then add identity column to your table it will add numeric primary key.
Or
you can also store inserted values from textbox to some local list variable and then on final save button click run insert sql statement with values for all the 4 columns, hence in this only database hit is required.
Regards,
Amit
|
|
|
|
|
I have a client who needs to get back the street address given a lat/long.
I have never done this before. Anyone have any experience with this? Are there services and/or API's I need? Can you point me in the right direction?
Many thanks
If it's not broken, fix it until it is
|
|
|
|
|
It's called reverse geocoding. There are many different services that you can use for this. You could use Bing maps, or Google maps. Here's[^] an entirely client side implementation of the Google lookup.
|
|
|
|
|
I should have mentioned...
1) They don't want to use Google. Cost prohibitive
2) This will probably all be in a WPF app. The LAT/LONG data will come from truck mounted GPS devices, and I will need to convert to addresses and store in SQL.
I've been Googling GeoCode Service and what would be nice is a .Net API I can use.
If it's not broken, fix it until it is
|
|
|
|
|
A lot of countries have addresses mapped to lat/long - if you can source this data locally, then you can save yourself some of the cost. For instance, here in the UK, we have the Ordnance Survey which takes care of a lot of this for us - combined with information from local councils.
|
|
|
|
|
Ok, I have no clue what all that means
If it's not broken, fix it until it is
|
|
|
|
|
You might get some traction with this[^].
|
|
|
|
|
I understand what Geocoding is. I don't understand how to code it. Again, I'm hoping for an API or other service that I can get started with.
If it's not broken, fix it until it is
|
|
|
|