instruction
stringlengths
34
19.9k
As a physicist, I've learnt programming on my own. But I would like to know the name of the discipline (like algorithmics is the discipline of designing algorithms) which consists of : making the right choice of language/paradigm designing a class diagram organizing the different parts of a code and how they will inte...
I do PHP Development on WAMP but sometime it don't work properly when I upload the files to a Linux server, its involve a lot of testing and annoying. I am looking for a solution to do PHP Development on Windows but the files will be sync with Linux Server. I do not want to use SFTP/SSH clients like WinSCP to view or e...
My situation is that I've been programming for about three years and have learned a lot but still have a long long way to go. I have an idea for an app that I believe would take off, but I'm afraid to build it because it involves architecting a back-end with databases and authenticated payment transactions and user acc...
Is "pass by value" synonymous with "functional programming" ? Are there any iterative programming languages that are (largely) "pass by value"? Are there any functional programming languages that are (largely) "pass by reference"? Thanks.
I already posted this question on SO and it did ok. It was unfortunately closed though(only needs one vote to reopen) but someone suggested I post it on here as it is a better fit so the following is literally a copy paste of the question I was reading the comments on this answer and I saw this quote. Object inst...
To create a website I create Psd Files for the design (Phase 1) I Convert these Psd's to html/css static webpages (Phase 2) I add some javascript to these webpages (Phase 3) I start the IDE "visual web developper" to start developping (Phase 4) I have studied computer programming for the past five years and now I not...
I'm in the middle of developing a new programming language to solve some business requirements, and this language is targeted at novice users. So there is no support for exception handling in the language, and I wouldn't expect them to use it even if I added it. I've reached the point where I have to implement the divi...
I am developing a new project where I will be constantly checking a webpage for data and adding this data to a queue for processing. This data will then be removed from the queue and added to a list if it hasn't already been added. This list will then be stored in the database. I was wondering about how to use threads ...
I'm a "weekend coder" developer making mobile apps and games and I've had the desire to make my own version of a game made for the Commodore 64 back in the early 80's by a small publisher e.g. Not EA Games or similar. The game hasn't been ported / released on any platform since. I want to make my version because it was...
I'm replacing a guy who was in his first job as a programmer. You'd think being fresh out of school means the basics are fresh in one's mind, but think again. The code base is horrible, Ctrl+C / Ctrl+V is apparent in lots of areas, about 60% of the logic is coded in forms and the rest is in a monstruous module called h...
I've landed my first contract (hooray, self employment!) and the company is asking for time estimates. Programmers are notoriously bad at time estimates, and I know I've been laughably wrong before. It's fixed bid, so I'm not concerned about charging. I'm just concerned about expectation management. So far I've ite...
I have recently came across some code where the variable names are in french, I could not use google translate because only part of the code needs translated, and it would not be that practical to copy and paste each of the variables into the translator. How can i easily translate the variable names? what translator co...
I have code that looks like this: tr.t.findIndexSmoothed(arg0.getX(), arg0.getY()); "tr" and "t" are objects. Is it bad practice to reach all the way down the object hierarchy to call methods? The only reason I can think of is that is breaks encapsulation, and if that's the case, can anybody tell me why that poses a p...
Our team using Scrum three iterations. We successfully estimate PBI in storypoints using poker-planning. But next we cannot do anything because we don't know Who create tasks? PBI is created by everyone and approved by product owner, but what about task Who estimates task? What technique should be using for task estim...
Just how efficient is "good enough" for all intents and purposes? I wrote a script to simply list off all numbers that divide into an input, x, as pairs (i, n//i) and was just curious how efficient I should be going for? what is the acceptable rate at which the script starts to lose its efficiency? This is my code (alt...
I was reading about the at most once property that defines what an atomic action is and I've been curios about this example: x = 0, y = 0 x = y + 1 || y = y + 1 If we use the 'at most once' definition, we can say that, indeed, x = y + 1 is atomic because y is only referenced in an another thread and x is not being re...
I have quite a bit of experience with using Django for websites and so when I started a new project I naturally chose to use Django for it. Everything went well for a time but now the application is really starting to rub up against what Django can comfortably cope with and I fighting all the time to ensure that things...
I am a Web Developer working at a company where the fronted framework we have selected is Angular JS. I am now in the position where I am the 'resident expert' whatever that may mean. I have been tasked with teaching/explaining everything that our Designers need to know about Angular JS. Unfortunately my knowledge/unde...
My job is mainly building websites using CMS such as Drupal, eZPublish or Magento. Most of the work is templating, CRUD and adhering to the specs with this. Occasionally, there is some business-specific logic, but it's usually 20 lines or so. Most of the logic is a bunch of if in the templates. In this context, I find ...
For a while I've been maintaining an ad-hoc script to check code style against our project's guidelines. I'm aware of AStyle/Uncrustify and have used them, but they are best for once-off code-style cleanups, but impractical to just run all code through some automatic process after every commit. To explain the issue a l...
Suppose I have design like this: class Corpus: def something1(self): pass def something2(self): pass def serialize_to_stream(self, stream): _CorpusJsonSerializer().serialize(self, stream) class _CorpusJsonSerializer: def serialize(self, corpus, stream): . . ...
So in the past few weeks I was introduced to Bootstrap 3-RC1. I made some web sites using it, and I actually enjoyed it. Then, recently, I discovered Twitter Bootstrap has already released version 3-RC2. It makes me wonder if it's okay for me to use Bootstrap RC2 for production now? Is it wise if I used it considering ...
As the data is migrated via the object level, there has been a slow upwards trend in memory usage. I can see the periodic gc activity, but the memory trend is still going up slowly. I have currently for my application set the starting and max heap at 14GB in production, however if we might need a large data set, my co...
I'm working on reviving a C++ codebase that hasn't been touched since '97. It's academic software for text analysis, and originally it was non-functional, it wouldn't even compile. I fixed the code so that it works, and added some new functionality of my own. I'm doing this privately for someone else, and they will pay...
I have re-written an open source project from java to haxe, then from haxe compiled to javascript, with totally different UI So, the question is, is the code considered to be mine after rewriting it to another language in a closed source project? can I use it freely with no worries about original copyrights?
Are there any good samples of web applications that consume restful web services? I am developing a webapp with spring, and have come to the point of reading lists of elements and element details from a RESTful JSON api. I started developing as though I was using a database, creating services, model elements plus DAOS,...
I've made a file browser in java that opens and read already been made excel files. (using Apache poi 3.9 library) program read those files perfectly but i want to update some of those files. how can i be able to update those files through my program. is there is any library or function/class that might be helpful, or ...
If I look at a database table for editing - is it made up of rows or records? If I write some sql and then look at the result is this made up of the same elements as the answer to 1.? Is it the case that they are all rows but in very specific circumstances they are also records? EDIT A recent article by Itzik Ben-Ga...
I have set up a web application which is of commercial use. This application had to make use of the plugin(which is not downloaded from http://plugins.jquery.com) I downloaded this plugin from http://jquery.malsup.com/cycle2 Kindly, let me know if I could use this plugin in my commercial website. If I do, would it caus...
Consider having restricted man resources and thinking about using Xamarin Studio for building cross platform application. Will you be afraid of Apple trying to ban all applications NOT developed by xCode? I mean in future. It is obviously not banned now. I am just asking this because I heard this on a meeting today a...
I'm maintaining an ASP.NET Webforms 4.5 application for a few months and frankly i'm fed up with server controls. So i switched to pure HTML and Javascript for front end, when creating new content (or fixing the old, assuming there was enough time). Almost (for reusability reasons) all new requests to the server are do...
What is it called when a website has another word in place of where www usually goes? For example, images.google.com vs google.com/images. I know the latter is a file on the server that the browser downloads, but what exactly is the purpose of the former? It would be helpful to know what this is called.
I am reading about common code smells in Martin Fowler's Refactoring book. In that context, I was wondering about a pattern I am seeing in a code base, and wether one could objectively consider it an anti-pattern. The pattern is one where a object is passed as an argument to one or more methods, all of which change the...
The frequency of commits depend on two factors: the developer himself: some developers tend to commit often, others may spend hours without committing, the current work: the same developer may have to commit very frequently when effectuating risky refactoring operations or similar tasks, and quite rarely when working ...
I'm looking at my interface design and I am struggling to decide which is the most "correct" way to implement role-based access control, given a user and a subject that the user would like to access. As far as I can see I have three core options (with a fourth being a bastardisation of the first three and a fifth bei...
Where I work, using Properties are discouraged. We have code generation tools to "speed things up". All object data ends up being Public fields. If you request properties anyway, you get something like this: Public sFoo as String Public Property Foo as String Get Return sFoo End Get Set(ByVal value as String...
I'm trying to understand how something like this works, but I'm inexperienced and I'm trying to understand how the process would work. Say you have ten categories, a thousand zip codes, and ten thousand items listed in each category, each of which has a description. When a user does a search for (e.g.) "guitar hero xbo...
What is the real difference between component-based software engineering and Service Oriented Architecture? Clemens Szyperski and David Messerschmitt present the following five principles that a software component should have: Multiple-use Non-context-specific Composable with other components Encapsulated A unit of in...
My company is going full steam with the agile process, with multiple agile projects in work. The first agile team, the proof of concept, carried the product through release and the first post production release. After this successful effort, the team was quickly disbanded, sent off to help other projects on their agil...
I was talking with a co-developer. He has a client that wanted to make sure that he delivers on time. The client wants repercussions for missed deadlines. While I do not do freelance work, I couldn't give an answer. So, my question is: What repercussions do you (freelancers) agree upon with your client if you miss dead...
On reliable websites I always see claims such as "All data is encrypted" or "All passwords are encrypted using 128bit encryption" and etc. However I have never come across a claim such as "All passwords are hashed." On my website, I will be storing all user passwords in a database after using SHA-512 (most likely) hash...
I am learning Python currently which wasn't part of my college curriculum. I was asked in an interview why I chose Python and I replied that it is easy to learn and the documentation is very well written. The interviewer didn't reply whether it was a good enough reason. He looked convinced but I cannot be sure. Is a we...
How to build a common infrastructure for my web apps using asp.net mvc, and efficiently manage it? The goal is to increase developer productivity. The common infrastructure stuff includes visual & interactive components like customizable menus, consistent web page layout, consistent navigation experience, breadcrumbs, ...
I'm just curious if there are any programming languages that use the '=>' and '=<' operators for something. I wonder why these are not commonly used when their variant '<=' and '>=' are so widely used by most languages. Is there a reason why? EDIT: I'm not asking why they aren't used for the same task as '<=', but why ...
Like many, I'm developing a couple of applications on my own (not at the same time) to eventually sell. But I also have websites to run, college work and a social life etc., so often I can forgot what stage I am in programming, especially after holidays abroad. Are there any techniques that I can use to help me keep tr...
I've noticed that a lot of the packages I've been installing on my Ubuntu machine has this "d" at the end. Googling it doesn't give me any answers that I can find. For example: FTP server - Package called: pure-ftpd TFTP server - Package called: atftpd SSH server - Package called: sshd What's up with this "d"?
I have a customer that wants me to build a web portal (Asp.net 4.0) that will communicate with a desktop client, tablet and/or smart phone (e.g. iOS and/or Android). I was thinking of using oAuth 2.0. But I'm not familiar with any potential cons to using OAuth. And I don't know how to compare OAuth to other Secure Aut...
So I'm using Node and ExtJS server-side/client-side respectfully. By using ExtJS, I'm moving a lot of the presentation logic client-side. Thus, something like MVC wouldn't make sense server-side since the view-logic is all client-side. At this point, my Node server's responsibilities are essentially: Act as proxy to ...
I am coming from .NET to PHP. I am playing around with a long file written by someone else (called "cryptographp.inc.php"). It builds and returns an image to the browser. I want to show the image that the file returns on my Cryptocode/index.php page--like this: <?php include './cryptographp.inc.php'; ?> But when I lo...
Suppose I have a Javascript based application written in iUI or Kendo UI. Can it be packaged in such a way they can run locally without a webserver? I have a few web applications, that with some rework and HTML5 LocalStorage, can possibly work offline (in an airplane or subway). My mobile development experience is l...
I'm working on a website and I want to validate that an individual is an employee at one of a large number of companies (probably using their company's email address, which I don't know before hand). The idea being some users are the general public and others are from these companies. And I need some way to authenticat...
For example, I have the function generate_salt() in encryption.file but the person may not know where generate_salt() is from. Using a namespace like encryption::generate_salt(), or encryption_generate_salt() for every function in the encryption.file. Or would it be a waste of space and typing because some IDEs can nav...
It is always said that the include directives should be placed at the beginning of a script. The main reason is to make the functions available throughout the script. Regardless of this fact, is it bad to place an include directive within the main function where it is needed? For example, #include <stdio.h> int main() ...
Is there a way to prevent session id restore on startup/restart of user's system? We are using a asp.net app and I am able to login and access the site. For the first time session id is created and stored in cookies. Problem: But if I restart my system without signing out, the session is still alive. How can I prevent ...
I'm interested in doing code obfuscation (native code, to make it clear what I mean by "native code": the actual machine code in x86/x64/arm executable files - PE, ELF, Macho and etc, not the sources) as a part of a build process. I can think of several ways of doing it: Writing a compiler plugin, that would get inter...
This is a question about the internal workings of Mercurial. I vaguely remember a fellow programmer explaining to me how mercurial works out which changesets differ between two repositories and that it had a speedy solution to the problem. Does anyone know how this works or can point me towards a document describing th...
Our business is considering writing a line of business application for tablets to enable road warriors and executives access our data. This will be primarily used for dashboards, reports and some form filling input: quite typical scenario. Our other apps being built in .Net (WinForms) with lots of related class librari...
I recently began work at a small company as a lone software developer. Before I came no true documentation/version control/etc. was in place. The best they have is Microsoft Word documents and Excel spreadsheets to keep track of everything the engineering team produces. Personally, among other things, I'd like to insti...
We have 10 distributed teams in our company and we are developing 3 huge web applications. A lot of time of our developers is spent with writing emails. We are using scrum and for that we had a daily stand-up meeting, but other questions regarding product features, design issues are always communicated via email? Is t...
We're developing a total solution, and we've chosen service-oriented architecture to loosen subsystems. However, now we have a problem. When customer orders something, Order Subsystem is responsible to get that order, and register it. However, there are some other modules which are responsible too, in order registratio...
I'm learning Objective C (from a C# background) and am having difficulty understanding the unusual method signatures and am looking for a shortcut to make the learning curve less steep. When reading Objective C code, what English words or phrases can I associate with the symbols? For example, calling a method looks l...
I have a requirement what seemingly looks very simple (and perhaps strange) but some minor details are giving me troubles. Perhaps I'm overthinking this. I'm building a scheduler application (on WPF) for an embedded device that runs everyday. The scheduler controls when the device can be turned on and off. For example,...
I have a MongoDB database with millions of users in collection. An aggregation function returns millions of results with the following format: Array ( [_id] => Array ( [user] => MongoId Object ( [$id] => 52050d48e654f6342c002d42 ) [send] => 1 [open] => 1 [click] => 2 ) Now I need to update corresponding ...
I try to explain better using an example: I create the class Product with attibutes like that: private string _ProductCode = ""; [DisplayName("ProductCode")] public String ProductCode { get { return _ProductCode; } set { _ProductCode = value; OnPropertyChanged("ProductCode"); } } the class Product implements th...
Does an Open Source license exist that allows me to retain rights to revoke usage of software/source at any time, for any reason, and without warning? I want to allow others to use my software and source code for free but at the same time, I want the ability to revoke rights to usage if I don't agree with the ways that...
I'm trying to figure out how MVP should be implemented at the UserControl level. I thought I had it, but I ended up reading a blog post that pretty much shut me down. Now I'm back at the start and with no idea how to proceed. Let's say my UserControl is something simple like two TextBoxes and a ComboBox. This gets invo...
I'm trying to get to grips with agile project management (with Pivotal Tracker) but keep finding myself running into walls when trying to define the first few stories of a project. Take for example this very simple story: "A user should be able to tag a product" Assuming I've already defined "product" elsewhere, this s...
I was reading Essential PHP Security and chapter 8 talks about problems with hosting your PHP app in a shared hosting environment. Some of the problems he mentions are: - Exposed source code and File system browsing. a web server must be able to read the source code in order to execute it. Since the web server is shar...
I have a Model Car in my iOS application where it's parameters like name, year, value etc are fetched from a web service in order to fill a list with cars data. Where should I put the method that asynchronously goes to the server and returns an array of cars (this method already converts the JSON to a Car array)? My cu...
I am not able to understand one algorithm discussed in TAOCP Volume 1; Section 1.3.3 named as "Algorithm A" stated as "Multiply permutations in cycle form" while compared with the stated example in next page. The step that is not clear is mentioned in 8th and 9th rows;i.e. how can be the "CURRENT" value becomes "g" af...
I'm coding in a non-functional language with functional mechanisms (C# to be specific, but you could substitute, say C++ and use function pointers, or what have you) on a small team. It's my habit to use functional techniques -- passing delegates (objects representing functions) as arguments, using closures, occasiona...
I want to make an open-source graph thing which looks and behaves very similarly to Google Visualization API, but it would be based on Flot. Is this legal, or must I not imitate Google Visualization API?
As part of my research, I write a lot of Python and MATLAB code that never needs to be distributed to anyone else. Even if I need to distribute my software, Python and MATLAB, both being interpreted, make sharing it relatively simple. Now I am writing some software in C++ that I'd like to distribute. I have a handle on...
When developing login module for a web application, do you suggest to keep the username and password in a keystore? Lets assume the keystore was kept in a very safe place in web server.
I need an algorithm for picking a user. Users are identified by letter {A, B, C, ...} and are ranked by number {1, 2, 3, ...}. Rank is the degree of likelihood to be picked, so a rank 2 user is twice as likely to be picked over a rank 1 user, and rank 4 is four times as likely, etc. So let's say four users are {A, B, ...
I used to think that it's not, but yesterday I had to do it. It's an application that uses Akka (an actor system implementation for the JVM) to process asynchronous jobs. One of the actors performs some PDF manipulation, and because the library is buggy, it dies with a StackOverflowError every now and then. The second ...
I am studying Spring framework, in web.xml I added following which is a bootstrap listener. Can anyone give me a proper idea of what is a bootstrap listener? <listener> <listener-class>org.springframework.web.context.ContextLoaderListener</listener-class> </listener> You can see the doc here: ContextLoadListener ...
CASE 1 (Definition and declaration in same source file) Suppose both my prototype and definition of global function is in .cpp file. Where should I write inline keyword to make compiler know? In the prototype In the definition Both CASE 2 (Definition and declaration in same header file) If I have declared prototype...
If I write code with proprietary dependencies, can I release my own code under the Apache licence? An example of this would be a plugin for a proprietary framework.
I was making a Python program to measure the growth of codereview.SE. My approach was to get the "Site stats" shown on the front page and store them on my hard drive. I plan to do this once every day. So far I have made enough to get the stats and append them to a text file. The python script can be viewed on github. T...
A client asked us to automate his offline paper-based processes. He sent us a copy of the physical forms that he uses. Our team met and discussed how the navigation should be, what major components would exist in the UI. That's it. Problem is, we don't have actual "written" requirements. With a lack of an actual busine...
I am not asking for code but rather design ideas. I am trying to develop a new system to learn more about client/server development. I would have 3 systems: Client 1 : Client Server 1 : Server DB Server 1: DB Server I would develop a server application as well as a client application What happens is that my idea woul...
I'm in a job hunting. And in my CV I placed a skill list like: Skills: C/C++/Java/... The most common question I got is: "hem, since you are familiar with both C++ and Java, can you tell some similarities or difference between the two languages." And I just don't know how to answer, what I said is basically some lang...
Over the past years I learned about 14 programming languages (assembler phyton delphi qbasic c++ c# ruby perl - etc etc etc). However this was all out of my own interest, I didn't went to school for it. Now without real education I am into a team with other programmers. We are into robotics with our work. In contr...
Open the CMD, and I should type the password and usename? In the GitShell opened by shortcut, I don't need to type the username and password. Related is here: https://softwareengineering.stackexchange.com/questions/209014/how-can-i-convert-gitshells-commands-into-an-bat-file Is this useful, I cannot make it take effec...
"Unhandled exception" term In .NET Framework, unhandled exceptions are the exceptions which were not handled by the application itself, and result in a crash. In a case of a desktop application, it means that a window similar to this one is displayed: For a web application, it mostly means an HTTP 500. Under unhandled...
I have to design and build an import script (in C#) that can handle the following: read data from various sources (XML, XSLX, CSV) verify data write the data to various object types (customer, address) The data will come from a number of sources but a source will always have one import format (either csv, xml, xslx)....
Consider the following typical scenario: if(myObject == null) { myObject = new myClass(); } I'm wondering what is thought of the following replacement using the null-coalescing operator: myObject = myObject ?? new myClass(); I'm not sure whether I should be using the second form. It seems like a nice shorthand, b...
I'm looking for a way to clearly diagram how multiple applications communicate via a service bus. The best I've come up with so far is a sequence diagram, but I really don't like that. Sequence diagrams necessarily relate some sort of sequence, and that's really not what I want. Furthermore, since every service communi...
So basically, my company is looking to create an app that can be distributed on Linux, Mac OS X, and Windows. We are hoping for a cross platform solution. I have experience working with Java Swing years ago and thought it was reasonable, but not great. It assuredly did however work on all platforms just fine. Is Java a...
I'm designing (not writing, yet) a task scheduler system for a complex video game. The rest of the program passes it objects containing a function and some metadata including an estimation of how much time is left before the data is needed (which can change, of course). The scheduler is responsible for prioritizing the...
I'm currently writing unit tests to test behavior of a method and would like to partially mock the methods calling injected properties. For example: public void doSomething() { int complicatedInt = 1 + 1; if(getProperty().someBooleanReturn()) { ... etc. ... } } So obviously I want to mock the getProperty()...
In the python datetime module, timedelta objects take weeks, days, hours, minutes, seconds, and microseconds as arguments upon instantiation. However, after the timedelta is created, the only two attributes it has of the former listed are days, seconds, and microseconds. Why is this?
The context of this question is choosing tools for writing design specifications for software projects. These documents will be written and maintained by architects and developers, I'm not talking about marketing requirements. Some of them may be shared outside the team, but only in a processed, non-editable form (PDF,...
If it was a 2-point story for one person, would you double it if people are pairing? Pairing isn't always necessarily done 100% of a dev task, so it seems that doubling the story points seems wrong. And it might not be obvious how much of the task will require pairing until the end, so you wouldn't know what the poi...
I'm mostly thinking of PHP here, but if you want to refer to other languages that's fine. An object has a method that requires data contained in another class of object. Should I extract that data from the other object into a variable and then send just that data to the requesting object? Or should I pass the entire da...
The C++ language allows intermixing of both C++ and C in one source file. For example, extern "C" { struct bar { /* ... */ } } Does C++ or has it ever supported any other "linkage languages" other than C? e.g. extern "Pascal" or extern "Haskell"
I have done tasks based on Java, but my seniors assigned me to collect requirements for creating a globalized bug tracking tool. I have read many types of requirements from Wikipedia and the mindtools website, but it was very confusing. What are the exact differences between functional requirements, operational require...
In this talk: http://www.youtube.com/watch?v=hQVTIJBZook, Douglas Crockford claims that class-based object-orientation can be represented in terms of prototypal inheritance. The construction he gives is something like: var theObject = function() { var private1 = ...; var private2 = ...; ... return { public1...
As pointers in C require 2 bytes of memory size irrespective of the size of the data type they are pointing. So does the same thing applies to java references also ?