instruction
stringlengths
34
19.9k
I would like to ask you, your opinion when it comes to implement a filtered search form. Let's imagine the following case: 1 Big table with lots of columns It might be important to say that this SQL Server You need to implement a form to search data in this table, and in this form you'll have several check boxes that...
I have pretty much completed work on a Winforms application, and would like to add a Help feature for users. I cannot send users to a website, and am thinking along the lines of the kind of help you get when you click on Help in IE (or hit F1). I believe this is compiled html or something, but am not sure what tools ...
I program in Java and it doesn't make sense to me to think about learning a Java library or a framework without knowing the actual language the thing is built with. Same goes for C. I always avoided JavaScript simply because I wasn't interested in the client side of things but that has changed now. I'm confused as to ...
I have an application built without any libraries using PHP, JavaScript, HTML5, CSS, and mySQL that will support major modern browsers - IE, Safari, FF, Opera, and Chrome. One thing I've noticed is that most web jobs 90%+ ask for library experience of some sort. About 10 % do not... they focus more on the language then...
I've been studying a bit of algorithms and have been looking at sites like SPOJ.pl TopCoder etc. I've seen that programmers prefer C or C++ usually for most algorithmic programming contests. Now I've been having some trouble lately. I know both a bit of C and Python and when trying to write a code I seem to prefer Pyt...
Imagine a discussion between four people - one a developer, one a manager, one a tester and one a deployment/operations type. The Manager is very angry as a system has fallen over after a new version of code was deployed into production. He is looking to point fingers. Operations person pleads ignorance - they followed...
I'm not a programmer by profession, but I do some coding and have used github some. I've run across what I find to be a surprising situation. I'm very familiar with git. There is a project which I found a (small) bug in that was affecting me. I spent an afternoon finding and fixing it. I forked the repository, comm...
I'm creating a project that I want to be able to distribute across platforms. I'm writing in Java and AWT which already gives me a pretty large range of devices, but I'm mostly interested in Windows and Linux (Debian/Ubuntu). I'm trying to determine where I should put config files. I have application-wide configuration...
I've been thinking for a while about defining several namespaces in one php file and so, having several classes inside this file. Suppose, I want to implement something like Doctrine\ORM\Query\Expr: Expr.php Expr |-- Andx.php |-- Base.php |-- Comparison.php |-- Composite.php |-- From.php |-- Func.php |-- GroupBy.php |-...
Our architecture consists of a front-end cache that most read only users obtain their data from directly. The front-end cache sits in front of a farm of webservers that serve pages written in PHP. We need to be able to detect certain conditions at the front-end cache level and pass those values through to the back-end ...
I am working on an application which spawns a new thread per request. Sometimes the number of threads active on the machine at one time is in the high hundreds. It's suspected that this is causing all sorts of problems. I would like to experiment with using thread pool instead to see if this improves work throughput. B...
The situation is this - we took an intern for a summer with a mind that if he will catch up during summer, we will keep him as a part time junior developer. We took him after his first year in university, so his knowledge was way too low to be involved into real projects(actually he programmed only in university), so m...
While I was programming in C++ some days ago, I made this mistake (that I have history of making it!). In one part of my code, I had 1/6 and I was expecting it be 0.16666666666 which is not the case. As you all know the result is 0 - C, C++, Java, Python, all behave the same. I post it on my Facebook page and now ther...
I know that Discrete Mathematics is a pretty broad topic that's used in a number of fields but I was just wondering what are some of the topics from it that you would expect an average computer science student to know? Here are the range of topics from the table of contents of a book titled "Discrete Mathematics and it...
I have a PHP app which is very large. There are usually 2-3 developers working on it full time and we are getting to the point where we are making changes and creating bugs (cough features!). The software isn't complex per say, just there is a lot going on (35~ controllers, about the same models, etc). Even being caref...
I suppose there's no straight answer to this, but what ideas come to mind for determining how much each programmer would get for participation in a collaborative project if it were to be sold?
Recently at my company we've had a bit of a debate about abstraction vs. simplicity. One school of thought I'd characterize as "DRY and abstraction can do no harm," and leads to code like this: def make_foo_binary(binaryName, objFiles, fooLibsToLinkAgainst) make_exe_task(binaryName, objFiles.ext('.o'), fooLibsToLi...
In Python luckily most of the times you don't have to write getters and setters to get access to class properties. That said sometimes you'll have to remember that a certain property is a list or whatnot and a property would save you there by abstracting the type and providing a setter to add something to such list for...
I am often asked to write a requirements document for a new piece of work. I write requirements using user stories. The list of requirements is then used as a contract with the client denoting the functionality that will be delivered. The temptation them becomes to add more and more detail and more and more stories in ...
Possible Duplicate: Best approach to learning web programming I am extremely interested in web development though I know very little about code. I did not read computer sciences in my college/university. Now I find myself very determined to learn the server side development and want to have a career in the field, wh...
Let's say I start and develop some project under open-source license, and accept some community contributions. How shaky is the ground I stand on if I decide to take the project commercial and closed-source (or split license)? This question doesn't directly address the issue of a project with community contributions, w...
Semi-open (or Half-Open, Half-Closed, Half-Bounded) intervals ([a,b), where xbelongs to the interval iff a <= x < b) are pretty common on programming, as they have many convenient properties. Can anyone offer a rationale that explains why SQL's BETWEEN uses a closed interval ([a,b])? This is esp. inconvenient for dates...
I have started reading Part 2 of Introduction to Algorithms and in the section The structure of the data the author/authors says in the context of sorting a sequence of numbers: In practice, the numbers to be sorted are rarely isolated values. Each is usually part of a collection of data called a record. Each record...
We currently work with a company that has a fairly simplistic web system for processing warranty information. The only way to get data out of it is through excel exporting. Compilation of this data and correlation with our systems has to be manual and makes us be reactive in our response. The ideal situation would be s...
(sorry for my poor english) I am developing a application using WPF, EF Code First using MVVM (Caliburn.Micro). It should be used mostly to CRUD work. I created a BaseViewModel<T> class from wich all other ViewModels inherit and exposed a T Selected property to bind to the View. I know it is not recomended to expose a ...
So, I'm not a programmer, though I've been writing code all of my life. As is my habit, I attempt to contact well know experts in almost any domain I find of interest, and interestingly, I get a lot of meetings, which I value a great deal. So, here's the deal -- a meeting has been set for me to meet a very well known ...
Loosely coupled classes gives flexibility. If I understand it right, Event flow, Observer Pattern and Design Patterns like MVC focus on loose coupling. So in this context I am aiming towards making a project where all the classes are loosely coupled. So, for example I have a class A that uses B: then instead of a.b....
When setting up a continous integration environment, does it always entail having the build server pull code and merge between branches? Or is it something you NEVER want to do because you are depending on an automatic merge would usually ends up having issues (and requires manual intervention).
I worked with JPA (Eclipselink implementation) and Hibernate. As I understand these two have great caching systems. I am interested in caching in a Web application and in order to better understand the process I'm trying to implement something on my own. Sadly, I cannot find any in depth documentation about this subje...
I am managing a team of 6 people that recently moved to Scrum. We have a Scrum Master (one of the developers in the team) and a Product Owner. Since I have quite a lot of free time (because a lot of management work that I used to do is now done by the Scrum Master and Product Owner), and since I want to remain technica...
We use Jenkins to run continuous integration builds. The output of these builds might be EAR files, WAR files, or just a collection of files that are TAR'd up. To this point we have used Jenkins to manage the produced artifacts. We have Artifactory deployed in-house. Would it be a bad idea to leverage Artifactory to ...
I would like to publish a website for certain family members only. Simply put, like a mishmash of family photos and videos. I want it to remain private, however. I was considering using openid for the login process because I really wanted to avoid: Storing Usernames and Passwords (Too much maintainance) Making a obfus...
Think of the question as a family tree, in the PS section I will explain what exactly it is but family tree is easier to imagine: so father, has kids, those kids may have more kids, those kids may have more kids, etc.. 1- I don't have the whole information in memory to traverse them. With each method call and hitting ...
Ok more of a conceptual question here: Say I have an existing record of type Meeting. When I go to edit the meeting I have a listbox with all current meeting participants, and one with all employees. I then add a few employees from the master list and remove a couple from the meeting list. What is then the best approac...
Let's say I have a repository of functions. These functions work with business objects within a database, CMS or other third party API. For example, my repository interacts with virtual files and documents in a document management system. I want to be able to implement a simulation mode in my repository such that when ...
We're implementing a Scrum workflow and I'm trying to wrap my head around user stories, when they're completed, iterations, etc. One thing we often do is work on a story during an early iteration, get it fully working but "ugly". We use plain buttons, no images, just the text to show that it's working the way they shou...
I'm wondering about the appropriateness of URL parameters in RESTful resource creation. First, here's some context. I'm working on an API that will remotely update the software on embedded devices connected to an online device cloud. The basic workflow is: Discover available updates Apply desired updates Monitor updat...
On reading the joel test and about daily builds, a discussion with a few tech-lead friends of mine in various companies revealed that they never did daily builds or continuous integration because according to them: Daily builds were meant for projects following Agile practices. It does not work for the waterfall mod...
How can we handle multiple instances of a method through a single class instance(Single constructor call)? To elaborate, I have a handler class which has two methods lets say verifyUser(String JSON) and getUserInfo(String JSON). Assuming that there are many users accessing this methods, there will be multiple instances...
I read and studied a lot of computer science and engineering and I rarely or never seen a book about debugging or a theory how to debug (though I surely developed some debugging theories of my own). Are there any debugging theories and/or books? Why / why not? I can read how to debug using gdb and some of the most usef...
I'm working on a ground up code generator project, but I feel I might be reinventing the wheel. Does anyone know where I can find some best practices guidelines or design patterns for code generation?
I know that .Net provides the feature to mix several languages within the same application (there are some constraints of course, but this is not essential). Theoretically, this might be done because the languages supported by .Net do not fully expose all the features it can provide. IL does of course. So when you need...
What tools exist to facilitate pair programming with Visual Studio when the programmers are not in the same physical location? At the moment we are thinking voice (Skype?) plus remote desktop (VNC? TeamViewer?), but it would be good to know of other suggestions and experiences. Also, is there anything more integrated w...
I'm creating a video player, like a custom YouTube player. All of the GUI elements (progress bar, video player, play button, ...) are different classes, but I obviously need them to communicate. When the progress bar is clicked, or the slider is moved, it needs to send a "seek(x)" command to the video player. Similarly...
I'm working on a large software project which is highly customized for various customers arround the world. This means that we have maybe 80% code which is common between the various customers, but also a lot of code which has to change from one customer to the other. In the past we did our development in separate repo...
How can I avoid code duplication in unit tests? Using Java and JUnit suppose I have something like this: public interface Arithmetic<T> { public T add(T a, T b); public T sub(T a, T b); } public void IntegerArithmetic<Integer> { // } public void DoubleArithmetic<Double> { // } And the test class: pub...
Predicate: I'm brand new to BDD / TDD, but I've done my homework. I'm trying to put everything I've read / learned into practice with VS2010, SpecFlow and NUnit. Things are working, but it's quickly becoming a chicken / egg scenario within a blur of unit and acceptance tests. I hope solving these BASIC questions will m...
Is it possible to use hash function but with File instead of Array, and it's gonna be saving the record in a file position and then search will fseek to that position, but I'm not sure how to open a file with let's say 1000 line, do you think that method could work?
They both seem to take about the same amount of effort to use: Singleton: needs a .h and .m file, has to be imported into any class you want to call it from and then has to be instantiated How is that any different than a class?
My first main language was Java. However, over the years I've dropped Java in favor for Python, JavaScript, bash, etc. I still have advanced reading knowledge of Java, but since I haven't coded in it for so long, my writing knowledge is intermediate at most. The other day, while looking at some old code written in J...
I am an independent contractor and, as such, I interview 3-4 times a year for new gigs. I am in the midst of that cycle now and got turned down for an opportunity even though I felt like the interview went well. The same thing has happened to me a couple of times this year. Now, I am not a perfect guy and I don't exp...
I'm looking for experiences regarding the ordering of the subject and modifiers in variable names. A simple object Shape would have just a subject for the variable name, such as Area. A slightly more complex case Sphere which has a wall will have an inner volume and an outer volume, which is where my question comes int...
Let's say you write a program that, when started, reads its configuration file to know which modules to start-up etc. If that configuration file is missing, an error will probably show up. This is an important situation that must always be handled. I read a statistic once which said that about 70 % of the code in a typ...
I am building an application that will be modular, in a way that it will be a set of separate systems communicating with each other. It uses Hadoop on all systems, and HBase on 3 of the 4. Scaling will only be an issue on the non Hbase system, it uses it's own NoSQL like system. It will be a client facing system, and ...
I'm new to the functional programming concepts in C#, but I have some experience with higher order functions via Haskell, Scala, Python and Ruby. I'm currently going through an old .NET 2.0 codebase with a LOT of duplication in it. Most of it is simple "copy/paste" with a few variables changed. I'm trying to condense a...
I would like to start getting more contracts in the mobile, smart-device, and console development space and, having little prior work experience in the field, I need to build a portfolio of example projects. Most of my professional experience is based on the .NET stack, so that is helpful in covering Windows Phone, Win...
Sometimes objects just need to be tightly coupled. For example, a CsvFile class will probably need to work tightly with the CsvRecord class (or ICsvRecord interface). However from what I learned in the past, one of test-driven development's main tenets is "Never test more than one class at a time." Meaning you should u...
I've worked in several contracts where the client used Cucumber and I've often felt that the testing suite didn't really have a place in our stack. From what I understand, business analysts/non-technical coworkers write up the tests and the developers make the step definitions work. My problem with this approach is th...
Do you need to buy a run time license from Sencha if your application code written is developed in Ext JS and deployed on a web server? http://www.sencha.com
I typically try and avoid bidirectional relationships at all costs. Recently I've been trying to follow a more domain centric design philosophy and I'm looking for advice in the best way to solve a specific problem. I am implementing a basic 2d grid. There are 3 basic classes, Item, Tile (has a list of Items), and Wo...
I'm in the process of setting up a GitHub account with the plan of making a pair of libraries I developed as parts of some recent iOS projects freely available for other iOS devs to use. I don't currently have off-site backup for most of my code, so as part of this, I originally thought I would upload all of my persona...
[edit#2] If anyone from VMWare can hit me up with a copy of VMWare Fusion, I'd be more than happy to do the same as a VirtualBox vs VMWare comparison. Somehow I suspect the VMWare hypervisor will be better tuned for hyperthreading (see my answer too) I'm seeing something curious. As I increase the number of cores on my...
Coming back to SQL Server after several years away, I find the Visual Studio Database projects (and now SSDT) very exciting, as they are aiming to offer a way to develop databases declaratively, rather than having to mess around with change scripts. However, the elephant in the room is the 'data motions' (I'm not too s...
I am student of 3rd year software engineering, and I find myself nowhere in field of programming. I know basics of programming languages like C, C++, Java, Visual Basic, HTML, JAVAScript, CSS and PHP. But every time I sit in front of my computer and start coding in any of the languages, I feel frustrated and distracted...
Are there some statistics out there that show the approx. number of users that popular programming languages have and the rate this number increases over time?
If I have a People table and those people can be at different addresses, and each address can have more than one person, thats a many-to-many relationship. So, using ORMs like Entity Framework and Django, I've got the hang of doing that. But my problem is that there are different types of people, like employees and cus...
Consider a case when I want to try some idea of an application. But I want to avoid investing a lot of effort in coding UI/work flows/database schema etc before I see that it's going to be useful to me (as example of potential user). My idea is stay lightweight and put all the data in text files. So the components coul...
I have the option to install the Android SDK on Windows or OSX. Which platform provides a better (easier) development experience? To keep this constructive, I'm looking for any difference that eliminates compatibility issues, ease of debugging, or compatibility with 3rd party utilities.
Suppose my favourite open source application has a bug. Now I want to contribute to the application by fixing its bug and submit the patch to the development team. What's the most effective way to do this? Do you actually read the whole source code of the project (or most of it) to understand the logic before start fix...
It's possible to omit the terminating semicolon in a tag. Example: <table> <th><td>Name</td><td>Email</td> <? foreach ($receivers as $receiver): ?> <tr> <td><?= $receiver->name ?></td> <td><?= $recevier->email ?></td> </tr> <? endforeach ?> </table> Note the <? endforeach ?> without a semicolon after...
I am new to REST and am struggling to understand how one would properly design a REST system to both allow for loose coupling but at the same time allow a consumer of a REST API to understand the API. If, in my client code, I issue a GET request for a resource and get back XML, how do I know what to do with that xml? ...
I know of a potential customer that has been paying for website development work on an hourly basis for several years by several independent contractors, but has never signed an agreement as to terms or ownership for it. They just get a bill and pay it. So, does this mean that there is implied ownership by the develop...
I have searched Programmers and Stackoverflow and was not able to come up with a satisfying answer, even though I'm quite sure it must have been asked many times before. The only question I found has answers only dealing with readability. The code excerpts below are from actual C# code I was writing. When dealing with...
When you're in Python or Javascript, you should always put binary operators at the end of the previous line, in order to prevent newlines from terminating your code prematurely; it helps you catch errors. But in C or C++, this isn't an issue, so I'm wondering: Is there any reason for me to prefer the second version t...
I have 6 years of programming experience, mostly following the object oriented paradigm, and I'm interested in learning functional programming. My main goal is to become a functional paradigm programmer and not a programmer who is using a functional language but still writes in imperative style. When I'm practising in...
Ever since entering the world of programming, I've been bombed with tips like "file should be only x lines", which is fair since new programmers tend to stuff everything into one file. But, having done programming professionally for more than a year now, I've mostly found myself getting hindered by the small size of th...
I'm a self-taught programmer about to enter the job market. What I want to know is what is the best way to show my experience to employers? What do employers want to know about my programming experience? Do employers want to look at code I wrote or could they want to see the software in action? Or do they only care how...
I know what a Web API is. I've written API's in multiple languages (including in MVC3). I'm also well practiced in ASP.Net. I just discovered that MVC4 has "Web API" and without going through the video examples I can't find a good explanation of what exactly it IS. From my past experience, Microsoft technologies (espec...
I am contemplating writing a programming language. Most grammars define expressions as being a kind of a statement. But really I cannot come up with a single example of any useful expression that would pass as a statement. See https://stackoverflow.com/questions/19132/expression-versus-statement for an easy definition ...
What does the => mean in Perl? my $CreateArray = [ objectClass => [ "top", "person", "organizationalPerson", "inetOrgPerson" ], cn => "Jane User", uid => "0000001", sn => "User", mail => "JaneUser@mycompany.com" ]; produces CreateArray: 0 'objectClass' 1 ARRAY(0x104ef40) 0 'top' 1 'person' 2 'organizational...
Nowdays it turned into a bloated client that works in Mac, Linux, and Windows, while still keeping the whole program in a single binary file that weighs only 876 kb, while competitors that use gui libraries weigh around 6 mb. Do they create a separate native gui for each platform instead of using a multiplatform gui li...
I am relatively new to Haskell and I am trying to learn how different actions can be executed in sequence using the do notation. In particular, I am writing a program to benchmark an algorithm (a function) foo :: [String] -> [String] To this purpose I would like to write a function like import System.CPUTime benchmar...
(I imagine this would be a good interview question, but in my case it's more pragmatic than that.) We have a large & complex application that models an extremely long and sophisticated chemical reaction process between dozens of chemical components. We are at the stage of designing Acceptance Tests for the application...
A function produces this hash of arrays: 'KEYNAME1' => ARRAY(0x1edeeb0) 0 'val11' 1 'val12' 2 'val13' 'KEYNAME2' => ARRAY(0x1efacb8) 0 'val21' 1 'val22' 2 'val23' Another function requires an array of hashes containing arrays: 0 HASH(0x1f6df98) 'KEYNAME1' => ARRAY(0x1f776b0) 0 'val11...
It seems like there are many different styles to write JavaScript, in fact I've heard that JavaScript is an expressive language. But the point of code is functionality (function) not expression (form). Is there a library that will be adopted into the ECMA standard the way the STL and Boost Library were adopted in to th...
I'm working as a junior programmer, and the senior programmer above me has instructed me to follow a certain unofficial policy for constructing new queries on our web development projects. Generally, we are developing an intranet site for some client, and they always have databases. He wants me to have a class containi...
When debugging, I sometimes find that I make some changes and I am not 100% sure why those changes correct some bug in the program. Is it essential to understand every single detail about why some bugs were occurring and why certain changes eliminated those bugs? Or is it common among developers to sometimes get the pr...
This video clip by NASA says that data from Curiosity relayed by the Mars Reconnaissance Orbiter (MRO) would be stored for a few hours, then transmitted to Earth (apparently taking about 14 minutes), after which it would take hours for engineers to decode the data. From what I've read, it seems that the MRO can be used...
We have a data layer that wraps Linq To SQL. In this datalayer we have this method (simplified) int InsertReport(Report report) { db.Reports.InsertOnSubmit(report); db.SubmitChanges(); return report.ID; } On submit changes, the report ID is updated with the value in the database which we then return. Fro...
We are looking for a version control tool. I personally think it's pretty cool to use Git. However, my boss recommends TFS. He told me it's much more secure to use an SQL Sever based tool, such as TFS and SourceAnywhere. In addition, my boss also sent me a link. My question is: Is it secure/strong enough to use Git or...
I have a class that performs basic MySQL operations. This is all in PHP. class dbTables { public $name; protected $fields = array(); // array of dbTableField objects public $result_sets = array(); protected $primary_key; // filled using getFields() from __construct() public function __construct($t...
I have some huge classes of more than 2k lines of code (and growing) that I would like to refactor if possible, to have some more light and clean design. The reason it is so big is mainly because these classes handle a set of maps that most methods need to access, and methods are very connected to each other. I will gi...
I recently finished my C++ programming class, and I'll start school in september. There is a limited online Parking spot registration and it always gets filled very quickly. I would like to create a code that will quickly access the page and register for me. The question is, how is this feasible? I guess I could use py...
I am designing a system that will be running online under Microsoft Windows Azure. One component is a REST based web service which will really be a wrapper (using proxy pattern) which calls the REST web services of a business partner, which has to do with BLOB storage (note: we are not using azure storage). The majorit...
Should I worry about the safety of my application if it runs in Full Trust level? If yes, why? What damages could be done? If the trust level should be a concern why it is the default level for asp.net applications instead of medium? I know all the yes and no's between medium and full trust levels, but I can't see whe...
What do you call classes without methods? For example, class A { public string something; public int a; } Above is a class without any methods. Does this type of class have a special name?
One of the best/worst Microsoft software innovations (great for compatibility; terrible for efficiency) has been Windows' Side by Side Configuration. This allows, among other things, for different components of a program to have multiple versions of the C/C++ runtime libraries loaded into the same process. This has alw...
In an answer to this question (written by Pete) there are some considerations about OOP versus FP. In particular, it is suggested that FP languages are not very suitable for modelling (persistent) objects that have an identity and a mutable state. I was wondering if this is true or, in other words, how one would model ...
I'm sorry if this is a ABSOLUTELY sophomoric question, but I'm curious what the best practices are out there, and I can't seem to find a good answer on Google. In Python, I usually use an empty class as a super-catchall data structure container (sort of like a JSON file), and add attributes along the way: class DataObj...
I'm not asking if EAV tables are good or bad. I'm wondering if they are considered "normalized", and if not, why? If they aren't normalized, which normal form are they violating and why?