Search Results

Search found 13737 results on 550 pages for 'asynchronous programming'.

Page 7/550 | < Previous Page | 3 4 5 6 7 8 9 10 11 12 13 14  | Next Page >

  • Assembly as a First Programming Language?

    - by Anto
    How good of an idea do you think it would be to teach people Assembly (some variant) as a first programming language? It would take a lot more effort than learning for instance Java or Python, but one would have good understanding of the machine more or less from "programming day one" (compared to many higher level languages, at least). What do you think? Is it a realistic idea, at least to those who are ready to make the extra effort? Advantages and disadvantages? Note: I'm no teacher, just curious

    Read the article

  • Assembly as a First Programming Language?

    - by Anto
    How good of an idea do you think it would be to teach people Assembly (some variant) as a first programming language? It would take a lot more effort than learning for instance Java or Python, but one would have good understanding of the machine more or less from "programming day one" (compared to many higher level languages, at least). What do you think? Is it a realistic idea, at least to those who are ready to make the extra effort? Advantages and disadvantages? Note: I'm no teacher, just curious

    Read the article

  • Programming my first C++ program

    - by Jason H.
    I have a basic understanding of programming and I currently learning C++. I'm in the beginning phases of building my own CLI program for ubuntu. However, I have hit a few snags and I was wondering if I could get some clarification. The program I am working on is called "sat" and will be available via command line only. I have the main.cpp. However, my real question is more of a "best practices" for programming/organization. When my program "sat" is invoked I want it to take additional arguments. Here is an example: > sat task subtask I'm not sure if the task should be in its own task.cpp file for better organization or if it should be a function in the main.cpp? If the task should be in its own file how do you accept arguments in the main.cpp file and reference the other file? Any thoughts on which method is preferred and reference material to backup the reasoning?

    Read the article

  • What are the differences between programming languages? [closed]

    - by Omega
    Once upon a time, I heard from someone the only difference between programming languages is the syntax I wanted to deny it - to say that there are other fundamental aspects that truly set a language apart from others than just syntax. But I couldn't... So, can you? Whenever I search Google for something like "differences between programming languages", the results tend to be debates between two specific languages (I'd like something more general) - however, some of the aspects that people seemed to debate the most were: Object-Oriented Method/Operator overloading (I actually see this rather related to syntax) Garbage-Collection (While it seems like a good difference, for some reason it doesn't seem that "fundamental") What important aspects other than syntax can you think of?

    Read the article

  • Good book about advanced programming techniques [closed]

    - by Luca
    I am looking to a book covering adavnced programming techniques, covering different practical scenarios and describing the different challanges with the relative solutions. As example, which are the best ways to implement a module for buying on a web application with credit card or how to manage responsivenes for the frontend of the web application itself (dealing with cache, optimeze plugins, etc). On the web there are tons of tutorials about these topics, but I am looking for a book where such cases are collected all together and treated by real professionists. If the book would provide some code samples, that would be a plus (especially if C# .NET), but I am more interested in the approach/solution rather than the code details. I could not find any of these cases in the general book about programming, therefore I hope someone might point me in the right direction. EDIT: I have 4 years experience as web developer, mainly with Microsoft (C#, ASP.NET, SQL Server) and client side technologies (jQuery, HTML/CSS).

    Read the article

  • [C#] How to consume web service adheres to the Event-based Asynchronous Pattern?

    - by codemonkie
    I am following the example from http://msdn.microsoft.com/en-us/library/8wy069k1.aspx to consume a web service implemented (by 3rd party) using the Event-based Asynchronous Pattern. However, my program needs to do multiple calls to the DoStuffAsync() hence will get back as many DoStuffCompleted. I chose the overload which takes an extra parameter - Object userState to distinguish them. My first question is: Is it valid to cast a GUID to Object as below, where GUID is used to generate unique taskID? Object userState = Guid.NewGuid(); Secondly, do I need to spawn off a new thread for each DoStuffAsync() call, since I am calling it multiple times? Also, would be nice to have some online examples or tutorials on this subject. (I've been googling for it the whole day and didn't get much back) Many thanks

    Read the article

  • Performance implications of Synchronous Sockets vs Asynchronous Sockets

    - by Akash Kava
    We are trying to build an SMTP Server to receive mail notifications from various clients over internet. As each of the communication will be longer and it needs to log everything, doing this Asynchronous way is little challenging as well as by using Socket's Asynchronous methods we are not sure of how flow of control and error handling happens. Previously we wrote lot of server/client apps but we always used Synchronous sockets, reason being they are longer sessions and each session also has lot of local data to manage and parsing messages etc. Does anyone have any experience over real performance differences between these two methods? Async calls use ThreadPool which we have experienced many times to just die for no reason. And we fail to restart threadpool etc. In one way Request-Response protocol of HTTP, Async Sockets makes sense, but SMTP/IMAP etc protocols are longer and they have interleaved messages plus state machine of server. So Async methods are really complicated to program. However if anyone can share the performance of Sockets, it will be helpful.

    Read the article

  • Asynchronous sockets in C#

    - by IVlad
    I'm confused about the correct way of using asynchronous socket methods in C#. I will refer to these two articles to explain things and ask my questions: MSDN article on asynchronous client sockets and devarticles.com article on socket programming. My question is about the BeginReceive() method. The MSDN article uses these two functions to handle receiving data: private static void Receive(Socket client) { try { // Create the state object. StateObject state = new StateObject(); state.workSocket = client; // Begin receiving the data from the remote device. client.BeginReceive( state.buffer, 0, StateObject.BufferSize, 0, new AsyncCallback(ReceiveCallback), state); } catch (Exception e) { Console.WriteLine(e.ToString()); } } private static void ReceiveCallback( IAsyncResult ar ) { try { // Retrieve the state object and the client socket // from the asynchronous state object. StateObject state = (StateObject) ar.AsyncState; Socket client = state.workSocket; // Read data from the remote device. int bytesRead = client.EndReceive(ar); if (bytesRead > 0) { // There might be more data, so store the data received so far. state.sb.Append(Encoding.ASCII.GetString(state.buffer,0,bytesRead)); // Get the rest of the data. client.BeginReceive(state.buffer,0,StateObject.BufferSize,0, new AsyncCallback(ReceiveCallback), state); } else { // All the data has arrived; put it in response. if (state.sb.Length > 1) { response = state.sb.ToString(); } // Signal that all bytes have been received. receiveDone.Set(); } } catch (Exception e) { Console.WriteLine(e.ToString()); } } While the devarticles.com tutorial passes null for the last parameter of the BeginReceive method, and goes on to explain that the last parameter is useful when we're dealing with multiple sockets. Now my questions are: What is the point of passing a state to the BeginReceive method if we're only working with a single socket? Is it to avoid using a class field? It seems like there's little point in doing it, but maybe I'm missing something. How can the state parameter help when dealing with multiple sockets? If I'm calling client.BeginReceive(...), won't all the data be read from the client socket? The devarticles.com tutorial makes it sound like in this call: m_asynResult = m_socClient.BeginReceive (theSocPkt.dataBuffer,0,theSocPkt.dataBuffer.Length, SocketFlags.None,pfnCallBack,theSocPkt); Data will be read from the theSocPkt.thisSocket socket, instead of from the m_socClient socket. In their example the two are one and the same, but what happens if that is not the case? I just don't really see where that last argument is useful or at least how it helps with multiple sockets. If I have multiple sockets, I still need to call BeginReceive on each of them, right?

    Read the article

  • How to write Asynchronous LINQ query?

    - by Morgan Cheng
    After I read a bunch of LINQ related stuff, I suddenly realized that no articles introduce how to write asynchronous LINQ query. Suppose we use LINQ to SQL, below statement is clear. However, if the SQL database responds slowly, then the thread using this block of code would be hindered. var result = from item in Products where item.Price > 3 select item.Name; foreach (var name in result) { Console.WriteLine(name); } Seems that current LINQ query spec doesn't provide support to this. Is there any way to do asynchronous programming LINQ? It works like there is a callback notification when results are ready to use without any blocking delay on I/O.

    Read the article

  • What sense does asynchronous IO make if the thread is blocked anyway (see example)

    - by codymanix
    Hello, I found an example for async ftp upload on msdn which does the following (snippet): // Asynchronously get the stream for the file contents. request.BeginGetRequestStream( new AsyncCallback (EndGetStreamCallback), state ); // Block the current thread until all operations are complete. waitObject.WaitOne(); The thing what I do not understand here is, which sense does asynchronous IO make if the thread is blocked anyway with an explicit waithandle. I always thought the advantage of asynchronous IO was that the user/programm does not have to wait.

    Read the article

  • Asynchronous email processing in Java web application

    - by Denise
    Hi everyone, I would like to implement asynchronous email sending in my web application when users register for a new account. This is so that if there is a problem or delay in sending the email message (e.g. the mail server is down or the network connection to the mail server is slow) the user won't be kept waiting for the sending to complete. My web app is built using Spring and Hibernate's implementation of JPA. What would be the best and most reliable way for me to implement asynchronous email processing in this web application? I am thinking about persisting the email information in a database table which is then regularly polled by a Quartz (http://www.opensymphony.com/quartz/) scheduled job for updates and when it finds new unsent emails, it attempts to send them. Is this a reasonable way of implementing what I want? Thanks.

    Read the article

  • Converting Asynchronous Programming Model (Begin/End methods) into event-based asynchronous model?

    - by David
    Let's say I have code that uses the Asynchronous Programming Model, i.e. it provides the following methods as a group which can be used synchronously or asynchronously: public MethodResult Operation(<method params>); public IAsyncResult BeginOperation(<method params>, AsyncCallback callback, object state); public MethodResult EndOperation(IAsyncResult ar); What I want to do is wrap this code with an additional layer that will transform it into the event-driven asynchronous model, like so: public void OperationAsync(<method params>); public event OperationCompletedEventHandler OperationCompleted; public delegate void OperationCompletedEventHandler(object sender, OperationCompletedEventArgs e); Does anyone have any guidance (or links to such guidance) on how to accomplish this?

    Read the article

  • Asynchronous Processing in JBoss 6 ("Comet")

    - by chris_l
    edit: Retagged as tomcat, since this is really a question about the Tomcat embedded inside JBoss 6, rather than JBoss itself I have an extremely simple servlet, which works on Glassfish v3. It uses Servlet 3.0 Asynchronous Processing. Here's a simplified version (which doesn't do much): @WebServlet(asyncSupported=true) public class SimpleServlet extends HttpServlet { @Override protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { final AsyncContext ac = request.startAsync(); ac.setTimeout(3000); } } On JBoss 6.0.0 (Milestone 2), I get the following Exception: java.lang.IllegalStateException: The servlet or filters that are being used by this request do not support async operation at org.apache.catalina.connector.Request.startAsync(Request.java:3096) at org.apache.catalina.connector.Request.startAsync(Request.java:3090) at org.apache.catalina.connector.RequestFacade.startAsync(RequestFacade.java:990) at playcomet.SimpleServlet.doGet(SimpleServlet.java:18) at javax.servlet.http.HttpServlet.service(HttpServlet.java:734) ... Do I have to do anything special to enable Asynchronous Processing in JBoss 6? Or do I need an additional deployment descriptor? ...

    Read the article

  • Implementing an interface using an asynchronous WCF service?

    - by John K.
    Hello, I am trying to figure out if it is possible to implement a .NET interface, where the interface method has to return something and you are implementing that particular interface method with an asynchronous WCF service? Hopefully you should already see the issue I am encountering. Here is the interface: public interface IDataService { IDataServiceResponse SendDataRequest(); } IDataServiceResponse is supposed to represent a simple container that holds the result of my asynchronous WCF callback. Here is the code snippet where I am implementing the interface method, SendDataRequest() public IDataServiceResponse SendDataRequest() { InitializeDataServiceParameters(); // Call the web service asynchronously, here.... _client.BeginQueryJobs(_parameters, DataServiceQueryCallBack, _client); // How do I return _dataServiceResponse, if I am calling the WCF service // asynchronously?? return _dataServiceResponse; } And the callback method signature: void DataServiceQueryCallBack(IAsyncResult result) { // ... implementation code } Thanks in advance, John

    Read the article

  • How do i get out of the habit of procedural programming and into object oriented programming?

    - by Shadi Almosri
    Hiya all, I'm hoping to get some tips to kinda help me break out of what i consider after all these years a bad habit of procedural programming. Every time i attempt to do a project in OOP i end up eventually reverting to procedural. I guess i'm not completely convinced with OOP (even though i think i've heard everything good about it!). So i guess any good practical examples of common programming tasks that i often carry out such as user authentication/management, data parsing, CMS/Blogging/eComs are the kinda of things i do often, yet i haven't been able to get my head around how to do them in OOP and away from procedural, especially as the systems i build tend to work and work well. One thing i can see as a downfall to my development, is that i do reuse my code often, and it often needs more rewrites and improvement, but i sometimes consider this as a natural evolution of my software development. Yet i want to change! to my fellow programmers, help :) any tips on how i can break out of this nasty habbit?

    Read the article

  • Django Asynchronous Processing

    - by freyrs
    Hello all, I have a bunch of Django requests which executes some mathematical computations ( written in C and executed via a Cython module ) which may take an indeterminate amount ( on the order of 1 second ) of time to execute. Also the requests don't need to access the database. Right now everything is synchronous ( using Gunicorn with sync worker types ) but I'd like to make this asynchronous and nonblocking. I am very new to asynchronous Django, and so my question is what is the best stack for doing this. Is this sort of process something a task queue is well suited for? Would anyone recommend Tornado + Celery + RabbitMQ, or perhaps something else? Thanks in advance!

    Read the article

  • Why are Asynchronous processes not called Synchronous?

    - by Balk
    So I'm a little confused by this terminology. Everyone refers to "Asynchronous" computing as running different processes on seperate threads, which gives the illusion that these processes are running at the same time. This is not the definition of the word asynchronous. a·syn·chro·nous –adjective 1. not occurring at the same time. 2. (of a computer or other electrical machine) having each operation started only after the preceding operation is completed. What am I not understanding here?

    Read the article

  • Mutating Programming Language?

    - by MattiasK
    For fun I was thinking about how one could build a programming language that differs from OOP and came up with this concept. I don't have a strong foundation in computer science so it might be common place without me knowing it (more likely it's just a stupid idea :) I apologize in advance for this somewhat rambling question :) Anyways here goes: In normal OOP methods and classes are variant only upon parameters, meaning if two different classes/methods call the same method they get the same output. My, perhaps crazy idea, is that the calling method and class could be an "invisible" part of it's signature and the response could vary depending on who call's an method. Say that we have a Window object with a Break() method, now anyone (who has access) could call this method on Window with the same result. Now say that we have two different objects, Hammer and SledgeHammer. If Break need to produce different results based on these we'd pass them as parameters Break(IBluntObject bluntObject) With a mutating programming language (mpl) the operating objects on the method would be visible to the Break Method without begin explicitly defined and it could adopt itself based on them). So if SledgeHammer calls Window.Break() it would generate vastly different results than if Hammer did so. If OOP classes are black boxes then MPL are black boxes that knows who's (trying) to push it's buttons and can adapt accordingly. You could also have different permission sets on methods depending who's calling them rather than having absolute permissions like public and private. Does this have any advantage over OOP? Or perhaps I should say, would it add anything to it since you should be able to simply add this aspect to methods (just give access to a CallingMethod and CallingClass variable in context) I'm not sure, might be to hard to wrap one's head around, it would be kinda interesting to have classes that adopted themselves to who uses them though. Still it's an interesting concept, what do you think, is it viable?

    Read the article

  • How do I create my own programming language and a compiler for it

    - by Dave
    I am thorough with programming and have come across languages including BASIC, FORTRAN, COBOL, LISP, LOGO, Java, C++, C, MATLAB, Mathematica, Python, Ruby, Perl, JavaScript, Assembly and so on. I can't understand how people create programming languages and devise compilers for it. I also couldn't understand how people create OS like Windows, Mac, UNIX, DOS and so on. The other thing that is mysterious to me is how people create libraries like OpenGL, OpenCL, OpenCV, Cocoa, MFC and so on. The last thing I am unable to figure out is how scientists devise an assembly language and an assembler for a microprocessor. I would really like to learn all of these stuff and I am 15 years old. I always wanted to be a computer scientist someone like Babbage, Turing, Shannon, or Dennis Ritchie. I have already read Aho's Compiler Design and Tanenbaum's OS concepts book and they all only discuss concepts and code in a high level. They don't go into the details and nuances and how to devise a compiler or operating system. I want a concrete understanding so that I can create one myself and not just an understanding of what a thread, semaphore, process, or parsing is. I asked my brother about all this. He is a SB student in EECS at MIT and hasn't got a clue of how to actually create all these stuff in the real world. All he knows is just an understanding of Compiler Design and OS concepts like the ones that you guys have mentioned (i.e. like Thread, Synchronization, Concurrency, memory management, Lexical Analysis, Intermediate code generation and so on)

    Read the article

  • How to diagram custom programming languages, non textual?

    - by Adam
    I've used and created domain-specific languages before, plenty of times (e.g. using yacc/lex). Normally we'd start with grammar written in BNF, and a bunch of keywords. This is easy to do, easy to share. Recently, I've started working with diagrammatic programming languages - closest parallel is circuit-diagrams in electronics, where it's very difficult to express ideas in text, but very easy to express them in wiring-diagrams. This is a new and novel problem for me: how to efficiently express these mini-languages, and share concepts in them with colleagues? (i.e. how to whiteboard-program within them. Actual programming is easy - you have physical components to hand) Are there tools for this? Or good/best practices (e.g. equivalent of "always use BNF as starting point for your new DSL, and use tools like yacc to generate the parser, compiler, etc"). My googlefu is proving weak - all I get is false positives for wiring diagrams, and UML editors (since these are custom languages, UML doesn't seem to help)

    Read the article

  • How do I create my own programming language and a compiler for it

    - by Dave
    I am thorough with programming and have come across languages including BASIC, FORTRAN, COBOL, LISP, LOGO, Java, C++, C, MATLAB, Mathematica, Python, Ruby, Perl, Javascript, Assembly and so on. I can't understand how people create programming languages and devise compilers for it. I also couldn't understand how people create OS like Windows, Mac, UNIX, DOS and so on. The other thing that is mysterious to me is how people create libraries like OpenGL, OpenCL, OpenCV, Cocoa, MFC and so on. The last thing I am unable to figure out is how scientists devise an assembly language and an assembler for a microprocessor. I would really like to learn all of these stuff and I am 15 years old. I always wanted to be a computer scientist some one like Babbage, Turing, Shannon, or Dennis Ritchie. I have already read Aho's Compiler Design and Tanenbaum's OS concepts book and they all only discuss concepts and code in a high level. They don't go into the details and nuances and how to devise a compiler or operating system. I want a concrete understanding so that I can create one myself and not just an understanding of what a thread, semaphore, process, or parsing is. I asked my brother about all this. He is a SB student in EECS at MIT and hasn't got a clue of how to actually create all these stuff in the real world. All he knows is just an understanding of Compiler Design and OS concepts like the ones that you guys have mentioned (ie like Thread, Synchronisation, Concurrency, memory management, Lexical Analysis, Intermediate code generation and so on)

    Read the article

  • My Only Gripe With Programming

    - by David Espejo
    Is that im having trouble practicing problems. Even if I decide to practice the problems from my C++ book, they dont give any idea of the way the solution(program) should look like, so that I may compare to see if my program is similar in anyway. My book gives me to many generic "Write a program to do "this" " projects without really showing a concrete example of what "this" really is. In other words How Do I Know That I did "that". One problem in my book said to write a program that calculates the sales tax on a given item????? First of all slase tax differs on state(whats the state,) whats the item(a house, a dog,) How can I check this to see if im right. Programming books dont have answer keys! I know that there is no ABSOLUTE answer, thats just silly, programs can be written in many ways, but a sample of what one would look like based of the difficulty of the problem would really help! Is there a solution to this, maby a book that has worked out examples for the problems they give , or online sources that do something similar.(is there such thing as a programming book with an answer key?)

    Read the article

  • What constitutes a programming language and how does one copyright a programming language?

    - by Yannbane
    I've decided to create a programming language of my own, mostly just for fun. However, I got interested in the legal aspect of it all. You can, for example, licence specific programs under specific terms. However, how do you go about licensing a language? Also, by that I don't just mean the implementation of the language (compiler & VM), but the standard itself. Is there something else to a programming language I'm missing? What I would like to achieve by such licensing: Make it completely FOSS (can a language even be FOSS, or is that the implementation that can be FOSS?) Establish myself as the author (can you legally be an author of a language? Or, again, just the implementation?) Make it so that anyone implementing my language would be required to attribute me (MIT-style. Please note that I do not have any hopes for anyone actually ever doing that though, I'm just learning.) I think that the solution would be to separately license the VM and the compiler for my language, as "the official implementation", and then license the design document as the language itself. What exactly am I missing here?

    Read the article

< Previous Page | 3 4 5 6 7 8 9 10 11 12 13 14  | Next Page >