Search Results

Search found 12660 results on 507 pages for 'programming pearls'.

Page 91/507 | < Previous Page | 87 88 89 90 91 92 93 94 95 96 97 98  | Next Page >

  • Deferent ways of solving problems in code.

    - by Erin
    I now program in C# for a living but before that I programmed in python for 5 years. I have found that I write C# very that most examples I see on the web. Rather then writing things like: foreach (string bar in foo) { //bar has something doen to it here } I write code that looks like this. foo.ForEach( c => c.someActionhere() ) Or var result = foo.Select( c => { //Some code here to transform the item. }).ToList(); I think my using code like above came form my love of map and reduce in python while not exactly the same thing the concepts are close. Now it's time for my question. What concepts do you take and move with you from language to language. That allow you to solve a problem in a way that is not the normal accepted solution in that language?

    Read the article

  • Automatic language transformation in editor or IDE [on hold]

    - by Rumca
    Are there any tools that are capable of editing code but in different language? To be more concrete, I want to parse java source file in editor, compile it to my language X, edit in X and compile back to java on save. Or edit pom.xml file using non-XML syntax. Which editor or IDE would be easiest to use for implementing such prototype? Option to transform only a snippet would be ideal to limit effort on parsing. For one example, Intellij IDEA can display anonymous class so it looks like lambda expression hiding some of boilerplate.

    Read the article

  • How would I go about implementing a globe-like "ballish" map?

    - by rFactor
    I am new to 3D development and I have this idea of having the game world like our globe is - a ball. So, there would be no corners in the map and the game is top-down RTS game. I would like the camera to go on and on and never stop even though you are moving the camera to the same direction all the time. I am not sure if this is even possible, but I would really like to build a globe-like map without borders. Can this be done, and how exactly? I am using XNA, C#, and DirectX. Any tutorials or links or help is greatly appreciated!

    Read the article

  • Languages with C/C++ output [closed]

    - by Vag
    Which languages have compilers able to emit plain standard C/C++ code? For a start: Haxe // uses Boehm GC Haskell (JHC) Haskell (old GHC) // -fvia-c, removed recently (emitted code is super ugly) Clay ATS Cython RPython (Shed Skin) // experimental RPython (PyPy) Python (Nuitka) // although author claims there are no speedups Common Lisp (ECL) COBOL (OpenCobol) Scheme (Chicken) APL // So far I've not found working implementation available for free download Ur/Web // GCC-specific output, and intended to be used only for web developments (included for completeness only) I'd like to build comprehensive up-to-date list but found only these ones so far. I've tested only Haxe and it works pretty well and quite fast. What about other ones? What is your expirience? How much ugly is generated code? Update. Any language chains (e.g. X - Scheme - C) will be perfectly OK as answer if its use is practical enough and suited for production use.

    Read the article

  • How to export user input data from python to excel?

    - by mrn
    I am trying to develop a user form in python 2.7.3. Please note that I am a python beginner. I am trying to use xlwt to export data to excel. I want to write values of following variables i.e. a (value to write:'x1') & d (value to write: be user defined information in text box), to an excel sheet, a=StringVar() checkBox1=Checkbutton(root, text="text1", variable=a, onvalue="x1", offvalue="N/A") checkBox1.place(relx=0., rely=0., relwidth=0., relheight=0.) checkBox1.pack() d=StringVar() atextBox1=Entry(root, textvariable=d, font = '{MS Sans Serif} 10') atextBox1.pack() Need help badly. Thank you so much in advance

    Read the article

  • Necessary Infrastructure for large project with many components communicating through IPCs

    - by jluzwick
    I have a fairly in depth question which probably doesn't have an exact answer. As a software engineer, I am usually tasked with working on a program or project with minimal understanding of how other components or programs in the project interact with each other. When one program fails in a sea of multiple components and processes, what infrastructure elements are necessary to ensure that the problem can be accurately tracked to the violating application? More specifically, what infrastructure elements should be necessary for this large project and which are optional but very helpful. One such example I can think of is some form of a common logging infrastructure that allows for a developer or tester to easily browse through a log that contains numerous components for messages that might allude to the culprit program along with a "trail" of what happened before the issue occurred. I'm thinking of something similar to Androids alogcat tool. These necessary infrastructure elements should be language-agnostic. While these elements should be understood by all engineers on the team in question, which elements should be understood at great detail by the technical system engineers and what should the individual software engineers be responsible for adding to their tools to allow for such infrastructures to take hold? Please feel free to ask for clarification if something does not make sense as I understand this question is very broad and needs some refinement. I will refine as necessary from the answers and comments I receive. Thanks for any help!

    Read the article

  • Is this high coupling?

    - by Bono
    Question I'm currently working a on an assignment for school. The assignment is to create a puzzle/calculator program in which you learn how to work with different datastructures (such as Stacks). We have generate infix math strings suchs as "1 + 2 * 3 - 4" and then turn them in to postfix math strings such as "1 2 + 3 * 4 -". In my book the author creates a special class for converting the infix notation to postfix. I was planning on using this but whilst I was about to implement it I was wondering if the following is what you would call "high coupling". I have read something about this (nothing that is taught in the book or anything) and was wondering about the aspect (since I still have to grasp it). Problem I have created a PuzzleGenerator class which generates the infix notation of the puzzle (or math string, whatever you want to call it) when it's instantiated. I was going to make a method getAnswer() in which I would instantiate the InToPost class (the class from the book) to convert the infix to postfox notation and then calculate the answer. But whilst doing this I thought: "Is using the InToPost class inside this method a form a high coupling, and would it be better to place this in a different method?" (such as a "convertPostfixToInfix" method, inside the PuzzleGenerator class) Thanks in advance.

    Read the article

  • Customizing Texmaker

    - by Gabriel Furstenheim
    I use LaTeX a lot but I find quite obnoxious all the crappy files it leaves behind when you compile: .aux, .log... Fortunately TeXMaker has the option "clean" that deletes all of these. However, I don't like having to remember to click on it every time I'm going to close a document, ie I'd like a button that both closes a document and cleans all that stuff. Any hint as how to do it? I suppose if I knew how to access the program code I'd be able to do it as I'd just have to put together two options that already exist. Thanks

    Read the article

  • What are the benefits of Android way of "saving memory" - explicitly passing Context objects everywhere?

    - by Sarge Borsch
    Turned out, this question is not easy to formulate for me, but let's try. In Android, pretty much any UI object depends on a Context, and has defined lifetime. It also can destroy and recreate UI objects and even whole application process at any time, and so on. This makes coding asynchronous operations correctly not straightforward. (and sometimes very cumbersome) But I never have seen a real explanation, why it's done that way? There are other OSes, including mobile OSes (iOS, for example), that don't do such things. So, what are the wins of Android way (Activities & Contexts)? Does that allow Android applications to use much less RAM, or maybe there are other benefits?

    Read the article

  • Dealing with a gfortran error?

    - by user293253
    I usually do some pieces of code in Fortran and C for my job, but since some days ago I get the following error: $ gfortran D.f -o D.x gfortran: error trying to exec 'f951': execvp: No such file or directory (I have Ubuntu 14.04 on a I7, 8cores and 64b) I did try searching on the forums and several option but nothing seems to work ... Could somebody help ... ? I guess the problem started when I did something to install adobereader and/or skype.

    Read the article

  • Where to start in creating a massive multiplayer 3D Java game [on hold]

    - by user1373771
    I am planning on creating a massive multiplayer world and I am wondering where to start. I am quite inexperienced in the field of Java but I have researched into it and learned that it is perhaps my best bet in creating this project is Java for the fact that it has a much easier learning curve than C++ to beginners and still capable of holding massive amounts of players at a time. My question is simple: Should I start the game by creating a single player prototype and introducing multiplayer later as I become more experienced or start with multiplayer before I am completely experienced in the field. Thanks for your help!

    Read the article

  • The advantages & disadvantages to be had from using a Web Framework?

    - by JHarley1
    Hello, This question is focused on extracting the advantages and disadvantages of using Web based Frameworks: such as Cake PHP, Zend, jQuery, ASP.NET). This question is completely language agnostic. Let me start with the notion of "Standing on the shoulders of Giants". Advantages: Empowers Developers - by taking features that would have previously have taken 100's of lines of code and compressing them into one simple function call empowers developers to integrate more complex features into their Web Sites. Allow for Quicker development of applications - this is very relevant for people that need websites created in a very small window (has anyone any examples of this?) Lower Costs - allows programmers to pass cost savings onto the customer, a whole new range of customers generated that wanted a website but previously could not afford the higher development costs. Disadvantages: Lost Understanding - by relying on the features of a framework a developer is in danger of loosing understanding on how things work (underneath the hood). The configuration cliff - once you go further than the configuration of your framework your productivity drops right off, it can be difficult to implement features outside of a frameworks configuration. Developer tramlines - you (the developer) has to do things the way that the developer want you to do things. Security issues - giving people these tools to develop professional looking websites fast is a potential risk, people can quickly create professional looking websites for fraudulent companies. I wonder what people make of my points, and whether any body disagrees with them? Also if people have additional points I would be grateful. Many Thanks, J

    Read the article

  • In Search Data Structure And Algorithm Project Title Based on Topic

    - by Salehin Suhaimi
    As the title says, my lecturer gave me a project that i needed to finish in 3 weeks before final semester exams. So i thought i will start now. The requirement is to "build a simple program that has GUI based on all the chapter that we've learned." But i got stuck on WHAT program should i build. Any idea a program that is related to this chapter i've learned? Any input will help. list, array list, linked list, vectors, stacks, Queues, ADT, Hashing, Binary Search Tree, AVL Tree, That's about all i can remember. Any idea where can i start looking?

    Read the article

  • Problem in udp socket programing in c

    - by Md. Talha
    I complile the following C code of UDP client after I run './udpclient localhost 9191' in terminal.I put "Enter Text= " as Hello, but it is showing error in sendto as below: Enter text: hello hello : error in sendto()guest-1SDRJ2@md-K42F:~/Desktop$ " Note: I open 1st the server port as below in other terminal ./server 9191. I beleive there is no error in server code. The udp client is not passing message to server. If I don't use thread , the message is passing .But I have to do it by thread. UDP client Code: /* simple UDP echo client */ #include <sys/types.h> #include <sys/socket.h> #include <netinet/in.h> #include <arpa/inet.h> #include <netdb.h> #include <stdio.h> #include <pthread.h> #define STRLEN 1024 static void *readdata(void *); static void *writedata(void *); int sockfd, n, slen; struct sockaddr_in servaddr; char sendline[STRLEN], recvline[STRLEN]; int main(int argc, char *argv[]) { pthread_t readid,writeid; struct sockaddr_in servaddr; struct hostent *h; if(argc != 3) { printf("Usage: %s <proxy server ip> <port>\n", argv[0]); exit(0); } /* create hostent structure from user entered host name*/ if ( (h = gethostbyname(argv[1])) == NULL) { printf("\n%s: error in gethostbyname()", argv[0]); exit(0); } /* create server address structure */ bzero(&servaddr, sizeof(servaddr)); /* initialize it */ servaddr.sin_family = AF_INET; memcpy((char *) &servaddr.sin_addr.s_addr, h->h_addr_list[0], h->h_length); servaddr.sin_port = htons(atoi(argv[2])); /* get the port number from argv[2]*/ /* create a UDP socket: SOCK_DGRAM */ if ( (sockfd = socket(AF_INET,SOCK_DGRAM, 0)) < 0) { printf("\n%s: error in socket()", argv[0]); exit(0); } pthread_create(&readid,NULL,&readdata,NULL); pthread_create(&writeid,NULL,&writedata,NULL); while(1) { }; close(sockfd); } static void * writedata(void *arg) { /* get user input */ printf("\nEnter text: "); do { if (fgets(sendline, STRLEN, stdin) == NULL) { printf("\n%s: error in fgets()"); exit(0); } /* send a text */ if (sendto(sockfd, sendline, sizeof(sendline), 0, (struct sockaddr *) &servaddr, sizeof(servaddr)) < 0) { printf("\n%s: error in sendto()"); exit(0); } }while(1); } static void * readdata(void *arg) { /* wait for echo */ slen = sizeof(servaddr); if ( (n = recvfrom(sockfd, recvline, STRLEN, 0, (struct sockaddr *) &servaddr, &slen)) < 0) { printf("\n%s: error in recvfrom()"); exit(0); } /* null terminate the string */ recvline[n] = 0; fputs(recvline, stdout); }

    Read the article

  • What language(s) do I need to learn in order to develop an application like this?

    - by Josh
    I have an idea for making a web application. Ideally this application would have products which prices are increased each time a Retweet of the product at hand is made. Kind of like bids with tweets. Unfortunately my web development knowledge is very scarce. I know just basic HTML, virtually no CSS and that's it. I'm kindly asking for your insights on what you think would be best for making a web app like this. I have no good idea of where to start or what I need to get going. Your inputs are greatly appreciated. Thanks in advance.

    Read the article

  • Is it a bad practice to include all the enums in one file and use it in multiple classes?

    - by Bugster
    I'm an aspiring game developer, I work on occasional indie games, and for a while I've been doing something which seemed like a bad practice at first, but I really want to get an answer from some experienced programmers here. Let's say I have a file called enumList.h where I declare all the enums I want to use in my game: // enumList.h enum materials_t { WOOD, STONE, ETC }; enum entity_t { PLAYER, MONSTER }; enum map_t { 2D, 3D }; // and so on. // Tile.h #include "enumList.h" #include <vector> class tile { // stuff }; The main idea is that I declare all enums in the game in 1 file, and then import that file when I need to use a certain enum from it, rather than declaring it in the file where I need to use it. I do this because it makes things clean, I can access every enum in 1 place rather than having pages openned solely for accessing one enum. Is this a bad practice and can it affect performance in any way?

    Read the article

  • Contiguous Time Periods

    It is always better, and more efficient, to maintain referential integrity by using constraints rather than triggers. Sometimes it is not at all obvious how to do this, and the history table, and other temporal data tables, presented problems for checking data that were difficult to solve with constraints. Suddenly, Alex Kuznetsov came up with a good solution, and so now history tables can benefit from more effective integrity checking. Joe explains...

    Read the article

  • SQL Server Unit Testing with tSQLt

    When one considers the amount of time and effort that Unit Testing consumes for the Database Developer, is surprising how few good SQL Server Test frameworks are around. tSQLt , which is open source and free to use, is one of the frameworks that provide a simple way to populate a table with test data as part of the unit test, and check the results with what should be expected. Sebastian and Dennis, who created tSQLt, explain.

    Read the article

  • Why can't `main` return a double or String rather than int or void?

    - by sunny
    In many languages such as C, C++, and Java, the main method/function has a return type of void or int, but not double or String. What might be the reasons behind that? I know a little bit that we can't do that because main is called by runtime library and it expects some syntax like int main() or int main(int,char**) so we have to stick to that. So my question is: why does main have the type signature that it has, and not a different one?

    Read the article

  • Looking for menu-driven coding platforms

    - by user2634047
    Can anyone point me to an application development environment that uses menu-driven coding? This would mean where commands, variable names, etc. are not keyed in, but rather are selected from a menu of context-specific options. For example, the user selects an If...then command from a menu of commands, and is then presented with a menu of variables to choose from for the the 'if' conditions(s) (or creates new variable(s) on the fly via the menu), and is then presented with a menu of applicable functions that are applicable to the selected variable (e.g., val()), and so on until the If...then statement has been fully coded. The idea is that the user never types any portion of the code, but selects all code elements from a menu, or defines them on the fly via the menu. Thanks.

    Read the article

  • How to avoid whitespace in PHP and ASP.NET? [closed]

    - by Goma
    You know that the PHP interpreter avoids whitespace and comments. However, I have heared that there is something you can do to make the interpreter does not see the whitespace at all and does not even think to avoid it, the same for the compiler in ASP.NET. What is that thing? Is it a function in PHP and a class in ASP.NET? or what exactly? Edit: For example the php_strip_whitespace function in PHP "Returns the PHP source code in filename with PHP comments and whitespace removed". Will this help in load time?

    Read the article

  • Is Akka a good solution for a concurrent pipeline/workflow problem?

    - by herpylderp
    Disclaimer: I am brand new to Akka and the concept of Actors/Event-Driven Architectures in general. I have to implement a fairly complex problem where users can configure a "concurrent pipeline": Pipeline: consists of 1+ Stages; all Stages execute sequentially Stage: consists of 1+ Tasks; all Tasks execute in parallel Task: essentially a Java Runnable As you can see above, a Task is a Runnable that does some unit of work. Tasks are organized into Stages, which execute their Tasks in parallel. Stages are organized into the Pipeline, which executes its Stages sequentially. Hence if a user specifies the following Pipeline: CrossTheRoadSafelyPipeline Stage 1: Look Left Task 1: Turn your head to the left and look for cars Task 2: Listen for cars Stage 2: Look right Task 1: Turn your head to the right and look for cars Task 2: Listen for cars Then, Stage 1 will execute, and then Stage 2 will execute. However, while each Stage is executing, it's individual Tasks are executing in parallel/at the same time. In reality Pipelines will become very complicated, and with hundreds of Stages, dozens of Tasks per Stage (again, executing at the same time). To implement this Pipeline I can only think of several solutions: ESB/Apache Camel Guava Event Bus Java 5 Concurrency Actors/Akka Camel doesn't seem right because its core competency is integration not synchrony and orchestration across worker threads. Guava is great, but this doesn't really feel like a subscriber/publisher-type of problem. And Java 5 Concurrency (ExecutorService, etc.) just feels too low-level and painful. So I ask: is Akka a strong candidate for this type of problem? If so, how? If not, then why, and what is a good candidate?

    Read the article

  • How can I create an orthographic display that handles different screen dimensions?

    - by Piku
    I'm trying to create an iPad/iPhone game using GLES2.0 that contains a 3D scene with a heads-up-display/GUI overlaid on the top. However, this problem would also apply if I were to port my game to a computer and run the game in a resizable window, or allow the user to change screen resolutions... When trying to make the 2D GUI/HUD work I've made the assumption that all I'm really doing is drawing a load of 2D textured 'quads' on the screen and am trying to treat the orthographic projection as an old-style 2D display with 0,0 in the upper left and screenWidth,ScreenHeight in the lower right. This causes me all sorts of confusion when I rotate my ipad into Landscape mode since I can't work out what to put into my projection and modelview matrices to turn everything around the right way. It also gets messy if I want to support the iPad's large screen, an iPhone or a Retina display since I have to then draw three sets of textures for everything and work out which ones to use. Should I be trying to map the 2D OpenGL co-ords 1:1 with the screen? While typing out this question it occurs to me that I could keep my origin in the centre, still running -1/+1 along the axes. This would let me scale my 2D content appropriately on the different screen sizes, but wouldn't I end up with the textures being scaled and possibly losing quality? I'm using OpenGLES 2.0 and have a matrix library that has equivalents to the GLES1.1 glOrthof() and glFrustrum() calls.

    Read the article

  • Game Asset Storage: Archive vs Individual files

    - by David Colson
    As I am in the process of creating a 3D c++ game and I was wondering what would be more beneficial when dealing with game assets with regards to storage. I have seen some games have a single asset file compressed with everything in it and other with lots of little compressed files. If I had lots of individual files I would not need to load a large file at once and use up memory but the code would have to go about file seeking when the level loads to find all the correct files needed. There is no file seeking needed when dealing with one large file, but again, what about all the assets not currently needed that would get loaded with the one file? I could also have an asset file for each level, but then how do I deal with shared assets This has been bothering me for a while so tell me what other advantages and disadvantages are there to either way of doing things.

    Read the article

  • What am I missing about PHP?

    - by Aerovistae
    It's like this mythical thing that a dominating portion of developers say is just the best option for back-end development, a part of development about which I know virtually nothing beyond the absolute basics. So I've looked up PHP tutorials a bunch of times, trying to figure out why it's so powerful and common, but it's annoying as hell-- all the tutorials treat you like a new programmer. You know, this is how you make an If Else statement, here's a for loop, etc. The "Advanced Topics" show you how to make POST and GET statements and whatnot. But there must be more to it! I don't get it! That's practically no different from JavaScript. What am I missing about this language? What else can it do? Where's the power and versatility? I've heard it called a function soup; where are all the functions? Please chide me. I'm clearly missing something.

    Read the article

< Previous Page | 87 88 89 90 91 92 93 94 95 96 97 98  | Next Page >