instruction stringlengths 34 19.9k |
|---|
I'm about to start working on a new commercial PHP project with a friend that will be licensed and sold as a script to run on your own shared hosting account or server.
Looking at the statistics (http://w3techs.com/technologies/details/pl-php/5/all) 50.3% of PHP 5 installations are still PHP 5.2 or lower (43.5% being ... |
I'm doing a PHP application with CodeIgniter and most of my controllers accept record ids as parameters for retrieving purposes.
I also pass record ids in my forms action.
Like this: www.sample.com/records/save/sFKu=4
Is this the right way to do this? Note that the record ids are encrypted.
|
We have an existing ERP system written in VB 6 that we are converting to .Net incrementally. Now, every module in the system is being separated into DLLs so that the product becomes customizable and flexible. I'm not sure if this is the way to do this.
I think this will cost a lot of maintenance in the future. What do ... |
Perhaps a bit of an odd question but I can't think of a way to achieve what I want.
I produce a product which ends up installed on-site at clients premises. It is a business critical and high availability application, and has to handle processes very quickly.
While obviously most of the work goes into the actual applic... |
I'm doing a lot of work with XML, our legacy XML generators use the ruby template language ERB to create the XML files. I've been experimenting with Nokogiri and the builder model of creating XML, but I seem to be able to accomplish everything I want using both methods. So, what should I be taking into account when cho... |
Let's assume the modeling of User model in a context of a social network.
User concept is composed of two notions:
Authentication elements like userName/Password/Email etc...
Extra data information sometimes called "User profile" like firstName, birthday, pictures etc..
At first glance, this analysis involves separat... |
Been trying to come up with a flow for a basic tiered web application, and have been reading conflicting information online. What I'm trying to figure out is if there is an advantage to still using DTO objects from your DAO to Service layer through the use of some sort of mapper.
The basic flow I foresee is as follo... |
Ok so I need to create a bunch of utility classes in python. Normally I would just use a simple module for this but I need to be able to inherit in order to share common code between them. The common code needs to reference the state of the module using it so simple imports wouldn't work well. I don't like singletons, ... |
I think it's generally good practice to #include the header for any types used in a CPP file, regardless of what is already included via the HPP file. So I might #include <string> in both my HPP and CPP, for example, even though I could still compile if I skipped it in the CPP. This way I don't have to worry about whet... |
I have the opportunity to rewrite a core piece of a project (C#) that is inheritance-heavy and feels increasingly restrictive in how it is designed. The scenario is pretty simple, imagine an application that is built to handle various small tasks. Every task is unique in it's functionality so it implements an ITask int... |
I have the opportunity to rewrite a core piece of a project that is inheritance-heavy and feels increasingly restrictive in how it is designed. The scenario is pretty simple, imagine an application that is built to handle various small tasks. Every task is unique in it's functionality so it implements an ITask interfac... |
When writing software I'm often forced to at some point to make a decision that involves a design pattern of "by convention" naming and behavioral patterns. This normally makes me feel kind of slimy as a .NET developer because nearly everything is statically typed (arguably even the dynamic type is statically typed, b... |
What is the best way to implement automated updates? I've gotten as far as libcurl, I imagine I need to ping the server every now and again with the current version of the software. But then what should I do? What server tech needs to respond, and how?
|
I notice that when I code I often use a pattern that calls a class method and that method will call a number of private functions in the same class to do the work. The private functions do one thing only. The code looks like this:
public void callThisMethod(MyObject myObject) {
methodA(myObject);
methodB(myObje... |
What's the best practice?
This :
for ($i = 0; $i < count($array); $i++) {
//stuff
}
Or, what I usually do :
$count = count($array);
for($i = 0; $i < $count; $i++) {
//stuff
}
Is it the same with the magic of compiler optimization?
|
Me and a small team of engineers are considering using SVN to store our electrical schematics and parts libraries; currently we just have a network folder where we put all of our files. Our company also has a separate SVN server that we have access to.
I was wondering if there was some way that we could use the SVN rep... |
What is the name of λx.λf.fx in lambda calculus?
Does the corresponding function have a standard name in functional programming languages, like Haskell?
In object oriented programming, is there a usual name for a method foo which takes a function as an argument, such that x.foo(f) returns f(x)?
|
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 unmo... |
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. ... |
Take the following examples:
public static String returnOnce() {
String resultString = null;
if (someCondition) {
resultString = "condition is true";
} else {
resultString = "condition is false";
}
return resultString;
}
public static String returnMulti() {
if (someCondition) {
... |
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 = createConcreteStrateg... |
Since I discovered the joys of AJAX, I tend to do all my requests to the server using AJAX. Is this a good idea?
According to you, what should I do in PHP and what should I do in AJAX?
I like to do my requests to the server with AJAX because I can use it as a kind of web service.
|
You can find many frameworks with an example todo list for demonstrating a small but full application in the framework. You don't have to consider large problems like scaling or caching, but you still exercise most of the fundamentals of that framework in a todo list.
Is there an analogous application for systems-leve... |
Say I want to build a website that support multiple language and use MongoDB datastore. I wonder what is a good approach to have multiple versions of the body and title of an article, one for each language.
Should I keep all versions in the same article document? Like a collection of key-value pairs of language code an... |
Basically, I'm trying to understand why layered and tiered are that different, and why they don't translate easily to each other.
I understand that layered could be 3 separate class files for UI, BL and DAL. Whereas tiered can be a Project for the UI, which links to a BL project which links to a DAL like entity frame... |
I'm releasing an open-source jQuery plug-in that is free to use, modify and redistribute as long as you don't directly or indirectly charge your customers. Your software doesn't need to be open-source, it just need to be free. If you charge your customers, you need a commercial license.
I'm not sure about the licensing... |
I want to use the MorphAdorner library available free for commercial use. But it uses several other libraries that restrict commercial use (like Gate etc). Can I use this library in my application?
|
I am working on a software project in my college.
And I want to make it open source. But I want that people to only contribute to the project.
I don't want that they should also release a project using my source with some modifications.
So what will be the best Licence to use with my project ?
|
In our webapplication we have a list of questions that have to be answered by the user. These questions are served to the user one by one and will be saved once the last question has been answered.
The problem we faced was saving all the 'help'-data that goes with this: storing the index of the last question, returning... |
Are there any languages that support foreach over multiple lists at once? Something like this:
foreach (string a in names, string b in places, string c in colors) {
// do stuff with a, b, c
}
Sure, this can be done with a regular for loop:
for (int n = 0; n<max, n++) {
a = names[n]; b = places[n]; c = ... |
I'm writing a module that runs a finite state machine* based on the contents of an array of records passed in at initialization. Each record describes a state and includes instructions on how to act on inputs (i.e., when in state S1, input I triggers a transition to state S2). For the FSM to work correctly, the trans... |
From the book Think Like a Programmer (emphasis mine)
The Luhn formula is a widely used system for validating identification numbers. Using the original number, double the value of every other digit. Then add the values of the individual digits together (if a doubled value now has two digits, add the digits individual... |
In Fred Brook's Mythical Man Month chapter 4 (Aristocracy, Democracy, and System Design) page 49, he says:
As Blaauw points out, the total creative effort involves three distinct phase: architecture, implementation, and realization ...
implementer has plenty to do ... designing module boundaries, table structures, pa... |
I've recently had a little disagreement with fellow developers. We're transforming various ontologies from the original source format (Pica+, RDF, etc) into our data format and have several converters dedicated to exactly this task. The argument came whether or not we should use the full ontology-data file, or create a... |
I started my career as a .NET developer 3 months ago and after a long training plan on diverse technologies, patterns and concepts the developers who were supervising me have decided that I am ready to join one of the many projects the company handles.
I am very excited to finally be able to start coding. The team I ha... |
Before starting on a current project I was wondering if there is a terminology for what I am planning on doing? Basically what I want to do is map out every object in layers such as all the controllers and what they'll be called, the methods that will exist under the controllers and their purpose; Including, the models... |
I am planning to implement the Websocket protocol and currently learning how handshake headers must be structured.
According to this link
http://datatracker.ietf.org/doc/rfc6455/?include_text=1
To prove that the handshake was received, the server has to take two
pieces of information and combine them to form a resp... |
I am currently develop a website application in codeigniter, and I'd like to do something in PHP / CodeIgniter where I can make a common template for separate sections of the website. I was thinking that I would keep the header / footer in a separate php files & include them separately.
The thing I'm not sure about is... |
I'm going to try to make this as concise and concrete as possible, but apologies since I can think of multiple ways to make it work. This question might also relate to handling production workflows or manufacturing, but I have no experience in these areas.
I have a problem where I need to move an Object, O, from diffe... |
I program in C mostly. However, it is pretty obvious that many more commercial applications are done in C++.
As far as I can tell, C++ is a very complex language, with seemingly convoluted syntax and too many constructs. C++ also encourages the abuse of Objects where structs and functions will do. In fact, the only sig... |
It's fairly obvious that OOP is viewed as a sort of silver bullet of programming today. In any computer science course, the merits of OOP are heralded.
I would like to know why people like OOP. To be honest, combining procedures, types, and data structures into a single conglomerate seems bad to me. I'd much rather vie... |
I have a website where users are directed to go through a sequence of pages to perform a sequence of work tasks (transcribe a paragraph, answer a survey, interact with another user, etc). For short, let's call these tasks A, B, C, etc. I'm using Django, and each task is currently implemented as a view function (or meth... |
I am trying to write unit tests in javascript for an application made in nodejs. What I want to know is -
Say there is a class Vehicles which is dependent on another class Roads.
Should I mock the Roads class and send it as a parameter to Vehicles for unit testing?
OR Should I just create a new object and send it as ... |
In our project we work in a zero-bug (a.k.a zero-defect) methodology. The basic idea is that bugs are always higher in priority than features. If you're working on a story and it has a bug it must be resolved in order for the story to get accepted. If a bug is found during the sprint for an older story we need to put i... |
When User A decides he want to pay a visit to http://example.com/ it all begins with a Request. A short moment later he is given a Response. In this cycle Request-Response a lot is going on, in different frameworks it's decoupled in different components among them Routing, Dispatching, etc.
I'm looking to make a simple... |
I am going to make a website for a client that wants to be able to alter the site about every week (changing pictures and textual information mostly). It is for a restaurant and so the client wants to alter the menu and images on an almost weekly basis. I've always made my websites and web apps from a framework or from... |
I have a simple MVC project. My current packages:
gui
controller
db
domain
I want to put extra classes which I will use, e.g. md5 hashing, email validator (methods which I will use in more than one class). Where do I put them? I will probably not use them in only one package, but in two or three (not in model for ... |
I need some advice on how to structure our projects in Git. We use Java and Maven is our build tool. Maven kinda assumes all of your projects have a common ancestor eventually. Maven can also be a real drama queen when things aren't setup exactly the way the Apache foundation sets up their projects (anyone using the re... |
I am just moving into freelancing (my primary sector will be web design / web development). I've got a few projects for friends as well as one or two 'professional' projects in the pipeline. I would like to know what are some of the most important things you need to hear from your client before you start the process of... |
My friend and I are working on an application that already works for Windows 8 and is written in Javascript, HTML, and CSS. Our desire is to make it cross platform for areas like windows mobile, chrome, firefox, and android.
So, our directory structure looks like this:
.
├SomeApp.sln // Visual Studio solutio... |
I am considering learning Go. As far as I know about it, it's a systems language geared toward parallel programming. (correct me if I'm wrong)
Should I have a very good understanding of C in order to be good Go programmer?
How much systems concepts (*nix OS concepts) I need to master before delving into Go
What other ... |
It is said that programmers should prefer composition over inheritance.
I was wondering if RTTI can be achieved as easily using composition.
|
I'm developing an enterprise website, and I have to define some sections like this:
I have many sections and each section have many (or one) sub-pages.
The number of sub-pages vary per section.
Each sub-page should not be longer than 2500 characters
Also, I have to use a relational database (MySQL).
I'm in doubt whi... |
I'm a PHP programmer and I've done any projects based on PHP and MySQL without using any framework so far.
Now I'm going to create a big link sharing system (excel-able,modular,fast,theme based,secure etc.). But I have no experience to use any frameworks before. I need to know which is better to me.Choose a framework (... |
For the past week I have been attempting to write a proof-of-concept project using dependency injection, a service layer, unit of work pattern + repository.
I am looking to design something that can easily be consumed by any type of application - be it a Windows desktop application, a CLI application, an ASP.NET MVC ap... |
I have an application that has about a dozen reports that provide totals and summaries of data in the database based on date ranges given as parameters. The application is near the end of user testing. The end-users are saying that the numbers in the totals don't match what they expect based on test data they have ente... |
I am interested in knowing how to deal with a current software development process that has not been changed for years and will eventually lead to product and team failure. Yes, probably the easier way to solve this is changing jobs, but with this economy is easier said than done. However, if you have specific examples... |
I'm current working on a command line app that will grab resources online for you when you're setting up a new project locally. Right now all the urls for the resources I need are hardcoded into the application and adding new targets require updating the software.
What are the benefits of hosting a database remotely th... |
In a typical (well-designed) MVC web app, the database is not aware of the model code, the model code is not aware of the controller code, and the controller code is not aware of the view code. (I imagine you could even start as far down as the hardware, or perhaps even further, and the pattern might be the same.)
Goin... |
I am trying to develop a series of unit tests for a production system that are dependent on a person's social security number. While I am more than comfortable hard coding a clearly bad social security number to test for failure, I'm uneasy about including one that is good for proper (and passing) results. The followin... |
I have a problem with a ranking system I am using.
Scenario:
An online game with around 10k players calculates a real time ranking of points when a certain event occurs. Events don't occur that often, around 1 time per minute. This ranking is kept in the cache for quick calculations, sorting and access.
Now players can... |
It is little depressive, but it seems to me that there is much more support for manipulating ugly proprietary closed format like xls in rails (and ruby) in general that to documented open Open Document format. Why it is so? (I know it is kind of philosiophical, but I just do not get the fact, that the opensource is not... |
What's the recommended way to serialize dependent objects, especially when objects are being freshly constructed (to avoid malicious byte streams, or whatever)? For example....
After creating a (genericized, but setup through Spring for my company) fiscal calendar based on JodaTime, I'm creating the next version based... |
I'm building a big website, and using the normal old mysql_query method for transactions and communications with the database, and everything i going fine, including security. I'm a little bit confused, should I switch to the new PDO interface? cause I learnt that's safer, or keep using the old mysql_query() and mysql_... |
I'm a web developer, but lately I have been learning Clojure and now I'm interested in creating a p2p application. And since Clojure is a general purpose language, I guess I can just use that.
Any suggestions?
|
I'm trying to implement the paper titled An Image Signature for any Kind of Image, but I'm having trouble understanding what they mean in this paragraph:
For each column of
the image, we compute the sum of absolute values of differences between adjacent pixels in that column. We compute
the total of all columns, a... |
i ve just tried to do coding bat exercise. There are posted solutions to the problem i tried to solve.
However, I was stubborn, i ignored them and tried to code it up my own way(basically reinventing my own wheel - square,bad working wheel).
After 4 hours it looks nasty and fails some tests.
Now i realize that my log... |
I have a large application in Java filled with independent classes which are unified in a PlayerCharacter class. The class is intended to hold a character's data for a game called the Burning Wheel, and as a result, is unusually complex. The data in the class needs to have computations controlled by the UI, but needs t... |
So far I've been using IPB and my custom scripts all coded in PHP but I am really disappointed of the long term performance of it.
I would like to move to native coding, the learning time to put into doesn't matter at all.
Ive found CppCMS and it seems to be the exact solution i was searching for.
I would like to know ... |
Sometimes action functions in the controller class can become huge and nasty, with many-many lines of code to simply control the flow of data from the Model to the View. At some point these huge functions completely lose track of the basic principles of good code, i.e. only doing one thing, being small, readable and ma... |
I'm a contractor at a large Telco where I'm usually working on several different projects at once.
The VCSs I use (mainly git and mercurial) tend to make me keep the code bases for unrelated projects in separate repositories, and I realise many benefits of this approach.
However, there are many little bits of utili... |
At our work place after hours of coding, testing and QA we have successfully added a couple of software tools in our product line. We specialize in web based software solutions so in order to tap on more users we are now considering putting our developed solutions online for hosting and providing online access to all o... |
We are working on scrum framework. Now a situation arise that we have to shuffle 2-3 scrum team members in between sprints.
Is it possible to shuffle sprint team members in between a sprint? What are the potential drawbacks of doing this?
|
I am working on developing range of web based software solutions. But the problem is that for some clients we need to deploy the applications in their local intranet. In such a situation I have to stick with Java as development language as I cannot give away the source code of the project.
Now in order to tap on more c... |
We got some code in a git repository that's used along different projects (with git different repositories), the problem is that we got now so many different projects that's difficult to track which projects will be affected and how when there is a change in the shared module.
Is there any way to find classes and meth... |
I am considering the options for designing a system in java which accepts data files from different systems applies some transformations to the data, concats data from multiple files to produce some output data files for the downstream systems. The data transformations are not per record transformation, e.g. I need to ... |
I've been working on writing .NET bindings for Rollbar, an error and message reporting service, like Airbrake. My library is working nicely and is published in the NuGet gallery.
So now I want to take it to the next level of usability and implement an NLog Extension for this. This entails writing one screen's-worth of ... |
I have been in an ongoing conversation concerning a project we are about to undertake at my place at work. The project concerns data integration. Our customers want to be able to integrate our data with theirs, either by sending data from their systems into ours, or by getting data from our system into theirs. I don... |
I am developing a graph-editor that uses drag and drop to build hierarchical graphs (containing nodes and links). Each node in the graph should be linked to a table in our database (SQL Server). I did a lot of research about libraries based on javascript or/and JSON specifications to draw nodes and links. There are a l... |
Someone proposed to me this pattern which I have never heard of before and can't find any information on it.
The basic idea is, when building a library for other developers to use; if the developer includes my library along with a 3rd party library the behavior of the API calls to my library changes.
An example:
I... |
I'm in the planning stage of making a code beautifier (similar to AStyle or Uncrustify) - originally I was going to just contribute to one of those projects,
but reviewing their source led me to the conclusion that I have different design goals and that their source is written in a way that makes it difficult for an ou... |
I have an idea in mind and would like to know if that's the way to go for my end application.
Think of my application as a social networking system in which I want to implement chat functionality. For that, I'd like to push data from the server to the client. I have heard I could use Node.js for that.
In the meanwhile... |
Eric Evan's DDD book, Cargo Shipping Example, pg. 168:
Location
Two places with the same name are not the same. Latitude and longitude
could provide a unique key, but probably not a very practical one,
since those measurements are not of interest to most purposes of this
system and they would be fairly complicat... |
At our company we typically make sure that we write an end-to-end test for our websites/web apps. That means we access a URL, fill in a form, submit the form to another URL and check the results of the page. We do this to test form validation, test that the HTML templates have the correct context variables, etc.
We als... |
Many languages like C++, C#, and Java allow you to create objects that represent simple types like integer or float. Using a class interface you can override operators and perform logic like checking if a value exceeds a business rule of 100.
I'm wondering if it's possible in some languages to define these rules as ann... |
I'm reading some Pascal code and everything is pretty straightforward except subranges. In the program I'm reading there's a variable d with the following type declaration:array[0..22] of 0..15; there's then the following procedure:
var a:integer;
begin
a:=0;
while k>0 do
begin
k:=k-1;
a:=(a+dig[k]... |
When I click on button, might be in windows apps, web apps, etc it has some animation to actually see it clicked and event is raised in background. I've knowledge of events and its attaching to button click events but I wanted to know how this mechanism works. I always assumed it is inbuilt in operating systems.
|
I'm putting much work in my program and after it's done I want to just setup a small website and sell each copy of the program but I don't want any legal issues.
Do I have to look for another library or can I "safely" link to it?
|
This question is asked in regards to gstreamer but it could apply to any add-on based architecture.
I have a Gstreamer based application that can ship as proprietary because I use unmodified Gstreamer in it with all LGPL parts. I may, however, also need to issue a version where one Gstreamer plugin is GPL. As far as ... |
I've been researching GDI a little and on some websites I'm lead to believe it can hardly draw a few boxes, while on others it can easily be used in an interactive charting application.
So I'm wondering what is used in applications like Excel where there can be a lot movement like scrolling through a large amount of da... |
Why is it that diff programs work on a line-by-line basis instead of a hierarchal one?
All code can be expressed in a hierarchy, even though it's not immediately apparent.
Most of the data we work with is hierarchal as well.
What are the potential issues with building a piece of software that can diff based on hiera... |
This is a generic question that I've always wondered.
In general, is it intensive for a CPU to create threads that perform "while not true ..." loops or similar?
For example, suppose I do:
// pseudo-code
new Thread(function() {
while (!useHasDoneSomething) {
// do nothing...
}
alert("you did somethi... |
I'm at the very start of a longtime running project with continual development. Because of that I'm hoping to make a good decision in which Framework will be right for this.
Previously I've worked with Codeigniter. A plusside is the huge community with a great User Guide. A few of the downsides are the backwards compat... |
I've taught myself a set of scripting and programming languages and right now I am very pleased with C#, I am the type of person that learns best by doing it and while I am able to create pretty much any kinda of application, my coding and skills are not as good as I wish.
How could I evaluate my skills and see what I ... |
Where is unsigned char used in C ( please tell about some real-world examples )? Why would we need both char and unsigned char?
Char ranges from -127 to 128 ( 8-bit integer )
Unsigned Char ranges from 0 to 255 ( 8-bit integer )
If the purpose is to store ASCII, why would we need both?
Another question.
Consider this:
c... |
Looking at some camera metadata on Windows File Properties there are (along with a few more) two Properties named Focal length and 35mm focal length.
I'm developing software that will make use of these two Properties. So far I have created a Property named FocalLength for the first, but I cannot seem to find a proper n... |
In several places Feature Driven Development (FDD) is called an Agile methodogoly - e.g. the Wikipedia entry on FDD.
Yet in general, to be considered FDD it seems the following requirements have to be satisfied:
Coloured UML has to be used (but documentation isn't necessary);
Instead of pair programming the team is d... |
If you are designing a function which should conver a string to an integer, how would you convert an empty string? The question is only about this one particular input value (empty string).
Between throwing an ExcStringIsEmpty exception and converting to 0 options I prefer the first. It seems more logical to me. Becaus... |
Let's say we have 3 cyclic sequences, each of them of length n and containing every number from the interval 1..n once.
The goal is to align the sequences in order to maximize the number of matches between the sequences. By a match I mean a column that contains 3 identical values. Since the sequences are cyclical, we ... |
I'm a beginning programmer, that for various reasons is using an existing Ruby codebase to learn to program. My goal is to be able to understand and eventually extend this codebase. However, I find it hard to understand what is a standard library function, a gem function, or a user-created function. Distinguishing betw... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.