instruction stringlengths 34 19.9k |
|---|
We recently experienced a deployment issue where it turned out that the version objects were not in sync in one of the environments.
We have a large database group and different teams have different responsibilities and ownerships - I might code on schema X, Y, Z but I also will have dependancies on objects owned by o... |
I have to learn OpenGL and get a basic OpenGL app built, and I have a few questions:
What are specific things programmers need to know to program in these frameworks?
How does the shader language in 2.0 affect using these libraries?
Are there any compelling reasons to start with 1.x before 2.0?
|
Been building a WP7 app and now I need it to communicate to a WCF service I made to make changes to an SQL database. I am a little concerned about security as the user name and password for accessing the SQL database is in the App.Config. I have read in places that you can encrypt the user name and password in the conf... |
I have designed a small library for work that consists of a few exposed classes. These can basically be thought of as a server class and client class. But now that I am writing all the test cases and examples, I am questioning myself on whether the classes should be used in a class or inherited.
I know about the compos... |
I was wondering if this license is:
self defeating
just a clone of an existing, better established license
practical
any more "corporate-friendly" than the GPL
too vague/open ended
and finally, if there is a better license that achieves a similar effect?
I wanted a license that would (in simple terms)
be as flexible... |
Smalltalk supports a syntax feature called "message cascades". Cascades are being adopted by the Dart Programming language.
As far as I know, C# doesn't support this. Were they ever considered during the design of the language? Is it conceivable that they could appear in a future version of the language?
|
I am using cppcms to create a blog like application and I'm trying to write a permission system, although I'm confused as to what would be the most efficient and manageable method.
At the moment, I have a table with permission id, user id, permission type (int) and permission value (an optional parameter, of sorts). Fo... |
I started learning PHP and I was able to get myself familiar with it. Now, I want to explore other programming languages like PERL so that I can compare it myself to PHP. Will I be confused to learn two language? Or are there any disadvantages?
|
I am using following function to autoload classes, it works fine if i am using only one directory called 'classes' however when i try to use Smarty lib also it fails and give me the error
Fatal error: Class 'Database' not found in /home/...
for ex:
require_once(DOC_ROOT."/libs/Smarty.class.php");
function __autoload($... |
I'm working on a website for a photographer, the whole code is just a few files, and whole repository is a few MBs without the actual photographs.
But, when I add the actual photographs to git and commit, then the repository jumps to 75 MBs. Considering the photos will be updated, the size of the repository is going to... |
Edit: I admit to being unclear when I first wrote the question. I suppose I wasn't sure of the issue myself, the comments and answers provided up to now helped me focus on the issue, thank you to all involved. This edit is a total rewrite of the question.
End editorial comment
On a dynamic website we have two systems -... |
I'm pretty new to TDD approach and my first experiments say that writing 1 line of functional code means writing about 2-3 lines of testing code. So, in case I'm going to write 1000 LOC, the whole codebase including tests is going to be something like ~3500 LOC.
Is this considered normal? What is the ratio in code you ... |
I'm using Foursquare to get a List of Restaurants nearby inside an iOS app. The Result is stored in an Array which consists of Dictionaries and regarding how deep the Data is, each Dictionary contains also an Array with Dictionaries and so on. The Result should be shown inside a UITableView. Should I create a Class tha... |
Trying to be a better programmer
I have an application that keeps track of Roles and Permissions, I had classes for Role and Permission which were just value objects.
class Role
{
int RoleID
string RoleName
}
class Permission
{
int PermissionID
string PermissionName
}
If I wanted to get the permissions for a ... |
I'm currently planning a Windows service. It will be a multi-threaded application which will continuously check for database records and process them. My first thoughts were to set a number of max available threads and create new thread for each process. This works OK but since I'm creating a new thread for every new p... |
What are the various ways of acheiving this ? Can someone please guide me?
I have to code a website for a friend (designer). The friend wants me to use core php and not any framework like codeigniter (something I really like and am comfortable with !) .
I had a look at a couple of roll your own MVC frameworks guides, b... |
When using an event based component I often feel some pain at maintenance phase.
Since the executed code is all split around it can be quite hard to figure what will be all the code part that will be involved at runtime.
This can lead to subtle and hard to debug problems when someone adds some new event handlers.
Edi... |
I'm developing a program to generate LARP characters in java and I've hit a snag.
Initially I had planned to use a decorator to iterate through the potential 'roles' (effectively classes), and then from that work out the costs for each skill depending on the combination of roles and store that in the character. I.e you... |
I need to work with 4-5 programmers on a fairly average PHP application using codeigniter. We're in 5 different locations in one city, and all of the programmers are all not too well educated and I'm assuming that most of them have never used any version control system.
Can you recommend some very very easy-to-get-into... |
What is preventing hardware manufacturers from creating a device that will allow the user to select their OS? A phone similar to a PC or a mac that can have linux, windows or mac OS installed. Are there any regulations preventing this?
|
It is common to use idioms such as:
x/60.0
to force a floating-point division when x is an integer in languages which do not have distinct operators for integer and decimal division.
Is this an accepted idiom or is it preferrable to cast x to a floating-point type?
I believe it is a concise and clear idiom- it might b... |
I am writing a system where both the system owner and myself are developers, and we are currently the only source of 'requests' or requirements for the system, which I would like to capture in user stories tied to features{1}. My urgent priority now is to get a managaeble backlog captured. How should I go about capturi... |
I'm about to start the process of migrating a program from one component to another. Most of the core functionality will be the same but I'll need to change database calls, etc. I'm sure there will be a few quirks somewhere.
Naturally, there will be many errrrrrors, some of which Ill miss completely. Would it be bet... |
I'm going to be teaching a class that covers a broad brush of estimation techniques. I intend to cover absolute estimation techniques based on SLOC (e.g. Function Points, COCOMO II etc.) and relativistic ones like T-shirt sizing, story-point estimation etc.
I was wondering what would be some good exercises to conduct i... |
My background is as follows. I've been programming since I was young, worked in BASIC, then Asm for M68K, then C, C++, and now I've spent the past 5 years in .NET becoming a rather good .NET developer. Somewhere along the line, I realized I have no clue how the internet works, I don't know how TCP/IP works, I have no... |
Recently I asked a question about whether or not I should refactor my code. the responses I received were most definitely in the camp of going through with the refactoring due to the presence of a God File.
However, now I'm pushing towards what I fear is Ravioli code. I will have around 6-7 ".c" modules (which I find p... |
I am using Entity Framework at my work and faced some problems.
Usually I hear about creating tiny Edmx´s files containing tables related to some Domain ie.: Help Desk Edmx, HR Edmx, etc. Instead of load all tables in one big Edmx, what would be much simpler, but for performance considerations(at design and build time ... |
After a system has gone through many migrations, and evolved enough for a second version, does it make sense to keep the old migrations around? I mean, old versions will use them to upgrade to the new one, sure, but should a fresh install have its database go through all the "historical" changes before arriving at the ... |
I have a personal project that doesn't have robust testing. I had a bit of TDD going on at the beginning, but it quickly became counterproductive as the project details changed dramatically over time. So a lot of previously written tests have become useless.
Now that the project solidified a bit, I dont' think big chan... |
I was wondering whether using (almost) empty derived classes to give additional semantics to a class hierarchy was a good idea (or practice) ?
Because a (not so short) example is always better than a long speech, let's assume we're writing a class hierarchy for SQL generation. You want to represent a data manipulation ... |
Simply spoken, one of my c# classes got too big and I'm currently splitting this class in several subclasses by clustering semantically related methods (actually actions, which do side effects).
So, to give you an example:
class ViewModel
{
// a lot of properties bound to view (MVVM pattern)
public Property 1 //bou... |
I am currently getting involved in a startup, I am the only developer involved at the moment, and the other guys are leaving all the tech decisions up to me at the moment.
For my day job I work at a software house that uses Microsoft tech on a day to day basis, we utilise .NET, SqlServer, Windows Server etc. However, I... |
I need to rebuild an old huge website and probably to port everyting to ASP.NET and jQuery and I would like to ask for some suggestion and tips. Actually the website uses:
Ajax (client site with prototype.js)
ASP (vb script server side)
SQL Server 2005
IIS 7 as web server
This website uses hundred of stored procedure... |
I'm not sure how the locks will work with multi processors/cores, I'm going to use shared memory in my application or FIFO, what worries me is the locks, I have a server with 2-CPU, how the lock will be able to lock a variable on one CPU while the another operation went to the 2nd CPU for the same variable?
I'm in Linu... |
Many web sites ask users to enter their email address twice, sometimes taking the trouble to disable copy-pasting.
What is the logic behind this? Is this e.g. a security measure?
|
The system I am developing is designed to have multiple organizations, with users and roles for each organization. Some organizations can interact, some can not, and generally organizations are not allowed to see or modify each others data with some exceptions.
I have a model class A that manipulates the data storag... |
I work with a team of programmers as the business analyst. We just released version 2.0 of our product and are working on the next version to be released in 3 months (it's an internal software product). Unfortunately version 2.0 has some issues that they have had to fix and we're going to deploy those fixes in a coup... |
I'm having performance issues on a Rails 3.1.0 application, now I've done dome changes on my queries with AR and so but views still takes too many time to render, I've divided the views, loops and so, on many partials that are rendered dynamically inside views and inside other partials.
So it's a bad practice to have a... |
I'm developing a piece of software (a WordPress plugin) in PHP and Javascript and CSS. The PHP code must be licensed under GPL, but CSS and Javascript can be under another license (as far as I've understood).
I'm thinking about writing a more permissive version of the AGPL license, and use it, for Javascript and CSS. ... |
For my next project, I'm looking to document my Object Oriented design in simple text before jumping the gun to code it up. I want to do this for two reasons.
I want to give proper thought to my design and possibly revise it several times.
I haven't exactly decided which language I want to implement my project in.
I'... |
I am designing a COBOL program that does 2 things.
1 reads specific rows from a table, and inserts a new row based on the original.
2 reads different rows from the same table, and updates those rows.
Is it bad standards to have 2 initialization procedures? I need to declare 2 SQL cursors, one for each task. So I was th... |
If you are building a web application, and you have a user management component, is it recommended to do:
class UserAdminView extends View {
}
or
class UserAdminUpdateView extends View {
}
What about controllers? Thoughts?
|
How do you name your iterators when you return a begin and an end iterator from a class? Without it sounding clunky, that is.
Example:
typedef std::vector<Idea> Ideas_Type;
Ideas_Type::const_iterator GetIdeasBegin() const;
Ideas_Type::const_iterator GetIdeasEnd() const;
Should it be GetIdeasBeginIter? IdeasBegin?
|
Early in my programming career I was in love with pointer twiddling, lean code, doing everything with as little layers of abstraction as possible and so on. The code was very C like I would say, close to metal and clever.
Time has passed, I have a lot more experience, and I'm noticing my attitude towards the code has c... |
I'm very familiar with xUnit frameworks and I try to implement unit tests on every project I start. Somewhere along the way, I realize that I'm writing the same tests over and over again, and then I run into a really difficult to test method or a test involving remote resources, and then I give up for a while. I end up... |
The other day I reviewed code someone on my team wrote. The solution wasn't fully functional and the design was way over complicated-- meaning stored unnecessary information, built unnecessary features, and basically the code had lots of unnecessary complexity like gold plating and it tried to solve problems that do no... |
I have a very big file delimited by some sequence of characters '*L*I*N*E'. The file will be of the order of 250G. And each line comes around 600bytes to 1000 bytes. I will be performing the following operations on the file,
Read the file line by line and for each line, I will be giving it to a parser which will do som... |
I'm bootstrapping my own project, it has a registration/login area (via devise with RoR, properly hashed and salted of course). As I'm using subdomains and I need to access them with iframes (it's justified, really!) I'd need one of those expensive certificates that cover subdomains.
As I'm doing this out of my own tim... |
I created a sessionful web service using WCF, and in particular I used the NetTcpBinding binding. In addition to methods to initiate and terminate a session, other methods allow the client to send to one or more tasks to be performed (the results are returned via callback, so the service is duplex), but they also allow... |
Recently I was talking with a colleague who mentioned that his company was working on adding the MVC design pattern as a PHP extension.
He explained that they wrote C code for adding Controllers, Models and Views to the language constructs to increase performance.
Now I know that MVC is an architectural design pattern ... |
I have a class created in some namespace, like SomeNameSpace.SubNameSpace.StaticClassName
Here is a code snippet from other code file where I want to use this class many more times, so I created a property in the code file like this
//Just to provide an Alias for long name "SomeNameSpace.SubNameSpace.StaticClassName.Pr... |
For definitions and examples of "state", see: http://en.wikipedia.org/wiki/Program_state , http://en.wikipedia.org/wiki/Finite_state_machine , http://en.wikipedia.org/wiki/State_diagram
A diagram showing a very easy example, notice how the current state changes how the turnstile operates when the same input (inserting ... |
This morning I found a note on my desk with some tips from a higher up developer who had been looking over some HTML/CSS I had put together.
One of his suggestions was for me to "stay away from context-based class and ID names like 'left' or 'right.' Never use colors as names. Stick to semantic names based on the conte... |
I'm a Rails developer and I prefer Mercurial over Git. However, I know that the Rails community is very pro-Git. So my question is it possible that my choice of version control system would turn back some developers?
|
I'm writing a Genetic Program that I need some advice on for crossover operations. The GP is attempting to find the best solution for a matrix that has hard row constraints and softer column constraints.
For a given solution in the population, the rows contain a random combination of object type ids from a fixed set. T... |
I have many classes in my application responsible for behaviour- views, controllers, models, network- often the state of one class or system depends on another and I'm finding that classes that are primarily responsible for the behaviour for one system inevitably become dependees or dependers of other systems or classe... |
It occurs to me that there's not a heck of a lot of difference between
$>python module.py
And:
$>javac module.java
$>java module.class
The former compiles to an intermediate language (python bytecode) and executes the program. The latter breaks the steps up, first compiling to the intermediate language (jvm bytecode) ... |
From Less is Exponentially More
If C++ and Java are about type hierarchies and the taxonomy of types, Go is about composition.
|
I found a question (code cowboy on the team), but it was more related to "Ninja Coder" then the problem that I have.
I have a team member who is a pure living example of "Cowboy Coder".
I do understand that one can't change people, but is a way to make him stop behaving like a "Cowboy Coder"?
He refuses to listen to ... |
I have always found it more logic to validate input instead of filtering it. How to appropriately filter data depends on the situation, so IMO it should be done in output or when saving to a database.
But I see that some frameworks provide automatic XSS filters for incoming POST and GET data. What is the logic behind t... |
Is it possible to write an open source project that uses generated code from CodeSynthesis XSD (C++/Tree) and then link it to a third-party library that is licensed under the GPL version 3?
Some background information:
CodeSynthesis XSD is licensed under the GPL version 2 but with an extra FLOSS exception (http://www.c... |
So I read up on the ordering of your includes, and this guy suggested you include your local header first so as to make sure it doesn't have prerequisites. Ok, I get that. I'm on board. The whole compartmentalization thing is good.
But I've got this file, file.c which includes it's file.h, which declares functions to ... |
In the PEAR standards there is no reference to HTML, if its allowed or not.
http://pear.php.net/manual/en/standards.sample.php
But I see some people use HTML tags like <kbd> and stuff..
So is HTML allowed?
Will it break some doc parsers?
|
We're working on a large product which has been in production for about 5 years. The codebase is.. erm.. working. Not really well but it is working. New features are thrown into production and tested with a small QA. Bugs are fixed, etc. But no one, except me, is writing unit-tests. No one uses the power of "tracking" ... |
I'm making an iPad app that will display a few choices and based on your choice will display a series of questions with each question triggering a different set of questions. I was wondering if there was a name for this or any open-source library that someone has made for this kind of app.
If not, would it be best to h... |
I'm not trained programmer, so be gentle with my ignorance.
I'm trying to search changelog files for where an open source project dropped a feature I need. I was just wondering if there may be a good set of terms to describe this.
Bugzilla has detailed bug reporting forms. Are design changes also logged using rigorous... |
I realize the above question probably raises a few 'what??'s, but let me try to explain :
I'm trying to wrap my head on a couple of related concepts, basically the Saga-pattern ( http://www.rgoarchitects.com/Files/SOAPatterns/Saga.pdf) in combination with Event-sourcing (A DDD-concept: http://en.wikipedia.org/wiki/Doma... |
I'm implementing a machine learning structure to try and predict fraud on financial systems like banks, etc... This means that there is a lot of different data that can be used to train the model eg. card number, card holder name, amount, country, etc...
I'm having trouble deciding which structure is the best for this ... |
In my company, I'm the only developer, but we plan on expanding the team by hiring a second programmer. I know there are a lot of implications to that (especially around source control). I've Googled a lot, but haven't found a good tutorial/article on how to grow the team from one to many developers.
Do you have any r... |
Initially I started learning OOP and later started grasping concepts of Design Patterns. I wonder whether it is the Design Pattern which is the SuperSet of OOP or it is the OOP itself.
|
TL;DR
Writing good, useful tests is hard, and has a high cost in C++. Can you experienced developers share your rationale on what and when to test?
Long story
I used to do test-driven development, my whole team in fact, but it didn't work well for us. We have many tests, but they never seem to cover the cases where we ... |
we have some API which will be called either by client A, B, C or D
Current code
doSomething(String client){
if (client.equals("A")){
...
}
else if (client.equals("B")){
...
}
Proposed refactoring 1
separate into multiple methods and have each client call the dedicated method such as
doSomethingForClientA()
doSometh... |
I am successfully able to scale all my old applications which were not using documented Design Patterns. Whatever pattern it is I don't know. To a large extent, I only felt a need to use simple OOP concepts.
The Design Patterns concept is complex and hard to understand. When implemented, how to determine whether the i... |
In many languages, the substring function works like this:
substring(startIndex, endIndex)
returns the substring from startIndex until endIndex-1 (if you view startIndex and endIndex as 0-based) / from startIndex+1 to endIndex (1-based)
This is confusing. I understand that the two parameters can be interpreted as "star... |
I know that default arguments are created at the function initialisation time and not every time the function is called. See the following code:
def ook (item, lst=[]):
lst.append(item)
print 'ook', lst
def eek (item, lst=None):
if lst is None: lst = []
lst.append(item)
print 'eek', lst
max = 3
f... |
I've been working with the XMLHttpRequest object in JavaScript recently, and I couldn't help but notice that the casing of this name makes no sense. Why is 'XML' all in caps while 'Http' is not? They're both acronyms!
Surely it'd make more sense for the name to be one of the following:
XmlHttpRequest (PascalCase, be... |
I am currently writing a grammar for a programming language (PowerBuilder) and I am also collecting documentation about parsing and compilers creation.
Now I would like to add in my grammar (that looks roughly like Visual Basic) the possibility to handle embedded SQL statements that are supported inline by the languag... |
At first, hopefully following terms project and product won't be confused.
Traditionally, we used to have a code base, which usually was a main project. For our products, we created one project for each product, and these projects surly depended on main project (code base). When product was released, we created relea... |
I'm studying YAML as a replacement for XML, but I'm experiencing difficulties when dealing with elements containing free-flowing text with embedded elements. For instance, the following XML document:
<text>
This is an example text, spanning multiple lines, and it has embedded elements
like <a p="value">thi... |
I have seen this article: CSS3 Loading elements at HTML5 and CSS3 Tutorials pages.
How did someone made this calculations? what angle, how much space, how much rotation to give?
If I do it with hand, starting number one, I fear it takes too long as a process to complete.
Is there some tool, or some trick that do this ... |
I want to know what is considered better way of returning when I have if statement.
Example 1:
public bool MyFunction()
{
// Get some string for this example
string myString = GetString();
if (myString == null)
{
return false;
}
else
{
myString = "Name " + myString;
// Do somethi... |
As I'm trying to get better at designing good software I'm wondering if there are out there good (as in well written) open source software with lot of code documentation that aims to explain details about why this or that design choice was made in the context of that specific problem set. I'm interested in OOP and I do... |
When I started learning programming with the .NET framework, I started by using WinForms as a UI technology. It uses “classic” menus just like this office 2000:
A few years later Office 2007 was released, the ribbon was born:
And even some years later Office 2010 was released, which also added new features like the s... |
I'm learning Clojure to see if it's something I can leverage at my current job, and more importantly, how I can convince my bosses that Clojure has a 'killer feature' over java that makes it worth the investment1.
The feature that I'm guessing most clojure evangelists would tout is state management and concurrency.
The... |
From time to time I've encountered scenarios where several complex conditions need to be met prior to triggering an event. Furthermore, most listeners also run additional checks to determine the course of action. This got me thinking whether a better solution would be to think in terms of smaller events and let them tr... |
In c++, the * operator can be overloaded, such as with an iterator, but the arrow (->) (.*) operator does not work with classes that overload the * operator. I imagine that the preprocessor could easily replace all instances of -> with (*left).right, and that would make iterators nicer to implement. is there a practica... |
I am writing a utility that runs on RHEL5 command line. I need my command line options to be simple but powerful. I looked at the various UNIX utilities to get an idea of how simple command line utilities have to be. Do you guys suggest any documents/links that talk about command line etiquette? I am modelling my util... |
Its very interesting for me which advantages gives "global root class" approach for framework.
In simple words what reasons resulted the .NET framework was designed to have one root object class with general functionality suitable for all classes.
Nowadays we are designing new framework for internal use (the framework... |
I was going through this heavily discussed and highly voted question on SO and stumbled across one comment that got 5 upvotes.
So I assume this was a great comment.But it got my head spinning at the same time. Can any one explain this comment? The comment says:
You can't compare big-O values directly without thinking ... |
I want to split poker pot to chips.
Example:
Pot = $17.500.
I have the endless piles of chips. I have the following types of chips: ChipsTypes = [$1, $5, $10, $25, $100, $500, $1.000, $5.000, $10.000, and so on]. Index starts from 0.
I want to get an array that says which chips I have to take to divide the pot and in w... |
I am currently adding some functionality to a popular open source project. It written in C and in Every file GPL license text is embedded. The functionality I am adding is not supported by the project. So you can say its some sort of extending.
My code gets compiled when the main project is compiled. My code is inside... |
I'm designing a tiered .NET application, and I want to use the Code First approach. I'm new to this, so I'm struggling to envision how it ought to be designed. Would the following be a reasonable approach? What problems or limitations might I run into?
Write DTO classes for my domain. These will be used for data t... |
Is the ISC license suitable as a MIT or Simplified BSD license replacement?
What are the pros and cons of ISC compared to MIT or BSD?
|
My company is exploring the move from Perforce to a DVCS and we currently use lots of Perforce proxies because the software development teams are spread over Germany, China, USA and Mexico and sometimes bandwidth from one place to another is not that great.
Speaking with IT, we started looking for a way to keep things ... |
I recently encountered a situation in our codebase where a different team created a 'god class' containing around 800 methods, split across 135 files as a partial class.
I asked the other team about this. While my gut reaction was to nuke it from orbit, they insist that it's a good design, a common practice, and that ... |
My service has a large ongoing number of user events, and we would like to do things like "count occurrence of event type T since date D."
We are trying to make two basic decisions:
What to store? Storing every event vs. only storing aggregates
(Event log style) log every event and count them later, vs.
(Time-series... |
My team is currently locked into using a tool we dislike that takes the form of a Eclipse plugin and a .jar; the plugin gives us a button to quickly run a single file's code (via invoking the main .jar and passing to it the current file). We want to move to C#.net. Is there any way to get Visual Studio to replicate th... |
In PHP you can have a function take an infinite number of arguments like
/**
* Do abc...
*
* @since 1.0
* @param mixed $arg1 Arg description
* @return string Results
*/
function abc($arg1 = null){
$args = func_get_args();
// do smth with $args
}
How should I illustrate thi... |
I am creating a software package that will be useful to programmers, engineers and scientists. List price will be in the region of $1,000 -- way beyond the budget of most open-source developers, hobbyists and enthusiasts. So I am considering two things, the first generous, the second maybe a little greedy:
Offering ... |
I'm a python programmer who sees a lot of C++ code but doesn't know the language and there seems to be two ways to initalize a class. I was hoping that someone can tell me the difference.
class Point {
int x, y;
public:
int get_x();
int get_y();
Point(int, int);
}
// ok we are goin... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.