instruction stringlengths 34 19.9k |
|---|
I am newly learning C Programming.
When we have a C Program with lot of functions, parameter passing, calling and all - It becomes a great problem as to which variable must be declared where.
My question is: If I declare all the variables (or atleast the variables that are confusing me) as Global Variables - my proble... |
I have created a small C# project to help me learn how to write good unit tests. I know that one important rule of unit testing is to test the smallest 'unit' of code possible so that if it fails you know exactly what part of the code needs to fixed. I need help with the following before I continue to implement more un... |
I'm reading "Professional Team Foundation Server 2010" by Wrox, and in an advantages/disadvantages list, the said:
"Like CVS, SVN makes use of .svn directories inside the source folders to store state of the local working copy, and to allow synchronization with the server. However, it can have the affect of polluting t... |
I'm new to unit testing and I need some help with the following.
I have created a small project to help me learn how to make Unit Tests. The functionality for one of the forms in my application deletes a user from the User table (and other rows in mapping tables).
Currently, the unit test I have created to test this s... |
I need to perform large amounts of computations on data storerd in a busy Microsoft SQL server. Would it be faster if I retrieve the data from the server, perform the computations locally in C++, and possibly later update the tables on the server, all through an API?
Many thanks.
|
A good example of someone who fits that description might be a project manager.
I was asked by my boss the other day, "what this Github thing is and why it's important?" He has some proprietary projects so he would need private hosting and I found myself struggling to explain beyond the usual: VCSs make collaboration ... |
We are starting a project where we will need to write parsers for a bunch of binary file formats, each of them representing very similar data (time-value series from different measurement devices).
Since we are starting from scratch, I would like to get it right, and I see two possible approaches:
write dedicated, hom... |
I have something that works like a fixed size list - it's actually called FixedSizeStack<T> in my program. I will use it to represent the X last occured events. This event list will then be examined by different observers, and if they detect patterns they will trigger some action.
Naturally, I see no reason for them to... |
I have to perform 3 tasks:
an insert, a delete, and a write
I'm not sure what the best way to do this is. My mainframe program design skills aren't too tight, so I was looking for advice.
Could I avoid doing a COBOL program for this?
The way I see it, I just need JCL that executes SQL statements. If I design my stateme... |
What's the best way to optimize a Rails app where you need to pull info from the database for a collection of items?
For example, if I am building an online forum system... I would have a number of Posts and the posts would have_many :recommendations and :comments and :favorites. When I display the posts in my view, I ... |
What are some examples of good class structures used to manage database access? I am a fan of class encapsulation and would prefer the containers (e.g. car) not to perform database tasks.
I would also like the ability to easily drop in things like a database cache in future.
I often take the pattern of container classe... |
I'm having a bit of a design dilemma here. I'm writing a library that consists of a bunch of template classes that are designed to be used as a base for creating content. For example:
public class Template
{
public string Name {get; set;}
public string Description {get; set;}
public string Attribute1 {get; ... |
I have a job as an intern at a technology company, I was given the unfortunate job of performing some data entry into our web management system. The information entered into the web form is stored in a MySQL DB. Upon receiving the data I realized I would have to submit this online form about 1000 different times all co... |
How do I separate words in a string?
In the following I have a random sample of words in a string extracted from text file with over a million words.
Here's the string:
"intervene Pockets Jerusalemand tissues powerful days gadgets rate invention heated Stewartis find communal working lots internal They caused noise of... |
I've used both Liferay and Alfresco trying to use them as the Document Management System for an intranet.
I noticed the following:
They use the file system and the database to store files
They use a GUID to name the file on the filesystem and that GUID is
used as an Id in the database.
The GUID-named file is a binary ... |
I have a c++/cli tcp client application sending a data in a specific format like L,20100930033425093,-5.929958,13.164021
to a main application on port 9000.The main application is actually done by the other vendor and I dont have the source code for that.
Now,I can communicate to the desired application using the IP an... |
We have the following scenario:
Changeset #1 is some unfinished buildable checkin
Changeset #2 is a completed small task
..
Changset #5 completes the work done at CS#1
They all affect the same output dll.
How do we deploy changes done at CS#2 without the other work? Also how can we avoid this situation happening again... |
I'm very new to GIT/GitHub (as new as starting yesterday). I would like to know what is the best way to manage multiple people working on the same project with Github. Currently I'm managing one project with four developers.
How do I go about the workflow and making sure everything is in sync?
(Note: All developers wi... |
I'm looking to develop a one page app, and will likely be using node.js for my server side coding.
I'm trying to get some advice regards the client-side coding. While i realise that something like backbone.js would really help me, since im very new to development the learning curve is very high for me.
So i'm going to ... |
As a long time PHP developer, I am now starting to explore the Python world.
I have narrowed the choice of framework down to Django and Pyramid, probably no big surprise there. I have played a bit both both frameworks.
I really like Djangos admin, and the fact that everything is already integrated. My concern with Djan... |
I have very little knowledge in application security. I have often seen to protect your application from csrf attacks developers use tokens and pass these tokens with request to validate. I want to know if i just validate the request is coming from my server and rejects all requests coming from any other server how can... |
I'm a junior C# developer, I learned at home and now I got my first job :)
I want to buy these books. But what is the correct order to read these books?
Code Complete: A Practical Handbook of Software Construction
Clean Code: A Handbook of Agile Software Craftsmanship
Pragmatic Programmer
|
I've been having a discussion lately with some colleagues about the best way to approach a new project, and thought it'd be interesting to get some external thoughts thrown into the mix.
Basically, we're redeveloping a fairly large site (written in PHP) and have differing opinions on how the platform should be setup.
R... |
In CSS, what is the difference between visibility:hidden and visibility:collapse
They are given to be separate in W3Schools, but I see no difference in their output.
I have tried it in Google Crome.
|
I have this idea for a database: it would hold everything I "need to remember", and allow future coding projects to access the information. These future projects include a day-planner and historical analysis of what I've been up to.
The things I need to remember break down in to two main categories: Events and Tasks. ... |
When I (re-)build large systems on a desktop/laptop computer, I tell make to use more than one thread to speed up the compilation speed, like this:
$ make -j$[ $K * $C ]
Where $C is supposed to indicate the number of cores (which we can assume to be a number with one digit) the machine has, while $K is something I var... |
Given that mobile app analytics reporting can cost a customer data traffic that, unlike a web app, use of the mobile app may otherwise not require, should a mobile app provide a user accessible setting to allow customers to opt out of app analytics collection or reporting?
If and where should a customer be notified tha... |
Persistence Ignorance is an application of single responsibility principle, which in practice means that Domain Objects (DO) shouldn't contain code related to persistence, instead they should only contain domain logic.
a) I assume this means that the code which contacts lower layers ( ie persistence layers ) lives out... |
Here's what is given:
public interface Request {}
// there are 20 subclasses of Request
public class CreateUserRequest implements Request {
@NotEmpty
public String userName;
}
// request processor is a thing that aimed to process requests
public interface RequestProcessor<TRequest extends Request> {
boolean pro... |
I'm building some software for OS X that isn't distributed through the Mac App Store. My software allows users to download different modules uploaded by various people too.
How can I create a software patcher to patch my software, as well as update modules that users might be uploading when necessary? I've looked a bit... |
I'm developing a simple website for a client.
I have read about phpDocumentor and DocBlocks, and I thought that documenting my classes and functions will be very useful.
I'm almost sure I will not generate any documentation for the site, since it's a pretty simple website, and guess what? It doesn't have an API...
But ... |
The scenario:
A system needs to produce a variety of artifacts to present to end-users during the normal course of business. Examples of these artifacts would be permits, invoices, or receipts -- imagine any online app that gives you one of those "print this page for your records" pages. I'm working on a system that ... |
In my childhood I used to program on an MK-61 Soviet calculator. It had four operating registers (X, Y, Z, T) and 15 storage registers. A program could have 105 steps.
As I recall it, it had commands like:
Swap X and Y registers
Shift registers (Z to T, Y to Z, X to Y)
Copy from storage register (1..15) to X
Copy from... |
My goal is to check commit data that don't meet certain requirements and then reject either the commit being created or pushed to the remote repository.
The problem of doing a pre-commit hook is that it's hard to deploy to many people who have to manually update their pre-commit hook file. As well, Git does not allow y... |
So I found this very interesting library in Google Code site. It turns out it is advertised as "LGPL", which is good enough for me. However, in the README file of the library the author contradicts himself saying it is not available for commercial purposes.
I'm guessing that when you sign up to create your project in G... |
When drawing up a backlog, I have several requirements that apply to a great many user stories, i.e. aspects of the application like error handling and feedback. How do I include these (without using an #include directive in each user story )? Should I treat error presentation as a feature, then have user stories for t... |
I am building an API platform.
I have already ensured that the platform always returns JSON responses.
My question is
Should my API platform enforce the rule that all requests must be JSON?
What are the benefits of making all requests to be JSON?
I understand the benefits of making all responses to be JSON as this me... |
I am a C++ coder by tradition. Over the last 12 months or so I have been doing a lot of C# coding, and have been pleasantly surprised by C#'s pragmatic approach (once I stopped trying to code it as if it was "C++ with garbage collection").
We have recently had some graduates in and when helping one of them I realised ... |
I'm developing a Roleplaying character viewer/manager programme for a locap LARP system. The Characters have access to skills that are layed out in a tree-like structure. There are a lot of skills, and potentially a lot per character.
I know I can just import the Java swing library to get access to a tree, but I feel l... |
I know that Senior Developer doesn't use only one language and only one platform or IDE.
Can you advise how to mix different styles of programming to make efficient code?
For example, best mixing is Perl + Objective-C.
$ObjectiveCLongNameOfVariablesAndMethods are worst for Perl-style, but good for iOS-team.
[self meth... |
When the company I work in hired new managers, they offered us to overview someone's code on every meeting. We have meetings every two weeks, so each time one of developers was to show his/her code on the projector, and others were going to discuss it.
I thought this would be great: each developer would be more careful... |
I am learning LINQ to SQL (and planning to learn Entity Framework). Initially I used a abstraction layer to convert LINQ to SQL entities into a domain objects. Later I discovered the “Inheritance Mapping” option and removed the abstraction layer and started to use ORM entities directly as domain objects.
After some t... |
I have been working with Silverlight 5 application for a while. I liked this technology and I was captivated to the point to get certified in Silverligt development.
However, Html5 gained momentum this point, a new wave of thinking about new applications. Now, i am considering whether to develop in Sl or html5.
I have... |
Is it better to check for allowed domain values on the frond end or let the database engine handle the domain integrity. For example If you have a data entry form for employee, is it better to check for allowed values on the data entry form before submitting the data to the database assuming network IO is not a big iss... |
Part of one of my applications has contracts and contract_types tables, wherein a type may have many contracts but a contract may only be of one type. Now a new wrinkle has been introduced: a contract may change type over time (although it can, thankfully, still only be of one type at any one time).
The simplest soluti... |
I wonder is it possible or is there a tool to generate annotated POJOs from a table.To make it clear,for example,Person table has fields like ,id,name,surname etc and i wanna to generate a POJO named Person with mappings made with annotations.
|
I knew double or float value can be not only normal value(-1.3, 0, 1.0, 2.3) but also NAN and INFINITY in Objective-C.
Is there other special values except for NAN and INFINITY for double/float value in Objective-C?
|
I have been programming in higher level languages (Python, C#, VBA, VB.NET) for around 10 years and I have completely zero understanding on what's going on, "under the hood."
I am wondering what are the benefits of learning assembly, and how will it aid me as a programmer? Can you please provide me with a resource that... |
Background: Currently an intern at a company and working on repurposing older programs (still in use, but for different departments) for use in testing new hardware. The new hardware is different in terms of register layout and firmware interface from the older iterations of hardware. I have been given free reign on ho... |
Is there anything that can be done for a single general purpose application to affect the power consumption of the device it is running on?
I am not familiar with how optimizations to individual applications may affect power consumption in a general way, can someone explain if different approaches to writing applicatio... |
I have an embedded database (SQLite), it stores information about events and page views, its purpose is to track the user journey inside my application. I need to provide support for optional custom properties on my events and page views.
In code this is not a problem, however I am torn between two solutions for stori... |
I have been using an agile methodology (SCRUM) for about three years now and I see certain advantages to it, especially in the short-term feedback at many levels (from customers having early access to implemented features, from testers that can test features as soon as they are implemented, from other developers that c... |
I'm facing problem in gsoap , if two user go to register
at a same time then database is
locked, i think its threading problem ,
how to handle it, please insist me. I am running multiple threads in background. every 5 seconds sending data to server.
|
I was reading Agile Manifesto Principles. Everything seems clear and reasonable except for one point:
Simplicity--the art of maximizing the amount of work not done--is
essential.
I dont understand this. Does this mean that the work that wasn't done should be somehow exaggerated? If so, it doesn't really make sence... |
I've been working on software to modify a game's resource files, and I'm planning on releasing it in open source. I'm perfectly fine with releasing my code under gpl v3. However, I'm afraid that that would deter others from writing extensions for my software, as I have had others offer to do so - the community which ... |
Ok, I understand the normal conventions of using verbs with functions and nouns with classes. What about interfaces? Is there any methodology when coming up with interface names that may not be that obvious?
Just to make it clear, I'm not talking about whether to put an "I" in front of the name or if to use camelCase o... |
Hi and thanks for looking!
Background
I have a project wherein I need to abstract meaning from a passage of text to determine what the text is seeking and then match that text to a list of search results.
Now, I have some context with this and the following scenario is very close, but doesn't violate my NDA with the cl... |
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?
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.