Search Results

Search found 20869 results on 835 pages for 'things i hate'.

Page 53/835 | < Previous Page | 49 50 51 52 53 54 55 56 57 58 59 60  | Next Page >

  • WPF more dynamic views and DataAnnotations

    - by Ingó Vals
    Comparing WPF and Asp.Net Razor/HtmlHelper I find WPF/Xaml to be somewhat lacking in creating views. With HtmlHelpers you could define in one place how you wan't to represent specific type of data and include elements set from the DataAnnotations of the property. In WPF you can also define DataTemplates for data but it seems much more limited then EditorTemplates. It doesn't use information from DataAnnotations. Also the layout of elements can be bothersome. I hate having to constantly add RowDefinitions and update the Grid.Row attribute of lot of elements when I add a new property somewhere in line. I understand that GUI programming can be a lot of grunt work like this but as Asp.Net MVC has shown there are ways around that. What solutions are out there to make view creation in WPF a little bit cleaner, maintainable and more dynamic?

    Read the article

  • Is it bad to have an "Obsessive Refactoring Disorder"?

    - by Rachel
    I was reading this question and realized that could almost be me. I am fairly OCD about refactoring someone else's code when I see that I can improve it. For example, if the code contains duplicate methods to do the same thing with nothing more than a single parameter changing, I feel I have to remove all the copy/paste methods and replace it with one generic one. Is this bad? Should I try and stop? I try not to refactor unless I can actually make improvements to the code performance or readability, or if the person who did the code isn't following our standard naming conventions (I hate expecting a variable to be local because of the naming standard, only to discover it is a global variable which has been incorrectly named)

    Read the article

  • Looking for a FormBuilder that gives me all images and sourcecode to my form

    - by Tracy Anne
    Wow, I started my search this morning and didn't think it would be so difficult to find. I'm just tired of spending hours putting together simple html forms in dreamweaver. I'm an enthusiast web developer mostly focused on php and mysql. I hate CSS and HTML and I'm looking for a simple program that will put a form together for me where I can then completely embed the form into my site. I'll do all of the programming to attach it to my database I just need the form and images. I've looked into jotform, wufoo, 123forms etc but it seems like they all want to keep my form on their servers in one way or another. It looked like jotform had a developers version but $450 bucks is a little steep for a part timer like me. Is there no simple software out there that will throw a nice stylized form together for me?

    Read the article

  • LIghtspark Playback Crashes [on hold]

    - by user147369
    My introduction is for my personal health: I hate Flash and then HTMLs finally wil be the only standard around =)(/)$§%&$%$ I installed Lightspark from a repository. Butt no video playback in FF oder Chromium. In FF I usually get one of the following messages within the black playback box (I can't copy it) Cause: Unhandled action script exception Cause: args[0]&&args[0]->getClass && args[0]->getClass(isSubClass) Can't read more since the error message is bigger than the playback frame. Thanks for all answers !

    Read the article

  • Tell Visual Studio 2012 UI Designers What to Fix

    - by Ken Cox [MVP]
    If you hate the default interface themes in Visual Studio 2012 as much as I do, you have another outlet to vent. The UI designers have posted a survey where you can tell them how distracting and annoying you find the gray themes and black icons. You even get to comment on the (fixable) all-caps issue. The UI people didn’t listen much to the (largely hostile) developer feedback during the product design – or more likely were constrained by some edict from on high - but seem more willing now to create decent themes for updates. Here’s the Visual Studio 2012 Visual Theme survey URL https://illumeweb.smdisp.net/collector/Survey.ashx?Name=VS2012ThemeSurvey VS 2012 is a great product hampered by a lousy UI. If I could have a Visual Studio 2010 theme (with its coloured icons) I’d be more than satisfied with the 2012 release.

    Read the article

  • SQL Query Builder/Designer and code Formating

    - by DavRob60
    I write SQL query every now and then, I could easily write them freehand, but sometimes I do create SQL queries using SQL Query Designers for various reason. (I wont start to enumerate them here and/or argue about their usefulness, so let's just say they are sometime useful.) Anyway, I currently use 2 Query Designers : SQL server management studio's Query Designer. Visual Studio 2010's Query Builder (must often within the Table adapter Query Configuration Wizard.) There's something I hate about those two (I don't know about the others), it's the way they throw away my Code formatting of SQL queries after an edit. Is there any way to configure something to automatically reformat the SQL output or is there any external tool/plug-in that I could use to do that job?

    Read the article

  • Why is Silverlight so unstable? [closed]

    - by 0101
    I have never programmed in Silverlight, but I hate it. The reason is that I need it to watch videos on one of the site I watch, but like every other day I need to update the plugin. Why is Silverlight so unstable ??? they just can't get it right and I have to update that plugin all the time. P.S. I'm now thinking of somehow hacking that video stream and bypass the silverlight(so I could just throw it away). P.S. Its not updated like any other FF plugin, because its special and you need to download an exe ... pathethic.

    Read the article

  • How to manage an issue tracker's backlog

    - by Josh Kelley
    We've been dutifully using Trac for several years now, and our "active tickets" list has grown to almost 200 items. These include bugs that are too low priority and too complicated to fix for now, feature requests that have been deferred, issues that have never really generated complaints but everyone agrees ought to be fixed someday, planned code refactorings and other design infelicities that we don't want to lose track of, etc. As a result, with almost 200 of these issues, the list is almost overwhelming; it's no longer useful as a source of what needs to be worked on right now. What's the best way to keep track of issues of this sort? Part of the problem is that some of these issues are such a low priority that they may never get done. I hate to lose track of these items (similar to not wanting to throw something out of my house in case I might need it someday); do I need to throw them out regardless (by marking them as wontfix) and assume I can find them in the future if I ever do need them?

    Read the article

  • What incidentals do server maintenance people/devs need?

    - by SeniorShizzle
    I'm trying to put together a thank-you package for clients who are server-side developers and in charge of their company's servers and databases. Since I've never been in that line of work before, I would like to know what it is like. Get inside your heads, for instance. My first thought was (don't hate me) a few patch cables. I don't know if you guys actually need these often or anything. What are some similar things that you like or need for your lives at work. Small incidentals less than $10 are preferred, like Coffee or a notebook, screwdrivers. Et cetera.

    Read the article

  • Dual monitor in Ubuntu 12.04 + Nvidia GPU with CUDA drivers?

    - by Aphex
    I'm thinking about setting up dual monitors on my desktop PC, running Ubuntu 12.04 with a Nvidia GTX 570. I use the GPU for CUDA programming so it's set up with the CUDA drivers. Is it possible/easy to set up dual monitors with this configuration? The only questions I saw related to this were for GPUs without cuda drivers. If anyone knows how dual monitors work with CUDA drivers, it would be much appreciated. It was enough of a pain getting everything running with the GPU and CUDA in the first place, I'd hate to ruin it all by attempting dual monitors.

    Read the article

  • Should I add old code into my repository?

    - by Ben Brocka
    I've got an SVN repository of a PHP site and the last programmer didn't use source control properly. As a result, only code since I started working here is in the Repo. I have a bunch of old copies of the full code base saved in files as "backups" but they're not in source control. I don't know why most of the copies were saved nor do I have any reasonable way to tag them to a version number. Due to upgrades to the frameworks and database drivers involved, the old code is quite defunct; it no longer works on the current server config. However, the previous programmers had some...unique...logic, so I hate to be completely without old copies to refer to what on earth they were doing. Should I keep this stuff in version control? How? Wall off the old code in separate Tags/branches?

    Read the article

  • How to tell whether your programmers are under-performing?

    - by A Team Lead
    I am a team lead with 5+ developers. I have a developer (let's call him A) who is a good programmer, who writes good clean, easy to understand code. However he is somewhat difficult to manage, and sometimes I wonder whether he is really under-performing or not. Our company requires the developers to indicate the work progress in the bug tracker we use, not so much as to monitor the programmers but to let the stackholders know the progress. The thing is, A only updates a task progress when it is done ( maybe 3 weeks after it is first worked on) and this leaves everyone wondering what is going on in the middle of the development week. He wouldn't change his habit despite repeated probing. ( It's OK, developers hate paperwork, I do, too) Recent 2-3 months he on leave quite often due to various events-- either he is sick, or have to attend a lot of personal events etc. ( It's OK, bad things happen in a string. It's just a coincidence) We define sprints, or roadmaps for each month. And in the beginning of the sprint, we will discuss the amount of work each of the developers have to do in a sprint and the developers get to set the amount of time they need for each task. He usually won't be able to complete all of them. (It's OK, the developers are regularly missing deadlines not due to their fault). If only one or two of the above events happen, I won't feel that A is under-performing, but they all happen together. So I have the feeling that A is under-performing and maybe-- God forbid--- slacking off. This is just a feeling based on my years of experience as programmer. But I could be wrong. It is notoriously hard to measure the work of a programmer, given that not all two tasks are alike, and there lacks a standard objective to measure the commitment of a programmer to your company. It is downright impossible to tell whether the programmer is doing his job or slacking off. All you can do, is to trust them-- yeah, trusting and giving them autonomy is the best way for programmers to work, I know that, so don't start a lecture on why you need to trust your programmers, thank you every much-- but if they abuse your trust, can you know? My question is, how can you tell whether your programmers are under-performing? Surely there are experience team leads who know better than me on this? Outcome: I've a straight talk with him regarding my perception on his performance. He was indignant when I suggested that I had the feeling that he wasn't performing at his best level. He felt that this was a completely unfair feeling. I then replied that this was my feeling and I didn't know whether my feeling was right or not. He would have none of this and ended the discussion immediately. Before he left he said that he "would try to give more to the company" in a very cold tone. I was taken aback by his reaction. I am sure that I offended him in some ways. Not too sure whether that was the right thing to do for me to be so frank with him, though. Extra notes: I hate micromanaging. So all that we have for our software process is Sprint ( where tasks get prioritized and assigned, and at the end of the month, a review of the amount of work done). Developers would require to update the tasks as they go along everyday. There is no standup meeting, or anything of the sort. Mainly because we have the freedom to work from home and everyone cherishes this freedom. Although I am the one who sets the deadline, but the developers will provide the estimate for each tasks and I will decide-- based on the estimate-- the tasks that go into a particular sprint. If they can't finish the tasks at the end of the sprint, I will push them to the next. So theoretically one can just do only 1 or 2 tasks during the whole sprint and then push the remaining 99 tasks to the next sprint and still he will be fine as long as justifies this-- in the form of daily work progress updates

    Read the article

  • Why write clean, refactored code?

    - by Shamal Karunarathne
    Hi programming lovers, This is a question I've been asking myself for a long time. Thought of throwing out it to you. From my experience of working on several Java based projects, I've seen tons of codes which we call 'dirty'. The unconventional class/method/field naming, wrong way of handling of exceptions, unnecessarily heavy loops and recursion etc. But the code gives the intended results. Though I hate to see dirty code, it's time taking to clean them up and eventually comes the question of "is it worth? it's giving the desired results so what's the point of cleaning?" In team projects, should there be someone specifically to refactor and check for clean code? Or are there situations where the 'dirty' codes fail to give intended results or make the customers unhappy? Do feel free to comment and reply. And tell me if I'm missing something here. Thanks.

    Read the article

  • Would you use UML if it kept stakeholders from requesting changes frequently?

    - by Huperniketes
    As much as programmers hate to document their code/system and draw UML (especially, Sequencing, Activity and State machine diagrams) or other diagramming notation, would you agree to do it if it kept managers from requesting a "minor change" every couple of weeks? IOW, would you put together visual models to document the system if it helped you demonstrate to managers what the effect of changes are and why it takes so long to implement them? (Edited to help programmers understand what type of answer I'm looking for.) 2nd edit: Restating my question again, "Would you be willing to use some diagramming notation, against your better nature as a programmer, if it helped you manage change requests?" This question isn't asking if there might be something wrong with the process. It's a given that there's something wrong with the process. Would you be willing to do more work to improve it?

    Read the article

  • Web application deployment and Dependencies

    - by Reith
    I have a free software web application that using other free software scripts for appearance. I have trouble to decide whether should I copy source code of used scripts to my project main repository or list them as dependencies and ask user to install them himself? Since some of scripts solving browser compatibilities issues and I'm not a good web designer (i hate to check my web site on IE to see compatibility) using the newest version of scripts is preferable and second solution works here. But it has problem with scripts aren't backward-compatible with versions I've used them for development. Maybe another method is well-known for this issues that I don't know them.

    Read the article

  • What are the pro/cons of Unity3D as a choice to make games ?

    - by jokoon
    We are doing our school project with Unity3d, since they were using Shiva the previous year (which seems horrible to me), and I wanted to know your point of view for this tool. Pros: multi platform, I even heard Google is going to implement it in Chrome everything you need is here scripting languages makes it a good choice for people who are not programming gurus Cons: multiplayer ? proprietary, you are totally dependent of unity and its limit and can't extend it it's less "making a game from scratch" C++ would have been a cool thing I really think this kind of tool is interesting, but is it worth it to use at school for a project that involves more than 3 programming persons ? What do we really learn in term of programming from using this kind of tool (I'm ok with python and js, but I hate C#) ? We could have use Ogre instead, even if we were learning direct x starting january...

    Read the article

  • What is Camera Raw, and Why Would a Professional Prefer it to JPG?

    - by Eric Z Goodnight
    A common setting on many digital cameras, RAW is a filetype option many professional photographers prefer over JPG, despite a huge disparity in filesize. Find out why, what RAW is, and how you can benefit using this professional quality filetype Latest Features How-To Geek ETC How To Boot 10 Different Live CDs From 1 USB Flash Drive The 20 Best How-To Geek Linux Articles of 2010 The 50 Best How-To Geek Windows Articles of 2010 The 20 Best How-To Geek Explainer Topics for 2010 How to Disable Caps Lock Key in Windows 7 or Vista How to Use the Avira Rescue CD to Clean Your Infected PC Enjoy Old School Style Video Game Fun with Chicken Invaders Hide the Twitter “Litter” in Twitter’s Sidebar Area (Chrome and Iron) Public Domain Day: Reflections on Copyright and the Importance of Public Domain Angry Birds Coming to PS3 and PSP This Week I Hate Mondays Wallpaper for That First Day Back at Work Tune Pop Enhances Android Music Notifications

    Read the article

  • Is Windows 7 written in Xaml? [closed]

    - by Jordan
    Is Windows 7 written using Xaml? Edit Wow, so much hate for such a little question. I'm not an idiot. I know what XAML is. I use it every day. I was just curious whether some of the visual features were laid out with XAML, or if XAML was incorporated in some way to the product. I'm sorry if it is a programming sin not to know what Windows 7 was written in. I mean, I know Windows XP et al used C++/C, I've used Win32 quite a lot (and MFC and .NET).

    Read the article

  • Programming languages similar to ActionScript 3 / EcmaScript based

    - by Juanlu001
    I almost learned programming and OOP basic concepts with ActionScript 3 on the Flash Platform years ago. Some time has passed since then; I'm not a professional programmer, but I have written code in PHP, Fortran, and now Python. But, lately, I have missed ActionScript 3 OOP implementation, static typing and, I confess, curly braces. As Flash platform is slowly dying nowadays, I'm looking for an Open Sourced programming language similar to ActionScript 3. I've read about Java, which is the most similar one I found, but actually is the only one it doesn't interest me (I started to hate it after bad experiences with web applets). Any ideas? Edit: Added EcmaScript to the title and the tags; I think that is what I am looking for.

    Read the article

  • Is there a sequence to read through the Android Developer Site for a user new to Android?

    - by Paul
    I keep seeing that I don't need to buy an android development book, that I should just read the Android Developer Site site because it has everything I need to know. I see it more as drinking from a fire hose. But I'm one of those people who likes to be walked thru the basics. I like to build up my knowledge, rather than being dropped into reference documentation. I also like to make sure I have see all/most of the topics covered. I'd hate to develop the wrong thing because I don't know about Fragments, Content Providers, or whatever. So, since it's a great resource, better than any book (we don't need no stinkin books), how do I traverse the site to get the information provide in the same way as a book would lay it out?

    Read the article

  • Is there a modern (eg NoSQL) web analytics solution based on log files?

    - by Martin
    I have been using Awstats for many years to process my log files. But I am missing many possibilities (like cross-domain reports) and I hate being stuck with extra fields I created years ago. Anyway, I am not going to continue to use this script. Is there a modern apache logs analytics solution based on modern storage technologies like NoSQL or at least somehow ready to cope with large datasets efficiently? I am primarily looking for something that generates nice sortable and searchable outputs with the focus on web analytics, before having to write my own frontends. (so graylog2 is not an option) This question is purely about log file based solutions.

    Read the article

  • What hinders Ubuntu from getting traction in the professional field? [closed]

    - by Prasad
    If this is not the place to ask this, please forgive this Ubuntu cub, I want to ask, what do people do with Ubuntu? As an Ask Ubuntu user I can see that most of the users (including myself) are asking questions about entertainment related problems. Is that all? No commercial use with it? Do people make fun of Ubuntu or just pretending to be Ubuntu users and use Windows secretly? Please don't hate me or make fun of me, I know lots of people trying to make Ubuntu even better, and I know it's better than Windows (if Adobe software just work on Ubuntu, I won't see Windows logo on my monitor anymore). What hinders Ubuntu from getting traction in the professional field?

    Read the article

  • .NET Code Evolution

    - by Alois Kraus
    Originally posted on: http://geekswithblogs.net/akraus1/archive/2013/07/24/153504.aspxAt my day job I do look at a lot of code written by other people. Most of the code is quite good and some is even a masterpiece. And there is also code which makes you think WTF… oh it was written by me. Hm not so bad after all. There are many excuses reasons for bad code. Most often it is time pressure followed by not enough ambition (who cares) or insufficient training. Normally I do care about code quality quite a lot which makes me a (perceived) slow worker who does write many tests and refines the code quite a lot because of the design deficiencies. Most of the deficiencies I do find by putting my design under stress while checking for invariants. It does also help a lot to step into the code with a debugger (sometimes also Windbg). I do this much more often when my tests are red. That way I do get a much better understanding what my code really does and not what I think it should be doing. This time I do want to show you how code can evolve over the years with different .NET Framework versions. Once there was  time where .NET 1.1 was new and many C++ programmers did switch over to get rid of not initialized pointers and memory leaks. There were also nice new data structures available such as the Hashtable which is fast lookup table with O(1) time complexity. All was good and much code was written since then. At 2005 a new version of the .NET Framework did arrive which did bring many new things like generics and new data structures. The “old” fashioned way of Hashtable were coming to an end and everyone used the new Dictionary<xx,xx> type instead which was type safe and faster because the object to type conversion (aka boxing) was no longer necessary. I think 95% of all Hashtables and dictionaries use string as key. Often it is convenient to ignore casing to make it easy to look up values which the user did enter. An often followed route is to convert the string to upper case before putting it into the Hashtable. Hashtable Table = new Hashtable(); void Add(string key, string value) { Table.Add(key.ToUpper(), value); } This is valid and working code but it has problems. First we can pass to the Hashtable a custom IEqualityComparer to do the string matching case insensitive. Second we can switch over to the now also old Dictionary type to become a little faster and we can keep the the original keys (not upper cased) in the dictionary. Dictionary<string, string> DictTable = new Dictionary<string, string>(StringComparer.OrdinalIgnoreCase); void AddDict(string key, string value) { DictTable.Add(key, value); } Many people do not user the other ctors of Dictionary because they do shy away from the overhead of writing their own comparer. They do not know that .NET has for strings already predefined comparers at hand which you can directly use. Today in the many core area we do use threads all over the place. Sometimes things break in subtle ways but most of the time it is sufficient to place a lock around the offender. Threading has become so mainstream that it may sound weird that in the year 2000 some guy got a huge incentive for the idea to reduce the time to process calibration data from 12 hours to 6 hours by using two threads on a dual core machine. Threading does make it easy to become faster at the expense of correctness. Correct and scalable multithreading can be arbitrarily hard to achieve depending on the problem you are trying to solve. Lets suppose we want to process millions of items with two threads and count the processed items processed by all threads. A typical beginners code might look like this: int Counter; void IJustLearnedToUseThreads() { var t1 = new Thread(ThreadWorkMethod); t1.Start(); var t2 = new Thread(ThreadWorkMethod); t2.Start(); t1.Join(); t2.Join(); if (Counter != 2 * Increments) throw new Exception("Hmm " + Counter + " != " + 2 * Increments); } const int Increments = 10 * 1000 * 1000; void ThreadWorkMethod() { for (int i = 0; i < Increments; i++) { Counter++; } } It does throw an exception with the message e.g. “Hmm 10.222.287 != 20.000.000” and does never finish. The code does fail because the assumption that Counter++ is an atomic operation is wrong. The ++ operator is just a shortcut for Counter = Counter + 1 This does involve reading the counter from a memory location into the CPU, incrementing value on the CPU and writing the new value back to the memory location. When we do look at the generated assembly code we will see only inc dword ptr [ecx+10h] which is only one instruction. Yes it is one instruction but it is not atomic. All modern CPUs have several layers of caches (L1,L2,L3) which try to hide the fact how slow actual main memory accesses are. Since cache is just another word for redundant copy it can happen that one CPU does read a value from main memory into the cache, modifies it and write it back to the main memory. The problem is that at least the L1 cache is not shared between CPUs so it can happen that one CPU does make changes to values which did change in meantime in the main memory. From the exception you can see we did increment the value 20 million times but half of the changes were lost because we did overwrite the already changed value from the other thread. This is a very common case and people do learn to protect their  data with proper locking.   void Intermediate() { var time = Stopwatch.StartNew(); Action acc = ThreadWorkMethod_Intermediate; var ar1 = acc.BeginInvoke(null, null); var ar2 = acc.BeginInvoke(null, null); ar1.AsyncWaitHandle.WaitOne(); ar2.AsyncWaitHandle.WaitOne(); if (Counter != 2 * Increments) throw new Exception(String.Format("Hmm {0:N0} != {1:N0}", Counter, 2 * Increments)); Console.WriteLine("Intermediate did take: {0:F1}s", time.Elapsed.TotalSeconds); } void ThreadWorkMethod_Intermediate() { for (int i = 0; i < Increments; i++) { lock (this) { Counter++; } } } This is better and does use the .NET Threadpool to get rid of manual thread management. It does give the expected result but it can result in deadlocks because you do lock on this. This is in general a bad idea since it can lead to deadlocks when other threads use your class instance as lock object. It is therefore recommended to create a private object as lock object to ensure that nobody else can lock your lock object. When you read more about threading you will read about lock free algorithms. They are nice and can improve performance quite a lot but you need to pay close attention to the CLR memory model. It does make quite weak guarantees in general but it can still work because your CPU architecture does give you more invariants than the CLR memory model. For a simple counter there is an easy lock free alternative present with the Interlocked class in .NET. As a general rule you should not try to write lock free algos since most likely you will fail to get it right on all CPU architectures. void Experienced() { var time = Stopwatch.StartNew(); Task t1 = Task.Factory.StartNew(ThreadWorkMethod_Experienced); Task t2 = Task.Factory.StartNew(ThreadWorkMethod_Experienced); t1.Wait(); t2.Wait(); if (Counter != 2 * Increments) throw new Exception(String.Format("Hmm {0:N0} != {1:N0}", Counter, 2 * Increments)); Console.WriteLine("Experienced did take: {0:F1}s", time.Elapsed.TotalSeconds); } void ThreadWorkMethod_Experienced() { for (int i = 0; i < Increments; i++) { Interlocked.Increment(ref Counter); } } Since time does move forward we do not use threads explicitly anymore but the much nicer Task abstraction which was introduced with .NET 4 at 2010. It is educational to look at the generated assembly code. The Interlocked.Increment method must be called which does wondrous things right? Lets see: lock inc dword ptr [eax] The first thing to note that there is no method call at all. Why? Because the JIT compiler does know very well about CPU intrinsic functions. Atomic operations which do lock the memory bus to prevent other processors to read stale values are such things. Second: This is the same increment call prefixed with a lock instruction. The only reason for the existence of the Interlocked class is that the JIT compiler can compile it to the matching CPU intrinsic functions which can not only increment by one but can also do an add, exchange and a combined compare and exchange operation. But be warned that the correct usage of its methods can be tricky. If you try to be clever and look a the generated IL code and try to reason about its efficiency you will fail. Only the generated machine code counts. Is this the best code we can write? Perhaps. It is nice and clean. But can we make it any faster? Lets see how good we are doing currently. Level Time in s IJustLearnedToUseThreads Flawed Code Intermediate 1,5 (lock) Experienced 0,3 (Interlocked.Increment) Master 0,1 (1,0 for int[2]) That lock free thing is really a nice thing. But if you read more about CPU cache, cache coherency, false sharing you can do even better. int[] Counters = new int[12]; // Cache line size is 64 bytes on my machine with an 8 way associative cache try for yourself e.g. 64 on more modern CPUs void Master() { var time = Stopwatch.StartNew(); Task t1 = Task.Factory.StartNew(ThreadWorkMethod_Master, 0); Task t2 = Task.Factory.StartNew(ThreadWorkMethod_Master, Counters.Length - 1); t1.Wait(); t2.Wait(); Counter = Counters[0] + Counters[Counters.Length - 1]; if (Counter != 2 * Increments) throw new Exception(String.Format("Hmm {0:N0} != {1:N0}", Counter, 2 * Increments)); Console.WriteLine("Master did take: {0:F1}s", time.Elapsed.TotalSeconds); } void ThreadWorkMethod_Master(object number) { int index = (int) number; for (int i = 0; i < Increments; i++) { Counters[index]++; } } The key insight here is to use for each core its own value. But if you simply use simply an integer array of two items, one for each core and add the items at the end you will be much slower than the lock free version (factor 3). Each CPU core has its own cache line size which is something in the range of 16-256 bytes. When you do access a value from one location the CPU does not only fetch one value from main memory but a complete cache line (e.g. 16 bytes). This means that you do not pay for the next 15 bytes when you access them. This can lead to dramatic performance improvements and non obvious code which is faster although it does have many more memory reads than another algorithm. So what have we done here? We have started with correct code but it was lacking knowledge how to use the .NET Base Class Libraries optimally. Then we did try to get fancy and used threads for the first time and failed. Our next try was better but it still had non obvious issues (lock object exposed to the outside). Knowledge has increased further and we have found a lock free version of our counter which is a nice and clean way which is a perfectly valid solution. The last example is only here to show you how you can get most out of threading by paying close attention to your used data structures and CPU cache coherency. Although we are working in a virtual execution environment in a high level language with automatic memory management it does pay off to know the details down to the assembly level. Only if you continue to learn and to dig deeper you can come up with solutions no one else was even considering. I have studied particle physics which does help at the digging deeper part. Have you ever tried to solve Quantum Chromodynamics equations? Compared to that the rest must be easy ;-). Although I am no longer working in the Science field I take pride in discovering non obvious things. This can be a very hard to find bug or a new way to restructure data to make something 10 times faster. Now I need to get some sleep ….

    Read the article

  • Current state of the art for holographic displays?

    - by kamziro
    In another thread I was asking about independent arcade system development, and partly it was because I'm interested in using available 3D holographic technology for the displays. I saw one which involved a rotating mirror at very high speeds, so that's probably not going to be too feasible (I'd hate to think of what happens when something goes wrong). However, I looked around for videos from trade shows, and I found this: http://www.youtube.com/watch?v=Vl0EIngM-RA But information is scarce, and I'm led to believe it's just using mirrors and reflections, and does not convey true 3D depth like the one using rotating mirrors at high speed: http://www.youtube.com/watch?v=YKCUGQ-uo8c So yeah, does anyone know if there's something better available today?

    Read the article

  • Tp_smapi on Thinkpad T440

    - by user2597381
    I have a Thinkpad T440 with Ubuntu 14.04 (using i3wm). I have had trouble installing tp_smapi. I successfully installed it with dpkg -- can't remember whether I used apt or just downloaded it somewhere -- but I can't load the module. When I use modprobe on tp_smapi, I get this: "modprobe: ERROR: could not insert 'tp_smapi': No such device or address" Note that this is different from the error I get when I mistype the module name. I read somewhere that I might have to rebuild my kernel for it to work, but I'd thought that the kernel I was using (3.13.0-24) had that already set up. Has anyone gotten it to work? I hate how Lenovo manages the batteries!

    Read the article

< Previous Page | 49 50 51 52 53 54 55 56 57 58 59 60  | Next Page >