instruction
stringlengths
34
36.1k
Consider a UML Action contained in a UML Activity defining the behavior of a classifier. Such Action has three input pins connected to other output pins of different action by means of object flow edges. It also has an incoming control flow. My question is: does the action start when all the tokens _ those coming from...
I'd like to make a graphical user interface for my script, instead of running it from the console. I'm aware there's a wealth of UI libraries for Ruby, but I'm quite familiar with HTML and CSS and I'd like to use them for building an interface. So the question is: Is it possible to use a HTML rendering library to make ...
Ever since I heard about programming, I was told that any password (especially the one used on login) should be stored in database using any kind of one-way hashing algorithm, and never ever as plain string. So, it can't be read directly from database, using any method. Today I noticed that my bank (country department ...
What shall be the relationship between the receptions of a class (was classifier before Aadaam correction) and the AcceptEventActions in the activity describing the behavior of its instances? I understand the former is related to signals reception of the type while the latter is related to runtime ReceiveSignalEvent e...
I am fresh to Visual C++. While moving forward in the book "Programming Windows with MFC", I came across GDI (Graphics Device Interface) and use of paint brush. The book says a brush cannot be created if your GDI is low on memory. I want to know when and how does GDI get low on memory? And more important, what is the ...
Case: I'm working at a company, writing an application in Python that is handling a lot of data in arrays. I'm the only developer of this program at the moment, but it will probably be used/modified/extended in the future (1-3 years) by some other programmer, at this moment unknown to me. I will probably not be there d...
Do I understand correctly that Liskov Substitution Principle cannot be observed in languages where objects can inspect themselves, like what is usual in duck typed languages? For example, in Ruby, if a class B inherits from a class A, then for every object x of A, x.class is going to return A, but if x is an object of ...
Postel's law: Be conservative in what you do, be liberal in what you accept from others. "Lazy" code (per The Pragmatic Programmer): Be strict in what you will accept before you begin, and promise as little as possible in return. I'm developing a finance (asset pricing, etc.) framework for Python. Question: when de...
I was thinking about different server-side languages and this question immediately cropped up in my mind. What was the first server-side programming language using which websites were being created? Was it java or some other language? Note: I think some languages became prime server-side because they provided or rather...
I was going over this video lecture on master theorem from Introduction to Algorithm and while explaining case A of the master theorem professor says that some function f(n) is polynomially smaller than some other function at point 53:08 seconds: What does it mean for a function to be polynomially smaller than this...
I am the manager of a team of 11 software developers who look after my company's web sites / web applications, running up to 4 concurrent projects plus day-to-day support at any time. Within the 11 developers there is a mixture of technical skills, job titles and experience, although the team structure is flat with all...
Our website currently restricts a cookie-based session to the IP address that was originally sent the Set-Cookie HTTP header. In the past a user's IP would rarely change, so this didn't present much inconvenience. However, some of our clients accessing via 3G devices are experiencing session failures due to this IP res...
Do you know a good way to design (i.e. write down) software with a method based on pseudocode? I'm new to software design and read some information about UML. My humble class hierarchies are good so far, however, after it gets complex I notice that with "seeing the whole" picture I could have used a different structure...
The thing is, eager loading some object with all of it's associations reduces the queries made to the database, but the query time is greatly increased. The question is: This increased query time in the end pays off the database not being hitted so often? It seems to me that you are avoiding one problem and falling i...
We are often told that the hardware doesn't care what language a program is written in as it only sees the compiled binary code, however this is not the whole truth. For example, consider the humble Z80; its extensions to the 8080 instruction set include instructions like CPIR which is useful for scanning C-style (NULL...
When reading about web servers, frameworks, etc most of the time I notice that the goal is to have a technology that has the next features: Able to handle as many connections as possible. Fit an I/O model (connections to DBs and other web services). Those features fit the actual web model but I am interested in knowi...
Okay, before everyone goes shouting about duplicate questions, yes, I've already seen several questions like this here. But none answer the question. If I link against a GPL-ed library without modifying that library, do I need to release my source code? According to this question, the answer is yes! But this answer ...
I have just started using a NoSQL document based database (MongoDB) and i'm curious about the best practices for designing databases. I presume the architecture should be different from relational databases? Should I still aim for a normalized database? For example I have a particular use case; I have a user with a ...
My question involves setting up a Software Development process. If you came in to an existing project that had no formal methodology or process set up, and then were asked to set one up yourself, how would you handle it? I have looked into various methodologies like Agile, or subsets thereof like XP, but these are prim...
My company has decided to purchase a multitude of devices for browser testing our stages e.g. iPhones, Android, Windows and assorted tablets. They've tasked me with finding specific devices that cover largest common denominator of users and scenarios. We recently had a client that had us testing 10-20 different devices...
I have code that represents the interface for a library that is used by a variety of internal clients. How should that interface code be exposed to these internal clients that live in different source control repositories? The interface should be relatively stable, but is in development (as is most of the internal clie...
I have been reading Java Concurrency in Practice by Brian Goetz and inside the section Stack Confinement it is mentioned that each thread gets its own stack and so local variables are intrinsically confined to the executing thread; they exist on the executing threads stack, which is not accessible to other threads. Wh...
I am well aware of best practices for storing user passwords: Never store passwords in plaintext Never store encrypted passwords; always store password hashes Always salt your password hash to deter brute force attacks Always use unique salts to deter attacks using rainbow tables. However, I have recently came upon o...
Simply what are the practical techniques people use to check if a class violates the single responsibility principle? I know that a class should have only one reason to change, but that sentence is somewhat lacking a practical way to really implement that. The only way I found is to use the sentence "The ......... sho...
I work in a small team of developers who all collaborate on several Zend PHP projects. We are using Mercurial with a collection of upstream repositories, as well as Jenkins for centralized testing and health reports. We want to implement a shared library of common classes, but are struggling with finding a workflow t...
If there's something that would kill Go language, then it's name. I find it very hard to find anything in web related just by using "Go" in the query. The word is on of the most frequent in English. So I see everything in the result except Go-related stuff. Even Google, who sponsors the language and famous for tracking...
I'm working on a project which uses GIT as the main version control system for trunk, the official branches and most sub-projects/unofficial branches. As such, I want to make my own branch use GIT to allow the rest of the community to access my branch using the system they know. However, I'm working on a part of the pr...
I was reading about Assemblies (modules, which Microsoft CLR works with). The Assembly contains so called Manifest, which by definition describes a set of files in the Assembly. I know that Android applications also contain a file called Manifest, which also describes a set of files contained in the application. Is thi...
I have been recently asked in an interview if I know about any garbage collection algorithms. I knew what garbage collection is but I never really thought about learning about garbage collection algorithms since as a developer I never had to worry about it and the Garbage collector does all the hard work for me. Do you...
I'm interacting with Git through GitHub for Windows, which is funny since I'll never push my repository to GitHub. I'm working on it alone and it's intended to be used only by me. I noticed that my commits are listed under "unsynced commits" and under "history" it says "no commits". Which brings me to the question, wha...
In Java: int count = (Integer) null; throws a java.lang.NullPointerException. Why doesn't this throw a Class Cast Exception for ease in programmer understanding? Why was this exception chosen over any other exception?
I'm working in a WPF application that both imports and exports delimited text files. At both ends, there is a UserControl which encapsulates some logic about delimiter configuration. It has some controls for individually selecting delimiters, and a 'Presets' dropdown for quickly selecting certain common combinations ...
I have written a bash script I would like to put under GPL v3. I've read the GNU documentation on How to Apply These Terms to Your New Programs and How to use GNU licenses for your own software. Still, I'm not quite sure what to put there and which artifacts are needed. So far, I did the following: Put a file called C...
I'm in a situation where part of my system has a dependency on another module in the same system, but the modules themselves need to remain independently deployable, where the parts they depend on would be filled in with another implementation. A module in this instance is the concept of a bunch of components that all ...
Possible Duplicate: Resources for improving your comprehension of recursion? I am a programmer with 2 years experience, and sometimes think I could solve a specific problem with recursion, but in most cases I fail miserably. I am asking your advice about resources for learning, refreshing and deepening one's knowled...
I recently saw a question on SE about how to do such and such when creating an IRC bot. The only use of IRC bots I was familiar with was message flooding and spamming. I did a Google search for the string I used as my title and was led to an article that was an eye opener as to what all an evil IRC bot could do, but I ...
Actually, I'm helping a small software shop on their Scrum Implementation. Recently the Scrum Master reported me that he has a problem because the Team is working Over Time to achieve the Scope (Committed Backlog). So they have an Unreal Velocity. My formal question(s) is / are: Apart from speaking about on the Retros...
I'm doing my first group project in a class where most quarters 40% of the students have failed. I believe the reason for this is the poor quality of teaching in the class. For example, the instructor did not know that scriplets in JSP was bad practice. (I learned JSP this week and I know that.) He didn't know that Swi...
I have a matrix. I have a list of people who have to occupy n1,n2,n3 etc cells, different number of cells in different rows. I have to place the people in the cells. Occupying the same cell across rows is considered overlap. Overlap has to be minimized. I have people referring to this variously as an optimization p...
Our company has started development of own systems "in-house". We already got couple of developers, who will be responsible for writing code in Ruby/RoR. We are currently discussing infrastructure, and I would like to ask: should we develop everything on local machines, then put it to test server and later to productio...
I wrote a standalone singleton class (scaffold) tonight that serves as a facade to a few other classes, including a template class and a view class. Templates and views are both named and instances of each are stored in the scaffold object. Templates can contain views and views can contain other views. A template a...
We are building a business application (a laboratory management system to be more precise) mostly for internal company use only. To make it easier for users to find items which they work on we are implementing a list of most used items. We had a little debate on which method would be better to implement: display the mo...
A Java App Store sounds like a cool idea right? Well, I turned to Google and found some remnants of an app store that Oracle had been developing. It looks like it has since been discontinued, but I haven't been able to find much commentary on why it was abandoned. So why was it discontinued? Links to other references,...
I successfully installed Jenkins and then Sonar to go with continuous integration. The firsts reports are not that good in term of rules violations ,comments, code duplication ... I set Jenkins to get java classes, run tests with cobertura and then launch SONAR once every night during week days. I then asked the develo...
The STUN and TURN specifications allow for client authentication using usernames and passwords, and call this authentication via long-term credentials. In fact, TURN requires that clients authenticate by this means. However, I would assume that almost all deployments run their STUN or TURN servers separately from their...
In a EF 4.1 Code First tutorial the following code is given: public class Department { public int DepartmentId { get; set; } [Required] public string Name { get; set; } public virtual ICollection<Collaborator> Collaborators { get; set; } } Then it is explained that the fluent interface is more flexible...
I'm a web development intern working on a small PHP application (just a few pages with a little database access) which has fast become a couple of very non-DRY, non-OO, individual scripts. A framework seems like overkill (maybe not?) but I was wondering what some best practices for code / folder structure and general s...
Suppose my code uses (simply links to) a library licensed under the GPL. Can I release my code under CC0 (public domain dedication)? Is my code affected by the copyleft nature of the GPL?
Our company has a private GitHub repository for the project I'm working on. After a full summer of work, it looks like we'll be launching this week (wheee!). However, I want to include a "submit a bug" link in the program that leads to a form somewhere where the user can fill out a form that becomes an issue for us o...
I'm currently learning Python and I'm at the point in the book about using the Math library. I looked on the Python website and noticed the library was a bit scarce and am writing some more useful functions. For example, I went ahead and wrote a function to take coefficients and return the roots of the equation. Essent...
Most API libraries define one method for each endpoint. If there is an endpoint for getting user information, you might have a method like: getUserInfo(userId); That simple method is often a wrapper around another function that actually does the api call: apiCall('/user/info', {userId: userId}); Another option I see ...
I recently started working with Unity3D and primarily scripting with C#. As I normally program in Java, the differences aren't too great but I still referred to a crash course just to make sure I am on the right track. However, my biggest curiosity with C# is that it capitalises the first letter of its method names (e...
There is a wordpress theme I am modifying to create my own derived work. This original wordpress theme has the GPLv2 licence in it's root directory, so I assume that the entire theme is GPL code. There is a particular php file which has the following written in its first few lines: // This code is protected under Crea...
I sometimes end up having to write a method or property for a class library for which it is not exceptional to have no real answer, but a failure. Something cannot be determined, is not available, not found, not currently possible or there is no more data available. I think there are three possible solutions for such a...
If we need to represent classes in a class diagram for a big project that is not completely designed yet, and the classes have to be actual tables in a database, how would we predict and design the classes? Let's say we have a project that is going to have more than 15 tables, do all these tables need to be classes in ...
Currently I'm working on an basic application that has a 'tutorial mode'. Initially hints (bubbles with text) will be displayed above various ui elements, explaining how they work. Currently I have a main view which contains a hint object that can be updated (position, text, etc.) and I'm dispatching update events fro...
This is for a site that relies on shipping items via UPS or FedEx. I know there is software out there that does it (http://en.wikipedia.org/wiki/Coding_Accuracy_Support_System), but if you are trying to build your own solution for a simple website.
My company is in the midst of a transition from waterfall-style development to Agile/Scrum. Among other things, we're told that the expectation is for us to have new working, testable (by QA) features at the end of each day. Most of our devs lose around 2 hours a day to meetings and other enterprisey overhead. This m...
I've been reading a lot on OAuth2 trying to get my head around it, but I'm still confused about something. I understand that the client authorises with the OAuth provider (Google for example) and allows the Resource Server to have access to the user's profile data. Then the client can send the access token to the resou...
I am looking at the String class in Actionscript 3.0. It has a property called String.length . Internally it's a getter function (or method ?) that returns the length of string. Why can't it be String.getLength() ? Methods can take in 1, 2 or more values...so their significance can be understood. But what significan...
Could someone help me in implementing association in cpp. I am trying to implement a dice game where I have two classes a diegame and a dice.
I've read some basics about unit tests and TDD, but I find it hard to convince myself why TDD can have an advantage over only selected unittests. I've read common arguments for TDD, but don't see the improvment compared to simple unittests. Maybe you can help to clarify: TDD allows a loosely coupled, testable design -...
I was wondering your thoughts on the best way to implement a SQL ManyToMany relationship in Java using annotations - in this case eBeans - where there is extra data associated with the join. I have created a db diagram to help explain: Using @ManyToMany on the organisation and users classes would create the join table...
This post is based on the question https://stackoverflow.com/questions/49002/prefer-composition-over-inheritance/11758048#comment15634305_11758048. Some people said - check whether there is “is-a” relationship. If it is there use inheritance. What I think is there should be a second check for using inheritance. Use inh...
I'm looking for some pointers on class design for a global application. Let's say I have to make a class structure to manage products, and the products are sold in different countries. Some of the fields for the product will have the same value across all countries (eg. product code, ERP Description) I will call thes...
This is some sort of follow up to an older question of me. So I put the GPLv3 license into the project which contains my script and also added the copyright notice and copying permission statement to the top of my script. Now, apart from the script, the package also contains files which are helpful for using the script...
Assume that you have a hierarchy of organizational units: - Company -- Branches --- Departments ---- Teams Lets say I have some settings (for simplicity assume that they have the same properties) for each level of hierarchy: Max nr of documents Min something else Can do X Can do Y many other properties So, the sub-u...
I want to allow consumers of a web services layer (web services are written in Java) to create automated integration tests to validate that the version of the web services layer that the consumers will use will still work for the consumer (i.e. the web services are on a different release lifecycle than the consumers an...
Let me preface this by saying this is not my code nor my coworkers' code. Years ago when our company was smaller, we had some projects we needed done that we did not have the capacity for, so they were outsourced. Now, I have nothing against outsourcing or contractors in general, but the codebase they produced is a mas...
I wrote a C# class that is used to start a list of EXEs (not one of mine - third party EXEs I have to run) and keep them running (will check occasionally to make sure it is still running, and start them if not). I am able to test the basic logic of adding, removing, etc fine. How do I Unit Test that the actual work of...
I can't understand the last line of this GPL license. Copyright (C) 2011 Some Name This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later...
I have had a hard time learning logic programming thus far, and my request for outside resources on this site was met with some opprobrium, so perhaps this question better addresses both my needs and the requirements of this community: Is there a step-by-step approach to writing a problem in Prolog or related logic lan...
When using reusable business objects, what is considered best practice when building view models? We use an object we call Builder to build our view models. One builder for each logical unit of views (orders, users etc), where each unit can contain a number of different view models (orders contains summary, order lines...
Many things in LINQ can be accomplished without the library. But for some scenarios, LINQ is most appropriate. Examples are: SELECT - https://stackoverflow.com/questions/11883262/wrapping-list-items-inside-div-in-a-repeater SelectMany, Contains - https://stackoverflow.com/questions/11778979/better-code-pattern-for-c...
I have an object hierarchy with a number of leaf nodes that will contribute to summary values for the parent object (specifically: project cost and square footage). What's the most efficient way to tally up those values while the project is being designed? Additional details Parent ListOne NodeA NodeA.1...
I'd like to find a way to call Javascript functions from C. Are there any language bindings available for this purpose? I'm trying to make a library of Javascript functions accessible from C. (Something like a C -> Javascript foreign function interface would be suitable for this purpose, but I haven't been able to find...
I've been working on a kind of CRM for the sales guys in our office - not as a job role but as a spare time task type of thing - I don't claim to be a developer or anything like that, but I would definitely like to pursue a career as a web developer down the line, I just think I need a much stronger understanding of OO...
I am new to databases and trying to understand the basic concepts. I have learned how to delete data in a database. But one of my friends told me that you should never delete data in a database. Rather, when its no longer needed, it's better to simply mark it or flag it as 'not in use'. Is that true? If so, how would...
I recently converted an old application that was using XML files as the data store to use SQL instead. To avoid a lot of changes I basically created ActiveRecord style classes that inherited from the original business objects. For example SomeClassRecord :SomeClass //ID Property //Save method I then used this new clas...
I was reading a text. It said, "Information presentation must be compatible with the response time needs of systems. The response time should be short enough that the information does not lose its freshness and value but it should be long enough to reduce volume (and costs) and reveal important trends that signal t...
I was curious to know, if juggling between 2-3 projects at a time is a good or a common practice or not. When I say, 2-3 projects I mean: 1. 1 primary project, 2. 1 project with minor improvements/changes and 3. 1 project which comes at times for bug fixes So essentially, I find my self generally working on 2 project...
I've been thinking about how to architect an infrastructure for one of our business applications with the following requirement: Data written by some user can only be read by that user and his superior and a 3rd person yet to be defined I'm thinking in using some sort of asymmetric algorithm, such as RSA for data enc...
I'm asked to perform or sit in during many technical interviews. We ask logic questions and simple programming problems that the interviewee is expected to be able to solve on paper. (I would rather they have access to a keyboard, but that is a problem for another time.) Sometimes I sense that people do know how to app...
I have been looking into how to document software projects more formally, and I have learned about IEEE 830-1998: Recommended Practice for Software Requirements Specifications. However, as you can see from that link, it has been superseded. I know that 830-1998, and probably even 830-1993, are probably just fine for ...
I am trying to setup my application's structure in VS and I want to "try" and future proof it to a reasonable level. This application will be a WPF re-write of an old Winform app that had followed no conventions. No Layers, Tiers, Acronyms, etc... It is a fairly largish Enterprise Application. I planned to use Linq ...
My company is attempting to set up a pub/sub connection using RabbitMQ and sockjs, on Windows servers. I have two questions: My supervisor is calling this setup a comet solution, I was wondering if that is the right terminology? Is there a better solution stack for having a data server asynchronously ship data to a cl...
When cleaning out old data from a set of database tables, is it safer to have the logic in the application or in a database trigger? I am upgrading an application that I wrote a while back (and in a hurried fashion) and one of the things I want to clean up first is ensuring that data which is no longer being used is pr...
To begin with, this isn't a question about which language one should choose :) We're considering a language switch as our general direction is changing from content-driven web sites to data/action-driven web applications. What sort of factors should one think about in order to successfully evaluate the various language...
Suppose we have a model of a human muscular system containing the following muscles each within a specific muscle group: Arms Biceps Triceps Forearms Torso Front Abs Chest Shoulders Torso Back Trapezius Lats Rear Shoulders Lower Back Lower Body Quads Hams Hip & Butt Calves Now, given a list of selected muscle...
The internet is full of references on how to get prepared for an interview. Many websites are loaded with questions and answers. But I can't find any useful information about what exactly an interviewer should do to evaluate a candidate. What I mean is not just collecting good questions to be asked. I am asking about ...
A reoccurring theme on SE I've noticed in many questions is the ongoing argument that C++ is faster and/or more efficient than higher level languages like Java. The counter-argument is that modern JVM or CLR can be just as efficient thanks to JIT and so on for a growing number of tasks and that C++ is only ever more ef...
We're designing a data service that will store a large number of statistics about stocks, including historical data. The client will be a web application, which will need to pull various bits of data to show in different places on the site. Since the different places need to show different sets of statistics, it's not ...
We're using JIRA with Greenhopper, and currently our business analyst has tasks for their analysis which will eventually lead to new stories placed in the backlog, running alongside the stories for the current sprint, and it feels kind of messy - especially because they don't overlap the workflow for the development st...
I'm working on an application which requires user credentials and so on. So a database is required on the backend. What is the best practice to connect to a database without hardcoding your password into it? The program could be reverse engineered and one might get the password which is something we obviously don't wan...
As the question states. What is an 'advice'? More importantly, what does it even mean (semantics)? What's the etymology of 'advice' in the Spring context?
I have for a long time been working on an ODS as well as Data Warehouse. Both are integrating a wide variety of data sources from stove pipe applications. One of the uses of the ODS is to provide data to other stove pipe applications. Imagine one app maintains a database of personnel, and another app manages tracki...
If one would to write auto-suggest for an IDE/code editor (like IntelliSense), does one generally need to write a parser for any language that should be supported, or do compilers/runtimes provide these things? Neither the PHP or Python binaries seem to support just parsing files and generating some kind of raw output....
I think mine is "there's no such thing as a five minute job" - that programmers tend to be overly optimistic about development and that we should really think through a the implications before promising a quick solution to a problem and then diving in to code
I have a need to make a somewhat custom change request system (very high auditing requirements). Instead of completely reinventing the wheel I was wondering if there's an open-source change request system, considered decent that I could write a custom module for? I've done some searching but the ones I have found don't...
We have a web service that takes in input different types of messages. The function of the webservice is to merely write in a database the content of the messages. There is about one table (with foreign keys to others) for every kind of message. We have been asked to transform the webservice in a configurable product b...