Search Results

Search found 14169 results on 567 pages for 'parallel programming'.

Page 11/567 | < Previous Page | 7 8 9 10 11 12 13 14 15 16 17 18  | Next Page >

  • How to do pragmatic high-level/meta-programming?

    - by Lenny222
    Imagine you have implemented the creation of a nice path-based star shape in Lisp. Then you discover Processing and you re-implement the whole code, because Processing/Java/Java2D is different. Then you want to tinker with libcinder, so you port your code to C++/Cairo. You are (re)writing a lot of boiler plate code, while the actual requirement "create a star shape" (or "create a path, moveto x y, lineto x y") has not changed. What are the options to encapsulate those implementation details? Some sort of pragmatic meta-programming? Maybe an expert system? How would you define your core business logic as language-independent as possible?

    Read the article

  • How can you become a real programming polyglot?

    - by Yob
    I work as a Java programmer, but C and C++ were always my favourite languages during studies. Unfortunatelly I don't have an opportunity to work with them as often as I would like to. As a result I sometimes get realized that I don't remember something quite important (today example: inherited protected members cannot be accessed in derived class constructors). The other example could be Python and Haskell which I enjoy using but don't use everyday. I got an idea to write my own wiki with easy to forget things (e.g. bash tricks & tips) but I find no sense in writing there everything I can forget about coolest programming languages. I know that the best way would be having a side projects (I want to start working on some C/C++ open source project after graduation), but currently I have to write my graduation thesis and work so I merely don't have time to do this. How do you stay sharp in languages that you don't use everyday?

    Read the article

  • All-around programming language for use on desktop and mobile devices

    - by mdm414 ZX
    Given that I am a PHP programmer and open-source is a must, what would be the best and practical programming language to use for all of the following: A desktop/cross-platform application. I've read that with HTML5, creating offline apps are possible? A web application. Android and iPhone/iPad apps. I am leaning towards using Python but I am not sure if it is possible to use it alone for all of them. There are other languages that I am also looking at like Ruby, Scala and Java. Kindly share your thoughts and experiences on this one. Thanks :-)

    Read the article

  • Are programming languages pretty much "stable" for now?

    - by Sauron
    Recently i have looked at the "timeline" of Programming Languages and while a lot has changed in the past 5-10 years, there are a lot of languages that have pretty much "stayed" the same in their niche/use. For example, let's take C language. We don't really ever see much languages being developed (correct me if i'm wrong) to try to Unseat C. However, there are a lot of languages that try to do similar things (look at all the SQL/No-SQL languages) Scripting Languages, etc... Is there a reason for this trend? Or is it just because C was designed very well ? and there isn't really any need for new once?

    Read the article

  • how Computer Networks is related to Web/Desktop Java programming

    - by C4CodeE4Exe
    Being a Java programmer , I am wondering how could my work experience would help me learning networking skills. I know C language is used in network socket programming. I know if one knows how to program in one language its not tough to learn another language. Question is I am not able to find much on networks when it comes to Java(may be my knowledge is limited). Do companies like CISCO,TELUS Inc. rely heavily on programmers with such background.

    Read the article

  • What's shell script's advantage over interpreted programming languages?

    - by Lai Yu-Hsuan
    (I'm not sure if it's a appropriate question here) Shell script, like bash, can do many things. It can call Unix programs, pipe their output, redirect I/O from/to files, control flow, check whether a file exists, etc. But a modern programming language, e.g, python and ruby, can also do these all. And their are (I think) more readable and maintainable. bash is worldwide spreaded. But many distributions have installed python interpreter, too. So what's the advantage of shell script? If I could write python, ruby or perl, is it worth to learn bash?

    Read the article

  • Code review vs pair programming

    - by mericano1
    I was wondering what is the general idea about code review and pair programming. I do have my own opinion but I'd like to hear from somebody else as well. Here are a few questions, please give me your opinion even on some of the point First of all are you aware of way to measure the effectiveness of this practices? Do you think that if you pair program, code reviews are not necessary or it's still good to have them both? Do you think anybody can do code review or maybe is better done by seniors only? In terms of productivity do you think it suffers from pairing all the times or you will eventually get in back in the long run? Thanks!

    Read the article

  • Programming language specific package management systems

    - by m0nhawk
    There are some programming languages for which exist their own package management systems: CTAN for TeX CPAN for Perl Pip & Eggs for Python Maven for Java cabal for Haskell Gems for Ruby Is there any other languages with such systems? What about C and C++? (that's the main question!) Why there are no such systems for them? And isn't creating packages for yum, apt-get or other general package management systems better? UPD: And what about unification? Have someone tried to unify that "the zoo"? If yes, looks like that project didn't succeed.

    Read the article

  • What are the different branches of Programming? [closed]

    - by clueless
    I just want a very general overview about what are the actual 'branches' of programming in the industry. What are different paths one can choose as a programmer and what are the common frameworks/languages/platforms in those paths. Currently I'm well versed with C/C++ and Python and I'm a beginner with Django. I want to know this because I can't decide what to proceed with after this, which route to take. Hope it's not a very general question. Thanks!

    Read the article

  • Programming for Digital frames

    - by spartan2417
    A project has recently come to my attention but i have no idea where to start or even if its possible. The idea revolves around programming a clock that is displayed inside a digital photo frame. The user would then be able to put different pictures corresponding to different times inside a usb pen for example, which would load as soon as you put the usb in. The project itself would be a really neat project - if it was just on a computer. I have no idea if what im talking about it even possible on a digital photo frame and if it is what language? Anyone who has any input at all would be great. My current idea is to maybe have a small device at the back, SSD, that runs the program through a screen, completely by passing standard digital photo frames, again though i dont know how to begin with this. And yes ive tried google (although it helps to know what to google).

    Read the article

  • Programming C++ using Qt4

    - by DaGhostman Dimitrov
    Hey guys I am really new to the C++ programing I have a little knowledge in C and a bit more in C++, but I do not know them enough to call myself a programmer. I am working as a PHP Web Developer I like being a crafts man and creating things so that is the reason to combine the programming with web development. I think that I could really benefit from both of them and so... My question is: Is it a good Idea to learn C++ with Qt or not? Can you give me pros and cons of both? Note: I do not want to become a programmer and give up the web development I want to combine them both.

    Read the article

  • Programming language for simple program?

    - by jamherst
    I am wondering about which programming languages people see fit to create a program idea that I had. I am looking to create a fairly simple program whose main functions are adding to, managing, and searching through a database of people, all through a polished GUI. It will be for use in the business world, so I think Windows would be the priority, but Mac and Linux support wouldn't be bad. Also, eventually I would like to add the ability for an instance of one program on a computer to interact with other instances on the same network, mainly through the sharing of a database. Most of my experience is in Java, but I don't particularly like the appearance of Java GUIs, so I'm looking for an alternative. I noticed that a lot of people have suggested C++ or C# in similar posts, so what are some of the advantages/disadvantages of one or both if that is your suggestion. Thanks for any help in advance.

    Read the article

  • How are Programming Languages Designed?

    - by RectangleTangle
    After doing a bit of programming, I've become quite curious on language design itself. I'm still a novice (I've been doing it for about a year), so the majority of my code pertains to only two fields (GUI design in Python and basic algorithms in C/C++). I have become intrigued with how the actual languages themselves are written. I mean this in both senses. Such as how it was literally written (ie, what language the language was written in). As well as various features like white spacing (Python) or object orientation (C++ and Python). Where would one start learning how to write a language? What are some of the fundamentals of language design, things that would make it a "complete" language?

    Read the article

  • Beginner's steps to game programming [on hold]

    - by CodeTrasher
    I have graduated from university less than 6 months ago and became a B.Eng in Software Engineering. I have moderate understanding of programming experience from languages like C++, Java and C#. But mostly on simple desktop and mobile applications. I've tried some simple Pong-like games but never finished even the smallest game. I have a couple of nice ideas growing (IMO, at least...) in my mind but don't really know where to begin. 2D is way to go, of course, at the beginning. I just want to hear from more experienced game devs how they started out. Should I make a rough outline of the core idea and mechanics and start working on a prototype of core gameplay? Or should I just practice more by making Pong, Asteroids and that sort of games and get an understanding of those before moving on? Thanks to all!

    Read the article

  • Looking for a dynamic programming solution

    - by krammer
    Given a sequence of integers in range 1 to n. Each number can appear at most once. Let there be a symbol X in the sequence which means remove the minimum element from the list. There can be an arbitrarily number of X in the sequence. Example: 1,3,4,X,5,2,X The output is 1,2. We need to find the best way to perform this operation. The solution I have been thinking is: Scan the sequence from left to right and count number of X which takes O(n) time. Perform partial sorting and find the k smallest elements (k = number of X) which takes O(n+klogk) time using median of medians. Is there a better way to solve this problem using dynamic programming or any other way ?

    Read the article

  • Programming error in 'aptdaemon' [closed]

    - by Real
    Using Ubuntu 11.10 While performing updates through the update manager I get the following message: An unhandlable error occured There seems to be a programming error in aptdaemon, the software that allows you to install/remove software and to perform other package management related tasks. Details Traceback (most recent call last): File "/usr/lib/python2.7/dist-packages/aptdaemon/worker.py", line 968, in simulate trans.unauthenticated = self._simulate_helper(trans) File "/usr/lib/python2.7/dist-packages/aptdaemon/worker.py", line 1092, in _simulate_helper return depends, self._cache.required_download, \ File "/usr/lib/python2.7/dist-packages/apt/cache.py", line 235, in required_download pm.get_archives(fetcher, self._list, self._records) SystemError: E:Method has died unexpectedly!, E:Sub-process returned an error code (100), E:Method /usr/lib/apt/methods/ did not start correctly Tried some of the fixes that were posted but did not work. What shall I do to fix this issue?

    Read the article

  • Parallelism in .NET – Part 10, Cancellation in PLINQ and the Parallel class

    - by Reed
    Many routines are parallelized because they are long running processes.  When writing an algorithm that will run for a long period of time, its typically a good practice to allow that routine to be cancelled.  I previously discussed terminating a parallel loop from within, but have not demonstrated how a routine can be cancelled from the caller’s perspective.  Cancellation in PLINQ and the Task Parallel Library is handled through a new, unified cooperative cancellation model introduced with .NET 4.0. Cancellation in .NET 4 is based around a new, lightweight struct called CancellationToken.  A CancellationToken is a small, thread-safe value type which is generated via a CancellationTokenSource.  There are many goals which led to this design.  For our purposes, we will focus on a couple of specific design decisions: Cancellation is cooperative.  A calling method can request a cancellation, but it’s up to the processing routine to terminate – it is not forced. Cancellation is consistent.  A single method call requests a cancellation on every copied CancellationToken in the routine. Let’s begin by looking at how we can cancel a PLINQ query.  Supposed we wanted to provide the option to cancel our query from Part 6: double min = collection .AsParallel() .Min(item => item.PerformComputation()); .csharpcode, .csharpcode pre { font-size: small; color: black; font-family: consolas, "Courier New", courier, monospace; background-color: #ffffff; /*white-space: pre;*/ } .csharpcode pre { margin: 0em; } .csharpcode .rem { color: #008000; } .csharpcode .kwrd { color: #0000ff; } .csharpcode .str { color: #006080; } .csharpcode .op { color: #0000c0; } .csharpcode .preproc { color: #cc6633; } .csharpcode .asp { background-color: #ffff00; } .csharpcode .html { color: #800000; } .csharpcode .attr { color: #ff0000; } .csharpcode .alt { background-color: #f4f4f4; width: 100%; margin: 0em; } .csharpcode .lnum { color: #606060; } We would rewrite this to allow for cancellation by adding a call to ParallelEnumerable.WithCancellation as follows: var cts = new CancellationTokenSource(); // Pass cts here to a routine that could, // in parallel, request a cancellation try { double min = collection .AsParallel() .WithCancellation(cts.Token) .Min(item => item.PerformComputation()); } catch (OperationCanceledException e) { // Query was cancelled before it finished } .csharpcode, .csharpcode pre { font-size: small; color: black; font-family: consolas, "Courier New", courier, monospace; background-color: #ffffff; /*white-space: pre;*/ } .csharpcode pre { margin: 0em; } .csharpcode .rem { color: #008000; } .csharpcode .kwrd { color: #0000ff; } .csharpcode .str { color: #006080; } .csharpcode .op { color: #0000c0; } .csharpcode .preproc { color: #cc6633; } .csharpcode .asp { background-color: #ffff00; } .csharpcode .html { color: #800000; } .csharpcode .attr { color: #ff0000; } .csharpcode .alt { background-color: #f4f4f4; width: 100%; margin: 0em; } .csharpcode .lnum { color: #606060; } Here, if the user calls cts.Cancel() before the PLINQ query completes, the query will stop processing, and an OperationCanceledException will be raised.  Be aware, however, that cancellation will not be instantaneous.  When cts.Cancel() is called, the query will only stop after the current item.PerformComputation() elements all finish processing.  cts.Cancel() will prevent PLINQ from scheduling a new task for a new element, but will not stop items which are currently being processed.  This goes back to the first goal I mentioned – Cancellation is cooperative.  Here, we’re requesting the cancellation, but it’s up to PLINQ to terminate. If we wanted to allow cancellation to occur within our routine, we would need to change our routine to accept a CancellationToken, and modify it to handle this specific case: public void PerformComputation(CancellationToken token) { for (int i=0; i<this.iterations; ++i) { // Add a check to see if we've been canceled // If a cancel was requested, we'll throw here token.ThrowIfCancellationRequested(); // Do our processing now this.RunIteration(i); } } With this overload of PerformComputation, each internal iteration checks to see if a cancellation request was made, and will throw an OperationCanceledException at that point, instead of waiting until the method returns.  This is good, since it allows us, as developers, to plan for cancellation, and terminate our routine in a clean, safe state. This is handled by changing our PLINQ query to: try { double min = collection .AsParallel() .WithCancellation(cts.Token) .Min(item => item.PerformComputation(cts.Token)); } catch (OperationCanceledException e) { // Query was cancelled before it finished } PLINQ is very good about handling this exception, as well.  There is a very good chance that multiple items will raise this exception, since the entire purpose of PLINQ is to have multiple items be processed concurrently.  PLINQ will take all of the OperationCanceledException instances raised within these methods, and merge them into a single OperationCanceledException in the call stack.  This is done internally because we added the call to ParallelEnumerable.WithCancellation. If, however, a different exception is raised by any of the elements, the OperationCanceledException as well as the other Exception will be merged into a single AggregateException. The Task Parallel Library uses the same cancellation model, as well.  Here, we supply our CancellationToken as part of the configuration.  The ParallelOptions class contains a property for the CancellationToken.  This allows us to cancel a Parallel.For or Parallel.ForEach routine in a very similar manner to our PLINQ query.  As an example, we could rewrite our Parallel.ForEach loop from Part 2 to support cancellation by changing it to: try { var cts = new CancellationTokenSource(); var options = new ParallelOptions() { CancellationToken = cts.Token }; Parallel.ForEach(customers, options, customer => { // Run some process that takes some time... DateTime lastContact = theStore.GetLastContact(customer); TimeSpan timeSinceContact = DateTime.Now - lastContact; // Check for cancellation here options.CancellationToken.ThrowIfCancellationRequested(); // If it's been more than two weeks, send an email, and update... if (timeSinceContact.Days > 14) { theStore.EmailCustomer(customer); customer.LastEmailContact = DateTime.Now; } }); } catch (OperationCanceledException e) { // The loop was cancelled } Notice that here we use the same approach taken in PLINQ.  The Task Parallel Library will automatically handle our cancellation in the same manner as PLINQ, providing a clean, unified model for cancellation of any parallel routine.  The TPL performs the same aggregation of the cancellation exceptions as PLINQ, as well, which is why a single exception handler for OperationCanceledException will cleanly handle this scenario.  This works because we’re using the same CancellationToken provided in the ParallelOptions.  If a different exception was thrown by one thread, or a CancellationToken from a different CancellationTokenSource was used to raise our exception, we would instead receive all of our individual exceptions merged into one AggregateException.

    Read the article

  • Is copy paste programming bad ?

    - by ring bearer
    With plain google as well as google code search tools it is easy to find how to program using some resource or solve certain problems ( such as a Java class, or a ftp block in perl etc) and so developers are so tempted to just purely copy paste the code (in a way re-use) - is this an incompetency? I have done this myself though I think I am a better programmer than many others I have seen. Who has the time to RTFM? In this age of information abundance, I do not think that copy paste programming is bad. Isn't that what sites like stackoverflow do anyway? People ask - ok here is my problem - how to solve it? now someone will post complete code and the person who asked the question would simply copy paste the most voted answer. No matter how small the problem is. I am working with a bunch of young coders who heavily rely on internet to get their job done. I see convenience (for example, you may be quite good with algorithms and such but you may not know how to use a BufferedReader in Java - would you read complete Javadoc for BufferedReader or look up some example of using it somewhere??) in copy pasting and modifying code to get the job done. What are the real dangers of copy paste coding that can impact their competency?

    Read the article

  • Thread safe GUI programming

    - by James
    I have been programming Java with swing for a couple of years now, and always accepted that GUI interactions had to happen on the Event Dispatch Thread. I recently started to use GTK+ for C applications and was unsurprised to find that GUI interactions had to be called on gtk_main. Similarly, I looked at SWT to see in what ways it was different to Swing and to see if it was worth using, and again found the UI thread idea, and I am sure that these 3 are not the only toolkits to use this model. I was wondering if there is a reason for this design i.e. what is the reason for keeping UI modifications isolated to a single thread. I can see why some modifications may cause issues (like modifying a list while it is being drawn), but I do not see why these concerns pass on to the user of the API. Is there a limit imposed by an operating system? Is there a good reason these concerns are not 'hidden' (i.e. some form of synchronization that is invisible to the user)? Is there any (even purely conceptual) way of creating a thread safe graphics library, or is such a thing actually impossible? I found this http://blogs.operationaldynamics.com/andrew/software/gnome-desktop/gtk-thread-awareness which seems to describe GTK differently to how I understood it (although my understanding was the same as many people's) How does this differ to other toolkits? Is it possible to implement this in Swing (as the EDT model does not actually prevent access from other threads, it just often leads to Exceptions)

    Read the article

  • C# Threading Background Process - Programming - How to?

    - by Magic
    Hello...I have been given the horrible task of doing this. Launch the website Take a screenshot Fill in the form details, click on Next Take a screenshot ... ... ... Rinse. Repeat. Now, with various combinations, this comes up to 300 screenshots. And I have to do this for 4 different browsers. Chrome, Firefox, IE 6 and IE 7. I cannot use tools which will capture the screenshot and store them, such as, SnagIT. I need to take a screenshot, copy it to a Word Document and take the second screenshot and take it to a Word Document. I thought, I will write a tiny utility which will help me do this. Here is the requirement spec that I put up for it - An executable which once launched seats itself in the System Tray. While it is active, all instances of Key Press (Print Scrn), it should write the contents to a Word Document as defined (either a default path or a user defined one). Save the document periodically. Now, my question is - if I am going to develop this using C# (Winforms application), how do I go about doing this. I can do a fair bit of C# programming and I am willing to learn. But I am not able to locate the references for how to do a background process so that it runs in the background. And while it runs, it has to capture the Print Scrn command. Can you folks point me to the right material where I can learn this? Theoretical references should suffice. But if there are practical references, then nothing like it. Thanks!

    Read the article

  • Ideas for student parallel programming project

    - by chi42
    I'm looking to do a parallel programming project in C (probably using pthreads or maybe OpenMP) for a class. It will done by a group of about four students, and should take about 4 weeks. I was thinking it would be interesting to attack some NP-complete problem with a more complex algorithm like a genetic algo with simulated annealing, but I'm not sure if it would be a big enough project. Anyone knew of any cool problems that could benefit from a parallel approach?

    Read the article

  • Understanding VS2010 C# parallel profiling results

    - by Haggai
    I have a program with many independent computations so I decided to parallelize it. I use Parallel.For/Each. The results were okay for a dual-core machine - CPU utilization of about 80%-90% most of the time. However, with a dual Xeon machine (i.e. 8 cores) I get only about 30%-40% CPU utilization, although the program spends quite a lot of time (sometimes more than 10 seconds) on the parallel sections, and I see it employs about 20-30 more threads in those sections compared to serial sections. Each thread takes more than 1 second to complete, so I see no reason for them to work in parallel - unless there is a synchronization problem. I used the built-in profiler of VS2010, and the results are strange. Even though I use locks only in one place, the profiler reports that about 85% of the program's time is spent on synchronization (also 5-7% sleep, 5-7% execution, under 1% IO). The locked code is only a cache (a dictionary) get/add: bool esn_found; lock (lock_load_esn) esn_found = cache.TryGetValue(st, out esn); if(!esn_found) { esn = pData.esa_inv_idx.esa[term_idx]; esn.populate(pData.esa_inv_idx.datafile); lock (lock_load_esn) { if (!cache.ContainsKey(st)) cache.Add(st, esn); } } lock_load_esn is a static member of the class of type Object. esn.populate reads from a file using a separate StreamReader for each thread. However, when I press the Synchronization button to see what causes the most delay, I see that the profiler reports lines which are function entrance lines, and doesn't report the locked sections themselves. It doesn't even report the function that contains the above code (reminder - the only lock in the program) as part of the blocking profile with noise level 2%. With noise level at 0% it reports all the functions of the program, which I don't understand why they count as blocking synchronizations. So my question is - what is going on here? How can it be that 85% of the time is spent on synchronization? How do I find out what really is the problem with the parallel sections of my program? Thanks.

    Read the article

  • parallel java libraries

    - by jetru
    I'm looking for Java libraries/applications which are parallel and feature objects that can be queried in parallel. That is, there is/are objects in which multiple types of operations can be made from different threads and these will be synchronized. It would be helpful if someone could ideas of where I could find such applications as well. EDIT: Actually, language doesn't matter so much, so C++, Python, anything is welcome

    Read the article

  • Parallel For Loop - Problems when adding to a List - Possible .Net Bugs

    - by Kevin Crowell
    I am having some issues involving Parallel for loops and adding to a List. The problem is, the same code may generate different output at different times. I have set up some test code below. In this code, I create a List of 10,000 int values. 1/10th of the values will be 0, 1/10th of the values will be 1, all the way up to 1/10th of the values being 9. After setting up this List, I setup a Parallel for loop that iterates through the list. If the current number is 0, I add a value to a new List. After the Parallel for loop completes, I output the size of the list. The size should always be 1,000. Most of the time, the correct answer is given. However, I have seen 3 possible incorrect outcomes occur: The size of the list is less than 1,000 An IndexOutOfRangeException occurs @ doubleList.Add(0.0); An ArgumentException occurs @ doubleList.Add(0.0); The message for the ArgumentException given was: Destination array was not long enough. Check destIndex and length, and the array's lower bounds. What could be causing the errors? Is this a .Net bug? Is there something I can do to prevent this from happening? Please try the code for yourself. If you do not get an error, try it a few times. Please also note that you probably will not see any errors using a single-core machine. using System; using System.Collections.Generic; using System.Threading.Tasks; namespace ParallelTest { class Program { static void Main(string[] args) { List<int> intList = new List<int>(); List<double> doubleList = new List<double>(); for (int i = 0; i < 250; i++) { intList.Clear(); doubleList.Clear(); for (int j = 0; j < 10000; j++) { intList.Add(j % 10); } Parallel.For(0, intList.Count, j => { if (intList[j] == 0) { doubleList.Add(0.0); } }); if (doubleList.Count != 1000) { Console.WriteLine("On iteration " + i + ": List size = " + doubleList.Count); } } Console.WriteLine("\nPress any key to exit."); Console.ReadKey(); } } }

    Read the article

< Previous Page | 7 8 9 10 11 12 13 14 15 16 17 18  | Next Page >