instruction
stringlengths
34
19.9k
I am aware that all the DevOps definitions are fairly vague, and this question is subjective, but it's still something I couldn't find an answer to. Is there any difference, prestige-wise, between DevOps and Software Engineers? Is the experience interchangeable? Are N years of DevOps experience interchangeable for N ye...
I was thinking of creating a text adventure game and after a small google search, I found out that quite a few (simple) text adventure games are created in Prolog. Why is that?
I am starting out with DDD and understand that aggregate roots are used to ensure transnational consistency. We should not modify multiple aggregates in one application service. I would like to know however how to deal with the following situation. I have an aggregate root called Products. There is also an aggregate ro...
The screen shot shows the magento product upload page. The left nav allows you to switch to different options for the product. Basically each option in the left nav appears as a different page. However when you save and close, it will save all the updates made on each page. Using Foundation4, html, css, js - what would...
I found that llvm could only generate assembly code. If someone want generate and link assembly code to native executable code, they should use external tool(GNU as/ld, for example. Currently lld is not ready, and there no more information about llvm-mc). This question's answer and other answers imply that Clang use B...
Well, the title is pretty much self explanatory, but I'll expound it a bit, and say the origin of my question. So, I've been wondering as to how the CPU knows when it received the RAM. I'm pretty sure it doesn't OR the RAM outputs together, because 0x00 is still a number, yet ORing that together says that the RAM has n...
Using globals makes your code hard to test thus more prone to bugs, not secure and unpredictable. That's why we pass the variables we want inside a function/object. So my question is simple: Do $_POST, $_GET, etc violate the encapsulation principle? I'm thinking that, to retain control of those variables in an OO way, ...
I'm writing a C++ library, and according to this site here: http://semver.org/, I should increment the MAJOR version when I make incompatible API changes. Is changing the name of a namespace considered an incompatible change in the API? I'm not quite sure. I don't know whether I should increment the MAJOR or MINOR ver...
I'm currently working on a group project to recreate the original Pokemon Yellow version in Java. We've only just started planning it out but they way we've drawn out the design right now is to have an abstract Pokemon class and have 151 (Count of the original Pokemon) classes that extend it, each one being a different...
Just found out that Intel processors now have Transactional Memory support !!!! I learned about Transactional operations in my dB/OS class, it is a very simple concept: entire operation is executed or nothing gets executed. How is programming under new Transactional Mem. model is different from Multithreaded model that...
On "hammerprinciple.com" website there are programming languages, statements about them and voting that associates languages with statements. In particular, there are statements: "This language is built on a small core of orthogonal features" "This is a mainstream language" Why they are so opposed to each other? Is b...
I've been asked to put together an application in RoR which has multiple roles for users. The idea is that a user will have a role, Admin, Moderator, User ect... and they will also have a department as well, HR, IT, Customer Care ect.... The app will have designated sections for each department to manage data and other...
I'm working on a distributed client-server system that uses TCP. The program's functions is to transfer money to an from the server, but also between the clients, a sort of MobilePay. When one client wishes to transfer money to another client, that client will need to accept the transfer before it is succeeded (one of...
I've built a flatfile db system that will work like mini-noSQL system and it split db to smaller files, and I did a SplFixedArray wrapper for it with a method for searching usage built on preg_grep. Everything working very good till now, but if the array became more than billions of indexes how to handle it? When sear...
I'm writing a simple chess engine in LISP. I actually know how the engine decide the move, it evaluates and reads some opening books. But that's not what i mean. This is my design. 57 58 59 60 61 62 63 64 49 50 51 52 53 54 55 56 41 42 43 44 45 46 47 48 33 34 35 36 37 38 39 40 25 26 27 28 29 30 31 32 17 18 19 20 21 22 2...
I've rolled my own SIMD-accelerated math library. It's gotten pretty complete, so naturally I went to conduct speed tests and optimize it. Btw this isn't premature optimization, the lib is actually complete in functionality, I really need it to be fast now. So anyway, I'm testing some vector dot product methods against...
At my current employer, we are using an open-source project hosted on Github as a component of our application. I have been working on this project to both add some features that we need and to integrate it with our build systems. My manager and I are in agreement that we would like to submit as much of our work on thi...
I'm very excited about Docker, if you're a developer in a big project you've suffered too much at the machine hands of environments and multi-platforms. One of the key selling points of Docker is that by snapshotting/committing image state you avoid the risk of building an environment with a different version, possibly...
I have a service(webservice) that is used to access to the domain logic. One of the methods of the webservice is createFoo, where Foo is my aggregate. So the class that implements the webservice's method calls my application service that contains the createFoo method which is responsible of doing some stuff and persist...
For a ticket reporting tool, I want to compute whether certain service level times (slt) are met. That is (a bit simplified): Was the timespan between opening and closing of the ticket within a certain slt. Now there is also something called a service window (SW), like mo-fr,9:00-17:00. Now to compute whether a slt was...
When I was starting to programme in Java, the fact that switch statements didn't take strings frustrated me. Then on using Enums, I realised the benefits that you get with them rather than passing around raw values — type safety (which brings easier refactoring) & also clarity to other developers. I'm struggling to thi...
I am designing an application, which will aid designing electric installations. I went for Domain Driven Design, as the topic is complex and the application will be growing with gained knowledge. However, I am newbie to this concept. For now, I have a problem to properly model the domain, especially to divide entities ...
Say that we are developing an application with modules (Sales, Accounting, Purchasing, etc). An example case here is : Sales module is the basic / primary module available, and Accounting module is a complementary module. SalesModule -. Product And AccountingModule -. Account -. Journal If we were to say that : I...
Abstract A common problem is to store objects (with graph), and to load them back. This is easy as long the stored object representation matches the executing code. But as time goes by, requirements change and stored objects do not match any longer the code. The stored objects should not loose their data, and the code ...
Was fascinated to read about the text adventure game The Hobbit which featured an incredibly robust parser called "Inglish": ...Inglish allowed one to type advanced sentences such as "ask Gandalf about the curious map then take sword and kill troll with it". The parser was complex and intuitive, introducing pronouns, ...
In F#, I want to build a hierarchical data structure in a way with a minimum amount of language noise. The actual problem is trying to build an RSpec inspired framework using F#. RSpec allows the construction of tests in a nested way. For example. describe Order do context "with no items" do it "behaves one way" ...
I'll express my doubt with an example. Suppose I have the following requirement: The customer needs a page in his website that displays all the products he has with a quantity field on the side of each product. The visitor of the website must be able to fill in the quantities desired, select one location and ask for ...
When designing a REST API, how deep should the resources levels go? For example; If I have the following database tables: Companies: ID, Name Employees: ID, Name, CompanyID Tasks: ID, Name, EmployeeID When exposing these through a REST API, it might look something like this (id is optional): Companies: GET /api/comp...
One of the advantages of using a DVCS is the edit-commit-merge workflow (over edit-merge-commit often enforced by a CVCS). Allowing each unique change to be recorded in the repository independent of merges ensures the DAG accurately reflects the true pedigree of the project. Why do so many websites talk about wanting t...
How do Valve create games that run on Linux, Mac and Windows? I imagine they dont really write one version for each platform bec that would just be a nightmare.. or do they? I imagine it is written in a portable C++ code (or C#?) but I wanted to know more details about this. I've developed an app on Adobe AIR and consi...
I encountered the following text in an article on the ModelViewPresenter pattern and my brain blue-screened: Passive View usually provides a larger testing surface than Supervising Controller because all the view update logic is placed in the presenter. I haven't come across this particular jargon before and I'm rath...
Recently reading a lot materials on Reactive Programming, one thing frequently mentioned is the 'PUSH' versus 'PULL' style of application. Event driven ( Reactive programming ) Some of the authors say that both these styles have their area of applications, but aren't most application domains we are trying modeling are...
I'm a college student and I have homework in C++. My professor wants separate hpp and cpp files for each C++ class. And it just didn't feel good how much I had to type, and how much I had to click to create two new files for every class. I haphazardly put together a simple Python script that would read a single file an...
I had this crazy initialisation -- documentList = new ArrayList<Map<String,Integer>>(); which I intended to store a new map everytime in a loop but unfortunately put itself inside the loop. And you know the havoc. How do you detect such mistakes? I might be looking for suggestions on 'recommended debugging techniques' ...
We have a professional Scrum Master consultant [*] who recently joined our project. Unfortunately, we don't know her name (she never introduced herself to us, she just came in one day and said "we are having a daily stand-up"), and she doesn't seem to do much else except chair a daily stand up meeting - when I half-jo...
I have a custom designated initialiser like this: - (id)initWithLocation:(CLLocation *)location { if (location == nil) { return nil; } self = [super init]; if (self) { self.location = location; } return self; } My colleagues sometimes ask me to wrap everything (apart ...
My application has a rather non-trivial, yet standard, log configuration. It includes a console appender and a rolling size-based file appender. When I'm running the tests, thru the IDE or with maven, where is the least surprising place to save the log files?
I've been doing PHP for 4 years now. 2 years at school and 2 years at work. But I feel like I'm stagnating. Here are some things that I currently know about PHP: Basics (variables, control structures, arrays, loops, sessions, cookies, file manipulation) Database Integration (MySQL) OOP - I only know of the basics (cre...
What are the differences between string.c_str() and &string[0]? Regarding performance my guess is that &string[0] is a little faster than string.c_str() as it doesn't require a function call. Regarding safety and stability common sense tells me that string.c_str() should have some checks implemented, but I don't know, ...
I have been having this experience for sometime now, when a client needs a software product and contacts me, the client usually wants to know the time frame on which this product will be accomplished. Usually as a software developer I might not be able to fully determine how long it will take me to finish the job since...
I work on a company that have a payment system that runs under a executable kiosk instance of internet explorer 7. when the application is running the process name is not similar with iexplore.exe or something like that. The name of the windows process is the same as the executable.exe. We cannot run the system under ...
At my company we have some vendors that we transfer data to and from. Sometimes the data is pulled into our local SQL database for business reporting. Other times we pull data from one vendor, transform it, and then transfer it to another vendor's FTP server. The guy I replaced has a couple of generic SFTP Push/Pull c...
This post describes a new feature in Java 8 called virtual extension methods (formerly called default methods, or defender methods). In the example provided, an interface has one method, which is implemented by a class. Then a second method is added, but instead of forcing the class to immediately implement the interfa...
I see many job adds which require at least x years experience. The question is how do you know when a candidate has the required years of experience? What do you expect from a person with x years experience (edit: effectively how do you check if the CV isn't lying without relying to skill checking)? What can a person w...
I have been falling into a pattern lately where I have been defining routines that rely on an interface defined by a function that is specified as a parameter to the routine. (The language is C#, but this can be applied to any language with first-class functions.) For example, I have an API that exposes CRUD operations...
Several implementations of mixins (e.g. Ruby mixin, Scala trait) include support for storing data (e.g. variables, properties) between method calls in instance variables. There was a bit of debate in this question about whether or not a Java virtual extension method qualified as a mixin because they cannot store data i...
I'd like to have suggestions about the structure of my web application. What the app does: My app receives files from about 800 scanners around my country and the users see the scanned pages into this web application, then they can organize the pages in groups, choose which one keep and which one discard, and insert ...
I have a decision to make and I am wondering what would be the better solution. I am refactoring an older application and intend to really get into the nuts and bolts of it. There are 8 report types currently and one of the modifications are to allow different reports to be "saved" in different ways. My two thoughts on...
I understand that the dependency injection is something done by coding and its all done at compile time. And that Dependency injection coding is easily done now by helper tools like Ninject. However this is at compile time that the dependency injection occurs. Then what does it mean that dependency injection also occu...
My Situation I work for a company that builds software for many other companies. When I learned installers weren't built-in with VS2012, I was curious how to deploy. So far, I have just been dropping .exes on our clients servers using PowerShell scripts. Now I need a full-blown Windows service. I have seen many example...
I'm designing a schema table that will manage the auth tokens for integrations // app with social networks. At the moment only for Twitter and Facebook. I'm thinking in this mode id social tw_token tw_token_auth tw_secret tw_secret_key fb_token fb_secret 1 twitter aaa bbbb cccc ...
I am using JRuby. I have many classes implemented in Java, and I want to create objects off of them in my Ruby scripts. Suppose that I have a class Sprite in Java. In Ruby, to refer to it, I use the following: Java::ComMyWebsiteMyProjectName::Sprite Because Sprite is defined in the package com.myWebsite.myProjectName....
I usually write my software projects in Java, and I am still a bit confused as to when to document my classes, interfaces and methods. There are two ways: 1) Write documentation after declaring or coding a class/interface/method/constructor. This way I am sure documentation is handled immediately. Disadvantage: I might...
I am building an online social network. I have finished writing RESTful API service using Django. This will return only JSON response (No HTML will be generated from server side) so that this JSON response can be used to build native smartphone apps. API service being common to all clients. My question is, since there ...
This is probably something that should go to the legal department -- presuming they have any inklings about software licensing -- but what software license should I use against code developed for use at a publicly funded institution (in the UK)? Specifically, it's internal-use code for various university systems. I bel...
I have a Grails application with a number of services that are starting to get very large. The flow in the majority of my service methods is Database read (Returns DBCursor from MongoDB) Iterate through the cursor and perform some operations. Return results from operation. I'm beginning to consider moving the logic ...
Stack for different thread is different.but what about Heap. If Heap is different for different threads, then how they share objects?
As I understand in most security breach where the list of hashed password are compromised, attackers do use brute-force to try to find weak password and, invariably, they always find quite some (like in the recent Github breach). If I'm not mistaken in most cases when a user creates an account, the password is sent, en...
I am really confused about software linceses, I've read a lot of articles but I can't find an answer to my question, which is: Can I develop and sell applications that uses libraries under gpl license? Like for instance, I want to use agsXMPP library in a windows phone app, and sell it in the market, so is it legal?
Is there a naming convention for higher order functions? That is, functions which return other functions. An example in Javascript: function onlyDivisibleBy(div) { // <-- higher order function return function (n) { return n % div === 0; } } var arr = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9]; arr.filter(onlyDivisibleBy(...
How do I make sure my REST API only responds to requests generated by trusted clients, in my case my own mobile applications? I want to prevent unwanted requests coming from other sources. I don't want users to fill in a serial key or whatever, it should happen behind the scenes, upon installation, and without any user...
I've a functional test using Junit which tests delivery of xml file to an end-point. XML file is sent by client, so I copied it to a test folder, read it from there in my test and do asserts. We have 10-20 such files with different data but same format, my architect wants me to copy all of them into same folder, loop ...
When Googled, many responses for this topic come up. However, I don't feel like any of them do a good job of illustrating the difference between these two features. So I'd like to try one more time, specifically... What is something that can be done with self-types and not with inheritance, and vice-versa? To me, there...
In some of my code, I have a static factory similar to this: public class SomeFactory { // Static class private SomeFactory() {...} public static Foo createFoo() {...} public static Foo createFooerFoo() {...} } During a code review, it was proposed that this should be a singleton and injected. So, ...
Doing some refactoring, I noticed an unusual pattern I'm not familiar with. Properties and variables that do not yet have a value are initiated with undefined declared explicitly, despite the fact that value-less variables and object properties would evaluate to undefined anyways: var foo = undefined; this.prop = undef...
I'm developing a multi-part solution that consists of an iOS application and OS X application which communicate over Bluetooth Low Energy. Everything works fine and I can send moderate amounts of text between the iPhone and my MacBook. I would like to be able to send larger amounts of data, such as an image, from the i...
Say you have a web service, which adds business logic on top of a data source. What each API of this service pretty much looks like is - given a set of constraints, give me the items from the data source that satisfy these constraints. You can say you get a "view" of the data source back from the API. Now, over time yo...
The current system I am working on goes through a set of documents & performs some logic using the metadata of the document. If the metadata of a document is fishy..it throws an exception. The system logs the exception, fail the job & let the developer fix the issue by looking at logs before moving on. I want to improv...
I have been tasked with teaching other teams a new codebase, but I keep running into an issue. Whenever I go to actually walk through the code with people, we don't get very far before the entire exercise devolves into a bikeshedding (members of an organisation giving disproportionate weight to trivial issues) exercise...
I am planning to post an article on codeproject.com where I will be sharing some code I feel worthy of the effort - so I went and read the posting guidelines. It appears that I will have to select a software license for my submission. I really do not care about my material and what people will do with the code that I w...
I'm studying OOP PHP and have watched two tutorials that implement user login\registration system as an example. But implementation varies. Which way will be more correct one to work with data such as this? Load all data retrieved from database as array into a property called something like _data on class creation and...
If you have different database per customer as there is no need to share any data between them does the same apply if a customer has multiple stores ? I believe that it is easier to do queries for statistics (some require 4-6 table join) if they are at a single schema rather than multiple schemas. But everyone (haven't...
I've been building a large web application for a company. Initially the project owner appointed a Graphic/Web designer to complete all design/front end works. Me and who ever I bring in to complete back end and all the view binding at the front. The initially front end/graphics guy dropped out and was replaced with a (...
I've been developing an application using the Laravel Framework & have been exposed to the idea of queues for the first time. There are a multitude of tutorials & articles about using queues & examples of what to use for, but I've never seen anyone writing about or highlighting when one does not need to actually use an...
New to OOP and trying to understand some basic fundamentals. Currently using PHP5 to build a basic web app. In using PHP's built in PDO as my database class and a separately created user class that handles, among other things, user log in and out, is it best to have the db class connect to the database in a log in situ...
I have a project on CodePlex that I have opened to basically anyone to join and help out on. I am mostly an enthusiast coder, although I have done some programming work as part of my job it has always been solo projects that my team uses for IT support. With my CodePlex project, I got my first new fork yesterday. I clo...
I want to implement loose coupling in a project. I know two examples of successful loose coupling designs: On a Unix workstation, shell scripts realise a loose coupling between basic utilities. The loose coupling relies on the shell's ability to blindly redirect data flows between utilities, without having any knowled...
I have a dictionary of Objects of a class Columns Dictionary<double, Columns> Columns is a class of columns, i.e. name, post code, etc, mobile phone. I would like to make Columns class as much open for extension as possible, so it will be no trouble to add more classes. I need to set few of the columns to be there alw...
I have some function names which are assigned to some nodes. I have to decide which functions to move to other nodes to increase speed. Why do I have to move the functions to other nodes? If communicating functions are on same nodes they take less time as compared to if communicating functions are on different nodes. A...
First time I make use of Code Review. At the moment I'm creating an Android application and the company I'm developing it for, has a specific file format that can be used to give text based data specific formatting rules. See it as an rich text format especially build and designed for their use. The File format to work...
When developing domain models, I can see two major ways of thinking about the user: The first one assumes that a program is a kind of "simulation" of what happens in the real world, and the user is an spectator. With that approach you would have a Customer class -for example- with perhaps methods that correspond to th...
I have a class that is 99% identical to its counter part. Sample code goes below: public abstract class BaseClass { void Method1() { } void Method2() { } void Method3() { } public void MainMethod(List<Object1> listObject) { Method1(); Method2(); Method3(); Method4(); ...
Are there any reliable strategies to implement a login mechanism that will allow access to an application for maintenance purposes? Kind of like how some routers have a list of default logins that technicians can use. But the way routers do it is insecure, and I was wondering if there are better ways to implement this ...
I'd like to know if there's a technical reason of why PHP's designers decided to invoke a static method using Class::static_method() instead of Class->static_method() (like any other method). Does the syntax change reflect any technical requirement? I'm asking this because the syntax for every single other language I k...
I'm working on an order system and implementing an audit log. Two main concerns are: 1) While auditing a line item , you should only see audits for the line item 2) While auditing an order, you should see audits pertaining to the header information AND line item. For example, a line item would have an audit trail for w...
I am using the MVC pattern. Lets say I want to create a new object and add it to my database. Where is it better to create the new object: View: Boo boo = new Boo("awesomness"); Controller.AddDB(boo); Controller: public void AddDB(string name) { Boo boo = new Boo(name); addtodb(boo); }
My P2P app needs to locate peers, but I don't want to hard-code a DNS address... One example I've seen is bootstrapping via IRC, but I'd like to do this over HTTP/s if possible. What are my options and techniques for bootstrapping a P2P app?
I'm working with some people are are used to making "associative arrays" in JavaScript like this: var arr = new Array(); arr.prop_1 = "asdf"; or arr['prop 2'] = "1234"; It works just like an object because it is. for...in loops can be used and accessing the properties is fine using a dot or a square brace. the lack ...
I will like to assist my group standardize to a reproducable Java tooling environment that aligns with some good practices to improve on our workflow. We are predominantly a .NET shop that has been doing quite a bit of Java development recently and have been burned too many times with our current Java development proc...
Let me start by saying that my GIT knowledge is fairly shallow, so I'm guessing that there might be something I'm missing. THE SETUP: As an example, we have a project which is being developed as a collection of plug-ins/modules. Some modules, such as contact management, depend on others, such as validation. Each module...
I am a novice JavaScripter and have no real knowledge of what goes on inside the V8 engine. Having said that, I am really enjoying my early forays into the node.js environment but I find that I am constantly using events.EventEmitter() as a means to emit global events so that I can structure my programs to fit a notifi...
I am working on a project and would like to expose some REST services. The technologies used are RestEasy, EJB and JPA/Hibernate. I have structured my app so that there is a clear delimitation between the service layer and model layer. A typical service that retrieves data from the database have a signature like this:...
I was signing up for a website last night, and once again was greeted with the fact that my username cannot contain certain characters (including spaces), and neither could my password. Is there a historic reason for this, or is there no particular reason? Passwords that are phrases have higher entropy and are harder ...
I'm trying to understand if a programming languages design is built on some a theoretical model. I came across few links that was describing Programming Language Theory, Lambda Calculus, Formal Languages and Turing machine. I got lost in all that theory, what I understood from all that is that (any ..?) programming lan...
In a recent project I was asked to implement an events system. An Event had to have a Location which was originally specced out as simply a physical location with some optional extra notes. Then the spec changed (as they have a habit of doing) and we needed to have "online" events too. These would not have a physical a...
Assume I'm using the following code to generate pseudo-random sessionID's: sessionID = SHA-512(GENERATE-GUID()) The GUIDs are pretty deterministic, i.e. I see lots of GUIDs with a lot of the same hexadecimals. My simple question is: How deterministic are my resulting sessionID's? The algorithms for SHA are supposed to...
Consider an application that contains a number of pages with a relatively large amount of javascript present, or a predominantly JS powered application. The script handles a number things, such as: Client side validation Showing/hiding entry sections when appropriate Autocomplete when filling text fields Date pickers...
Background: I'm working on an Adobe AIR app that has many facets. I'm looking for strategies to find memory leaks. Broadly speaking, the EXE contains an embedded JVM, and an AIR Native Extension for Windows (using C). So there are many moving parts. As one example, I'm using MonsterDebugger which traces either the AIR ...
I was trying to design a small C++ geometric API for learning purposes, but came across a problem when dealing with intersections of geometric entities. For example, the intersection of a line and a sphere can have three different types: a couple of points, a point or nothing at all. I found several ways to deal with t...
I am planning a database scheme and I hesitate between two designs, which one should I choose? For the purpose of the question, assume we want to prepare a database scheme for an application managing student information in a university. There is several modules in the application: Registry, dealing with general infor...