instruction stringlengths 34 36.1k |
|---|
I would like to export the contents of the GCIDE dictionary data from xml format to sql format for sqlite; however, I am concerned how the GNU GPL License impacts my use of the data. To be clear I want the data and not the xml tags inserted into my database. I then plan to create a small app that will make use of that ... |
I have recently joined a team working on an application with an integrated chat system. It is a standard chat system that allows clients to communicate, with messages routed through a central server.
Usually when dealing with user-input text, it is recommended to 'escape-on-output' instead of 'escape-on-input'. There a... |
Background
I started to get involved in a project written in python and wxPython (for the GUI). My task is to debug and add a few features to the GUI.
The widgets are organised mainly with sizers, and the application as a whole only looks good at a certain screen size and resolution.
First thing I did was to group some... |
In this Wikipedia article about Closures
function startAt(x)
function incrementBy(y)
return x + y
return incrementBy
variable closure1 = startAt(1)
variable closure2 = startAt(5)
It says that "Note that, as startAt returns a function, the variables closure1 and closure2 are of fun... |
Scenario: I've been working for half a year on a small project with a team of two people. They are working in a foreign country, so most of the time we worked via video conference tool.
While those tools work well for providing information, feedback and giving directions, I don't think these are great tools for activi... |
While chasing a segfault around a complicated and grouchy c++ program I added several //comments and cout statements, but no 'actual' code. Then, suddenly, for no apparent reason the segfault vanishes.
I'm happy, but still a little worried, because I don't think I fixed anything and there was clearly something wrong.
... |
The project that I am currently working on is using a library (well, sort of a library, it self-describes as a toolkit, Geant4), that is several versions out of date.
As there are bugs in it, that have been fixed in newer versions, its likely that it will be updated. I may not be asked to do it, but if I am, what's th... |
I know this is a very basic question but I cant seem to find the answer with Google. What is the difference between a hotfix and a bugfix?
|
First time poster. I'm currently programming a hamming distance program using a dictionary.
So if we start with the word "cat" and we want to transform it into "dog", the sequence is cat-->cot-->dot-->dog, and "full" to "tree" is full-->fuel-->feel-->teel-->tyee-->tree. All intermediates must exist in a dictionary. I... |
Apache has two separate tools:
Apache Maven
Apache Ant + Apache Ivy
They seem to both fill the same niche. I have two questions:
What are the highlights of the main differences between the two tools?
I'm sure a really long article could be written on the differences between the two, I am not looking for that much ... |
Programming: Practices and Principles - Bjarne Stroustrup
Drill in Ch 5 - Errors
He wants us to correct the code:
boo c = "fool"<s;
On correcting boo to bool, this is a comparison, so that's fine. c will be assigned either true or false. But if I edit it to
bool c = "fool";
It also evaluates to true. Then I tried "",... |
In C, what meaning, if any does the t at the end of integer types like uint8_t and int32_t have? Where did it originate? Why wasn't the type just called int32?
|
I know that final keyword is used to prevent virtual method from being overriden by derived classes. However, I can't find any useful example when I should really use final keyword with virtual method. Even more, it feels like usage of final with virtual methods is a bad smell since it disallows programmers to extend c... |
While the run the below program in Turbo C compiler, I am getting the expected output, however, when I run the same program it using "gcc" compiler in linux, it is giving an unexpected output!
int main(){
int i=1;
i=2+2*i++;
printf("i : %d\n",i);
return 0;
}
Output in Turbo C => i : 5 (This is as e... |
Firstly, I hope I'm asking this in the right place. I work for a large online retailer in UK. We ship approaching 2000 orders each day and are growing very quickly.
We currently use multiple delivery firms to handle all our deliveries. We're planning to launch our own fleet of delivery vans soon for deliveries local to... |
I am part of a consultant team implementing a new solution for a customer. I am
responsible for the majority of code reviews on the client-side codebase (React and javascript).
I have noticed that some team members use unique coding patterns to a point that I could pick a file at random at tell who was the author fro... |
Does an object have to represent an entity?
By an entity I mean something like a Product, Motor, a ParkingLot etc, a physical, or even a clear-cut non-physical conceptual object -- something that is well defined, with some core data clearly belonging to the object, and some functions/methods that clearly operate on th... |
Writing an interpreter for a dynamically typed language usually involves creating an Environment, a data structure which stores mappings of variable names to their values. Values are boxed in some kind of wrapper type, which might look like this in C:
typedef struct value {
type_t type;
void * datum;
} value_t;
wh... |
I'm working on obtaining a clean compile with -Wsign-conversion for existing library code. The library is 25 years old or so. Eventually, this higher bar will be a security gate, and all check-ins will need to meet it or be rejected.
The existing library code does a fair amount of the following (a gross simplification ... |
"Web Components" and "Custom elements" are often mixed up, and web searches for the title of this question don't yet produce much clarity. Let's fix that.
|
I am trying to design an API. For creating contracts below are the two approaches:
Approach 1:
public class MyController
{
public void MyAction1(Dictionary<string, dynamic> input)
{
//Use input like below
//Read from input dictionary and apply minimal business logic if needed
//And Call CustomDataProvid... |
Let's say I have REST API which provides me list of something and I want to implement paging support - possibility to tell "give me records 20-29 (page 3)". Currently, I don't care about implementation server-side, but about how client tell API he want specific page.
You can pass it in URI (/some-list?page=3) or send i... |
I've a website built with ASP.NET, and uses Cookie based Forms Authentication to protect it self from unauthorized access.
It also has a REST based API which uses API key based Authentication. (Key is distributed separately).
We've a case where one of our customers want to embed certain pages from our site inside their... |
If the event handler is declared in the markup, it'd be (kind-of) adding presentation logic to HTML.
<button id="btn" onClick="foo()">Click Me!</button>
If the event handler is declared in the script, it'd be (kind-of) hard to look at the code and figure out what button does.
document.getElementById('btn').onclick=foo... |
I am going through the stored procedures written throughout our project and see that multiple distinct queries are written inside a single stored procedure and are called by passing different values to input parameter.
Will this not be a performance issue? If multiple clients are calling the same stored procedure by p... |
I'm writing AI for the game and encountered this article that helped me out. I'm not sure how the probability function is computed. Does it rely on some advanced math I'm not understanding or for each move program generates randomly lots of possible set ups and then computes chance by counting times ship is encountered... |
I must implement , in Lisp , a depth-search algorithm in an implict graph (namely a graph where I have the starting node, the goal node, and the successor function ,f, that give a node create his successors). There is a depth limit d. The algorithm must return a path (obviously cannot be minimal).
My problem is how man... |
I am working on a project where we develop an embedded application for a Linux-based device handling data from different sensors and visualizing them to the end user. We try to use Scrum process but came across different difficulties related to our and management team perception of Requirements Engineering.
Basically S... |
Sample scenario and my first stupid question on this network.
I have winform as dll.
It's contain reusable method and properties.
Code:
using System;
using System.Drawing;
using System.Text;
using System.Windows.Forms;
namespace MyWinForm
{
public partial class MyWinForm : Form
{
public string Se... |
I have the following situation:
table1
------------
ID Name Param1 Param2 Param3 RegistrationID
1 Test Value1 Value2 Value3 101
table2
------------
RegistrationID LangID Value
101 EN English-Value
101 DE German-Value
101 IT Italian-Value
I am interested in what ... |
Say I have a typical website which provides authenticated users access to their stored ('owned') data. Authorised users must be able to perform CRUD operations on their data. If I were using a RDBMS-based solution I would use a series of joins based on the user_id retrieved from the session in order to make sure that I... |
I am working on an embedded application that has a web server as a GUI. The webserver supports what you would expect, and I am using javascript to request data from the application and supply it to the user.
The user can interact with the hardware by changing physical relays on it. This is all displayed and controlled ... |
For this 2d grid (black square are not penetrable, white square are):
I want to find path who permit to move an object to a start point (x:18, y:18) to a end point (x:1, y:1), square by square. Imagine this object is an ant or a robot, so:
It can only know the direction of its objective, distance from its objective an... |
I'm currently in the process of learning Java and swing and in doing so am trying to create a desktop app.
As part of this app I have set up a mysql database which the app is connected to, however I'm uncertain as to how this would work if I was to distribute the app for other users, how would I create a database that ... |
Recently, I was asked to help with some side optimization project at our company, I've made some good research. I'm still not 100% sure if this is most efficient way to do this.
Problem:
Scraping for over a dozen different information from a internal system ( website ) and passing them into Microsoft Office document ... |
When reading Spring tutorials I'm quite often coming across the @Transactional annotation.
When I google it, I get documentation that says things like:
Comprehensive transaction support is among the most compelling reasons to use the Spring Framework. The Spring Framework provides a consistent abstraction for transac... |
As a 'seasoned' Rebol developer with some knowledge of the world outside, I'd be curious as to the utility/pitfalls of implementing Lisp-style macros in Rebol (and/or Red).
My understanding (always happy to revise) is that Lisp is able to preprocess code prior to evaluation/compilation, modifying that code according to... |
This is a Design question relating to finding out a good OO design pattern or design structure or class combination that can house an algorithm that processes user selection to produce product recommendations.
Scenario
User specifies Motor and Product requirements and hits Submit. Algorithm processes input, loads vari... |
I have gone through many articles to understand why we need WebApi's when we can create restful architecture using WCF rest services but could not find some solid reason. Can we use these interchangeably? Are these just two approaches to solve similar type of problems.
Or else there are some things/features which each ... |
Has anyone managed to use a common rules system between their frontend and backend?
Similar to this question:
Managing client-side and server-side validations in one place, I'm trying to find a way to have consistent business rules applied on the front (JS) and back end (Java). Unlike this question though, I'm not int... |
I've written a simple event logging system, which I write to with a function similar to:
void IIncidentLogic.ReportIncident(
string code,
string noun,
string hostname,
DateTimeOffset occurredAt)
Where code is derived from a set of constants such as VOL_SIZE_INCREASE, noun would be the path of the volume, hostn... |
Is it a security hole to name each session with the username of the user currently logged in?
example:
//Alice has login
sessions_name('Alice'); sessions_start(); //Alice has login
//When Bob Logs in
sessions_name('Bob'); sessions_start(); //code follows for Bob
etc....
|
The project I'm working on has quite a few classes. These classes can be grouped in two different ways. I'm trying to decide which grouping is best as for namespacing. Currently I a set of user facing classes that look like:
JamJar
HoneyJar
PeanutButterJar
etc...
These are all similar in that they all inherit from Sp... |
I ran into these lines of code in the QPYTHON Android app. They are part of a sample that uses the Bottle module to create a simple Web server that seems to work fine.
app = Bottle()
app.route('/', method='GET')(home)
app.route('/__exit', method=['GET','HEAD'])(__exit)
app.route('/__ping', method=['GET','HEAD'])(__ping... |
I've been using the usual My.Settings... method when it came to saving settings for my program but I was just wondering, If I wanted to save program settings into the Registry and load those settings, are there any benefits when comparing with saving settings to a custom written file and loading those settings from the... |
How would I go about writing a program to solve this kind of puzzle:
The green squares represent trees, and you have to plant them in such a way, so that:
Trees do not touch each other at all (not even diagonally)
Each row and column contain a specific number of trees, which is denoted in the corresponding cell to the... |
Title is an abstraction of what I am actually doing, but in essence the same.
The main entity I will be dealing with are the Employees themselves; "Send package to employee John Doe". In order to work with a given Employee, I need to use the IOffice they belong to, and each office has a different way of delivering tha... |
I'm building a library that generates a couple of types of objects that can be used by user code and the library. To keep track of these objects, I'd like to use shared_ptr's, so I can build in some run-time clean up. Since these are consumed by user code, I was curious if it would be worth typedefing the shared_ptr ty... |
I had a software that was written on VB .Net and used Crystal Report to print out reports. It was a pain to maintain in my case, so I want to move the report to webpage version.
I did some researches and found out that it was more safe to connect database from server side on webpage. However, I want to know if there i... |
I have included my approach and solution. My solution works fine, however, is unoptimized with O(n^3) complexity
An NGO is running seed distribution program. It has limited quantity of varied quality seeds. In order to get seeds, farmer needs to request number of seeds. Seed distribution happens only on Sunday with goa... |
I have a data structure which has an add function.
When the user instantiates a new data structure object, she can specify an algorithm which will be executed each time the add function is called and alters the newly inserted value based on the previous values in the data structure. The algorithm needs to have access ... |
I want to extend an existing server written in C++ to be able to communicate with an other server over websockets (e.g. logging or user authorisation purposes). All examples (including the very well written Beej's Guide) I've found have an infinite loop (e.g. for, or while) to handle the socket's send and receive metho... |
I have a functional sign up page for a blog that updates a database with a users name, email, profile picture and a short bio. The General information page and the profile picture upload/bio page are two separate pages and I have a problem with users being able to go back into their profile pic page and re-entering the... |
I've got an arraylist of SpecialParts. A SpecialPart is an object that holds a bunch of information about itself: name, ID, date created, etc.
I've got a ListView that presents the user with all the names of the SpecialParts in this arraylist. The user can select one of these parts in the list and then do stuff with ... |
I am working on an AngularJs project which is getting bigger very fast.
Currently I need to store some user data, so I was using $localStorage for Angular.
But I had a problem, as the application is saving a big amount of data, it is hanging the browser some seconds which is very annoying.
Searching for asynchronous us... |
I am trying to make an AI that plays a game. Actually, I'm playing around with both StarCraft and MineCraft which are completely different kinds of games. As well, I use different programming languages for both, and one is multi-threaded (java), other event-driven single-threaded (Node.js).
Despite all those difference... |
According to this guide: https://github.com/mspnp/azure-guidance/blob/master/Retry-Service-Specific.md
They say:
Note that the StackExchange.Redis client uses multiplexing through a single connection. The recommended usage is to create an instance of the client at application startup and use this instance for all opera... |
Firstly, this does not suggest that efficiency and quality are in conflict... only that some methods prioritize them differently.
Secondly, this is not a question of whether you agree with Scrum practice or not.
An expressed goal of Scrum is to create high quality increments of a deliverable product. This does not ex... |
I'm primarily a Python/R developer. In those languages, the way I develop is to sketch out a data and class structure, write the methods and their tests in interactive mode, then refactor them up into class methods and properties and sort out the tests. Some friends are suggesting I learn C#. I don't do much work with ... |
I am creating an object model for a device that has multiple channels. The nouns used between the client and I are Channel and ChannelSet. ("Set" isn't semantically accurate, because it's ordered and a proper set isn't. But that's a problem for a different time.)
I'm using C#. Here is a usage example of ChannelSet:... |
Imagine a software system where you have like 100 parameters, each of which is sensible to change (in my case this is a reasearch system for machine learning). The obvious solution is to store all parameters in a config file, so that the system is easy to handle and see through.
Whis approach is better, what are benefi... |
By "prototyping language", I mean one which was chosen by virtue of it's relative ease of quickly accomplishing the sort of design changes common to prototyping in a particular context. (such as data visualisation, for example)
By "production language", I mean one which, with a more solidified design, is likely to prod... |
I am aware that doing Flow Control on a program using a try-catch block is bad practice, but I can't see how to do it in another way when the error caught needs a redirection of the code's execution.
For example, let's say I have screen where the user clicks a button, and on the buttons click I execute some code. Afte... |
After reading around I found that there were various git workflows being used but there aren't enough (or I just haven't found them yet) info on how to use git properly with having test builds.
I was hoping someone here could shed some light regarding the problem me and my team are facing.
This image below is a high le... |
In my current project I have a Report class, and I am going to implement a service layer for it. Every method will be allowed only for some roles. Like this:
public class ReportService : IReportService
{
public void CreateReport(Report report, User user)
{
if(user.HasRole("Admin"))
{
... |
I have an API that for firewall reasons can't sit on an internal DMZ and has to reside on the internal network. It was suggested that I build a 'shell' API that basically has all the same endpoints but just passes data back and forth between the APIs and Web App.
So is creating another API to sit in the internal DMZ s... |
I've separated interfaces from their implementations by different packages, it's just add clarity, the separation is good looking and it is easier to navigate the project structure. I like it. The only point which confuses me - I've started thinking I might overdo stuff. So the question is - do you think it's a good pr... |
So I'm doing a 3D implementation of collision detection.
Considering
Boxes are oriented on the axis.
They are rotatable but has to be orientated on the axis.
Box A and Box B cannot go through each other. However; one of there sides can have similar (x,y,z) points.
Here is a visual aid of what SHOULD happen.
COLLIDIN... |
I would like some advises on the organization of a set of related but independent C++ projects stored in a single (git) repository. The projects use CMake.
For a simplified example we imagine 2 projects A and B, A depending on B. Most people developing A will get B via the packaging system. Thus they will compile only ... |
Let's say that I want to create a website where users will be able to create, edit and delete some kind of resources, for example posts.
I have created a RESTful API, so user can create a post by sending a PUT request to http://www.example.com/posts/my-new-awesome-post, delete it by sending DELETE request, etc.
But mos... |
I have a database table with numerous fields including "category". The source of this table is an xml file which the system receiving occasionally. Each xml file contains data for one category. The table needs to be updated with the new category data from the xml file. The xml file includes all data for that category, ... |
Here is a similar question
Where to validate domain model rules that depend on database content?
I am asking this new question because I have more descriptions and I don't want to change the previous question mentioned above
Problem
I have Form aggregate root that has Fields collection. On my form I have the SetCus... |
Given the following recurrence:
T(n) = T(n-1) + n^2
How can I prove it to be O(n^3) with the substitution method? The O(n^3) guess derives from the fact that at every step of the recursion we pay n^2 and we have n steps of recursion therefore having: n * n^2 = n*3.
I would even expect this to be theta(n^3), but I can'... |
I recently was looking for a CSS solution to vertically-align elements, and I found one here.
One thing that I thought was nice was the right-justified code; example:
.vertical-center {
// ... other stuff ...
-webkit-box-pack : center;
-moz-box-pack : center;
-ms-flex-pack : ... |
Say I have a dictionary that contains complex classes that need to be loaded and unloaded in a special way. (Not especially special, just outside the bounds of this question.) Should I gracefully subclass the built-in dict like this:
class ExampleClass(dict):
def __str__(self):
return 'ExampleClass; '+dict.... |
I'm looking at code that somehow calls a library but I don't see it calling any of the library's headers at any point. I've done searches within the code and I don't see anywhere the functions, typedefs or structs getting defined anywhere...yet it compiles and works, and LDD shows it calling the library. What is it t... |
Looking through the Java Collections Framework, I've noticed quite a few of the interfaces have the comment (optional operation). These methods allow implementing classes to through an UnsupportedOperationException if they just don't want to implement that method.
An example of this is the addAll method in the Set Inte... |
I have some classes I've created that are immutable and follow the builder pattern. I'm now creating a composite class that will include those classes as fields. Should the builder for that composite class call through to the sub-builders and then build them in the outer builder's build() method, or should the composit... |
I have a PHP page the sole purpose of which is to spawn a bash script to run some background code (10-15 seconds run time), and then forward to a second page. The second page waits for the background code to run and displays the output.
Obviously, this set up is fertile ground for a DoS attack. Can anyone comment o... |
I want to know the best pratice, to validate the attributes on jsf project. I know two forms of validation:
Option 1: Validate on JSF page
JSF Page validation:
<h:inputText value="#{userBean.textEg}" maxlength="15" />
Bean attribute:
private String textEg; // ++getAndSetter
Where i defined by param at input my maxLen... |
I'm the only active maintainer for an open source project, which receives support requests on various channels (Twitter, email, GitHub) almost daily. I'll be on vacation for the next three months, where I'll have very limited time to respond, let alone accept pull requests or resolve issues. What can I do to prevent di... |
Given a plain array of values, e.g.
["Apple", "Orange", "Banana", "Strawberry"]
and a list of operations from the set of [insert, delete, sort and replace], e.g.
[
{cmd: "insert", index: 2, entries: ["Cherry", "Kiwi"]},
{cmd: "delete", indices: [3]},
{cmd: "sort", newOrder: [3,1,2,0,4]},
{cmd: "insert", index:... |
At my company we created proprietary software that we use only internally - we do not distribute this software - to generate reports from client data. We sell these reports to our clients, not the software.
If we were to link to GPL licensed software from our software, would will still need to (upon request) provide ou... |
I want to implement a data structure that will hold the paths of directories, sort of fake file system.
Input:- I have a text configuration file containing the paths as follows
...
C:/temp1
C:/temp1/insideTemp1
C:/temp2/
...
I might end up storing huge amount of paths inside the data structure and I am looking for... |
I'm extending a class with 10 different constructors. The new subclass, SpecialImage, is used like this:
SpecialImage specialImage = new SpecialImage(..);
// Leverage the Rotate() method of superclass Image, which
// returns a new rotated image.
// Notice the type is still SpecialImage.
SpecialImage rotated = special... |
I'm looking for an update .net 4.5 WPF+MVVM+TDD tutorial for my team.
I have found only one good tutorial
https://deltaengine.fogbugz.com/?W199
My goal is to learn Test Driven Development using WPF and MVVM (we know WPF and MVVM and also use Nunit for unit testing and coded UI)
However I think we can save a lot of tim... |
I've convinced a few colleagues to try scrum with me, but one of them works remotely. We'd like to try using a physical task board.
I think we might be able to pull it off by snapping a photo and sending it to him every time the board is updated, and when he wants to update any of his tasks at the end of the day, he ca... |
I've been working with OOP for a while now, but in each large project that I find myself starting, I seem to run into the same problem; where does the responsibility reside.
Like many who use OOP on a regular basis, it becomes natural to start breaking things into nouns, verbs, adjectives, etc. Recently I read a post a... |
My boss has three websites and each of those websites have forms on them that people can sign up for nightclubs.
He asked me to look up usability tests, however, I don't think that's what hes actually looking for. In fact, he wants the forms tested frequently (for instance once per day) to make sure they are working pr... |
I do web app development and bash scripting and I usually work on several projects at once in different contexts and languages and often return to a project after a few months absence.
When I return to a project there are always fragments of code that are incomplete and I have trouble "re-familiarising" myself with wha... |
When my coworker thinks that there is no need for a test on his PC, he makes changes, commits and then pushes. Then he tests on the production server and realizes that he made a mistake. It happens once in a week. Now I see that he made 3 commits and and pushes with deployment to the production server within 5 minutes.... |
I have been programming in Javascript for a while and I am quite comfortable with it. And I know the basic concept of prototypes and I have also used them a few times. But one thing I can't figure out is that when should a prototype be used.
And what is the correct usage of prototypes. For example:
Currently I am creat... |
Since it is convenient for the developer, the same paradigm are often used for implementations and specifications, e.g.
for testing (e.g. Java for the implementation and unit tests, Scala for the implementation and property testing)
for model-based testing (e.g. C# for the implementation and specifications using Spec ... |
I know that (on Linux at least, with native file systems like Ext3) file paths can in theory be quite long, and PATH_MAX is often (but not always) as big as 4096 (see this; and this explains it could be longer or runtime defined!).
However, file paths are often constructed on the fly, and it not uncommon in C to code s... |
I can understand the fact that Java needs both a compiler and an interpreter. It compiles source code to bytecode and then a virtual machine (on Windows, on Linux, on Android, etc.) translates that bytecode to machine code for the current architecture.
But why does Python need both a compiler and an interpreter? Since ... |
This is motivated by this answer to a separate question.
The builder pattern is used to simplify complex initialization, especially with optional initialization parameters). But I don't know how to properly manage mutually exclusive configurations.
Here's an Image class. Image can be initialized from a file or from a... |
I want to design my relational schema to store information about users following other users. So if user1 is following user2 the schema will be as below
user_follow
------------
|user1|user2| -> Column names
------------
|U_Nm1|U_Nm2| -> tuple
------------
So in this way if user1 is following 100 other users I will ha... |
Recently in my company it has been suggested that one developer should focus (and only one) in one feature. That would mean something like setting the developer aside of the normal team routine, releasing it of some other responsibilities (meetings and such) and this person would be the "only" responsible for the featu... |
I may not have worded the title correctly. Is there any programming language(s) which deals with natural mathematical number types rather than the typical data types we see like Int32, Int64, Float, Double etc?
By natural number types I mean the likes of
natural (1, 2, 3 ...)
whole (0, 1, 2, 3 ...)
integer (-1, 0, 1, ... |
What should you do if an API has changed the provided functionality? [In this case it would affect your project as a whole]
Some more context in my situation: Facebook eliminated the APIs ability to create, update, or delete event's via their API, they only provide read access. My whole application is based on creating... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.