instruction stringlengths 34 19.9k |
|---|
We currently have a monolithic Rails application that is really three separate applications that make use of the same data. In trying to figure out how to properly compartmentalize and break the mono-app into smaller pieces, it seems apparent that we need to have a central data service that the various pieces can commu... |
I'm a php developer working on a startup, and my friend,
my partner(a developer also), who is building the startup with me,
is an asp.net/C# developer.
How do we work together collaboratively, as we program in two distinct languages? I know you can use Mono http://mono-project.com to design android applications, (which... |
I am trying to write a simple program that should allow a user to save and display sets of heterogeneous, but somehow related data. For clarity sake, I will use a representative example of vehicles. The program flow is like this:
The program creates a Garage object, which is basically a class that can contain a list o... |
I'm new to object-oriented programming, and I keep running into this issue. (I'm programming in Java) I've been a bit reluctant to ask about this, since it seems like such a basic issue, but I can't find any information on it, or questions about it here, and none of the textbooks I have read (on a quite basic level of ... |
Recently had a doubt about how and where to test repository methods.
Let the following situation: I have an interface IRepository like this:
public interface IRepository<T>
where T: class, IEntity
{
IQueryable<T> Query(Expression<Func<T, bool>> expression);
// ... Omitted
}
And a generic implementation of ... |
I've seen two styles of using sizeof for memory-related operations (such as in memset or malloc):
sizeof(type), and
sizeof variable or sizeof(variable)
Which one would you prefer, or would you use a mix of the two styles, and when would you use each style? What are the pros and cons of each style and when you use the... |
I understand PKI reasonably well from a conceptual point of view - i.e. private keys/public keys - the math behind them, use of hash & encryption to sign a certificate, Digital Signing of Transactions or Documents etc. I have also worked on projects where openssl C libraries were used with certs for securing communicat... |
For example, let's say I want to build a game, and I have a limited knowledge of programming(some but definitely not enough). Should my first move be to design the game and then learn how to implement each separate part? Or should you learn a language really well before you design a game?
|
I have a bit of a challenge and I am not sure how to approach this.
We have a very very large project (that is about 5 years old).
The code base is HUGE so a full refactor is out of the question.
What we will be doing is refactoring bits of code as we use those parts (this is backend code, which we will be using on a f... |
I understand PKI reasonably well from a conceptual point of view - i.e. private keys/public keys - the math behind them, use of hash & encryption to sign a certificate, Digital Signing of Transactions or Documents etc. I have also worked on projects where openssl C libraries were used with certs for securing communicat... |
We are in a process of redesigning our product code in such a way so as to support multitenancy.
Currently the implementation is such that one product deployment caters to only one customer.
Thus the application data corresponds to only one customer. This data (which is global wrt the application) is in the form of ... |
I currently have a SQLite DB on my server that is needed by an android app I am currently developing. I download the DB to the android device using HTTP each time the contents are changed.
Does anyone have any suggestions as to how to do this more efficient. ie. when the database gets large I don't want the android us... |
The golden rule of code structuring is always said as splitting into many sub functions is a good thing. Though I noticed it becomes a problem in complex applications when a class of e.g. 10 bigger functions is split into a class with 50 functions. When development went so far, it becomes quite hard to understand the c... |
I'm not so familiar with C++. Can someone please inform me what this lines does (in detail):
auto add_element = [&rows,&cols,&values](size_t row, size_t col, double value)
{
rows.push_back(int(row));
cols.push_back(int(col));
values.push_back(value);
};
Rows, cols, values are obvious vectors.
Is this the s... |
As a side project I wrote a simple macro in SAS to add syntatic sugar to SAS code. I hate how verbose SAS is sometimes!
So my macro looks like this
%macro md(code);
/* expects a superquoted string */
* append a b;
%if %lowcase(%scan(&code.,1)) = append %then %do;
proc append base = %scan(&code.,2) dat... |
I have just been reading through some of the white papers & examples from Microsoft "Roslyn" and the concept seems very interesting. From what I can tell, it opens up the black box that is the compiler and provides an interface that we can use to get information and metrics about code written in Visual Studio.
Roslyn ... |
A customer of my employer has recently requested new features for some legacy code, and since the authors of the program are no longer here, I've been assigned to implement the new features.
I've been provided with some high-level documents that are mostly from early stages of the project: the project definition, black... |
This last semester i've had lectures about OOP design, i understood most of what i was supposed to
but there is something that i can't get right.
I'm pretty sure that the models i create are wrong because they cannot be implemented.
I wrote quite a lot because i can't tell where the problem is.
This isn't homework , it... |
Is it ethical to make a copy of my work's source code, for the sole purpose of my own reference? By reference, I mean as reference where I can refer to it about how I (and my teammates) implemented various design patterns, architecture, etc. It does not contain any trade secret, product, secret algorithm or anything li... |
For advocacy purposes, I'm looking for a good example of some popular/widely-known closed-source and generally paid-for software application/package which uses dynamically linked LGPL-licensed libraries, and isn't shy of saying so in its installer dialogs or preferably in its "About" info and/or online documentation on... |
I just ran into an odd scenario. I’m sure that I must have run into the same situation in the past and yet somehow not noticed it until now.
I am writing a program that requires at least two command-line arguments. Dealing with this is simple enough, just check that there are sufficient arguments. For example:
A: if (... |
Let's say I have a boolean condition a AND b OR c AND d and I'm using a language where AND has a higher order of operation precedence than OR. I could write this line of code:
If (a AND b) OR (c AND d) Then ...
But really, that's equivalent to:
If a AND b OR c AND d Then ...
Are there compelling arguments in favor or... |
I am making a voxel game like Minecraft. I am able to load chunks using multithreading with the code...
for (int x = 0; x < WorldSettings.WORLD_WIDTH_IN_CHUNKS; x++)
{
for (int y = 0; y < WorldSettings.WORLD_LENGTH_IN_CHUNKS; y++)
{
chunks[x, y].BulidVertexData();
Thread.Sleep(50);
}
}
this... |
We are starting a total new Branch at our firm. I am usually developing database interfaces or internal server/client applications/tools for our company, but I never had to do something with hardware.
Szenario
My Boss want to sell a device, which has a touch-screen to set up the many, many features. However, the config... |
I have been given the task of redeveloping an "in house" solution to make it expandable and easier to maintain and administer.
The original solution had been hashed together over time using PHP as more requirements were added, and the need to expand is expected into the foreseeable future.
The solution, gathers many di... |
I've noticed an increase in mobile applications being released that offer high value features, but without any corresponding web based version.
Was just reading about a new medical app for iPhone that allows doctors to share medical images, and had this idea been done 5 years ago it surely would have been a web applica... |
I was thinking about this earlier today and figured I would get some input on the matter. When I develop applications I would usually have the Data Access Layer on another project, incase it could be re-used elsewhere in a similar manner in the future but also to allow updating the DAL without updating the UI layer.
Wh... |
I want to know how to manage a big project with many components with version control management system.
In my current project there are 4 major parts.
Web
Server
Admin console
Platform.
The web and server part uses 2 libraries that I wrote. In total there are 5 git repositories and 1 mercurial repository. The pro... |
I'm currently designing an automated testing framework for doing embedded systems testing on an embedded Linux system. There exists an old system, but it is particularly hard to use, mainly because it wasn't designed as a framework and was originally designed to test one product only. What this means is that the framew... |
I program in C and I believe I know the language well. I understand all the concepts and my problems never come from misuse of the language.
I have problems because I always forget or oversee things. Setting a variable to zero, or generating a particular test case. I keep finding bugs in my code due to conditions I cou... |
I've been reading articles such as this one that indicates web development has evolved to use JS frameworks. Where I work, we have a massive website with many existing web applications that are already established and are server side heavy.
One article I read said that the DOM manipulation/jQuery method leads to unmai... |
I am making a multiplayer game. Now I am trying to choose the technology to connect the android devices to the server. The clients run on Android, and the game is MMORPG. I would like to write the server in java. Right now I have only 3 ideas for it:
1) creating multithreading environment with plain java and sockets. I... |
I'm new to git (and github). I work in Java and Python. Right now, I manage my projects in only one directory - let's call it Code and the folder is on my Desktop.
I want to group my projects by the language I code in. So, I want:
/Code/
++ /Java/
++ /Python/
I do not know if Git would be happy with this or not. If it... |
About this function: org.apache.commons.lang3.BooleanUtils.isFalse(Boolean bool) and the similar isTrue, my co-work (less experienced) use it for every boolean in the code. I am trying to convince him that it is not a good practice because make the code confusing. In my POV, it should be used ONLY if the boolean to be ... |
So, I've been developing some analytic software at my work and also have started to take more notice to analytics in general. For instance, I recently installed Google Analytics on my blog(which is custom and open source).
I mostly make open source software outside of work, so I think it might be cool to be capable of... |
Is there a language with something like the following construct?
var_type(TYPE_1, TYPE_2,..., TYPE_N) obj;
and now its possible to:
TYPE_17 staticTypeVariable17;
obj = staticTypeVariable17;
TYPE_3 staticTypeVariable3;
obj = staticTypeVariable3;
without obj being a pointer of some base class and with no need for cast... |
I'd just like to hear about any experience creating a (simple) site for redirecting requests.
Basically we have multiple domains, but as we add more domains and change URLs, there is a huge problem of maintaining old links.
When discussing this we are considering using one constant site to determine where the present ... |
Reading this SO question it seems that throwing exceptions for validating user input is frowned upon.
But who should validate this data? In my applications, all validations are done in the business layer, because only the class itself really knows which values are valid for each one of its properties. If I were to copy... |
I am fairly new to Java and my experience is limited to Web Based Applications running on a Web Container (Jboss in my case).
Am I correct in saying that for Web Applications the web container takes care of multi-threading? If so, can I introduce new treads in a Web Based applications? Is there any advantage in doing ... |
When checking for parameter consistency a the top of a function body, what is the best strategy?
This one:
protected void function(Object parameter)
if (parameter == null)
return;
//... do things
}
...or this one:
protected void function(Object parameter)
if (parameter != null) {
//.... |
I'm reading through a PDF on C++ programming from this page on Stanford's site. It says that when you're creating a C++ header file for a library interface, use a #ifndef preprocessor command to make sure you don't compile the same interface twice.
So, your header would look something like this:
/**
MyFile.h
*/
#if... |
In computing what is meant by binary compatibility?
I read about it in context of serialization/deserialization that this process of serialize/deserialize should be binary compatible. What does it mean in this context? In particular I am interested in understanding the role of binary compatibility in a language like J... |
I got involved into a project where we are taking over a bunch of legacy code. Code is basically shell scripts and PL/SQL packages/procedures/functions. There is no documentation how the code works and there is also no comments on the shell scripts. I was thinking that first thing to do is to get an understanding of th... |
What should a programming language have so that it can be said to promote good reusability? Only generics and functions come to my mind when I hear the word reusability. What else make a programming language good for writing easily reusable code?
|
Is it completely unheard of to have a .c file dedicated to just data? In my case, I'd be using it for global variables that are shared across two other .c files. Here's specifically how I'm using it.
// serverth.h
struct serverth_parameters {
struct { // right now, this is the only struct needed
char * roo... |
re-edited by author: no this is not 2 questions. This is one question about code review questions containing two separate points. Please do not edit my question.
For naming variables, the two sides are regarding using articles (a, an, the) in the variable name (e.g. theBook vs. book -or- parseTheString vs. parseString... |
This has happend to me more than once, thought someone can give some insight.
I have worked on multiple projects where my project depends on external service. When I have to run the application locally, i would need that service to be up. But sometimes I would be coding to the next version of their service which may no... |
So there is a website that I want to build. It will be a review aggregator and probably a bit more. I want to build this website for three reasons:
I really think this website will be used by a reasonable amount of people
I want to practice my programming skills since currently at my job I am doing mostly scripting ... |
May be this is a stupid question, but I'm kind of intrigued.
Being JavaScript a prototype based language, with its pseudo-class function constructors sort of half baked (remember JavaScript: The Good Parts ...) I wonder how is it possible that it didn't have, right from the start, some easy way to access the prototype ... |
People often give me the "divide and conquer" tip, but I think for some problems it's not nearly enough. The problem with such a complex problem as the Hanoi Tower problem is that you can't even simulate or abstract parts of the problems even if you divide it into parts if you know what I mean. So, can anyone give me a... |
Throughout my life I've accumulated a fair share of scripts that have proven to be useful to me in many cases and might be useful to many others. I look at things like todo.txt (which probably started off as just someone's personal text file manager) and even simpler ones online and sometimes I feel like I want to put... |
It appears in not just one language that comments can't be nested. Do you have a good solution for this problem? One workaround in C/C++ and Java is to only use the single-line comment but it becomes impossible then to comment out a larger block. I'm facing something like this:
</li><!--
<li><!-- Save -... |
When creating websites, is it better to have a lot of images in one folder, or have them separated?
It's something that has always been in my mind but I never researched enough about it, and googling didn't give me many answers.
So I have been building mostly sites for real estate agencies since I started, and I always... |
How do I convince project managers, product owners, business analysts, clients and various other stakeholders that refactoring is a worthwhile and productive part of the development process?
As developers we all know that requirements change or are never fully explained from the start, and therefore how we wrote a piec... |
As far as I understand, the adapter pattern is creating a wrapper object for our real object of interest, simply one more level of indirection, which provides flexibility. The flexibility is in that if the real object's interface is changed, then we change the wrapper interface pointing at the real object, leaving the ... |
In a method, i have calls of single method of another object that returns field value, like foo.value(), which is defined like Field value() {return this.value;} Is it better to make a local variable, like Field value = foo.value() and use it. Or use many method calls of a single method? Why? How does it correlate with... |
I am constructing a ray tracing algorithm , i know that the first step is to develop camera and view plane specifications.
Now is the next step performing rasterization algorithm on image before a BVH tree is constructed so that intersection tests can be performed?
Kindly Guide
|
I had a discussion with my colleague about the following problem.
We have an application where we need filtering functionality. On any main screen within the upper navigation bar, there is a button in the upper right corner. Once you touch that button, an custom written Alert View like view will pop up modally, behind ... |
We java developers always know that you should always override equals() when you override hashCode(), but I consistently have trouble remembering this rule.
What is a clever mnemonic to help Java developers remember this?
|
Background
I have read people rebutting the fact that a certain software is free as in free speech, even when it is licensed under GPL.
Some say Java isn't free because to obtain a professional certification you must get it from Oracle.
Some say Java JDK is not free to re-distribute.
Some people even say the openJDK is... |
Please, tell me the things I must use for modeling an (Enterprise Architect) activity diagram of
object1.method1() calls object2.method2()
I'm able to dragndrop a method of a class from model tree-view to my diagram, and it appears as new action there. But there is no hint about its belonging object. Also I don't get ... |
I have this GPL project, it got stuck for like a year, I really like the idea, then somebody fork it and changed the whole thing but used the same name, I don't mind for the code (it was GPL after all) but I like the name. What's the etiquette for this kind of situation?
The project will benefit myself, and I like it,... |
I'm a server-side junkie, and by that I mean I spend time writing code that's not visible to anyone.
I'm interested in rounding out my skillset and becoming more self-sufficient with writing full-stack webapps.
But, I find it difficult to work with the the sort of 'organicity' of client-side html tech.
I know there is ... |
I am designing a small application that is really justa gui for a command line using vb.net.
Question 1.
Should messages(msgbox) to the user come from the UI or should messages come from subs and functions that the UI calls.
Question 2.
Should subs and functions throw new exceptions to the UI or should they be containd... |
Is a programmer required to learn and memorize all syntax, or is it ok to keep handy some documentation?
Would it affect the way that managers look at coders?
What are the downside of depending on intellisense and auto-complete technologies and pdf documentation?
|
Background
I am dynamically building an FQL query statement and because of the nature of the app, I exclude FB family members, this is the base portion of the query and remains fairly static. The query returns the FB profile pic and I display it on the UI.
However, after the FB friends are displayed on the UI, I want ... |
I'm currently working for a company on the engineering team of about 5-6 people and have been given the job of heading up the redesign of an embedded system tester. We've decided the general requirements and attributes that would be desirable in the system, and now I have to decide on a language to use for the system, ... |
The pipe & filter architectural pattern is defined as a chain of processing elements, arranged so that the output of each element is the input of the next. Every example seems to consider inter-process or inter-thread connection performed through some kind of shared buffer.
To me, it seems that Haskell function composi... |
When should or shouldn't a variable be declared as a custom Interface type?
When walking through some code, I required to know what was happening here:
Public Class MyMainProject
....
Public Sub DoMyWork()
Dim objIMyInterface As IMyInterface
....
objIMyInterface = GetReturnObject()
E... |
I need to create a string using the following algorithm:
Generate a GUID as a byte array.
Convert that GUID to a string.
From this string, get the UTF-8 encoding as a byte array.
From this byte array, hash those bytes to another byte array.
From this byte array, get the base64 encoding as a string.
Append a string con... |
I want to develop a mobile application. I recently read an article on Telerik Forum, which compares among three types of mobile application and I don't know which one should I select to begin with. Here is an image describing the pros and cons of different mobile design choices
To decide between these design choices, ... |
Everyone knows that the "current" way to do things is to have user-readable URLs. Like:
http://example.com/blog/edit/1234
Rather than:
http://example.com/blog.php?action=edit&id=1234
When exactly did people start making web technologies handling this though? I remember in the dark ages of the early 2000s, I don't remem... |
I'm building a perl application which does the following operations:
Copy a bunch of files (class fileFetcher )
Parse each file (class fileParser)
Store some data from each file in a database (class dbHelper)
Now, should I, in my main.pl (entry point of the script), construct an instance of each of these and call the... |
Normally I do this:
if (Animal is Dog)
{
Doc d = (Dog)Animal;
// d. etc..
}
else if (Animal is Cat)
{
Cat c = (Cat)Animal;
// c. ....
}
Is this a good way or are there better ways to implement this code above (performance, ...) ?
Should it be like this?:
Dog d = Animal as Dog;
if (d != null;)
{
... |
The tutorials I've read tell you to use [ValidateAntiForgeryToken] attributes and <%= Html.AntiForgeryToken() %> in your code.
I was wondering why this isn't a built-in automatic setting or at least a global toggle in the web.config. Perhaps it is, and I haven't realised, but I am doing it by hand and I can't help but ... |
I am coding a system where I have objects which represent a set of resources. These resources are identifiable (they have an ID). There can only be one resource with the same ID, and so multiple objects with the same ID really should have the same values.
My problem is with the equality concept in this case. Should it ... |
I am developing a software for a laboratory to test some devices. To test each device there are multi subtests which should be done to reach to the final result.To perform a complete test, the software must pass Stage1 then automatically goes to Stage2 then Stage3 and so on until the whole test is finished. meanwhile t... |
Simon Peyton Jones himself recognizes that reasoning about performance in Haskell is hard due to the non strict semantics.
I have yet to write a significant project in haskell so I wonder: can I reason about performance only at the beginning of a project (when choosing basic data structures & IO library) and whenever a... |
currently I'm designing an add-in for the modelling tool Enterprise Architect. The general architecture is shown in the picture below.
Basically every action where the add-in can react to is triggered by PreDefinedEvents for which the add-in can provide callback functions. These callback functions are the starting poi... |
I took a test recently and found that I could touch type comfortably at around 100 wpm... and if given some sort of autocorrect/intellisense then that would be even faster (who knows maybe 150 wpm?)...
I definitely do not program anywhere near that speed... This led me to wonder how exactly does one become faster at pr... |
A previous developer has a couple public classes that do not inherit from any other classes but are filled with static properties. Is this another way of creating a struct or enum? Is this an older or newer technique of housing static data to be referenced? I find it odd/different to see a class built in this way but a... |
I'm presenting a software design for approval today and as I'm going through the hundreds of pages of design documentation, cherry picking what's important, I'm unsure if I should start with the activity diagrams or use cases. I was thinking of having it stacked like so:
Activities Diagrams
Use Cases Diagrams
Sequenc... |
I have never published an app to app store.
I have a chance to buy an apple mac from someone.
Is it possible to use that to publish to app store? What if the first owner was also a developer?
If I buy Mac with the only intention of publishing an app should I only go for a new one to get developer license or I can do... |
This is my first contract negotiation. So I've written a program which supports some hardware that the company makes. (The support is important, and most customers will buy it, but the software product is ultimately optional.) It will sell for about $2K/license and they sell 70-80 hardware systems/year. The market ... |
For, say, a subtle background gradient to a web page, what are the advantages and disadvantages of saving it as a 16bit/channel png?
Are the colours represented by >8bits displayed in the intended detail in all browsers?
|
From the texts I have read so far, the conventions talk about organizing constructors, starting with the default, if any. I am wondering, should all classes have a default constructor anyway. This will at least help to create a simple instance of the class on the fly, without having to use a parameterized constructor, ... |
Java Swing GUI's don't look native by default (Except on Mac OS X for some reason). Swing uses it's own look and feel. You can get Swing to use the system look and feel by putting:
javax.swing.UIManager.setLookAndFeel(javax.swing.UIManager.getSystemLookAndFeelClassName());
in the beginning of your main method, but: Wh... |
I have a Java program that takes about an hour to run. While it is running, if I change the source code and recompile it, will this affect the above run?
|
I am busy writing a Python application using ZeroMQ and implementing a variation of the Majordomo pattern as described in the ZGuide.
I have a broker as an intermediary between a set of workers and clients. I want to do some extensive logging for every request that comes in, but I do not want the broker to waste time d... |
I want to have sign up/login functionality on my site with a "Login with Facebook" and "Login with Twitter" button.
Considering the following scenario:
User A logs in with Twitter.
Account gets created.
User A logs out.
User A comes back next week and can't remember what they signed up with (or just feels like) using... |
I was wondering how secure public private key encryption methods are.
If two individuals were sending emails back and forth forever, where each person would encrypt the body of the email they were sending with the other person's public key, would anyone be able to decrypt the body of those emails after a while?
I'm as... |
Is there any consensus between languages how tests for emptiness are distinct from tests for noneness? In python the following expression is false:
{} is {}
However this expression evaluates to True
False is False
Why is the first expression not evaluated to True?
|
I am engaging in redesigning a linux c++ server application. The application acts as file relayer in the form of receiving file packets (incuding control packets and data packets) from client A, writing these packets into a local data file then create and update index file, finally start many threads to read the file d... |
I was wondering whether all programs run in a Loop, checking for variable changes then acting upon said changes followed by another Loop. Or do they run in a While statement, waiting for a variable to change before they execute a routine? Or am I just completely wrong?
|
We are working on project where we have to manage these conditions.
i.e.:
A User can save an order under these conditions:
User has permission "SaveOrder"
Order is in state "shipped"
Online Shop is opened.
This condition is for example - I would like to point out, that we have three conditions from different areas(ro... |
I am developing an application and i want to use two words somewhere in my application.
First i want to use the word "Safari" in a menu option which labels "Open in Safari"(for a url).
The second is the word "Apple" in my Terms pages where i want to use it in the phrase "....as provided by Apple",referring to technolog... |
I'm making a windows forms application which I want to install on a few computers that are all connected together on a network. Each of these computers have access to a number of servers on which various tasks are carried out etc.
I want each instance of the application in use to be able to store and retrieve data rega... |
"Extreme" suggests that it has very different from normal, very aggressive, exceeding limits, but in my opinion regular releases, pair programming, unit testing, collaboration with customers are quite normal and acceptable. What does extreme mean?
|
I am a young programmer (finished computer science university but still under a year of working in the industry) and I recently got a job working on some C code for a decent size web service. Looking at the code the only places I saw comments were when people were stashing their old code. Function and variable names ar... |
We have a stream of points with about 1000 points per second. For each point, we have a complex vector (hundreds of dimensions). Our goal, for each point is to link it to the 5 closest points that we've already seen.
We determine "closest" by computing a distance (euclidian or other) between 2 points. Obviously, in a p... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.