instruction
stringlengths
34
19.9k
What exactly does "Security through obscurity" means in the context of stroing unencrypted passwords? I'm using a small program (I won't name it, to not enlarge enough large shame on its author) that uses my Google account for some tasks. I've noticed, that it stores my password in plain-text unencrypted file. Just a s...
I would like to know what options are available for documenting a project which has already been developed, as the developers who worked on didn't write even a single page of documentation. The project has no other details other than many pages of scripts with functions written and modified by developers who worked on ...
Is there a way to show and save all "final" definitions entered into a Scheme REPL into a text file? Say, if I have defined in the REPL: (define (increase x) (+ 1 x)) (define (multbytwo x) (* 3 x)) ; let us say this was an error (define (multbytwo x) (* 2 x)) I want to save this into an .scm-file with the ...
I want to see all user-made definitions in a Scheme REPL, both loaded from files and entered at the REPL. Is there any way to "dump all definitions"? E.g. if there is: (define (plusone x) (+ 1 x)) (define (plustwo x) (+ 2 x)) (define (plusthree x) (+ 3 x)) then I want to see all of these definitions, but o...
I am confused as to what the problems could be if a constructor was inherited from a base class. Cpp Primer Plus says, Constructors are different from other class methods in that they create new objects, whereas other methods are invoked by existing objects. This is one reason constructors aren’t inherited. Inher...
While trying out the below applet, I saw that this path finding algorithm called Jump Point Search yields significantly faster result than A* and Dijkstra. http://qiao.github.io/PathFinding.js/visual/ A*: 46 seconds Dijkstra: 1 minute 39 seconds Jump Point Search: Less than 3 seconds Needless to say, I'm quite astou...
Let's assume that we have a simple GIS-like application, which presents (using Google Maps or anything similar) recorded tracks. Each track consists of points (data portions) with geo-data and additional information, like speed, altitude and similar attributes. Basing on these additional params, I want to calculate som...
My company has so far been developing a medical device, which is connected via USB to a desktop system (running x64 Windows 7) to run the image analysis and do everything GUI related. I am familiar with both Windows and Linux programming, C, C++, C++11 and C#, but now our new project coming from management would be a h...
When Enum is used as below, say if we have enum Designation { Manager = 0, TeamLead = 1, Associate = 2 } then write the below code if (designation == Designation.TeamLead) //somecode Now if we decide to change the enum element from "TeamLead" to "Lead" then we have to modify the above line of code as well...
An asm.js application is very fast (near native C++ speed): http://kripken.github.io/mloc_emscripten_talk/micro4b.png But how is it possible to write one in C++, convert it to LLVM code, then do some trick with emscripten/asm.js ? I haven't found any tutorial about it. And if I write the code in C++, then how to use ...
I'm trying to build a general understanding for what's common in this situation so that I can decide if it makes sense to pursue it further. Are installers welcome in a typical corporate environment with the following? Change control process Dev/QA/Production environments Designated deploy teams for various areas (fi...
I am fairly new to Angular.js, and one that confuses me is how to best use modules in an application. It seems to me that modules can contain any of the other common constructs in AngularJS (controllers, directives, filters, services, etc.), but from here I am unsure which module(s) should contain which things. Shou...
Recently I've been browsing source code of large applications written in C++ to learn a bit but I couldn't help but notice that most if not all use a lot of IFDEFs and class-less functions (where they could have been class members/methods). An example is Qt Creator IDE source code: http://qt.gitorious.org/qt-creator/qt...
I have some questions about VPS and web hosting. As far as I understand, VPS is a virtual machine on which we can do anything as we can do with our local machine. Install software, change settings etc. Web hosting is where we have only a folder in which we place our web site in. However, most of the provider currently...
In electrical engineering class we learned that signal lines are not ideal, so it takes time for the signal to reach the other end of the cable, and if we doesn't take this into account, it can lead to crazy phenomenons like: Imagine we have a tank game, where tank1 (played from Europe) shots tank2 (controlled from th...
Single responsibility ( reason to change ) of an entity should be to uniquely identify itself, in other words, its responsibility is to be findable. Eric Evan's DDD book, pg. 93: most basic responsibility of Entities is to establish continuity so that behavior can be clear and predictable. They do this best if they...
Through most of my dev experience, I've never had to deal with much variety of access control architectures. They've all been pretty straight forward: Group [Create, Update, Delete] - User 1 - User 2 Group [Update, Delete] - User 2 Which, for all intents and purposes, works well. The problem I have is the...
i'm using Ruby 1.9.3 I figured out that you can use an array, or a hash as hash key in ruby: h = Hash.new h[Array.new] = "Why?" h[Array.new] # Output: "Why?" h[Hash.new] = "It doesn't make sense" h[Hash.new] # Output: "It doesn't make sense" But an object works differently... h[Object.new] = "LOL" h[Object.new] # Ou...
We have a team of roughly ~8 devs who regularly work on the same feature over the course of a 3 week sprint. It isn't quite pair programming, but in our current workflow devs regularly push up incomplete code for a colleague to complete. This worked fine before we introduced Gerrit, but now our commits need to represen...
I've been using Python for a little while now and I am enjoying it, but a few of my friends are telling me to start using a language like C# or Java instead and give these reasons: Python is a scripting language Python apps don't port well to people who don't have Python It's hard to make good GUIs in Python since it'...
I recently took over the maintenance of 10-15 SQL Server databases and to my surprise found out that the team does not store the code scripts anywhere. They currently deploy changes to each environment without any paper/code trail. The code for applications that use these databases are all stored in TFS and I need t...
There are a few claimed benefits to Node.js that I typically hear. Some (many?) I agree with. There is one that I completely do not understand, which is the one language argument: "You can now use one language on both the client side and the server side." This does not make sense to me on many levels: most people alre...
In most MVC frameworks, Controller class contains multiple methods, each representing one action. Then annotations and reflection is used to call those methods appropriately. But from OOP point of view, the whole class has many responsibilities, eg. one for each action. Then each action should be represented by it's ow...
Why not use a RTOS with microkernel architecture for web servers? The scheduler is deterministic and all requests will be handled quickly leading to faster response time? It's easy to extend an OS based on microkernel architecture, since everything is like a client-server communication via message passing. Also, the se...
I am interested in building a custom Websocket server for college project. I have a good familiarity about HTTP 1.1 and knows quite well of how it works. I am asking this question assuming that Websocket clients (browsers) have their protocol specification since Websocket clients connects to Websocket server through UR...
Suppose I have a web app where sellers add their products and set them as available for sale. Then I show a list of products in my mobile app, where I get products via my REST API. My problem: suppose two clients view the same product(and there's only 1 item available from the seller) and they make simultaneous order. ...
I am making an Android application which reads several JSON files and inserts the read information into tables in my database. For instance, there are three files: countries.json { "countries": [ { "name": "United States", "org_ids": [ { "id": 1...
I previously asked this question about creating an algorithm for joining records from multiple databases, and since then, I have built a rudimentary version of it (which doesn't allow for inter database table associations to keep it simple for the moment), and now I am trying to test it. So far, I have tested doing joi...
I have some concurrent key-value store implementations that are implemented with hash tables and search trees that I would like to compare. I would like to benchmark them with a real world application where several threads stresses the key-value stores. I already have some micro-benchmark that stresses the key-value s...
One thing I cannot find anywhere is: is this approach limited to non-critical software? Because in critical (or just when customer wants us to follow his rules) we have no freedom in testing and just follow the procedures. Am I right?
I'm interested in what algorithms or rules I can programmatically implement to generate RGB or HSV colors for plotlines to keep them visually distinct from the neighbors. I know that in professional mapmaking, there are algorithms or rules that make sure that no two adjacent countries on a map are the same color. I can...
I am trying to improve my knowledge and ability with graphs and graph algorithms and have noticed something curious: as far as I can tell no "mainstream" language contains support for graphs in its standard library. Trees yes, graphs no. The only language that comes even remotely close is C++ with Boost (which isn't te...
I'm developing a simple web application in node.js. Users can log in from any page in the application, so I handle authentication in the server's code and logic, and the application's server-side code checks to see if a couple session variables are set. If they are, the application continues with user-specific inform...
I was looking for an answer to the question of what a DAO should return when a search ends up to be for an entity that does not exist. There are some generic previous questions related to returning null, but I am looking for an answer specifically in the context of the DAO retrieve scenario. To be clear, when I say N...
We are building a Game Client and Server, our system is broken into four major projects: (Client and Server, Shared Interfaces, Source Art). In addition, both client and server have a set of libraries where we put shared code for client and server respectively. As you can imagine this leads to a lot of projects, I coun...
So, we've got a guy who likes to write methods that take Objects as parameters, so they can be 'very flexible.' Then, internally, he either does direct casting, reflection or method overloading to handle the different types. I feel like this is a bad practice, but I can't explain exactly why, except that it makes it mo...
I've refactored a program to remove its dependency on an sql database by storing all the state in a memory model. However the manager liked the ability to easily inspect the domain state just by doing an sql join/filter on the database at any time; and he wishes to maintain some similar domain inspection ability. We ...
I know that an app developed with PhoneGap is slower than a native one because at PhoneGap the whole code must be interpreted at runtime into a native one. But could someone explain or has a good in-depth website which explains why a native app retrieves data (a picture or text) from a web ressource faster than an app ...
Our specific situation is that we are creating an agreement between ourselves and another team for shared control or use of a PHP based web application that we have been building. We have a set of standards and conventions documented in our technical specs. However, I have been asked to define them in terms of an i...
I am trying to design a table to store references to multiple tables as a "target" of the item in each row. An example should clarify what I am trying to do: Imagine you have 4 tables (images, videos, comments, likes) with likes being similar to CREATE TABLE `likes` `target` int(11), `user_id` int(11), `created_at` tim...
I'll admit it, I haven't yet mastered the language, but my experience with it tells me that Javascript is a highly flexible language, allowing prototypal inheritance, dynamic typing, functions as first class citizens and so many more cool stuff. I think such features bring some inconsistencies, but that's nothing new, ...
I have a View Controller or a View that implements delegate and dataSource methods of UITableView. These methods are not going to be used outside this class. So is it a good idea to make the declaration of the UITableViewDataSource and UITableViewDelegate inside the .m file with a private category? For example : Instea...
I have this personal rule to start all function/method names with a verb. My verb of choice for functions or methods that get a value based on some data structure or object is get. I'm wondering if that's a good idea. The good thing about get is that it doesn't really say anything about how that value is being retrieve...
I am about to begin writing a program in c# that will read Addresses from a source file create a Geocoding request, sent it to Google Maps API, get the response choose the coordinates from the xml and then store them in a database. My question is what is the proper type of source file considering performance and easy i...
I will be taking an advanced PHP UNiversal IT Test (UNITT) for a position I am applying for. However, I am unfamiliar with the term 'unitt test'. What is a unitt test and how would a company execute one? If anyone is familiar with this, please let me know the best way to prepare
I have been learning UML and have a basic understanding now, but I keep seeing these sort of high level architecture diagrams. Here's one from Microsoft: Source: A bad picture is worth a thousand long discussions. Is this a UML diagram? Are there any rules to follow for creating these types of diagrams? I would like t...
I am a relatively new to the world of software development and I've used the Ruby on Rails framework to develop relatively simple applications before. I know that frameworks can be extremely useful in terms of getting applications up and running quite quickly. However I also know about the well documented problems tha...
I am creating an application that visually displays world regions, e.g. to place markers within an administrative region. Does a dataset exist with geometrical or geographical (long/lat) descriptions of the world's current country borders (and possibly other administrative divisions)? Ideally the dataset would be in a...
Why? Depending on your source the Intel compiler is likely or most definitely the compiler generating the fastest executables for the x86 architecture (5 to 100 % execution time improvement). Intel offers its compilers for Linux under a non-commercial license for free (I think I read it is free somewhere on their page:...
Wonder if anyone could shed some light on this messaging construct: The documentation says that messages appear btwn brackets [] and that the msg target/object is on the left, whilst the msg itself (and any parameters) is on the right: [msgTarget msg], e.g., [myArray insertObject:anObject atIndex:0] OK, simple enough.....
How do you deploy your website in Azure so that it looks exactly like when you run it in your localhost? This is a very simple website that I created following the ASP.NET MVC4 tutorials. However, I added a new background image and it doesn't show. Is there anything else I need to do to make sure all of my files are b...
Here are reasons why one would want this: 1) We often don't use all the dlls but we force customers to install the entire .NET framework. It would be great to just deploy the dlls we need. 2) We often want to update our application and the framework but that sometimes requires a machine reboot because other applicatio...
I've been looking att different web stacks, mainly rails and node.js. One thing that strikes me is that while rails is often used with a relational database Node.js seem to go hand in hand with Mongodb, judging by the blogosphere. Is there a specific reason for this? I like the modularity of node but I'm also sceptical...
At our company we have pretty large body of PrototypeJS based JavaScript code, which we are porting to jQuery for several reasons (not really important here). I'm trying to set up coding guidelines to make/keep things tidy during the porting. One observation from wading through the prototype based implementation is tha...
Say I have a web service with a method MyWebServiceMethod(string passedValue). The web service calls a method MyServiceMethod(string passedValue) where the value from the web service is passed along. The service calls a repository method MyRepositoryMethod(string passedValue) where again, the value from the service is ...
Suppose I have component A,B,C that all put some data into a database. Each component depends on data in the database inserted by the previous component. How do I test these modules in isolation? I already have tests at the unit level, but I now want to test with the database. I have seen suggestions to make a dump of ...
For example, what happens if a coder tries to code in purely functional-style paradigm in OO-paradigm language(Java)? Will it work? Or the OO nature of Java will not let it happen? Also, is applying wrong paradigm to language unfitting to it a bad practice or not? Is it like trying to drive a jet on road instead of fly...
I currently work in a company where the Waterfall model is deeply ingrained. We are pushing Agile principles but it's a long process. Meanwhile, I have to work in a Waterfall world with sequential projects phases. My question is about the analysis phase. I must provide a list of task and how long they will take. What t...
I am pretty new to Web Application programming and so to OOP Javascript and the new Client-Server interactions. I am encountering some trouble wondering about how much AJAX I should use or how much data I have to save "locally" . Explainig it better: at the moment , to manage the data that I obtain from AJAX request ...
Quick background: In JavaScript, the constructor function for each object type has a prototype property. The prototype refers to an object that each constructed object uses as the next step up in its prototype chain. When you want one type to inherent from another type, you can set the prototype of the child type to a ...
I am developing an application, which currently has about 150,000 lines of code. The previous developer didn't really use any discipline when writing code. Application is in production but is continually developed. I have read Martin Fowler's book (Patterns of Enterprise Application Architecture) and it talks about 'T...
Many applications do nothing to separate the interface from domain logic. I’ve been programming for a couple decades and have worked at more than a dozen shops and none of them have taken any measure of separating the interface from the domain logic. That is, they're all using the Autonomous View pattern. This runs...
Why does 0 evaluate to false and any other integer value to true is most programming languages? String comparison First of all, it may seem evident to any programmer, but why wouldn't there be a programming language - there may actually be, but not any I used - where 0 evaluates to true and all the other integer values...
I tried to find if there's a similar question but didn't even know what keywords should I use :) I got a method in an interface accepting an other interface as a parameter: bool CanDoIt(AnInterface subject) One of the implementations needs to fulfill the requirement that the method should return false for all concrete...
For some time in personal projects I have been using XSL to convert my raw XML data into human-friendly HTML/CSS (in simple projects, I have no JavaScript, so let's leave that out of the equation for simplicity). Now I'm trying to understand the MVC architectural pattern (not my first experience with it, but it is taki...
I was creating a language and discovered that my language tokenizer would have to change depending where in the parse it is. I.e. abc[1] would be parsed as 4 tokens (abc, [, 1, ]), where as { abc[1] } would be parsed as 3 ({, abc[1], }). Is a grammar that would change its tokenizer mid parse defined somewhere? Does a g...
Context: I'm working on a fairly large Access database (which I inherited) that has its interface and tables separated. In order to make this work together, we have a lot of SQL queries (dozens). Some pointing to that database and some pointing to our datamarts. The code at this moment is somewhere around 12k-14k lines...
I've been trying to think outside of the box as to how desktop GUIs can be designed in code(not a graphical designer!). I've come across basically three ways this is done: XML Raw code (create a window, create a text box, add text box to window, etc) HTML and friends I'm sure that someone has done something other tha...
Occassinally I have to write methods like this: string GetReportOutputDirectoryAndMakeSureExist() { string path = Path.Combine ( ... ) //whatever logic if(!Directory.Exists(path)) Directory.Create(path); return path; } or string GetAndVerifyExistenceOfReportConfigurationPath() { string path = Path.Com...
Whenever the question comes up on which Agile tool to use use there always some people that answer "don't use an electronic tool because you will lose the big-visible-board advantage which better generate team conversation". Is this always the case or are there any contexts where an electronic tool is a better choice? ...
I have a class Base that has several children, say A, B, C. For testing purposes I'd like to mock those derived classes by deriving from them. So MockA derives from A, MockB derives from B and so on. The problem is, that MockA, MockB, ... all inherit protected members from Base that have to be set in the same way in ea...
I want to save some user-generated data with some signature of the user that generated it (let's say that the user has to fill some forms with some data and I want him to sign the written data). The server side is some random server language (that has big enough libraries to cover everything I'll need to do), the clien...
I've been facing a problem recently, in which I want to optimize two programs. For that, I wanted to create some kind of "Common Interface" which I could reuse between my two programs. However, the code of these are approximately 1000 lines, and I don't want to spend a big amount of time checking if this or that functi...
Google has given a reason that All apps on iOS have to run in the sandbox environment except for special apps by apple that get to tap into some private APIs. So Chrome on iOS uses whatever the UIWebView provides plus it might be doing its UI stuff and some external caching to add something extra to it. But Why does G...
The Apache License states: "You must give any other recipients of the Work or Derivative Works a copy of this License;" So if you've copied a bunch of functions from some Apache-licensed code (so it's not just linking, you've borrowed code) into a product that is not itself Apache-licensed, what's a good way to indicat...
I am currently working on creating a toolkit for work and I've gotten to the point where I'm wondering about error reporting. Basically all of my tools, which consist of a grouping of classes, will eventually be ran from a main method. Many of these tools will be doing operations on file like reading them in and con...
I have to create a github-presence for an open-source organization. The aim is to distribute code snippets and reference implementations in different programming languages. These contributions are going to be (ideally) created by people outside of the organization and should be collected. I know that good practice is t...
edit: so clearly I didn't explain this well, so let me try again with examples. I have a 'pipe' of a given size with signals routed through it at given offsets. The pipe can get fragmented with signals in different offsets making it impossible to fit a new signal. I want an algorithm that will tell me how to arrange...
I have created a windows form using visual studio design, that is simply drag n drop component into the form from Toolbox. Is it possible to import it into Blend and change its appearence using Blend? I opened the project from Blend but ony the code appears not the form itself. Thanks in advance!
So I saw this video on Youtube with all these C++ masters on GoingNative 2012 : Interactive panel where everybody could ask the questions. This is the video I was talking about: GoingNative 2012 - Day 1 - Interactive Panel: The importance of being native And at time 0:24:00 someone put a very interesting question: We'...
After reading for what seems days on the specifics of GPLv3 and more specifically AGPLv3, I have one question as far as distributing and to whom. If I create a web app (server and client) for a client. They pay me, I hand over all source and ownership. The web app is currently only accessible to employees and contracto...
This extends off this other Q&A thread, but is going into details that are out of scope from the original question. I am generating a parser that is to parse a context-sensitive grammar which can take in the following subset of symbols: ,, [, ], {, }, m/[a-zA-Z_][a-zA-Z_0-9]*/, m/[0-9]+/ The grammar can take in the fol...
I often find myself returning a boolean from a method, that's used in multiple locations, in order to contain all the logic around that method in a single place. All the (internal) calling method needs to know is whether the operation was successful, or not. I'm using Python but the question isn't necessarily specific ...
I've been catching up with the modern client-side JS ecosystem and reading up on CommonJS and AMD (incl. associated tools - browserify, requirejs, onejs, jam, dozens of others). If I'm writing a Javascript library, how do I modularize/package it such that it can be most broadly accessible (ideally by users who swear b...
We are a small team working on a web application using MVVM design pattern using technologies like .NET, Knockout and HTML. I am trying to come up with a code review checklist for this, so that my team can make use of it while coding as well as while reviewing. I tried to find in google, but no help there. Can you guys...
I am in a search of a better performant algorithm to implement a program, to find the count of each word in a sentence i.e.., a String in the programming sense. I know my algorithm is too basic and Noob. Here's my algorithm. Read the String. Tokenize the String with the delimiter, put each token in a list(ArrayList)...
I need help with coding something. I'm trying to design a system that will allow users to setup rules for the system to process (similar to email processing rules, in a way). When I receive a chunk of data (in this case, it is a object that has properties with values related to the client system's hostname, OS version,...
I'm building a REST API. I don't want to have real folders in my directory structure, but I'm not quite sure what to use else. My REST API uses paths like this: api.server.com/<object>/<action>[/] Here, <object> is the object the action <action> should be performed on. For example, a URL api.server.com/user/create wou...
The only way I could figure how to do it was create the schema on the localDB with code first and then manually change the database string to Azure and then run the code on Azure.. But that only gives me the schema and not the data.. Is there a better way like ? bacpac? Create a script instead? Or some other concept ...
I have a database sanitizing function that I use when the user enters some data into my website. I escaping the mysqli characters with mysqli_real_escape_string(), but I wish to also output the content with htmlspecialchars(). The problem is, let's just say the user enters something with a single quote; that will be ...
Many languages use the concept of an iterator. The c++ STL expands on this with input iterators, output iterators, forward, bidirectional, random access and others. As far as I know, these distinctions don't exist in other languages. In this talk the author of the STL, Alexander Stepanov, talks about iterators (among o...
I have recently started learning the nuances of scalable and enterprise computer architecture, and one of the central components is a messaging queue. In order to learn the most I can from any programming paradigm, I am trying to implement my own version of a messaging queue service. So far, my initial design runs on a...
When doing unit tests the "proper" way, i.e. stubbing every public call and return preset values or mocks, I feel like I'm not actually testing anything. I'm literally looking at my code and creating examples based on the flow of logic through my public methods. And every time the implementation changes, I have to go a...
I work for a small software development house (10~ developers, a few product managers and a few support staff) that sells various products and services to organisations internationally through resellers. I arrived in the job 7 months ago into a role opened up by a developer who left after 3 years. The company has maybe...
So you've made some code changes that should hopefully speed up some part of an application. But there is just one problem - you don't know how it will perform in live. Different networks, different machines, different memory, different configuration, different times of day, different users, different server loads etc ...
How would you define Continuous Integration and what specific components does a CI server contain? I want to explain to someone in the marketing department what Continuous Integration is. They understand Source control - i.e. they use Subversion. But I'd like to explain to them properly what CI is. The Wikipedia Articl...
I was evaluating the various ways in which the big guys implement auto suggest. These are my observations.(Search string used was "ab") Questions towards the end. Yahoo tries something like this, where the response was a JSONP. Response is readable and serves the purpose. Yahoo's response yasearch({"q":"ab ","gprid":"Y...
I'm planning to build a eCommerce web application(similar to http://zovi.com/) using JSF 1.2 and node.js. All front end components will be jsf components binding to backing bean. I want to achieve real time functionality ( such as displaying Today's hot sellers ,Customers who viewed this item also viewed such patterns)...
I was applying markdown comments in the xml comments of a config file when the XmlParser reported that two hyphens (--) are not allowed in xml comments. Checking the XML Specification, it appears that xml comment isn't designed to contain two hyphens for compatibility reasons with SGML parsers. Why do SGML parsers disa...
I've seen some projects that - with each new year - start to change all files in their source-tree to update the copyright year. Isn't this just pushing hot air on a level of magnitude? AFAIK: Copyright year is based on relevant changes of a work (also) - not only because of a trivial change of the copyright year in a...