instruction
stringlengths
34
19.9k
I come from php community and just started learning Python. I have to create server-side scripts that manipulate databases, files, and send emails. Some of it I found hard to do in python, comparing to php, like sending emails and querying databases. Where in php you have functions like mysql_query(), or email(), in p...
I am a lone developer and maintain a SVN server for source control. So far, I haven't followed anything specific while committing my changes. I was just reviewing my previous commits, and couldn't make any sense of my comments. What do you put in comments while committing your checkins?
The best thing I like about ASP.NET MVC, is that you can directly call a server method (called action), from the client. This is so convenient, and so straightforward, that I really like to implement such a model in ASP.NET WebForms too. However, in ASP.NET WebForms, to call a server method from the client, you should ...
I currently work with Zend Framework, but I also know about CodeIgniter and Kohana. I've just wonder that should I stick to a framework or depend on my purposes? Because I think I cannot master everything.
Possible Duplicate: How important is studying algorithms and theory is to becoming a great programmer? Today I learned the fast sort Algorithm. I doubt I will ever implement my own version though as C# has its own built in Sort method for lists and arrays. How important is learning Algorithms for high level language...
I'm learning CSS "seriously" for the first time, but I've found that the way you deal with multiple CSS classes in CSS and HTML quite inconsistent. For example, I learned that if I want to declare multiple CSS classes with a common style applied to them, I write: .style1, .style2, .style3 { color: red; } Then, if ...
I am a C# software developer. I was recently approached by a client to develop a multiplayer board game (max 4 players). I fiddled around with WCF, WPF and EF 4.1 to get something going but I keep running into small stumbling blocks. It certainly does appear that integrating all these technologies into one solution ...
I'm trying to refactor my application into MVC, but I'm stuck on the M part. In a database-backed app, the model is implemented in the app code, right? But then, what is in the database -- is that not also the model? (I'm not using the database as a simple object store -- the data in the DB is an enterprise asset).
When documenting software I traditionally write a plain text file (like a README.txt) which works well, but unfortunately cannot contain images like HTML can. Unfortunately images must be stored as separate files with a normal HTML document (using <a href=".../foo.png">) which give unnecessary clutter. The "Save a sin...
there are a couple of discussion on SO about setter methods returning "this" type. And looks like java 7 had the proposal of void methods returning this. But this proposal could not make it to java 7 features. I could not find if this proposal is moved on to java 8 or future or have been completely discarded. Is it? R...
Velocity Template Language's set directive requires a variable on the left hand side. This doesn't work. #set ( $entries.add("d") ) Even though I have no use for the return value of add("d"), I have to assign it to a variable. #set ( $x = $entries.add("d") ) I want to communicate that the variable is necessary, but...
All. I am creating some libraries for other teams in my company. They all have different logging mechanisms. I want to provide trace information of what my libraries are doing. What should I to achieve this? Thanks
I'm probably over-thinking this and it might not matter in the scope of things, but I'm wondering how people build up initial versions of their projects in source control? I'm talking about when you start with nothing but an idea, so no forking an existing project or anything. When do you do your commits before having...
I have an interface called Cell. In the start of the code, I read input data from which I can come to know the implementing class (not as a class object but I can know for example the string). And after that I need to call the constructor for the implementing class to initialize an object. What would be the best way to...
So my professor was giving back some feedback on a project I've been working on. He docked a few marks for this code: if (comboVendor.SelectedIndex == 0) { createVendor cv = new createVendor(); cv.ShowDialog(); loadVendors(); } This is in a combobox "index changed" handler. It's used when the user wants to creat...
I am part of a software deveopment team. Originally there were just 2 of us, and two applications. To ease our job we create a set of libraries, handling stuff like GUI, database access, calculation, business rules etc, so that we can reuse them in our applications without implementing them twice. Now the team grew, 6...
I have an ASP.NET C# application that needs to go off and iterate through a directory of .xml files and do some processing on the data inside them. This is easy enough, but i need to display the result after each .xml is processed, how can this be done? What im really asking here is how do you process a lot of data in...
I have a set of steps that need to run sequentially over a list of data. However each step only operates on a single piece of data at a time. Because of this, I can run the steps asynchronously. For example I have two pieces of data, and two steps. When step one is done processing the first piece of data, it passes it...
TL;DR: I need to develop an app which should look kind of the same on desktop and as a website incarnation. Since I am a web dev and have never developed for desktop, I want to use a language that can embed a webkit view so I can use the same HTML/JS front-end for both usages, and minimize the learning curve for GUI at...
Please feel free to suggest a better name or way of explaining this question - I wasn't quite sure what to call it. The situation is one that may just come under the heading of "be organized" but I often find myself passing around either big blobs of data or many smaller sub-blobs (blob in the non-technical meaning of ...
I want to know the rules of naming (AlwaysCapitalize, _underscore, firstSmallLetter, etc...) for each of Namespaces, Classes, Interfaces, Exceptions, Data Members, Methods, Variables, etc.... also I would like to know: Are they standards? Do they differ According to the access modifiers? (public, private.....) What ab...
To the best of my understanding the schedule for the project is derived using the effort estimates for the individual tasks (in person hours), and the number of relevant resources used for the particular task. As discussed in this question, we are starting a project using a new platform, featuring a brand new API and...
I have been working at the same software company for more than ten years. As a result, I have implemented a large code base using various object-oriented programming languages. I was a beginner programmer when I first started my career and I didn't know much about good interface and class design principles. I would li...
I've seen many companies using certification services such as Brainbench when evaluating candidates. Most times they use it as a secondary screen prior to interview or as a validation to choose between candidates. What is your experience with Brainbench scores? Did you try the tests yourself, and if so do you feel the ...
Microsoft technologies keep getting better but they do so on the expense of adding one more abstraction layer every time. In the early stages we used to play with C# code and SQL procedures to perform CRUD operations. Then generics came along with ADO.NET, DataSets, Entities. Next, LINQ came offering LINQ to SQL, to XM...
I have a number of large text files that I need to manipulate in a highly performant manner. I've decided to look into using Memory Mapped files in C# (.NET 4). However, I can't find any examples of or guidance on how to read/write to a memory mapped file that, underneath, is bound to a text file. Can anyone shed some ...
I'm frustrated by the lack of concrete explanations on how to go from being able to script (bash, awk) and write simple applications (c, php, python) to designing and developing larger, more complicated software. It seems that on one side there are programming language books and on the other side there are the software...
I want to learn multiple technologies. Currently I have knowledge of core Java, C, and PHP. I want to know the approach which should be followed to learn multiple things. I know if you know the core concepts of the behavior of programming language, any programming language can be learned. I want to make command on such...
It's not a secret to anyone that managers can and often will impose the programming language that will be used for a project. Being a programmer myself, I have never been able to understand this. But now I think I do: I've just had a revelation when Joel Spolsky said on the podcast that they should use QuickBooks becau...
recently I hired a freelancer to develop an iPhone application for my website, this application will get information from the DB of the website, normally I should give to him the access to the DB to take the information needed. The question is, how to let him take the information needed without safely, i.e preventing t...
We currently use Subversion and TeamCity, we're going to move to using Mercurial (specifically Kiln as we're FogBugz users). Obviously this will result in changes - hopefully improvements - in our development patterns (all two of us!) but the one issue I'm stuggling with is how to structure things so that we still enjo...
Among the reasons for a developer to publish a self-written library as open source library, there is definitely fame. Now when it comes to Boost Libraries, they are available and promoted in a very anonymous and impersonalized form. The name of the author will be readable in the documentation and source files, but be ...
Our library extends another (third-party) library. When we create a child class in our library, and want to throw exceptions, should those exceptions extend the exceptions from the parent class or from our own namespace? For example: class Their_Exception extends Exception {} class Their_Class {} class Their_Class_Exc...
Recently starting my first job as a software developer, I was a little thrown to be told that I did not have to follow any naming conventions in my code. Code written by groups working on other, larger projects followed naming conventions, but since I was brought in to write a new, stand-alone, application, the feeling...
I'm in the process of creating a grammar for a scripting language but as I'm working on it I started to wonder what makes a language good in the first place. I know the goals for my script but there are always 1000 different ways to go about doing things. Goals: Easy to use and understand (not my grandma could do it e...
As I've written about in other questions here, the project that I'm working on now has no software process. That means no documentation (including hard copy requirements or specification), no source control, no bug database, bugs are "fixed" (hopefully) and new code is added at the same time, and no formal testers - we...
Since this question seems to be pretty subjective, I'm posting it here. Let's say you're writing your own version of Stackoverflow using ASP.NET MVC, so there are classes like Question, Answer, User, etc. Since you're lazy, you decided to use entity framework. So, all the classes mentioned above have navigation propert...
I'm looking for an approach to the following problem: I have a reusable library. It contains a controller class, in the MVC sense. Let's say it's called UserAdministrationController, and it's for editing users. This class requires an object implementing IUserStorage, for storing its data. The library doesn't need to kn...
I heard about Domain Driven Development from a developer in the area. He talked it up like it was just about the silver bullet to changing requirements. I read the wiki. Still not too clear. What is "3D" in practical terms? Is it really that amazing that now UML class diagramming is just obsolete?
Nearly a year ago, I started writing a game. I was just messing around at the time, but now I'm pretty serious about it. As it's grown, it's taken on the responsibilities of a major game engine, as well as the game logic of an actual game. At some point, I decided I should break the two out, and designate a game and a ...
There is an utility we have which is used to upload files (and perform other operations on the file) to a network shared location. The file size tends to vary from a few mb to 500 mb. A suggestion has come up that we should maybe support multi-threading when uploading the files to the shared location - not required to ...
I am a beginner Java programmer, and have tried searching for a way to set up a login system with my Java application. The application is a game and I do not want people to just upload it to a website so others can down load and play. I want to use something like MySQL to make the user authenticate in order to use the...
See https://softwareengineering.stackexchange.com/questions/109817/superior-refusing-to-use-subversion My question is similar, but here are the main differences in my scenario: We are starting a new project from scratch, using PHP and web tech. There would be no down time in development as we would be adopting it from...
I have recently moved to a new company where I am tasked (in part) with evaluating the existing code base and coming up with patterns and best practices. Our development team consists of around 20 programmers and we have nearly as many projects. The bulk of the code is done in C# and SQL (Stored Procedures). Naturally,...
I was reading Code Complete and in the chapter on layout and style, he was predicting that code editors would use some sort of rich text formatting. That means, instead of code looking like this Procedure ResolveCollisions { Performs a posteriori collision resolution through spatial partitioning algoritm } ( CurrentM...
When I was originally learning about SQL I was always told, only use triggers if you really need to and opt to use stored procedures instead if possible. Now unfortunately at the time (a good few years ago) I wasn't as curious and caring about fundamentals as I am now so never did ask to the reason why. What's the co...
I have a personal project - a web application I wanted to develop - but I'm confused on which route to take. I know a little programming, and have dabbled in Pascal, C, HTML, CSS and Actionscript (for Flash). And I don't mind learning a new language (PHP, Python, mySQL, etc). I am not under any time constraint. About ...
I have been coding on and off on C and to a certain extent on C++ since my college days(2003), but I never had the opportunity to work with a hard core programming responsibility, which could have taught me "industrial grade coding" better and what is needed really for solving real life problems. To me it looks like I ...
I am a team lead dealing with a programmer with a Bachelors Degree in Computer Science. He has a couple of years of experience and is still a code monkey. Having observed him for quite a while, he is very slow in programming even fizzbuzz style questions. For other stuff, he tries to make do with just tinkering with co...
I read something on this site saying that Qt's GUI being a big problem that stop programmers from using Qt. They say the problem is that the GUI don't look native, and they are inconsistent. I personally use Windows, and from what I can see (some tree view and table view), they look pretty good and very native-looking ...
Imagine I've written a game and I want to make it free software. Am I also required to make the game server software free software because the game uses it to connect to other players to play against? Imagine I've written a stock ticker and I wish to make it free software. Can I charge for the subscription to the stock...
I recently learned of a program called Total Commander. It's a Windows Explorer replacement and has its own stuff to copy files. To check whether the files are identical, instead of calculation a CRC, it literally checks every single byte, one at a time, on both the original and the copy. My question is: Is this necess...
I have the following situation where I have a base class and multiple polymorphics derived classes: #include <iostream> class Base { public: virtual void foo() = 0; }; class Derived1 : public Base { public: virtual void foo() { std::cout << "Derived1::foo()\n"; }; }; class Derived2 : public B...
I have the following problem: Given n chips [note: these are VLSI chips] out of which majority of chips are good, we need to find one good chip. The only test that we can apply is on a pair of chips that answers if both chips are good or both are bad. The second part is to find a good chip if some tests might produ...
I'm developing a NES emulator as a hobby, in my free time. I use C++ because is the language I use mostly, know mostly and like mostly. But now that I made some advance into the project I realize I'm not using almost any specific features of C++, and could have done it in plain C and getting the same result. I don't...
I'm starting a hobby project and I'm in the middle of designing its architecture. I would like to make my program plugin-based (never done anything like that before), to make it extensible. Now I'm trying to grasp how such an architecture is created conceptually. Now, this wikipedia article about Plugins says that the ...
We have a small webdesign firm, and count with one designer. We can currently not afford too much expansion in the design area, so that means that the designer creates the main design of a website (which often means: the homepage), and the programmers then work with this to make it into a website. In general, this work...
I'm wondering what are the specific differences in the terminology we use for grouping related parts of code. I've sometimes seen the terms used interchangeably: many OO languages even use the keyword "function" to define a method. (Why?) If you wanted to be precise, what are the specific meanings of each? Or is it jus...
So, I'm a computer science major and I'm also a huge fan of the no-longer-on-TV show, Numb3rs. Now, whenever I talk with my friends they also ask me quite a few questions about programming and computers (and how they work). Now, on Numb3rs, they (Charlie, and occasionally Amita or Larry) often went on short, but well ...
Think JSFiddle. LINQPad is pretty sweet for fast C# with similar options. Is there anything like LINQPad that runs in a browser?
do you know of any algorithms which give an exact solution for the Traveling Purchaser Problem. I can only find heuristic and probabilistic approaches. I do have implemented a genetic algorithm so far, which by its nature does not terminate by itself an does not always yield the optimal result. Thus I'm looking for an ...
Today Javascript application of a relevant size become more and more common, and as the need arises, certain patterns are identified to manage the code complexity. I try to follow good advice, but I have some trouble in organizing the view layer of an application I am writing. While the other layers are nicely decouple...
I had a job process that was executing a lot of IO to read and write temporary files. Now I want to (need to) reduce the quantity of IO executions. So I want to create a sort of circular buffer that is going to be filled up with a data from a text file within first thread. The consumer (reading) thread will fetch d...
It's not uncommon to hear of decoupling the UI from program logic, or database design/access from program logic...or even program logic from itself. However, I've never heard of an approach to generalizing or abstracting away the details of threading tasks to the logic (aside from Tymeac, an Android-specific package). ...
I've been putting time into learning functional programming and I've come to the part where I want to start writing a project instead of just dabbling in tutorials/examples. While doing my research, I've found that Erlang seems to be a pretty powerful when it comes to writing concurrent software (which is my goal), but...
I have a form with several controls on it. Every control has to be declared in the class, formatted in the constructor (-size, location, event subscription etc), and its event-handlers declared, again, in the class. This is getting a bit unorganized, so I was thinking of refactoring this. For every control: Preparing a...
Does anybody have experience with using a bug-tracking / issue-tracking software like bugzilla, mantis or JIRA not only for bugs or tasks, but to initiate and maintain discussions that in the end lead to a decision? For example, a developer thinks that all protected fields should be abolished and changed to private fie...
I am a Java developer and most of my experience is on Java. But sometimes I have face some database related questions in the interviews. Hence I wanted to ask that from the interview point of view, which questions a Software Developer/Sr. Software Developer (non-DBA, non-Database Enigneer) should be able to answer abou...
What should I search/research if I'm looking for how to get started with translating database tables to Java code? For instance, if I have a one-many relationship in the database and I want to translate that to java code...what is that process called? I'm really looking for just plain Java code example and not any too...
Possible Duplicate: Using “Foo” and “Bar” in examples I discovered that in many examples of code i various books/questions/answers/tutorials the word Foo is used to name functions, interfaces, classes, properties, variables etc. It is a special name, or is simple to name something in 3 letters, and why Foo?
When I picture a really well functioning software team in my mind, one of the visions I have is of a developer showing off to a small group of devs some cool, clever UI that they just came up with based on something that they were just playing with. I'm afraid that while we're doing great at being creative writing expr...
I have been given the task of producing a compilation of pros, cons and key points on the issue of mobile native applications versus mobile web applications. It will be input for a discussion on top management level. What are some valid and maybe overlooked topics here?
For someone who doesn't have much real world experience yet, the notion of maintainable code is a bit vague, even though it follows from typical good practice rules. Intuitively I can tell that code can be well written, but not maintainable if for example it hard-wires information that is subject to constant change, bu...
Yes, you can access the mobile web site from a range different mobile devices, but the platform, I suppose, is still the web server and the client browser (the latter ideally being the "same" on any device). When talking mobile and cross platform I am thinking frameworks such as PhoneGap and Appcelerator Titanium, but ...
Regarding source folder hierarchy, there are always some common features, such as the src, doc or test folders, which have rather easy-to-understand contents. However, I realized that big projects have both a lib and vendor folders, while I had always thought they were the same, as their names hint at including “third-...
I am starting a project with following technical environment : .Net 4.0, Entity Framework 4.0, WPF with MVVM Architecture I saw lots of examples on the net, some books with this environment. In some of the examples authors had this Idea : Viemodel will have an instance of Model class (Entity Framework Entity e.g. Pers...
I'm looking for assistance in figuring out the best approach to managing User Acceptance Testing (UAT) and how users raise defects/bugs - I've been in the situation before of having to deal with a free for all in that every small error is raised as a bug which takes valuable time from actual bug fix whilst I sift throu...
I've been doing research on .net implementations with CQRS. Either everything I've seen so far is do-it-yourself, azure-specific, outdated (i think), or not well adopted Problems: Scritchy - is not well adopted NCQRS - appears to be a bit older? it also requires a DIY-ish setup - meaning, you need to create several pr...
Does Entity Framework mean you might never have to use SQL or design database tables again? Is this what "persistence ignorance" means? I am new to EF and ORMs in general, and I would like to understand how much of it is hype and how much is reality.
When should you prefer inheritance patterns over mixins in dynamic languages? By mixins, I mean actual proper mixing in, as in inserting functions and data members into an object in runtime. When would you use, for example, prototypal inheritance instead of mixins? To illustrate more clearly what I mean by mixin, some ...
The following scenario often happens with my team at the office. Let's say we decided to plan our Sprint this way: 50% new features 50% bug fixing (they are high priority AND unestimated as the fixes are easy, the hard and time-consuming bit is the investigation) The Sprint goes well and we finish all the features, s...
When you are being interviewed by potential future employers, it is of course of benefit to both parties to discuss what your previous job entailed (ie, what you have been doing for the last few years). What if the technology (and the ideas behind the technology) that you have been working on is sensitive and confiden...
In Pro C# 2008 it is stated Using constructs such as AppIDs, stubs, proxies, and the COM runtime environment, programmers can avoid the need to work with raw sockets, RPC calls, and other low-level details. It then demonstrates a VB6 call where a COM object is instantiated by passing in the AppId. Then, a method...
I was reading, Facts and Fallacies of Software Engineering, which has a section of maintenance. Since, I'm have been a maintenance developer for years now, I was very interesting facts presented. Here's three. Fact 41: Maintenance typically consumes 40 to 80 percent (average, 60 percent) of software costs. Therefore, ...
There's a quotation by Ralph William Gosper, Jr that says: A data structure is just a stupid programming language. What did he mean by this? Alas, all I can find in Google about it is relentless copy/pastes of the quotation itself, without any context.
I am debating with my colleague on when to perform code review - before or after unit tests. What is the best practice? Some factors we might need to take into account (there may be more): Size of code change - a big change means more changes will result from the code review. If these changes are big than, if UT was...
After a while, we are hiring again, and I'm reviewing tests for programmers; some of them are a bit out of date. What are some of the FizzBuzz-type questions for web developers and SQL? That is, not too trivial, but still solvable in five to ten minutes with pen and paper and without Google? I typically eliminate about...
I would like to make my programs much less of a hassle to extend or create, I am imagining a scenario where the end user has a variety of check box options that affect how the program interacts. Something like in a word processor where you say underline, or bold, or to a game where you say, include this feature exclude...
If I were to build a Twitter or Facebook application using pure client-side technologies like HTML and javascript, how would I mask/hide my API keys? For example, for Twitter I have consumer key and consumer secret. In order for me to call Twitter's API I'll have to pass these keys to authenticate my app. If I am usin...
Google App Engine has been great for trying out ideas and learning stuff, but so far I haven't seen much confidence in the community in using it for production applications. One significant issue that has come up over and over again is that when things go wrong, it's nearly impossible to actually talk to anyone at Goog...
Recently, I was developing a set of coding standards for our company. (We're a new team branching out into a new language for the company.) On my first draft, I set the purpose of our coding standards as improving Readability, Maintainability, Reliability, and Performance. (I ignored writability, portability, cost, c...
While I agree that catching ... without rethrowing is indeed wrong, I however believe that using constructs like this: try { // Stuff } catch (...) { // Some cleanup throw; } Is acceptable in cases where RAII is not applicable. (Please, don't ask... not everybody in my company likes object-oriented programming a...
I have been developing Windows applications in C++ for like 10 years now. And recently I've started digging into some Linux projects, and I can't stand how unproductive I am... I'm a fast learner, and I've been using Linux as a primary platform for some time now. And I do feel very comfortable with shell, OS principles...
Here's a question for me that really makes me wonder every time I start designing and developing a thick-client desktop application. I'm a .NET developer, and with my forms (WinForms mostly, but the platform should be unimportant) I also choose the startup position to be Center. The reason I do this is because I can't...
Say I have class that is partially implemented as a static class and partially implemented as a singleton. Besides "kludge" and "code-smell" (imo this is both) is there a more appropriate term for this type of mixing programming idioms?
I was reading the following article: Great Hackers The following part grabbed my attention: "When you choose a language, you're also choosing a community. The programmers you'll be able to hire to work on a Java project won't be as smart as the ones you could get to work on a project written in Python. And the qualit...
I'm trying to understand the origins of AJAX, and think MSXML and XMLHTTPRequest were the objects that started it all. Which came first, and/or became the defacto way to create dynamic pages?
In order to implement JSR 292, a.k.a. invoke dynamic, something called richochet frames is introduced into the hotspot vm. I'd like to know more about it, such as invoke dynamic itself, how richochet frames implements it, where the name richochet comes from, etc. Google seems to be not very helpful here. Any pointers w...
It would be interesting to hear what is used besides sketches from UX engineers during development of a GUI. Unfortunately our UX team provides just a minimum of requirements for GUI screens. I believe that a better solution would be to use some tables with requirements and state machines or may be just some text desc...
I am web developer and have experience of developing several web applications in PHP. I have an idea of developing a product for myself and decided to use a MVC based framework because I really like the idea of MVC and how one can easily manage and modify the application without any difficulty. I chose Zend Framework a...