_id
stringlengths
1
6
title
stringlengths
15
150
text
stringlengths
30
21.8k
104339
Identify Service Oriented Architecture
How can I tell if a system is built upon a service oriented architecture when reading its source code?
220742
Using Full GPL Libraries in Software as a Service (SaaS) Models
I already searched the site, but I could only find answers relating to using GPL libraries in software that people were going to sell/distribute. In this case the answer is that they must also make the source code available. What about SaaS? That is, I'll be building an app that clients will pay a monthly fee to use over the Internet, and they won't download anything or get access to the code. Questions: 1. In this case am I allowed to use full GPL libraries without having to make my source code available? 2. Is there some other restriction/requirement of the GPL that I should be aware even if my model is SaaS?
195982
Moving forward in the programming world
I have been placed in a recent position where my job title does not adequately represent what my current duties entail. I am worried that this classification will affect me later in my career as the job title does not specify 'programmer'. How important is the job title while maintaining a career when compared to the experience and knowledge I am receiving while working? Should this be something to fret over or will a simple explanation be sufficient when transitioning to another workplace in the future?
220746
Can someone explain the concept behind Haskell's memoization?
(note I'm putting the question here because it's about the conceptual mechanics of it, rather than a coding problem) I was working on a small program, that was using a sequence of fibonacci numbers in its equasion, but I noticed that if I got over a certain number it got painfully slow, googling around a bit I stumbled upon a technique in Haskell known as `Memoization`, they showed code working like this: -- Traditional implementation of fibonacci, hangs after about 30 slow_fib :: Int -> Integer slow_fib 0 = 0 slow_fib 1 = 1 slow_fib n = slow_fib (n-2) + slow_fib (n-1) -- Memorized variant is near instant even after 10000 memoized_fib :: Int -> Integer memoized_fib = (map fib [0 ..] !!) where fib 0 = 0 fib 1 = 1 fib n = memoized_fib (n-2) + memoized_fib (n-1) So my question to you guys is, how or rather why does this work? Is it because it somehow manages to run through most of the list before the calculation catches up? But if haskell is lazy, there isn't really any calculation that needs to catch up... So how does it work?
148171
What is a good rule of thumb to do technical writing that doesn't confuse people
Sometimes I'm such a nerd that not even nerds understand me, or rather, sometimes I cannot put stuff in understandable and simple-enough terms... and sometimes I can but cannot really tell until after. I like the details on technical stuff, I enjoy writing about them, but sometimes I cannot stop or tell when it is too technical or too abstract to understand. I often end up putting too much detail into stuff thinking that it will help the understanding of some concept, but it sometimes it backfires. These are all edge cases, I'm not that bad at writing (I hope), but, what would be a good rule of thumb to know when you are probably going to make people dizzy when reading your stuff?, how do you test your analogies?, I'm looking for one or more rules of thumb to know if I'm writing technical explanations right, knowing what to reference and what not, etc. **What is your golden rule for writing about technical stuff to technical people who are not necessarily familiar with what you are writing but are also not noobies in your area?, where is the line?**
104332
best practice when unit testing for embedded development
I am looking for some best practice strategies for unit testing code written for embedded system. By embedded system, I mean code such as device drivers, ISR handlers etc., stuff that are pretty close to the metal. Most of the unit tests are not possible without testing it on the hardware with the aid of a ICE. Sometimes, the embedded unit also needs to be hooked up to other stimulus such as a mechanical switches, stepper motors and light bulbs. This usually occurs in a manual fashion, automation would be great but hard and expensive to achieve. **Update** I came across a C testing framework that seems to be quite successful in testing embedded projects. It uses the ideas of mocking hardware. Check out Unity, CMock, and possibly Ceedling.
93072
Is it more efficient to query once for all settings, or query whenever a setting is needed?
For my blog script I have a usergroup and permission system set up. Each user is assigned to a usergroup and I have a long list of permission settings. Both are stored in a MySQL database. At the moment I perform around 10 permission queries for each page, for various content management functions. Coupled with another 20 or so queries for general blog use, the number of queries is building up. Would it be more efficient to instead perform one query at the start of the script to retrieve all permission settings into an array, and then have all functions compare values in the array instead of checking the database?
148172
Test-driven development: To create test when issue is filed or when issue is picked up by somebody?
I've recently been working on a web development project on a team of less- than-five people. Things are going good but now we are decided to go with test-driven development. So far what I've learned is that one of the ultimate goal is that when you are testing your software, everything should be passed. However our current situation is that we have more open issues/stories than what we can handle within an iteration or two and we're a bit confused on how to actually handling test-driven development in this situation. One thing we can do is that when each of us pick a story, that person will write the test for it. Each of us will working within red-green-refactor cycle. Or another thing we can do is that we try to create test cases for all open issues. Then each of us can pick that up and working on eliminating the red for that issue. The first approach looks nice to me that we can ensure what we've done is green across the board. However the latter approach is what I've been thinking it looks more realistic as it reflects the imperfect status of your software. I am not really sure how it is managed in real world or what should be the best practice for this. Inputs from all are welcome.
93075
Should deployment errors constitute a build failure?
Our software uses in-house written deployment software due to the complexity of the product. As part of our current QA (not dev) build process (using more in-house software) we compile the code, patch the databases, deploy the software and run a smoke test and, in some cases, automated UI tests, before the build is "passed". We are moving to TFS2010 and getting rid of the in- house build process and I would rather not have to add this process into TFS builds. What processes do you use to ensure that the deployment is successful and reporting errors back to the development team? Should a build be classed as a failure in the event of deployment errors / smoke screen or automated UI test failures? TFS ends it's build process when the files are placed in the drop folder it then marks that build as OK. If I am to use the same solution as we have now, either TFS build has to be extended to perform all these tasks before marking the build as a success or we have to have a mechanism to mark the build as failed after it has previously succeeded.
115036
What kind of metrics should I collect for a website/web app
I have a website that allows users to register for accounts, login, and renew an annual membership fee. They can also update their personal profile, their personal profile, look at a list of their employees, make bulk payments for their employees, view receipts and invoices, etc. For non-members it's a regular website with a lot of pages, but for members, it has quite a few member only areas, with more to come (Such as forums). It also has a job listings page, course registrations, etc. **What are some useful "metrics" I can collect to give me meaningful information about the site, that I can share with my clients.** I really don't know a lot about collecting data about this kind of thing, and would like to learn. I already have a dashboard where the admins can view/export registrations this week and registrations by week for the past 30 weeks. I've been able to show them that registrations spiked after sending out an email about the new system. I'm think I'll also be adding stats about how often users update their profiles and how many users have updated their profile that day/week. Thanks
149880
Who was the first software engineer?
It's fairly well known who the first programmer was but who was or were the first software engineer(s)? By software engineer I mean someone who uses formalized specifications and methods to deliver software not just a batch programming job. When was the term first used?
127100
Package name best practice when porting a library
What is the suggested way (specifically in the open-source world) for the package name when porting a library. Say I am porting someone else's library where they have used a reverse domain name stucture for there package name, so there library package name was some thing like `com.therename.thelib`. What should I do if I decide to port it to a new language? Should I keep the domain name intact, even though they didn't have a hand in it? Or should I change it to something like `com.myname.thelib`?
127106
Should I use the language I'm most comfortable in, or the company "standard"
I'm going to be developing an Intranet site for my specific plant, and our company standard for web-development is IIS \+ ASP.Net \+ VB.Net \+ Microsoft SQL Server (note that we have about 10+ plants). The Intranet site will only be used by my plant, and I'm the only one who will support it. I'm much more proficient with a LAMP setup, and I could do development and problem solving much more rapidly with PHP than I could ASP.Net. Even though the company "standard" is ASP.Net/VB.Net, most of what the company does as a whole is to purchase third party software (which is usually Java based), and very, and I do mean very few people in the company even know VB6, let alone ASP.Net/VB.Net. That being said, **is it better to violate the company standard and go with the setup that I can support better, or is it better to go with the setup that the company can support better if I ever were to leave, even though no one currently in the company can support their own standard anyway?** Some additional factors to consider in my personal case: * Again, this is only for my plant, and I'm the only one who will ever be supporting it unless I leave the company, and then my replacement would be supporting it. Not someone else already in the company. * The company does very little development with their standard anyway. * Hardly any of the companies existing software uses their standard. * If I choose the company standard, then I have to use the Express version of Microsoft SQL and a Windows 7 OS. From my readings, the Express version is okay for business use, but the database size is limited.
149885
Can coding style cause or influence memory fragmentation?
As the title states, I'd like to know if coding style can cause or influence memory fragmentation in a native application, specifically one written using C++. If it does, I'd like to know how. An example of what I mean by coding style is using `std::string` to represent strings (even static strings) and perform operations on them instead of using the C Library (such as `strcmp`, `strlen`, and so on) which can work both on dynamic strings and static strings (the latter point is beneficial since it does not require an additional allocation to access string functions, which is not the case with `std::string`). A "forward-looking" attitude I have with C++ is to not use the CRT, since to do so would, in a way, be a step backwards. However, such a style results in more dynamic allocations, and especially for a long living application like a server, this causes some speculation that memory fragmentation might become a problem.
253440
12 factor app config and Java
I was reading the 12 factor app manifesto. The manifesto recommends storing the configuration data for the application in environment variables. Does this mean that properties like the DB username / password, resource URL should be stored as a part of Java Env variables rather than as property files? Is this a secure way of storing the information? To me this seems to be a pretty clunky way of storing the information. One option that I can think of is to have a separate configuration service running in the landscape, and use env property to connect to the config service and then query the config service for further detailed configuration data.
253441
How to approach a bad request from a client?
Say you coded up some new feature. Now the client comes to you and asks for a change that would make that new feature less user-friendly and just plain wrong. Should you just accept the change request or can you influence the client that their request is misguided?
149888
What was the historical impact of Ariane 5's Flight 501?
The disintegration of the Ariane 5 rocket 37 seconds after launch on her maiden voyage (Flight 501) is commonly referred to as one of the most expensive software bugs in history1: > It took the European Space Agency 10 years and $7 billion to produce Ariane > 5, a giant rocket capable of hurling a pair of three-ton satellites into > orbit with each launch and intended to give Europe overwhelming supremacy in > the commercial space business. > > All it took to explode that rocket less than a minute into its maiden voyage > last June, scattering fiery rubble across the mangrove swamps of French > Guiana, was a small computer program trying to stuff a 64-bit number into a > 16-bit space. > > One bug, one crash. Of all the careless lines of code recorded in the annals > of computer science, this one may stand as the most devastatingly efficient. > From interviews with rocketry experts and an analysis prepared for the space > agency, a clear path from an arithmetic error to total destruction emerges. What major changes did Flight's 501 failure and the subsequent investigations inspire to the research of safety critical systems and software testing? I'm not looking for an explanation of the bug itself, but for an explanation of the historical impact of the bug, in terms of research that were inspired from or were directly related to the investigation(s) of the failure. For example this paper concludes: > We have used static analysis to: > > * check the initialization of variables, > * provide the exhaustive list of potential data access conflicts for > shared variables, > * exhaustively list the potential run time errors from the Ada semantics. > > > **To our knowledge this is the first time boolean-based and non boolean- > based static analysis techniques are used to validate industrial programs.** Similarly, this paper(pdf) notes: > Abstract interpretation based static program analyses have been used for the > static analysis of the embedded ADA software of the Ariane 5 launcher and > the ARD. The static program analyser aims at the automatic detection of the > definiteness , potentiality, impossibility or inaccessibility of run-time > errors such as scalar and floating-point overflows, array index errors, > divisions by zero and related arithmetic exceptions, uninitialized > variables, data races on shared data structures, etc. The analyzer was able > to automatically discover the Ariane 501 flight error. **The static analysis > of embedded safety critical software (such as avionic software) is very > promising**. I would love a thorough explanation of the impact this single event had on software testing approaches and tools. 1 The $7 billion figure possibly refers to the total cost of the Ariane 5 project, Wikipedia reports that the failure resulted in a loss of more than $370 million. Still a quite expensive failure but nowhere near the $7 billion figure.
253443
Testing that an attribute does not exist cannot fail when writing tests before code
I have been taught to follow the Red->Greeen->Refactor pattern when doing TDD. There have been situations where this pattern have not been applicable though. For instance, a test to make sure that a controller action method (ASP.NET MVC) does not have an Authorize attribute. Since the test is testing the absense of an attribute it will pass on the first go, unless an Authorize attribute is added only to have the test fail. What I have done so far when testing for absense of said Authorize attribute is to write a test for it, then add the Authorize attribute just to make sure that the test actually works, then immediately remove the Authorize attribute. Am I doing something wrong, or is this just the way it is; some tests will pass unless we intentionally add code to make the fail and then remove that particular code?
213559
Algorithm to create an TicTacToe game AI
What are the algorithms I could use to create an AI for the game TicTacToe. I have already used Alpha–beta pruning and Predictive modelling. What the other good Algorithms I can use to create this AI. I want to practice a new language this would a great way to learn a new language. Thanks
215895
Initiating processing in a RESTful manner
Let's say you have a resource that you can do normal PUT/POST/GET operations on. It represents a BLOB of data and the methods retrieve representations of the data, be they metadata about the BLOB or the BLOB itself. The resource is something that can be processed by the server on request. In this instance a file that can be parsed multiple times. How do I initiate that processing? It's a bit RPC like. Is there best practice around this? I've read this: RESTFul: state changing actions but it doesn't really answer the question. (First time on programmers. This is the right place for this sort of question, right?)
215891
Loose typing not applied to objects
I have very little experience working with classes and object. I work in a loosely typed language, PHP. I was working with a SimpleXML object and ran into a problem where I was trying to do math with an element of that object like `$results->ProductDetail->{'Net'.$i};` If I echoed that value, I'd get `0.53` but when I tried to do math with it, it was converted to `0` Is there a reason that a loosely typed language would not recognize that as a float and handle it as such? Why would "echo" handle it as a string but the math fail to convert it? Example: $xml='<?xml version="1.0" encoding="UTF-8" ?>'; $xml.='<Test> <Item> <Price>0.53</Price> </Item> </Test>'; $result=simplexml_load_string($xml); var_dump($result->Item->Price); echo '<br>'; echo $result->Item->Price; echo '<br>'; echo 1+$result->Item->Price; echo '<br>'; echo 1+(float)$result->Item->Price; Output: object(SimpleXMLElement)#4 (1) { [0]=> string(4) "0.53" } 0.53 1 1.53 No object version: $no='.53'; echo 1+$no; Output: 1.53 ================================ Side note: PHP `strpos()` does not properly convert an integer needle `$i` into a string. $x=101; $i=1; if(strpos($x,"$i")===FALSE){echo $i." missing";} and $x=101; $i=1; if(strpos($x,$i)===FALSE){echo $i." missing";} give different results. I don't want to become a php hater, but I'm beginning to lose that loving feeling.
215890
How to collaborate on features using github
github encourages 1 fork per user, so that that user can work independently on a feature and then request that feature to be accepted into the main repository via pull request. However, what if 2 developers need to collaborate on that feature? What is the ideal workflow for this? I could see a number of options: 1. Both developers fork the original repository. Each developer pulls/pushes changes between each other's repository. This seems like a lot of work (tiny micro operations) and also creates a delay between changes, so increases the window for conflicts. 2. Developer 1 forks from the main repository, developer 2 forks from developer 1. Same as #1 mainly but hopefully simplifies Developer 2's life a little? 3. Developer 1 gives Developer 2 permissions to his own fork, so they both work out of the same central repository. Not sure if this is ideal. I'm also curious where branches come into this. Obviously there would be a branch for the feature itself but that branch can't exist in a single place, it would have to exist on multiple forks and be synchronized. Basically just really confused about this workflow, would like an approach for how this can be best accomplished.
120457
What are some of the benefits of a "Micro-ORM"?
I've been looking into the so-called "Micro ORMs" like Dapper and (to a lesser extent as it relies on .NET 4.0) Massive as these might be easier to implement at work than a full-blown ORM since our current system is highly reliant on stored procedures and would require significant refactoring to work with an ORM like NHibernate or EF. What is the benefit of using one of these over a full-featured ORM? It seems like just a thin layer around a database connection that still forces you to write raw SQL - perhaps I'm wrong but I was always told the reason for ORMs in the first place is so you didn't **have** to write SQL, it could be automatically generated; especially for multi-table joins and mapping relationships between tables which are a pain to do in pure SQL but trivial with an ORM. For instance, looking at an example of Dapper: var connection = new SqlConnection(); // setup here... var person = connection.Query<Person>("select * from people where PersonId = @personId", new { PersonId = 42 }); How is that any different than using a handrolled ADO.NET data layer, except that you don't have to write the command, set the parameters and I suppose map the entity back using a Builder. It looks like you could even use a stored procedure call as the SQL string. Are there other tangible benefits that I'm missing here where a Micro ORM makes sense to use? I'm not really seeing how it's saving anything over the "old" way of using ADO.NET except maybe a few lines of code - you still have to write to figure out what SQL you need to execute (which can get hairy) and you still have to map relationships between tables (the part that IMHO ORMs help the most with).
222453
Calculator with 3+ values
I am new to c++ and have been making the good old Calculator. I have gone forward from a 2 value calculator to a 3 value calculator and wondered.. How is it possible to make a 10 digit calculator (purely using +,-,*,/) that doesn't forever to code.. I have a if statement which returns what happens if the operators are + and + or + and - etc.. and if i was to go to 4 value, i would be writing 64 ifs, and 5 value would be 256 if statements. Is there a way to change this such that it wouldn't require writing out so many if statements? Here is my the important parts of the code: Calculator.cpp: #include "stdafx.h" #include <iostream> #include "headers.h" using namespace std; int main() { int nInput1 = GetUserInput(); char chOperation = GetMathematicalOperation(); { if (chOperation == '=') { cout << "The answer is: " << nInput1 << endl; return 0; } } int nInput2 = GetUserInput(); char chOperation2 = GetMathematicalOperation(); { if (chOperation2 == '=') { int nResult = CalculateResult(nInput1, chOperation, nInput2); cout << "The answer is: " << nResult << endl; return 0; } } int nInput3 = GetUserInput(); int nResult = CalculateResult2(nInput1, chOperation, nInput2, chOperation2, nInput3); PrintResult(nResult); } CalculateResult.cpp: #include "stdafx.h" #include <iostream> #include <string> using namespace std; int CalculateResult(int nX, char chOperation, int nY) { if (chOperation == '+') return nX + nY; if (chOperation == '-') return nX - nY; if (chOperation == '*') return nX * nY; if (chOperation == '/') return nX / nY; return 0; } GetMathematicalOperation.cpp: #include "stdafx.h" #include <iostream> #include <string> using namespace std; char GetMathematicalOperation() { cout << "Please enter an operator (+,-,*,/ or =): "; char chOperation; cin >> chOperation; return chOperation; } CalculateResult2.cpp: #include "stdafx.h" #include <iostream> #include <string> using namespace std; int CalculateResult2(int nX, char chOperation, int nY, char chOperation2, int nZ) { if (chOperation == '+' && chOperation2 == '+') return nX + nY + nZ; if (chOperation == '+' && chOperation2 == '-') return nX + nY - nZ; if (chOperation == '+' && chOperation2 == '*') return nX + nY * nZ; if (chOperation == '+' && chOperation2 == '/') return nX + nY / nZ; if (chOperation == '-' && chOperation2 == '+') return nX - nY + nZ; if (chOperation == '-' && chOperation2 == '-') return nX - nY - nZ; if (chOperation == '-' && chOperation2 == '*') return nX - nY * nZ; if (chOperation == '-' && chOperation2 == '/') return nX - nY / nZ; if (chOperation == '*' && chOperation2 == '+') return nX * nY + nZ; if (chOperation == '*' && chOperation2 == '-') return nX * nY - nZ; if (chOperation == '*' && chOperation2 == '*') return nX * nY * nZ; if (chOperation == '*' && chOperation2 == '/') return nX * nY / nZ; if (chOperation == '/' && chOperation2 == '+') return nX / nY + nZ; if (chOperation == '/' && chOperation2 == '-') return nX / nY - nZ; if (chOperation == '/' && chOperation2 == '*') return nX / nY * nZ; if (chOperation == '/' && chOperation2 == '/') return nX / nY / nZ; return 0; }
144661
CSS3 will be standardized by browsers?
I'm using CSS3 for the first time, but using specific styles with prefix for each browser looks strange. The need of using `-moz-`, `-o-`, `-webkit-` and another prefix turns the CSS bigger and harder to maintain. I want to know if the browsers are implementing some standardization to avoid the usage of prefix for styles.
222450
Implementation of algorithm to generate chess positions
I am interested in developing a program that generates an endgame table-base for the chess. I have gone through the technical papers of the greats like Shannon and Ken Thompson. I have found that retrograde analysis is used for the generation. How can I generate all positions in a `KBBK` chess endgame which are mates in 0?
222457
Is it a good idea to const-qualify the fields of structure in C?
Consider the following program: #include <stdlib.h> #include <stdio.h> typedef struct S_s { const int _a; } S_t; S_t * create_S(void) { return calloc(sizeof(S_t), 1); } void destroy_S(S_t *s) { free(s); } const int get_S_a(const S_t *s) { return s->_a; } void set_S_a(S_t *s, const int a) { int *a_p = (int *)&s->_a; *a_p = a; } int main(void) { S_t s1; // s1._a = 5; // Error set_S_a(&s1, 5); // OK S_t *s2 = create_S(); // s2->_a = 8; // Error set_S_a(s2, 8); // OK printf("s1.a == %d\n", get_S_a(&s1)); printf("s2->a == %d\n", get_S_a(s2)); destroy_S(s2); } I'm not aware of anything particularly bad with this kind of design, but there might be impact when compiler is heavily optimizing the code and some considerations I'm missing. Is it a good idea to use `const` in `C` as a mechanism of write access control in such a way?
115033
Java vs COBOL programming examples
I am a COBOL programmer, desperately trying to learn and program Java. Although I understand the OO priciples and concepts, I am at a lost putting all together. I am trying to find some examples on how code will look in COBOL vs Java - something a bit more complicated than "hello world" [I am past that initial headache! :-)], that includes OO principles - basically, a decent 1000+ liner in COBOL, with the Java code to work through. After working through book after book, doing the examples, and even writing small java programs at work, I think working through an example I can compare will be the best way to getting my thinking cap converted, and being able to do in Java what I can do after 10 years with COBOL. Can anybody help?
151938
Security aspects of an ASP.NET that can be pointed out to the client
I need to write several passages of text in an offer to the client about the security layer in ASP.NET MVC web solution. I am aware of security that comes along with MVC 3 and an improvements in MVC 4. But all of them are non conceptual, except for `AntiForgeryToken` (AntiXSS) and built-in SQL Injection immunity (with a little of encoding needed by hand). What would be the main point of ASP.NET security I can "show off" in an offer to the client?
151937
Git bug branching convention
I've been following the successful Git branching model guide for most of my development. I still wonder if the way I handle bug tickets is correct. My current workflow: Once I accept a bug ticket I will do a `git checkout -b bug/{ticket_number}`, create a single commit as a fix and then checkout develop and do a `git merge --no-ff`. I'd love to hear from the experiences of others whether or not I am abusing the --no-ff option in this instance. If I am, could someone suggest a better approach?
151933
Planning milestones and time
I was hired by a marketing company a year ago initially for link building / SEO stuff, but I'm actually a Web developer and took the job just in desperation to have one (I'm still quite young and just finished 2nd year of University). From the 3rd day my boss realised that I'm not into that stuff at all and since he had an idea of a web based app we started to plan it. I estimated that it shouldn't take me longer than two months to do it, but as I was making it we soon realised that we want to add more and more stuff to make it even better. So the development on my own lasted for about 4 months, but then it became an enterprise size app and we hired another programmer to work along me. The guy was awesome at what he did, but because I was assigned to be programmer/project manager I had to set up milestones with deadlines and we missed most of them, because most of the time it was too much work, and my lack of experience kept me setting really optimistic deadlines. We still kept adding features and had changed the architecture of the application twice. My boss is a great guy and he gets that when we add features it expands the time frame in which things should be done so he wasn't angry at me nor the other guy. But I was feeling bad (I still am) that I suck at planning. I gained loads of experience from the programming side, but I still lack the management/planning skills which make me go nuts. So over the last year I have dedicated probably about 8 months of work to this app (obviously my studies affected it) and we're launching as a closed beta this month. So my question is how do I get better at planning/managing a project, how do you estimate the times? What do you take into consideration when setting goals. I'm working alone again because the other guy moved from the city. But I'm sure we'll be hiring to help me maintain it so I need to get better at it. Any hints, points or anything on the topic are appreciated.
253993
Finding the shortest path through a digraph that visits all nodes
I am trying to find the shortest possible path **that visits every node** through a graph (a node may be visited more than once, the solution may pick any node as the starting node.). The graph is directed, meaning that being able to travel from node A to node B does not mean one can travel from node B to node A. All distances between nodes are equal. I was able to code a brute force search that found a path of only 27 nodes when I had 27 nodes and each node had a connection to 2 or 1 other node. However, the actual problem that I am trying to solve consists of 256 nodes, with each node connecting to either 4 or 3 other nodes. The brute force algorithm that solved the 27 node graph can produce a 415 node solution (not optimal) within a few seconds, but using the processing power I have at my disposal takes about 6 hours to arrive at a 402 node solution. What approach should I use to arrive at a solution that **I can be certain** is the optimal one? For example, use an optimizer algorithm to shorten a non- optimal solution? Or somehow adopt a brute force search that discards paths that are not optimal? EDIT: (Copying a comment to an answer here to better clarify the question) To clarify, I am not saying that there is a Hamiltonian path and I need to find it, I am trying to find the shortest path in the 256 node graph that visits each node AT LEAST once. With the 27 node run, I was able to find a Hamiltonian path, which assured me that it was an optimal solution. I want to find a solution for the 256 node graph which is the shortest.
253990
Would this be considered Single Tenant or Multi-Tenant?
As a company, we lease a managed server from a provider. In that sense, our server is a single tenant server. On this server, we have multiple customer databases. Each customer has its own database. We have been asked by a customer if we are a single tenant or a multi-tenant solution. From our perspective, we are the sole tenant of the server. But, what is the correct answer to the customer?
98336
Is it possible to be agile without use cases and tests?
Rhetoric teaches us that the answer is probably yes. However I feel that we would no longer relate to the vast majority of Agile success stories. I think that my upper management read the benefits column of an Agile process but forgot to read about the requirements or how successful Agile businesses got there.
150080
Is there a faster way to work out this logic?
The purpose of this assignment was the find the smallest and largest of the integer(User inputs 5 entries) I am a beginner Java programmer with no prior experience. Is there an easier way to do this without a ton of if/else statements? Forgive for the dirty code. //Scanner Object Scanner input = new Scanner(System.in); int num1, num2, num3, num4, num5; int large; int small; System.out.print("Enter Num1: "); num1 = input.nextInt(); System.out.print("Enter Num2: "); num2 = input.nextInt(); System.out.print("Enter Num3: "); num3 = input.nextInt(); System.out.print("Enter Num4: "); num4 = input.nextInt(); System.out.print("Enter Num5: "); num5 = input.nextInt(); //If/Else statements (SMALL) if (num1<num2 && num1<num3 && num1<num4 && num1<num5) { small = num1; } else if (num2<num1 && num2<num3 && num2<num4 && num2<num5) { small = num2; } else if (num3<num1 && num3<num2 && num3<num4 && num3<num5) { small = num3; } else if (num4<num1 && num4<num2 && num4<num3 && num4<num5) { small = num4; } else { small = num5; } //Large if (num1>num2 && num1>num3 && num1>num4 && num1>num5) { large = num1; } else if (num2>num1 && num2>num3 && num2>num4 && num2>num5) { large = num2; } else if (num3>num1 && num3>num2 && num3>num4 && num3>num5) { large = num3; } else if (num4>num1 && num4>num2 && num4>num3 && num4>num5) { large = num4; } else { large = num5; } //Display: Use printf when using a format limiter (%) System.out.printf("The smallest integer: %d\n", small); System.out.printf("The largest integer: %d\n", large); }// end of main }
150081
How to deal with exceptions to business rules?
I have been given a file with several records. I have also been given business rules that determine how to process those records and produce an output file. The business rules are relatively simple: 1. If record is of type A, use methodology A. 2. If record is of type B, use methodology B. However my client emailed me with a problem: There is one "special" record in the file. It's a type A record, but it needs to be processed with methodology B. How does one deal with these exceptions to business rules? Some options I have thought of so far: 1. Hard-code the exception into the software: `if record.id == "some_id" && record.value == 123.45 then methodology B`. 2. Manipulate the file by hand, run the program, and then correct the output by hand. My coworker is astonished that I would even consider option 1. It's messy, and next year (when I have to run this process again) the file could be different. It will turn out to a nice hidden "gotcha" that could cause problems long after I forgot about the exception. However option 1 is easier than option 2, and if the exception to the rule stays the same for next year, I won't have to even think about it. It's already been handled. Besides, it's easy to change if I need to change it later. How do I deal with random exceptions to business rules? EDIT: This is very targeted software - written to specifically do one job for one client.
194167
MVC4 Service > Controller Models
I'm working on a MVC4 N-tier application and have a quick question about Service to Controller relation and using Domain/ViewModel. public ActionResult Details(int id = 0) { TenantDomainModel tenant = _tenantService.GetById(id); TenantViewModel tenantViewModel = Mapper.Map<TenantViewModel>(tenant); return View(tenantViewModel); } As you can see my service return a DomainModel that my controller use to create a ViewModel using Automapper. Is there a better way to do that ? Ideally I would like to have no domain model referenced in my Presentation/Web layer but i'm not what are the exact best practice on this specific point. Thanks
194161
Dynamic programming proof
I have aquestion, lets say im trying to maximize: S=∑j=1nfj(xj) subject to ∑j=1nxj≤B, where B∈ℤ+ and fj:ℝ→ℝ. how would i do this using dynamic programming and what would be the states and recursive formulation. Also how would I go about finding the time complexity of this method? Any help would be much appreciated kind regards
64473
How does VoiceDrop work?
I'm interested in building some functionality similar in nature to that provided by VoiceDrop (http://www.voicedrop.ws/). I'm thinking about using Twilio, offers some very powerful telephony features, but it's not immediately obvious how one would dial a user's voicemail directly. Anyone have any ideas? _edit:_ apologies for the poor tag, I wanted to put "voicedrop voice-mail twilio"
153577
Programming for Digital frames
A project has recently come to my attention but i have no idea where to start or even if its possible. The idea revolves around programming a clock that is displayed inside a digital photo frame. The user would then be able to put different pictures corresponding to different times inside a usb pen for example, which would load as soon as you put the usb in. The project itself would be a really neat project - if it was just on a computer. I have no idea if what im talking about it even possible on a digital photo frame and if it is what language? Anyone who has any input at all would be great. My current idea is to maybe have a small device at the back, SSD, that runs the program through a screen, completely by passing standard digital photo frames, again though i dont know how to begin with this. And yes ive tried google (although it helps to know what to google).
51865
Need Help in Pointing to focus on the Key elements in Code Review Phase?
Please share your views on the code review process. If someone gave a code snippet and asked you to review that code, then what are the major things you will focus on that code Review process? For instance, I will check if any dead code is available in that code, other than checking dead code, what are the key elements to be focused on in the code review process? **Update:** Please share any free code review e-book which helps me to understand more and more.
16271
Why Oracle still loves command-line black dump screen?
I wanted to know about this since a long time. Other vendors are coming out with intuitive IDEs with even more flexibility to developers and DBAs, whereas we rely on Toad and other third-party IDEs to work with Oracle. Why they are sticking to command-line black dump screen?
210111
Can a daily scrum meeting be replaced by a status email?
If an agile team has members like Developers, Testers, and Automation Testers from different geographical regions, how can the daily scrum meeting can happen? Obviously they have to work in different time zones. Can this be successfully managed? Do you think the daily scrum meeting can be replaced by sending status emails at the end of day, or by answering the three Scrum questions in an email?
251595
Defining user operations on application/collection+json response?
I'm fairly new to Collection+JSON. I have a bunch of questions regarding Collection+JSON and user operations. # Use Case Having user permissions in a Collection+JSON response would be useful in telling the client what operations can be enacted on a particular object. As an example, it would allow the client to know which "buttons" to render on the user interface. ## Questions 1. Should the user's permissions be bundled into the Collection+JSON response? 2. Should the user's permissions be bundled into a separate call to the user object? 3. Is this beyond the scope of Collection+JSON? ## Thoughts My personal thought is that user permissions should be stored in a user object for a separation of duty, however, if this is the case then every request should then be paired with a request for a user object. This doesn't seem like a correct methodology. ## Examples In the following examples, "permissions" are represented by an integer value where 1 represents read, 2 represents create, 3 represents update, and 4 represents delete. The server will always validate the user's request, but this would make it easier for the client to know what operations can be done to the object. ### 1\. Bundled in the response "Permissions" could be added to the Collection+JSON specification, but this would be modifying the specification. { "collection" : { "rel" : {string}, "href" : {string}, ... links, queries, items, etc... "permissions" : { integer value } } } ### 2\. Bundled in the User object Permissions are stored in the user object and change based on the URL to provide the client with information on what this user can do at this particular state in the application. { "collection" : { items: [{ ... name, username, etc... "permissions" : { integer value } }] } } ### 3\. Beyond the scope According to the _draft_ specification: > The Collection+JSON hypermedia type is designed to support full read/write > capability for simple lists. I suspect that by providing a Collection+JSON response, it is assumed that all CRUD operations are available to the client and that the server will provide the appropriate response when a request is made.
224606
Best way to assure uniqueness in filename with php
I was wondering, **without using any kind of user info** (id, nickname, age, etc), what would be the best way to assure filename uniqueness using php **in a large database with high traffic and most probably simultaneously** between many users? I am using `$file = time()` for example but I would like to know if this should suffice whenever two users might go over this code at the same time (at a large large large scale, 10000 users at the same time and the same function ran 200 at the same time).
194740
Should dependency relationships always be shown on class diagrams
I recently started using the Object aid UML generator plugin for Eclipse and noticed that by default adding of dependency relationships is switched off. This made me wonder if in most cases they should not be shown or rather that most people don't want to show them, seeming as this is the default setting. How do I decide whether to show dependency relationships or not?
196983
is it wrong for my parent object to make assumption about child objects?
I have a simple domain with about 6 objects in the model. For the most part they have a clear child/parent relationship with parent having multuple children. I'm going to have all of them be immutable. However, at some point I'll need to both fetch a set of all objects of a given type, and be able to fetch a specific object of a certain type by it's label. I was going to have a model with some generic maps, and an abstract class for objects in the model. Adding to the model sticks the object in my map, and asks for the parent objects and sticks those in the map etc. Likewise a delete can delete all classes that called themselves children. This way I can query for specific classes in a generic method without writing logic to hunt down each class. Once I thought of this my next thought was rather I can use a similar framework to save CPU by looking up children in the same manner. If I already have to store "these objects claimed x was a parent" to do the delete I can then say "give me children of X". However, this assumes that X knows something about the other objects (what classes are effectively children of it). I can put in type safty via reflection mostly; but is it brittle for one object to presume that certain other class is going to claim it as a parent and persumably be in the model as such? TO clarify, lets say I have a node and edge class. My edge would report a node as it's parent. My Node can then say "give me all Objects that claimed me as parent and are edges" and do logic on them; even though it never did anything to ensure that there were edges out there using it as a node. Is this wrong? Note, this is a small system. I know that there are great abstraction patterns for huge systems, that I mostly don't think are worth the implementation cost or less explicit code for such a simple system.
149223
When to use shared libraries for a web framework?
**tl;dr:** I've found myself hosting a bunch of sites running on the same web framework (symfony 1.4). Would it be helpful if I moved all of the shared library code into the same directory and shared it across the sites? **more** I see some advantages to this: * Each site takes up less disk space * Library updates (an unlikely scenario) can take place across all sites I also see some disadvantages, mostly in terms of a single point of failure and the inability to have sites using different versions of the framework. My real concern, though, is performance. I hypothesize that I will see a performance increase, since the PHP code will already be cached for all sites when they call the framework. Is this a correct hypothesis?
117277
Are there successful examples of development "shifts"?
There is some thinking going on around how to get more output from the current resources we have. The thought is that two teams working different shifts might produce more output. The first shift might work 8am - 5pm, and the second team works 4pm - 1am. There is an hour overlap for status meetings and any communication that needs to happen between the teams. You would obviously need two team leaders, one for each shift. So far, the benefits I can see from this are: * Better ability to respond to customer issues (time zone affects things less) * Utilize the same workstations, equipment, and office space (less cost per developer) * Allows "night owls" to work at night, when they're more productive * Might be able to complete certain less complex tasks in less days (not time, days) * Less people in the (open-plan) office, meaning less distractions and higher productivity The drawbacks I see are: * Developers don't have a space or equipment to call their own (am I the only one that cares about this?) * Communication between the teams will suffer since they only see each other for an hour each day * Much more documentation and specification writing will be necessary (you can't rely on on-the-fly decisions from decision-makers because they might not be available) * Older developers tend to have families and night-time activities, and don't want to be at work Any other thoughts? Has anyone worked in this type of environment? I'd be curious to hear your thoughts on this development model, and your opinion on whether it was a good one or a bad one.
117274
Is there a standard name for this search approach?
In order to create a (Lucene) query, an "incomplete" domain object is used. All properties with a value are used for the query, the rest is ignored. In the absence of a better name, we call it "search by example", but as with many other "original" approaches there is probably a (standard/agreed upon) name for this approach, but I could not find one. Thank you.
105062
Are questions about the Singleton pattern a good way to evaluate a job applicant?
I have been recently assigned the task of taking interviews in my company. I have been taking interviews of developers and engineers with atleast 5-6 years of experience. One of my favorite question is to ask whether they have used any kind of patterns...and the default answer has always been "Singleton Pattern" Since it is the most simple pattern, I always end up asking them to write a code for it, and only 1-2 out of 5 end up getting it right, but get confused when I start asking about thread safety, double-checked locking issues and etc.. My questions are: 1. Is it fair on my part to expect a person with 5-6+ years of experience to know how to write a Singleton pattern? 2. Is it fair on my part to judge a person upon their ability to code a Singleton class? EDIT: Some clarifications. \- When I ask if they know anything about design patterns, I would like to know what kind of GoF patterns they have used, why they have used and how they have used them. And with 5-6 years of development experience, I would expect a person to know about GoF patterns...correct? \- The first answer which everyone say when I ask about patterns is "I have used and written Singleton Classes". Singletons are at the cusp of being declared an anti-pattern...with asking them to write about it, I try to gauge 1. If they can code, 2. If they can code what they claim they could code, 3. Tell me the problems with Singleton... Do I sound more reasonable now? :)
193756
Querystring Advanced Search where there are about 20 search fields
I am creating an advanced search page where there are about 20 search fields for a user to filter their search. My question deals with the query string, Is it standard web development practice to have say 20 parameters in a querystring? The search results display large tables of data. Is there an alternative that still uses HTTP GET(querystring), if it is not standard? I would like the users to be able to bookmark their searches.
191660
Requiring Explicit Null Reference Handling
One of the problems I have with null references is that they may not be exceptional. In my current position, there are few requirements and you are lucky if conventions are followed. This means being unable to handle a request is a frequent occurrence and throwing an exception is too slow (think millions of requests). I am in charge of writing an api for handling these requests and I am trying to decide how to handle failures. Our code is written in C# and I am a huge fan of LINQ. I know that LINQ handles this problem by providing two methods "Function()" and "FunctionOrDefault()". By returning the default value (usually null), we make it very easy for the developer to shoot himself in the foot. On the other hand, throwing an exception is unacceptable for us. There is also the "TryParse" pattern, but that doesn't lend its self well to lambda expressions. I recently discovered the Option type in F# and how it requires explicit handling of both the Some and None cases or your assembly will not compile. This seems like a much better solution to the null value problem than leaving it up to the developer to remember to implement error handling. I could implement an option type that will not both compile **and** return the desired value unless both Some and None cases are handled. The contract for my implementation would look like this: Option<SomeClass> option = new SomeClass { Value = 5 }.ToOption(); // Extension method int value = option.Some(x => x.Value).None(x => x.Default(25)); // Other helper methods provided as well for None cases. So my question is, if I have the ability to require explicit null reference handling, are there any downsides to this approach? Would it be better to stick with conventions rather than try to solve this problem upfront to prevent future hidden bugs?
991
5 things before starting a project?
What are the first 5 things you do before starting a new project? Do you always spend a day researching new frameworks? Or, using similar or competing products?
102593
Tips on Converting a C program to Pure Python
I'd like to convert an open source C application to pure python (not to Cython, IronPython etc). The documentation and presentations of the original creator of the C application has given me a good understanding of the architecture of the application. Since I want the first version of the python application to be as identical to the C based one, a manual conversion seems to be the best option. I'd appreciate some tips on how to best approach this code conversion (C to Python), based on your experience. (I am just looking for insights on how others have handled a similar task before.) * * * (Python version 2.7; The C application is the popular database SQLite. Please don't let that or C vs python distract you from the actual question. My C is rusty but good enough for the task, and my Python is above average.) * * * Clarifications: * I was planning a manual rewrite. Appreciate advice on how to analyze the C source and header files and things to keep in mind vis-a-vis python.
198580
GPL v 3 & Scripts
I'm not asking for legal advice; just some rough guidance. I have a host application in Java that uses the Rhino JS engine to execute JavaScript. That JavaScript can then make calls into other Java libraries, some of which might be licensed under the GPL. I distribute my hosting app, the JS files as source and the unmodified Java libs. I have released all of the JavaScript as open source. Am I also required to release my Java hosting apps source?
198583
Name of this algorithm (Create binary image)
Some days ago I saw in this site the algorithm below to convert color images to binary images and I used it in my application (with some small changes). However, I need to know what is the name of the implemented algorithm and, if possible, some references about it. Thanks in advance! public static boolean[][] createBinaryImage( Bitmap bm ) { int[] pixels = new int[bm.getWidth()*bm.getHeight()]; bm.getPixels( pixels, 0, bm.getWidth(), 0, 0, bm.getWidth(), bm.getHeight() ); int w = bm.getWidth(); // Calculate overall lightness of image long gLightness = 0; int lLightness; int c; for ( int x = 0; x < bm.getWidth(); x++ ) { for ( int y = 0; y < bm.getHeight(); y++ ) { c = pixels[x+y*w]; lLightness = ((c&0x00FF0000 )>>16) + ((c & 0x0000FF00 )>>8) + (c&0x000000FF); pixels[x+y*w] = lLightness; gLightness += lLightness; } } gLightness /= bm.getWidth() * bm.getHeight(); gLightness = gLightness * 5 / 6; // Extract features boolean[][] binaryImage = new boolean[bm.getWidth()][bm.getHeight()]; for ( int x = 0; x < bm.getWidth(); x++ ) for ( int y = 0; y < bm.getHeight(); y++ ) binaryImage[x][y] = pixels[x+y*w] <= gLightness; return binaryImage; }
198586
What is the best way to represent quantity in stock in domain model?
A `Transaction` contains one or more `LineItem`. One `LineItem` has a relation with an `Item`. Every `Item` has a number field that represent quantity in stock. Using this approach, every `Transaction` creation will need to decrease quantity in `Item`. If user update a `Transaction` then quantity in `Item` will need to be adjusted. If user delete a `Transaction` then quantity in `Item` will need to be increased. What is the best way to implement this rule or behaviour in domain model layer? `Transaction` operations (like create, update, or delete) are located in data access layer.
198589
design strategy pattern with null checking
When the context class can accept a null strategy, is there another way to do it without check if its null? Is this considered a good strategy design implementation? class MainApp{ static void Main(){ Context context = new Context(); while(true){ Strategy strategy = createConcreteStrategy(Console.ReadLine()); context.setStrategy(strategy); context.run(); } } static void createConcreteStrategy(string input){ if( input == "strategyA" ){ return new StrategyA(); } if( input == "strategyB" ){ return new StrategyB(); } return null; } } abstract class Strategy { public abstract void doSomething(); } class Context{ Strategy strategy; ClassX x; public Context(){} public void setStrategy(Strategy strategy){ this.strategy = strategy; } public void run(){ if( strategy != null ){ data = strategy.doSomething(); x.setData(data); } } }
221901
Why is the following naming guideline different between OO and non-OO languages?
I am working with a non-OO language and I'm trying to name my routines consistently. I came acrross the following guideline from Steve McConnell's Code Complete: > _To name a procedure, use a strong verb followed by an object_ McConnell gives the following good and bad examples: * good, non-OO --> `PrintDocument(doc)` * good, OO --> `doc.Print()` * bad, OO --> `doc.PrintDocument()` For an OO language, `doc.PrintDocument()` is non-recommended on the basis that it is redundant. I'm having a hard time wrapping my head around this guideline. Why is `PrintDocument(doc)`recommended, and `doc.PrintDocument()` non-recommended? Also, what would be the problem with the simpler name `Print(doc)` in a non-OO language? Am I missing something very basic here?
221904
How can I automate the process of code review
I have a team that works on multiple technologies. I want to know how can I automate the process of code review for .Net, .Net MVC, Python, PHP, Drupal and HTML5/CSS with JavaScript. I have read about and have used some tools like StyleCop/FxCop for .Net and PHP Code Sniffer and likes for PHP and pyLint for Python. I understand that automated code reviews do not fully replace the manual ones, but I want to setup a process to support manual code reviews. Any suggestions? Thanks
221907
What are common code review processes and what is considered bad?
My company recently started doing formalized code reviews. The process goes like this: you submit into a github, request a pull request, code gets reviewed by approximately three people, then if all passes, your code goes in. The process seems fair, however the three people who do the code reviews don't seem to be fair. I notice that when I put my code in for review, I get anywhere between 100-200 comments. The top number for me was 300 comments once. Of course you'd think it is big changes, but this can be very small changes as well with less than 50 lines of code (which includes unit tests). All comments are considered "must do" and without argument. With that in mind, my main problem here is that it seems a bit excessive. I talked to the group and they told me basically that just because I had so many years of development in php doesn't mean I am an "developer." Of course this seems more hurtful than not. Also I notice that within the group, they don't appear to produce as much comments and most of the time they ignore or otherwise disregard other comments or suggestions rarely accepting it as a valid point even if something is broken. So my question is if this is fair? Or common?
58894
*Hidden Features* in your operating system that increase productivity?
_As developers how much time, or do you spend time, In learning the hidden features tricks of your operating system ?_ * * * * How important do you feel is this for productivity in day to day programming? tasks. * What do you mean when you list knowledge of an OS in your resume? * What are your most useful hidden -less known features * * * For example: A common problem of How can i open the cmd window in a specific location a do it yourself solution in say xp and what to do if something breaks * * * Or are these something you look into as and when you find the need to do so?
152626
Is it possible to develop apps with Kendo UI to submit to iOS App Store?
The number of platforms I have to develops apps for is increasing and It brings me lots of stress to learn new technologies for each target platform. I found out that Telerik's Kendo UI is very good to build websites that look and feel native on mobile platforms (e.g. iOS and Android). My question is, is it possible to build HTML5 apps to deploy them on iTunes App Store and Google Play? Please note that I am eager to know the possibility of creating apps (complete apps bundled in standard format of Apple and Google for distribution in their respective mobile app markets) but not websites.
152620
Is beginner knowledge of Java enough to develop for Android?
I just finished the book "Tech Yourself Java in 24 Hours, 6th Edition" I have an understanding of the language (by understanding I mean, the basics and everything covered in the book) and I have been experimenting and building little things with my knowledge. I want to learn about Android and was wondering if I need to increase my knowledge in Java before moving on to Android or can I just go straight to Android?
9095
What are the biggest differences between F# and Scala?
F# and Scala are both functional programming langugages that don't force the developer to only use immutable datatypes. They both have support for objects, can use libraries written in other languages and run on a virtual machine. Both languages seem to be based on ML. What are the biggest differences between F# and Scala despite the fact that F# is designed for .NET and Scala for the Java platform?
213541
What skills (technologies) get outdated slower?
It's a common knowledge that since the IT industry develops very quickly, most of the skills get outdated fairly rapidly: jQuery, .NET, Ruby on Rails, etc. They change all the time so that it is difficult to keep track of them and especially learn them. Once I learn Ruby on Rails 3.2, Ruby on Rails 4 has appeared; the same thing for other frameworks and libraries. What skills (or rather, **technologies** ) get outdated slower and, at the same time, pretty useful in terms of being able to find a job? I figure these are knowing networks and algorithms. What else?
49363
Browsing Prog.SE etc instead of paying attention to my degree
I've just realised that I've spent more time browsing Programmers.SE than actually doing the exercises I should be doing for my Computer Science degree this hour - they aren't coursework, just timetabled, supported, lab sessions - this time basic SQL SELECT statements. I already know SQL, but I have trouble writing syntactically correct statements first time. The exercises are along the form of "Write a query to get the names of all the pets born more than 10 years ago sorted by owner surname". Is it bad that I'm doing this? I think this is more useful than those exercises, but I'm not too sure.
49361
Addressing a variable in VB
Why doesn't Visual Basic.NET have the _addressof_ operator like C#? In C#, one can int i = 123; int* addr = &i; But VB has no equivalent counter part. It seems like it should be important. **UPDATE** Since there's some interest, Im copying my response to Strilanc below. > The case I ran into didnt necessitate pointers by any means, but I was > trying to trouble shoot a unit test that was failing and there was some > confusion over whether or not an object being used at one point in the stack > was the same object as an object several methods away.
223464
block access to area/controller's methods but allow inherited controller to run methods, asp .net mvc5
I am trying to find out how to block a whole area/controller from being accessed by typing url website.com/area1/basecontroller/method1 (this area also contains the views that will be displayed) , while still being able to inherit said controller and use the method from original controller like so website.com/area2/extendedbasecontroller/method1. There would not be a method1 in the extendedbasecontroller, it would just perform method1 from the basecontroller Is it possible or could it be achieved in a different way?
98800
Is MapReduce anything more than just an application of divide and conquer?
Dividing a problem to smaller ones until the individual problems can be solved independently and then combining them to answer the original question is known as the **divide and conquer** algorithm design technique. [See: Introduction to Algorithms by CLR] Recently, this approach to solve computational problems especially in the domain of very large data sets has been referred to as **MapReduce** rather than divide and conquer. My question is as follows: Is MapReduce anything more than a proprietary framework that relies on the divide and conquer approach, or are there details to it that make it unique in some respect?
2666
What was your worst software development day like?
Sometimes, people really have a bad day... I think it's interesting to learn why that day was bad and learn from our mistakes made on that day. So... What was your worst software development day like?
37149
"Testing Plan Lite" for web project
How do you draft a quick & easy "Testing Plan Lite" for a medium-sized web project (70k lines, 2 developers)? I've seen many tutorials/articles on methods of testing, but all seem cumbersome. For us, the goal is to be able to be able to divide up and delegate testing instructions to our friends for different project segments, browsers, etc. What's the quick & easy way to write test plans for web apps? (the 20 of the 20/80 rule) Thanks!
181514
Feature organization / authentication?
Let's say I have a product that has different features, or different feature access depending on things (i.e Premium User, Beta, Demo, Logged-in User, etc..). What's the best way to organize a system to where it's not a set of static checks (i.e a bunch of if statements, for example)? The platform isn't important, I'm precisely asking for design principles / general design.
20988
Why is Python written in C and not in C++?
In Python's tutorial one can read that Python's original implementation is in C; > On the other hand, the Python implementation, written in C, (...) I'm very curious why was Python written in C and not C++? I'd like to know the reasoning behind this decision and I'm looking for references to historic data.
199458
Difference between sending a message and emitting it
Halfway through the RabbitMQ tutorial, I noticed that the tutorial stops referring to producers "sending" messages and starts using the verb "emit" instead — and pretty consistently, too; after the second tutorial, the verb "send" is no longer used to describe a producer transmitting messages. Example: Second Tutorial > The main idea behind Work Queues ... encapsulate a task as a message and > **send** it to the queue. A worker process running in the background .... Fourth Tutorial > We'll use this model for our logging system. ... Let's focus on **emitting** > logs first. What is the difference between sending a message vs. emitting one?
198324
Enterprise application with lots of SQL queries
**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 which is not huge by software development standard but not so short that I can just rewrite it. Additionally, that database is fed by a form which is distributed to all our internal clients. **My question:** I'm wondering what's the best way to deal with this. I'd like to know if there is a better way to manage all those queries than to have them in code in string variables. I'm sure it's possible to use files but then we have to distribute those files and that can't happen (i.e. I don't want users to have SQL queries wide open to them). Is there some clean (in terms of design) way to manage SQL queries that still has a decent amount of security (access to those queries) ? Just to be clear, we are using Access 2007 with VBA.
168240
Is there any way to get faster app reviews?
I am trying to build a business around an iPhone app. The app will be our main sales channel, and being able to adapt the sales channel faster than the 9-10 days delay cause by the app review times is crucial. Therefore, I was wondering whether there is anything I can do to improve the speed of reviews. I am thinking that the publishers of Angry Birds, surely would not have to wait in line for reviews on the same terms as some obscure free app. So what can I do? Some things I am considering: * Would Apple prioritize apps that they earn money on? * Could I in some way pay Apple directly? I already know of the possibility of requesting an expedite review, but it seems like one can get punished for supplying a non-technical reason.
108770
How significant are Spring and Hibernate in software development?
I am a software professional with about 1.6 years of experience in Java. Due to personal reasons, I had to quit my job, and now after 5 to 6 months, I am about start my career again. I am planning to attempt to take the SCJP exam, but some of my seniors suggested that I should learn Spring and Hibernate. I am totally new to Spring and Hibernate, but I am good in core Java concepts, servlets, and JSPs to some extent. Which option would help me securing a job fast? Do software companies not use Java and JDBC alone, without advanced concepts like EJBs, Struts, Spring, Hibernate, servlets, JSPs, etc? Is it enough for an individual to possess skills in Java alone by attempting to obtain the SCJP certification, or do you need advanced Java skills to secure a job?
71808
How much pressure should programmers be under?
I have been blessed with an amazing workplace and my colleagues are really understanding.. However this is my first programming "gig" and i know some people aren't so lucky, Especially those who run their own company! (I've seen my boss work unhuman hours and go way beyond out of his way to make a customer happy.) The ugly truth is when your contracted by a big corporation, as we have been, you learn quickly that corporations don't care for clean readable code, programmer happiness, best practice or maintainability.. And they will call you on weekends.. At 3AM.. with 1 weeks worth of work they need for a meeting at 7AM! 1. How much pressure is normal for a programmer? 2. How much pressure should a programmer be under?
58270
Bugs vs. Nonexistent Features
Is it fair to refer to a feature that has not yet been coded as a "bug"? For example, I am working on a project that involves three distinct features. If I only start one of them, is it correct to refer to the other two as bugs? Or do bugs only apply to features that have been coded and tested?
211798
Design decision for implementing the cache re-arrange logic
I'm working on a webapp which has an existing framework to cache values from the database. I have a requirement which needs multiple values from the database and the values have to be rearranged/restructured so that it's easy for the UI framework to handle them. I'm unable to decide where to put this 'complex re-arranging' logic. Should I do it from the database queries itself? or Should I create a combined cache i.e read values from other caches, rearrange data, then store the result in a new cache? or Put the rearranging logic in the UI?
167305
What functionality does dynamic typing allow?
I've been using python for a few days now and I think I understand the difference between dynamic and static typing. What I don't understand is under what circumstances it would be preferred. It is flexible and readable, but at the expense of more runtime checks and additional required unit testing. Aside from non-functional criteria like flexibility and readability, what reasons are there to choose dynamic typing? What can I do with dynamic typing that isn't possible otherwise? What specific code example can you think of that illustrates a concrete advantage of dynamic typing?
211797
AS2 vs AS3 communication protocol difference. Server requirement
I'm researching what's needed for EDI as far as protocols and server/application setup. This is transportation industry and I'm interested in X12 format for transactions like 204, 210, 214. Specific question is: Do BOTH trading partners have to run servers? With AS3 it seems like SFTP server and it seems like one partner can run it and another partner can push/pull. What about AS2? Can it have server only on one side? Or both partners should be able to push?
102041
Why are data structures so important in interviews?
I am a newbie into the corporate world recently graduated in computers. I am a java/groovy developer. I am a quick learner and I can learn new frameworks, APIs or even programming languages within considerably short amount of time. Albeit that, I must confess that I was not so strong in data structures when I graduated out of college. Through out the campus placements during my graduation, I've witnessed that most of the biggie tech companies like Amazon, Microsoft etc focused mainly on data structures. It appears as if data structures is the only thing that they expect from a graduate. Adding to this, I see that there is this general perspective that a good programmer is necessarily a one with good knowledge about data structures. To be honest, I felt bad about that. I write good code. I follow standard design patterns of coding, I do use data structures but at the superficial level as in java exposed APIs like ArrayLists, LinkedLists etc. But the companies usually focused on the intricate aspects of Data Structures like pointer based memory manipulation and time complexities. Probably because of my java-ish background, Back then, I understood code efficiency and logic only when talked in terms of Object Oriented Programming like Objects, instances, etc but I never drilled down into the level of bits and bytes. I did not want people to look down upon me for this knowledge deficit of mine in Data Structures. So really why all this emphasis on Data Structures? Does, Not having knowledge in Data Structures really effect one's career in programming? Or is the knowledge in this subject really a sufficient basis to differentiate a good and a bad programmer?
37802
Am I going to damage my career if I switched to a completely different route?
I have been in the Java programming for the last 4 years, basically doing Java web development and JEE. I have spent the last 7 months investing in learning Objective-C and iOS development for fun. Now I'm considering to scout a professional iOS development career. My question is does iOS development career considered a serious profession (like Java or .NET)? Am I going to hurt my career in the long term if I switched to iOS development after four years in the popular platform?
149656
Are There Any Examples of Uncle Bob's High-Falutin' Architecture?
I just finished watching this presentation by Uncle Bob (as well as his "Architecture" section of his "Clean Code" videos), but I'm left wondering: Are there any examples out there of applications that implement this Entity- Boundary-Interactor (or Entity-Boundary-Controller) structure? At one point I downloaded the source code to FitNesse (the acceptance testing project he mentions often as an example of not only high test coverage but good architecture, since they were able to defer the decision to not use a database until the very end), and based on a quick glance of it it appears even this project doesn't seem to fit this pattern. **Are there any nontrivial examples of this architecture out in the wild, or should I not bother even looking into it and chalk it up as "it would be great if you could get there, but nobody really does"?**
227959
Uploading files(code) on a web server?
I have a very small and basic web site on a web server. Usually I'm doing the changes on a localhost where the development version is, and after that I upload it to the server with FileZilla. That's the very obvious way, but it's not the most convenient. I've worked with SVN, but I've never needed to set anything - just checkout, commit, update. Reading some tutorials I wonder is this the easier way to upload the files to a server? Or are there any easier?
132369
Should we rename overloaded methods?
Assume an interface containing these methods : Car find(long id); List<Car> find(String model); Is it better to rename them like this? Car findById(long id); List findByModel(String model); Indeed, any developer who use this API won't need to look at the interface for knowing possible arguments of initial `find()` methods. So my question is more general : What is the benefit of using overloaded methods in code since it reduce readability?
132361
Why are developer commit statistics harmful?
I have long believed (and heard from others) that keeping track of commit statistics, such as how many commits each developer makes per day, is harmful to the development process. The reason seems obvious - developers will commit in smaller increments, maximising their commit-per-day number, but making it harder to bisect (perhaps all their intermediate patches won't leave the repo well formed) and harder to work with the commit history (a change will suddenly be in multiple commits, instead of just one, reverting a patch is harder etc). Are there any studies that show commit statistics are harmful? Any elegant and well-argued article on the topic? Equally applicable would be anything about why measuring the wrong thing leads to people optimising the wrong thing, which this problem is just a special case of.
27518
If you could ask one technical interview question, what would it be
First off, there are equally important questions for a candidate that are non- technical (do they work well with others, can they imagine a better approach, etc.). But to evaluate the technical skills, what would be your one question? I ask because I have one. I have no idea why this question works so well. I don't even have a good theory. All I have is an incredible correlation between answering this question correctly and being a really strong programmer. The question was suggested to me by someone I respect a lot. I replied that it seemed too easy but he suggested I try it. He's a smart & imaginative guy so I started asking it of people I interview. The interview process at virtually every company I have worked at has been 3 – 4 hours long. We ask basic programming, we ask brain teasers, we have them bring in some code they are proud of and spend 45 minutes having them take us through what they did and why. And 99% of the time, getting this question right or wrong predicts if they will pass the 3 – 4 hour process. Question: For the integers between 0 and 100 (i.e. 1, 2, 3, …, 100) – how many have the digit 7 in them? Answer at The Best Programming Interview Question – ever! (so you answer it yourself before seeing the answer).
222339
Using the system tray / notification area app in Windows 7?
Many dekstop apps have this, such as dropbox (windows version). You right- click the dropbox systray icon and there are shortcuts to the features of the main app. Right now, I want to keep it simple and just want to run a exe(?) and have a custom icon appear in the system tray notification area. How do I build this?
222336
Session management in a Service Oriented Architecture
Where should you manage a users session in a SOA? Should you manage it in the Web Service or in the client and why? My application is SPA (Considering that this will be the stacked that will be used Apache CXF for Web Services AngularJS for making REST calls)
106741
Is there a canonical reference on GUI programming in Java?
I'm practicing Java in Netbeans. Is there a reference out there that's the de-facto standard for describing best practices, design methodologies, and other helpful information on GUI programming in Java? What about that reference makes it special?
91000
The correct choice of tools for a new Deep Zoom application
I want to create a new application. It will basically be a Deep Zoom application that users can draw annotations on (that will save to a DB so other users can see those annotations.) At first it will just simply run in a browser. However, the app would be useful if it could be used by enthusiasts in the field, so ability to run on smartphones or other handheld devices would be massively beneficial. 3G/4G signal is likely to be practically non existent in those places, so having the ability to download all the images and info for an "area" would be good. I can't decide on which technology to use. Silverlight Deep Zoom apps look really nice in browsers, but I have heard that it is not a widely supported technology that MS might be ditching anyway and the only smartphones that would be capable of running Silverlight would be Windows phones = a very small share of the smartphone market. Flash will probably never run on iPhones/Apple products in general. So should I use HTML5? HTML5 all seems a little confusing to me at the moment, would it even be possible to make a HTML5 Deep Zoom application that users could annotate? Any thoughts and advice would be really handy, thanks for reading.
106747
Computer Science graduate. Master or full-time job?
> **Possible Duplicate:** > Is a Master's worth it? I have just gotten my Bachelor's Degree in Computer Science and I have to make choice. Whether to continue with my full-time job I just got or put the job slightly in the background and concentrate on getting a Master's degree. I am currently working as an embedded C developer in a small company. The cool thing is that, because the team is quite small, my engineering ideas really play a part in the final product. Not to mention that I get to work on very different areas of embedded programming: device drivers and development of a Real Time OS. I am very enthusiastic about my job and what I do. On the other hand, in my country there isn't really a master's degree that focuses on embedded development so my gain from getting this degree will mainly in the field of general computer science knowledge. That being said, is it worth giving up all my spare time which I now use to study different areas of embedded devices and work mainly to get a degree rather than pure knowledge and experience in the field I want to work in?
137620
Should developers be expected to compile an internal library before the actual program?
Recently a senior developer that I work with made a case for requiring that developers get the latest version and compile as part of their project a major internal library. This stands in contrast the the counter argument that project teams should be working off a stable version that they get from an internal Maven repository to which the developer argued that having the source code available on the developer machines saves time as they can read the libraries source code to determine if required functionality is available. Does the senior developer have a valid argument? Or is requiring developers to read the libraries source code run counter to the basic philosophy of encapsulation and even having the library in the first place?
67123
How useful are compile-time functions?
How useful are compile time functions? Personally I haven't worked in any language that supports them but they seem nifty in some cases. For those who don't what I mean, a compile-time function is evaluated at compilation rather than at runtime, so if you have for instance in your code int i = Pow(4,34); you could instead do something like this int i = Pow<compilation>(4,34); and the actual runtime code would be int i = 295147905179352825856; Naturally there are some restrictions on what functions could be run at compile time, they pretty much have to be pure/static but I can also see some instances where it could be used to fetch data into something from a file or database (even though in most cases those things shouldn't be compiled into the code) What do you think, is a feature like that actually useful or just "cool"? :)
67122
How do I approach fixing an unreproducible/randomly occurring bug?
We have a multilingual website in which a bug was discovered some days ago. It was displaying other language data in other language and also the mixture of data like English language was selected but it was displaying other language data as well in the page and vice-versa. It is doing it infrequently but is present in the website. Going through the code also doesn't help because this is not always occurring. Any suggestion in finding the issue in a timely manner? I am asking for strategies here.
147673
What are the roles of singletons, abstract classes and interfaces?
I am studying OOP in C++ and, even though I am aware of the definitions of these 3 concepts, I cannot really realize when or how to use it. Let's use this class for the example: class Person{ private: string name; int age; public: Person(string p1, int p2){this->name=p1; this->age=p2;} ~Person(){} void set_name (string parameter){this->name=parameter;} void set_age (int parameter){this->age=parameter;} string get_name (){return this->name;} int get_age (){return this->age;} }; 1.Singleton **HOW** does the restriction of the class to have only one object work? **CAN** you design a class that would have **ONLY** 2 instances? Or maybe 3? **WHEN** is using a singleton recommended/necessary? Is it good practice? 2.Abstract Class As far as i know, if there's only one pure virtual function, the class becomes abstract. So, adding virtual void print ()=0; would do it, right? **WHY** would you need a class whose object is not required? 3.Interface If an interface is an abstract class in which all the methods are pure virtual functions, then **WHAT** is the main difference between the 2 of them? Thanks in advance!