instruction stringlengths 34 19.9k |
|---|
So I'm not sure if this is really the right place to ask or even the right question but I want to give it a try.
Requirements:
We should have a database & webservice (or something similar) which runs in OUR office, clients cann access the application via the internet ("wohooo").
Clients must be able to create orders in... |
If we assume we have this little snippet of code:
string str = "checked";
bool test1;
if (str == "checked")
{
test1 = true;
}
else
{
test1 = false;
}
Is it bad practice to change a simple statement like this to the following?:
bool test2 = (str == "checked");
Because they work exactly the same, and work as r... |
Sue is designing a JavaScript library, Magician.js. Its linchpin is a function which pulls a Rabbit out of the argument passed.
She knows its users may want to pull a rabbit out of a String, a Number, a Function, perhaps even a HTMLElement. With that in mind, she could design her API like so:
The strict interface
Magic... |
Most of my work is creating websites in Django (a Python web framework) and deploying them to my own or clients' servers. I work from a virtualenv to separate site from system packages and have perhaps 60-80 packages installed in there and that lot is shared between two-dozen sites.
This obvious limitation to this app... |
Is it possible to build an operating system that contains some Turing complete compiler (language?) but is unable to run any malware? Or is there any definition for a malware?
This question popped on my mind as I was wondering why Windows has more malware than Linux. If Linux contains a C programming language and its c... |
I'm trying to figure it out some nice workflow for our company, and we have so far the main repository on the github's organization account and we all, the members of the team working on the branches of that repo.
Could you please mention some advantages on forking the repo or some use, by the members of the organizat... |
We've been using Git as our version control but as the team grows, there are more and more pains when it comes to getting all our changes onto a single branch ready for a deployment.
I'm wondering if maybe we're outgrowing Git as an effective collaboration tool. I know there are large OSS projects with many developer... |
I've inherited a hosted system (system "A") which can be used to manage products, inventory, and orders, and can send those products to various third-parties.
Quite simply, system "A" doesn't work. The product and inventory systems are slow, convoluted, and buggy. The third-party integration doesn't work at all. The co... |
As Semantic Versioning (and common sense) declares - the major version is incremented in case if non backward compatible change is introduced.
Now let's assume we have a project called Project that has a current version 1.0.42 and a library Lib it depends on that is of a 2.1.3 version at the moment.
Does that mean that... |
Mocking frameworks are useful for creating mock objects that isolate the code under test from its surrounding software environment. Some mocking frameworks cannot mock non-virtual methods, so they require that you create an Interface for each class, if you don't want to make the methods virtual.
How do you distingui... |
The amount of servers and the complexity of our application is growing and we now have servers in different regions (hosted on AWS). Certain database operations require low latency so we have stuck a database in each region (which is basically a user cache) to keep the network latency low. The way the application ser... |
I can easily follow the Semantic Versioning recommendations if I develop a library or API, but what if the developed product is a website or a desktop application?
When would you increment a major component in that case?
In case of a complete UI redesign? Or something else?
Thoughts?
|
After 2 years, I'm still struggling with MVVM as a practical method of producing working software. In some cases it's great. I did a multithreaded application that controlled a small assembly line that would have been a nightmere without MVVM concepts. An abstraction from the physical assembly line was almost a no b... |
New with Mongodb, and I'm not sure what implications or benefits there are between the use of an array vs an object.
So..
As above what are the implications and benefits between the use of arrays and objects?
For example my case. The idea is to store a document with a "capture" time, and a 2000 slots of "packet" count... |
I have a MVC which has this structure:
ui
controller
db
model
Basically the controller doesn't really do much more than connection ui with db layer.
Do I need to provide JUnit tests for the controller (if the program's point matters, it's my semester project)?
Would that help me somehow as there isn't much code - I b... |
I am currently thinking of the following branching strategy
Main branch
Development branch
Feature branch
Release branch
Basically the whole idea is to have a release branch so that hot fix can be applied quickly for specific release.
Here is the issue what if I have an urgent feature that I need to do for a specif... |
Please can you answer a couple of questions based on the code below (excludes the try/catch blocks), which transforms input XML and XSL files into an output XSL-FO file:
File xslFile = new File("inXslFile.xsl");
File xmlFile = new File("sourceXmlFile.xml");
TransformerFactory tFactory = TransformerFactory.newInstance()... |
When forming opinions, it is a good practice to follow scholastic tradition - think as hard as you can against the opinion you hold and try to find counter-arguments.
However, no matter how hard I try, I just cannot find reasonable arguments in favor of antivirus (and related security measures) on development machines.... |
I'm have been doing some research into making code more testable and modular, but after reading alot about AMD based JavaScript, it doesn't appear to fit the needs of a static website. Is this assumption correct? Is AMD based development geared more toward highly interactive web applications that simple websites?
|
For what I know, encapsulation is useful because:
if you use directly an attribute and change its type in a static typed language you have to change all the code that uses the class. On the contrary, if you have declared getters and setters for that attribute you have not to do this
it hides the internal functioning o... |
I have a service where users can upload/download/replace/delete files. These files have about a dozen attributes that are saved to a SQL Database. Periodicaly throughout their session they will have to download a summary (FileName, size0in-KB, and ID) of a subset of files.
When working in the service it creates an obje... |
I'm currently working on a client's project that involves programming in multiple languages. It has gotten to the point where the amount of source code for each language has grown to such a large volume that it's difficult to navigate. Especially when returning to that code base after an extensive break working on othe... |
Technically not my first, but my new client wants to enter into negotiations regarding the cost of a website.
It's fairly straight-forward, it's a little bit more than a portfolio page, and I should be able to finish it without much complications.
However, I don't know how to make an estimate to enter negotiations. O... |
I have two git branches with almost the same code, but some minor changes in order to support different platforms.
I need to maintain these changes because I need them to run the software on different computers. So there is no master and development branch, both are equally important.
Nevertheless, I need to "synchro... |
We want to be able to offer users of our software the facility of having a miscellaneous folder for each of their clients.
All these client folders would be stored together in another folder called 'miscellaneous data' for example
It would be accessible via an icon in the client record window in our software and would... |
I do Entity Framework stuff using repository patterns that are passed to the controller to than be called by the client using jquery AJAX.. Is there any basic rules on in what format I should be passing around these lists? Within the server code I suppose I could just pass around an Iqueryable? yes? And to the client... |
I started out with a script that was a few hundred lines. Later, I realized I wanted another script that would require much of the same code. I decided to wrap certain areas of the original script that would be shared, into definitions. When I was deciding exactly what should be in a function, I came across various thi... |
I'm in the beginning of creating a website that uses Google Datastore to store information related to clients and I'm curious if the record is too deep for NoSQL or if I'm fine.
Essentially I'll be storing details about clients at a fitness business that get's fairly detailed.
A completely made up record example could ... |
Statistically speaking, user story maybe the most popular requirement technique in Agile but I am curious to know the alternatives and why.
|
I would be interested in formally defining (and consequently demonstrating) a "type system" for, well, a type system. More specifically, I would like to explore the idea of what C++ calls concepts for my bachelor's thesis. How would one go about defining such system (formally) ? It's basically a meta-language for gene... |
Say you have a list of "vehicles" - you have an observableArray of these ko.observable()s.
You let your user add a new vehicle with the following:
var emptyVehicle = {
"make": "chevrolet",
"model": "corvette"
};
app.on('CLICKED_ADD_VEHICLE', function () {
var vehicle = new vehicleViewModel(emptyV... |
I have the following user story:
As a registered user i can request for a new license key
with the following condition
When the user request a license key they required to enter some
hardware id
Should i create another user story base on this condition? example
As a registered user i can request a new license key ... |
I keep hearing about early and late binding, but I do not understand what they are. I found the following explanation which I do not understand:
Early binding refers to assignment of values to variables during design time whereas late binding refers to assignment of values to variables during run time.
Could someone ... |
The C standard states that any character in the machine's standard printing set will never be negative.But the following code:
char c=1234;
printf("%d\t%c",c,c);
gives a negative output and prints a strange character,meaning that the character is in machine's printing character set.Is the C standard being violated her... |
From MSDN, we have the following definition of WCF Binding
Bindings specify how a WCF service endpoint communicates with other endpoints.
At its most basic, a binding must specify the transport (for example, HTTP or TCP) to use. You can also set other characteristics, such as security and transaction support, through ... |
I'm writing an optimizer for a language similar to JavaScript, and need to choose an intermediate code representation. The obvious/typical choice these days is Static Single Assignment (SSA).
However, Modern Compiler Implementation in C also discusses functional intermediate form, which basically means going pure funct... |
The C standard states that if an attempt is made to change a const type,the result is implementation defined.This gives error on my system,but what does it depend on(compiler,os)?
What are the possible results(implementation defined) on various machines?
|
Currently, I am using Android/Java. I am looking for the most efficient means to determine the average of the highest 100 pixel values taken from a greyscale preview.
The preview part I am more or less okay with; however, it determining which sorting methodology is the most efficient. The other option is to apply a t... |
Well, actually it's a assignment project and I've already implemented a simple yet functional forum with NodeJS. But now we've been required to use ORM frameworks to refactor part of your code worth refactoring.
As I use Node.JS, there's no such type-safe benefits from ORM I could get. Besides, the code is already func... |
The C Programming Language by Ritchie says that:
The library routine sqrt expects a double type and will produce nonsense if inadvertently handled something else. So if n is an integer, we can use sqrt((double) n) to convert the value of n to double.
But the following code works fine on my system:
printf("%f",sqrt(9)... |
I'm creating the design for a browser bookmark merging program and I've ran into a design problem that I've seen before yet I've never come up with a good solution for it. So lets say I have a Browser class:
Browser:
String bookmarkFilePath
String type
Bool bookmarkFileExists()
When my program runs I will want ... |
I'm adding copyright notices to all my source code files:
Copyright (C) 2013 My-First-Name My-Surname
But what if someone else is also named My-First-Name My-Surname? What does courts think about that? How would they know who is the real author? Is there something I can/should do about this situation? (So they'd know... |
To be specific, I want to know which function/types in libpri and being used in the Asterisk project. I'm not traditionally a C programmer, but I know some basic stuff because I took a class in college.
|
Can anyone give an example of instances in which the AF_UNIX i.e unix domain sockets are used for process communication in a unix-based system
|
I need a little help understanding the implementation of radix exchange sort algorithm.
Radix exchange (I don't know if it's the exact name in english based literature) is a lot similar to quicksort, but uses binary representation of numbers.
Firts we look the highest digit in binary representation, and then using two ... |
I'm writing a lexer in JavaScript. It's pretty typical - rules are specified with regular expressions and produce a token.
I am unsure of the best way to handle when multiple rules are matched. The existing lexers I've looked at handle this by picking the rule with the longest match.
It also seems like a viable strateg... |
Say I have a model written in php whose properties are the columns of a table in a db and each instance of the model represents a row in the table. I also have a page ('view') where I display the contents of each column one row at a time, starting with the first row (id=1). Above this display are two buttons, one which... |
Reading the Go language specs, I read in the intro:
"The grammar is compact and regular, allowing for easy analysis by automatic tools such as integrated development environments."
Is the word "regular" here a technical term, or should it be interpreted just as a vague English word?
|
I'm reading the Go language specification. The section on comments states:
Line comments start with the character sequence // and stop at the end of the line. A line comment acts like a newline.
What is the point of specifying that a line comment acts like a newline? Couldn't line comments simply act like empty strin... |
For some time now our Scrum teams have experienced recurring impediments caused by external factors to the team. The teams have discussed the impediments in their retrospectives and also brought it up on "Scrum of Scrums". It seems that the impediments may require involvement by management as it requires some rather si... |
I have searched around for a way to run a program meant for ARM processors on an Intel computer, but I can only find ways to do the reverse, to compile Intel programs for ARM. Are there any open-source cross-compilers that will allow me to do so? Thanks for your help.
|
Lest's say I have user stories about using product catalog in shop:
As an administrator I can add/modify/delete catalog items (one or more user story, doesn't matter here)
As a customer I can search product catalog
As a customer I can view product details
Each of this stories rely on predecessor: design and create d... |
The source code I'm working on at the moment performs numeric calculations between a bunch of different properties belonging to different data models. All the calculations are coded in a big method with a lot of If statements than make it very complex, difficult to change and it contains some bugs.
I have not found a ... |
My program should perform following task:
It listen on http port after getting request it does following things.
Connect to gearman
Parse gearman payload to JSON (Upto 100 bytes)
Connect to Redis
Parse redis payload to JSON (256 bytes to 10KB. 80% cases it will ~256 bytes)
Put some data in MySQL
Put data in Redis... |
Similar question here (but not the same) because I am interested in which specific algorithms work particularly well in Lisp.
Lisp tutorials always give the example of finding factorials, but wanting to find factorials is not a good enough motivation to use Lisp.
I've heard that Quicksort has a particularly elegant imp... |
I am completely new to designing algorithms with graphs. I am following CLRS and other video lectures in Youtube, notably from IIT/MIT. They are pretty good, and I currently have decent idea about graph data structures, search, spanning-tree, etc. However, I am completely clueless as to how to identify a coding problem... |
I've got an existing SQL table structure that looks like this:
Orders
- order_id
- organisation_id
- [all the rest of the order data]
Organisations
- organisation_id
- [all the rest of the organisation data]
Users
- user ID
- [all the rest of the user data]
I'm trying to change the Orders table so that an Order can ... |
I have been trying to understand the DOM, and although I have a fair idea of what it is, there are certain ideas I just cannot pin down. I will list down what I think the DOM is and my questions will be inline.
The DOM is a fully object-oriented representation of the web page. The W3C DOM standard forms the basis of ... |
As I have been taught - one controller = one use case.
But I have:
OutsiderController
SupplierController (which extends OutsiderController)
SubContractorController (which also extentds OutsiderController)
And I want to do the SSD for SupplierController and SubContractorController. What do I do? Do I write in both SSD... |
Initial situation:
We are developing a software platform where products can be generated by configuring different components and adding additional ones. The platform is developed several years by a little developer team. Now the platform is more and more used, we get new developers as well as testers. We are currently ... |
I work for a company that has bought a licence for a windows client software that allows only 20 running clients per company. I am trying to find a way around this 20 user restriction by programming a PHP web front end that connects to the existing database. This will allow unlimited users to access the database.
The ... |
The development team I'm in has been working on a VERY large project for months now and we recently started to implement a kanban board with agile practices into our process. We have seen MASSIVE improvement in our throughput! Its so exciting! But we have one struggle right now. We have a total ticket count for the pro... |
When rolling out a new feature, sometimes it makes sense to notify the end user what it is, and give them an opportunity to provide feedback whether the software should get them to 'try something new' or 'put it off'.
In a cloud software, how should user preference data such as this be managed? A small piece of inform... |
I am more of a high-level wheel reinventor. I definitely prefer to make use of existing API features built into a language and popular third-party frameworks that I know can solve the problem, however when I have a particular problem that I feel capable of solving within a reasonable time I am very reluctant to find s... |
Is there a best practice for calling language-native functions when writing testable code?
I have experimented a little with php code and have come up with two methodologies:
create a wrapper class for all native functions and mocking this wrapper when writing tests
using "namespace magic": calling all native function... |
I ask because so many of the questions I see in SQL amount to: "This is slow. How do I speed it up"? Or are tutorials stating "Do this this way and not that way as it's faster".
It seems to me that a large part of SQL is knowing just how an expression would be performed and from that knowledge chosing expression styles... |
I work as a solo developer in a small company. There's more than enough work, but the same does not apply for money. Thus, I won't be seeing any new colleagues in the near future.
I am responsible for absolutely everything that has do to with IT operations. This involves development and maintenance of software used in-... |
How can I convert this requirement into one requirement:
For columns where there are just numbers, numeric sorting will be used. For columns that have numbers and letters, alpha-numeric sorting will be used. For Date columns, time sorting will be used. All sorting will have ascending and descending properties.
|
We are doing agile software development, basically following Scrum. We are trying to do sprint reviews but finding it difficult. Our software is doing a lot of data processing and the stories often are about changing various rules around this.
What are some options for demoing the changes that occurred in the sprint... |
I have the following (in C#, but the question could also apply to Java):
public interface ILibraryAdapter
{
string Property1 { get; }
string Method1(string param1);
...
}
public class ThirdPartyLibrary : ILibraryAdapter
{
private readonly ThirdPartyClass thirdPartyClass;
private readonly ILog log;
... |
I have a very very limited understanding of SQL and PHP. I have a few projects I want to try and work on, which will require doing some web scraping for data collection and then storing, sorting through, and analyzing the data. I would like to also have this data available on my website so others can sort through it as... |
Starting with #Delphi #XE2 many of the new RTL units related to Vcl styles, OSX and so on, uses inc files to declare types, classes and implement code (just like the FPC does), what is the justification to do that? you can see what i mean if you inspect one of these folders (source\rtl\posix, source\rtl\posix\osx, sour... |
I am torn between object oriented and vector based design. I love the abilities, structure and safety that objects give to the whole architecture. But at the same time, speed is very important to me, and having simple float variables in an array really helps in vector based languages/ libraries like Matlab or numpy in ... |
I am trying to write a Java application that works similar to MapReduce. There is a server and several workers. Workers may come and go as they please and the membership to the group has a soft-state. To become a part of the group, the worker must send a UDP datagram to the server, but to continue to be part of the gro... |
I'm building an Online Food Ordering System with PHP and MYSQL, One of the feature of the application is to allow users to search for the restaurants by typing the area name.
I would like to know using PHP for search will be more efficient or using Stored Procedure or using any third party tool.
Efficient in the sense ... |
I am using an Export Module, now I want to extend it for different connections.
I have a database which contains products
Its Description, Review, Images etc. I use the serialize function to save it as XML file.
After saving it as XML, in admin pannel I have possibility to select how this XML file will be exported.
for... |
Given a maximum integer value M, I want to generate N integer values that are distributed with a lower frequency when approaching M (preferably M should still have a non-zero probability).
I don't really care much about the probability function, let's assume (half of) a normal distribution.
How would I do that if I don... |
The majority of my work over the last three years has largely been around maintaining legacy systems that needed patching up or the occasional revamp before being sold again.
I understand the critical role dedicated maintenance programmers have to play in companies with a large number of projects and limited developers... |
I have a script I want to sell. It's written in PHP, but that's not relevant here I guess. I want to secure my script with a license, so the buyer is forbidden from redistributing it.
This is the first time I am selling my own script, so I have no idea how to start with this. Please let me know how I can protect my sc... |
In many interviews I've been asked this question. What is a Package Diagram? and What is a Sequence Diagram? and difference between Package Diagram and Sequence Diagram.
Thanks in Advance.
Edit
Sorry, google give me lot of answer, but i want to practical answer with example.
|
I was thinking about experimenting a bit with using mapreduce and such on a dataset we have to see if we can benefit from it in any way.
What route should I go if I want to be able to instantly, without any major modification, deploy my findings to some kind of grid/cloud-system to see if there is any extra benefit to ... |
I'm trying to understand constructor chaining better. I understand that this technique can be used to reduce code duplication for initialization of a class object and I also understand the order in which they're executed.
I found the following example and I cannot see clearly what the benefits are in the code? And whe... |
Preamble
If I say "BSD" I mean the 3-Clause BSD license
If I say "GPL" I mean the GPLv3 license
I am not the author of the GPL project
I am the author of the BSD project
Simple Task
I want to use a 3rd party software (GPL) in (or better 'with') my open source project (BSD).
Situation
I won't change any of the GPL pr... |
currently I'm working on a project with the following setting:
There is a proprietary application which performs transactions on a Microsoft Access database (which is actually stored as an .mdb file)
The API of the application doesn't have enough functionality for the requirements we're facing
Our application has dire... |
I understand all the advantages of Daily Scrum and my team does it when we are working on stories.
But sometimes we just have bugs to fix for days, while we're waiting for new stories, and when this happen we put daily scrum aside. Some of developers says that "There's no need to do a Daily Scrum when we have nothing t... |
I've had a chance to try it out and I like it very much. I'm thinking of using it in all of my future projects. I'd like to hear some critique and opinions about it. I've done a little research on the subject and I'm not sure I've seen this approach around, but I'm pretty sure that it must have been tried by some more ... |
I am developing mobile based social network with backend and I cache some data from facebook. I asssume I should include a kind of Terms of use and privacy policy statement in the application? is it really neccessary? where can I find proper templates for this?
|
The problem is the UserTypes property (used to populate a drop down list in the AddUser view) is not being retained after POSTback of the form.
Here is my AddUserModel: (which inherits from EditUserModel which doesn't have properties for UserTypes/UserTypesSelectList - probably part of the problem?)
public class AddU... |
I am trying to do something somewhat unique, and the best path I can find at the moment is to use List joins, but I'm not sure this is possible. I'm hoping someone can suggest a best course of action.
The issue at the moment is that I have several lists (i.e. Employees) that all have a lookup to the Assets list. I al... |
Since Javascript is an interpreted language, entire functions can be changed during runtime. I have recently been contemplating a framework that would allow for dynamic code changes (such as UI plugins) to take effect without having to reload the page, while still providing enough information to undo the change if desi... |
Let's say we're making a parser. One implementation could be:
public sealed class Parser1
{
public string Parse(string text)
{
...
}
}
Or we could pass the text to the constructor instead:
public sealed class Parser2
{
public Parser2(string text)
{
this.text = text;
}
public ... |
I've seen plenty of questions asking if listening to music boosts productivity, etc. but I haven't been able to find one about performing music. Learning to play the piano has been on my to-do list for a while, partly because I have a sneaky suspicion that learning to deal with the relationships, recursions, etc. inher... |
I know Aggregation is a has-a relationship, but I encountered a question in a test which did not make sense (and had grammatical mistakes as well)
Which of the following statements correctly describe the concept of aggregation in OOP?
A Splitting a class into a several sub classes
B Creating one piece of code that wor... |
I have been given a spec to create a new MVC4 website, it will not be too large a project at first but I suspect it will grow as the business gets new ideas for it.
Using .NET 4.5 ASP.NET MVC4 and EF I have to choose between code-first with migrations or Sql Server Data Tools (SSDT) for handling my database.
With the S... |
I used the Process Editor (from TFS Power Tools) to update the Workflow diagram of a particular Work Item Type (viz., the "Issue" type). There are a dozen other projects on our server that share the Issue type, and I would like to port my changes to all of them. But unfortunately, while the Process Editor allows you to... |
Just like NVR (Network Video Recorder) and DVR (Digital Video Recorder), I was wondering if there's a term / acronym for Desktop Monitoring Recorder? Perhaps DMR? I can't find any standard terms for this type of system.
I'm writing a system which is just like an NVR but records / monitors computer desktops instead. It'... |
I wish to acquire a new computer that is specially designed for programming.
I would like to build it myself for the learning experience, but am willing to purchase it made as well.
Basically I have downloaded so many files dedicated to programming that are so large that a) my computer is near capacity and b) my 4 yea... |
I have been reading a lot lately and I have come across articles in which people make the 'grand' assertions that there are no bugs in the Tex program by donald knuth. Is this in any way possible and if so how is this possible?
|
The C Programming Language by K & R states that C, like most languages, does not specify the order in which operands of an operator are evaluated. (The exceptions are &&,||,?: and ','). According to the book, the result of the statement :
printf("%d %d\n",++x,power(2,x));
depends on the compiler. But it itself says in... |
I've read many, many, many posts on how "you're probably storing passwords wrong". They are always referring to storing passwords on a server into which a user is logging; they basically rehash (pun intended) ubiquitous advice like make sure to salt the passwords, etc. etc. However, I've never seen an article on best p... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.