instruction stringlengths 34 19.9k |
|---|
I realize that this question is similar to Low level programming - what's in it for me, but the answers didn't really address my question well. Part from just an understanding, how exactly does your low level knowledge translate into faster and better programs?
There's the obvious lack of stop-the-world from garbage c... |
There seems to be a lot of discussion of the various speed merits to C or C++ as compared to say Java or Python, but I rarely see Objective-C mentioned. Roughly where does it fall in terms of language performance?
|
I am researching this question for a possible paper. Given the exploitation of user identities for risk management and market tracking, how easy is it to alter a browser enough to throw off fingerprinting techniques?
My current sources are:
EFF Panopticlick project
Peter Eckersly's follow-up presentation at Def Con 1... |
I am writing a text based RPG, and I have three classes that inherit from a super class, they all have special attacks that they can perform, at the same time I have a class that holds the function which handles battles in my game.
Now how do I get the unique special abilities functions for whatever role the player cho... |
A great feature of Javascript is function statements. You can do this:
(function myFunc(){
doSomething();
doSomethingElse();
})();
Which is a way to declare a function and call it without having to refer to it twice. Can that be mimified on Python?
|
I want to reorganize a large application with lot of code duplication into multiple components. Plus, some code is also duplicated over other applications.
The common set of functionality that can be taken out of main application is clearly defined.
Now, do I write a library or do I write a service for this functional... |
I am relatively new to unit testing and have a query about what/how I should be testing a certain method. For the following (psudo-c#) method I have created (not a real-life example) what would you test for?
Initially, my thoughts would be to test the output with variations on the dictionary of form fields, e.g. valid,... |
I have a log that our web application builds. Each month it contains around 16,000 entries of a string with about the average sentence worth of text.
To filter/search through these in our admin panel the script uses preg_match() but this seems to be taking ages and timing out on the 30sec limit. I have isolated that it... |
At the moment non/semi sensitive information is sent from one page to another via GET on our web application. Such as user ID or page number requested etc. Sometimes slightly more sensitive information is passed such as account type, user privileges etc.
[EDIT: I may have worded this wrong, I'm not passing sessionID o... |
I have binary data in my database that I'll have to convert to bitmap at some point. I was thinking whether or not it's appropriate to use a repository and do it there. My consumer, which is a presentation layer, will use this repository. For example:
// This is a class I created for modeling the item as is.
public cla... |
I am planning to build an expression parser that will be used to graph algebraic functions ( think TI-83 ) with JavaScript.
Functions will take the form of f(x)=
Aside from typical operators such as: + - * / ^
I'd also like to add support for inline functions such as: sin(), cos(), log() and random().
I have looked at... |
I am going to fork an open source project. Would you recommend to create a new changelog file or to update the original one? Would it be reasonable to increment its version number or would it be better to reset it?
|
I have to model User and Board in rails using mongoid as ODM.
Each board is referenced to an user through a foreign key user_id and now I want to add the ability to share a board with other users.
Following CRUD I'd create a new Model called something like Share and it's releated Controller with the ability to create/e... |
I'm planning on leaving my current job because we're locked into using Blub, with an enterprise Blub framework and a Blub-level web server, on mediocre shared hosting. My coworkers are friendly and my boss is an average small business owner - I want to leave entirely because of the technical reasons. I feel like being ... |
I am currently working on converting a "legacy" web-based (Coldfusion) application from single data source (MSSQL database) to multi-tier OOP.
In my current system there is a read/write database with all the usual stuff and additional "read-only" databases that are exported daily/hourly from an Enterprise Resource Plan... |
I work in the prodution area at my works and I design and create the software to run our automated test equipment for testing our products. Everytime I get involved with a new machine I end up with a different and (hopefully) better design. Anyway I have come to the point where I feel I need to start standardizing all ... |
Is there a tool that takes as input a proposed patch and a git repository, and identifies the developers are the best candidates for reviewing the patch? It would use the git history to identify the authors that have the most experience with the files / sections of code that are being changed.
Edit: The use case is a l... |
I really like the simple and transparent nature of C: when I write C code I feel unencumbered by "leaky abstractions" and can almost always make a shrewd guess as to the assembly I'm producing. I also like the simple, familiar syntax for C.
However, C doesn't have these simple, helpful doodads that C++ offers like clas... |
While many other languages have rapid development, such as Python, which has come out with a whole new version in the past few years, or to use a framework, Rails, which evolves super-fast (A book that was published in early 2011 is now obsolete), it seems that there are no updates for C. Why is this?
|
I posted this last night on StackOverflow and was advised to move it over to StackExchange, thank you for taking a moment to look at my question.
I'm developing a project proposal for my final year project at University and as I aim to use programming languages I am currently not too familiar with I'm looking for some ... |
I'm a novice programmer. I study languages such as C, C++, Python and Java (mainly focusing on C++). I'm what you'd call "young and inexperienced" and I admit that because I can't claim otherwise.
As a student, I have many other problems besides programming. I practice programming as often as I can, and especially bec... |
The majority of GUI Toolkits nowadays use the Signals + Slots model. It was Qt and GTK+, if I am not wrong, who pioneered it.
You know, the widgets or graphical objects (sometimes even ones that aren't displayed) send signals to the main-loop handler. The main-loop handler then calls the events, callbacks or slots a... |
In Item2 on page 16, (Prefer consts, enums, and inlines to #defines), Scott says:
Also, though good compilers won't set aside storage for const objects of integer types...
I don't understand this. If I define a const object, eg
const int myval = 5;
then surely the compiler must set aside some memory (of int size) ... |
The Red - Green - Refactor cycle for TDD is well established and accepted. We write one failing unit test and make it pass as simply as possible. What are the benefits to this approach over writing many failing unit tests for a class and make them all pass in one go.
The test suite still protects you against writing in... |
I'm looking to track the time it takes users to traverse through a few forms I have on a website.
My old thought was to use something like jQuery to poll the server updating the time spent on a page, but it appears this would be incredibly resource intensive.
Recently I've been reading about sockets.io and node.js. It ... |
I have the following problem. My UI interace contains several buttons, labels, and other visual information. I am able to describe every possible workflow scenario that should be be allowed on that UI. That means I can describe it like this - when button A is pressed, the following should follow ->
In the case of tha... |
I work for a company for which the domain is really difficult to understand because it is high technology in electronics, but this is applicable to any software development in a complex domain.
The application that I work on displays a lot of information, charts, and metrics which are difficult to understand without ex... |
I develop some scripts for data analysis in a small team. For the moment we use SVN, but not in a very structured way. We haven't even looked how to use branches even though we need this functionality.
What do you suggest as the best practice to setup the following system:
two code bases (core and plugins)
versions ca... |
I frequently write small applications (either web based or otherwise) that require heavy database usage. i've attempted various ways of handling where to put the actual sql queries (sort of ad-hoc ORM systems). These include:
Models that build themselves up - and only allowing SQL to be inside of a model.
A sort of fa... |
Provided that many tools for computers benchmarking are available already, I'd like to write my own, starting with processing power measurement.
I'd like to write it in C under Linux, but other language alternatives are welcome.
I thought starting from floating point operations per second, but it is just a hint.
I also... |
Is it standard practice when setting up a Continuous Integration server to build a Debug and Release version of each project? Most of the time developers code with a Debug mode project configuration set enabled and there could be different library path configurations, compiler defines, or other items configured differ... |
We have an Azure service (web role) that heavily depends on the database. For offline development/testing, we'd like to have the app+db run offline within the emulators. Running the webrole itself within the emulator is straightforward but doing so for the Azure SQL isn't so.
What is the simplest way to ensure that th... |
I'm writing an Agile course for some of the new guys we are on-boarding recently, and I want to add a cautionary tale so they understand that Agile is not meant for all projects.
My problem is that, because of the nature of the projects I work in with Agile has worked pretty well so far, I can't honestly point out wha... |
I'm in my first real job as programmer and what I see is just the "Big Ball of Mud" code (without useful comments too), but I like to do clean code, and it's really hard for me to code in a worse way.
I'm searching for some study case where the usage of clean code (I see various definitions here of what is clean code) ... |
Possible Duplicate:
Should you write good documentation and clean code to increase the “Bus Factor”?
I often ask young programmers why they are not documenting their code. Their responses, perhaps jokingly, frequently include "job security." I hear this from experienced professionals, too. And not just in programmin... |
There are many development practices (TDD, continuous integration, cowboy-coding), principles (SOLID, layers of abstraction, KISS), and processes (RUP, Scrum, XP, Waterfall). I have learned you can't follow any of these blindly, but have to consider context and ROI (return on investment).
My question is: How do you kn... |
I have a set of base characteristics, and then a number of sub-types. Each instance must be one of the sub-types, but can be multiple sub-types at once. The sub-types of each thing can change. In general, I don't care what subtype I have, but sometimes I do care.
This is much like a Users-Roles sort of relationship whe... |
Possible Duplicate:
I'm a Subversion geek, why I should consider or not consider Mercurial or Git or any other DVCS?
What is the value of using version control?
I am a relative noob to programming, and am not going to be developing super-good software or even programming professionally anytime soon. With this predi... |
I'm building an multi processes application and I need to save session ID, the sessions ID is 32 bit, and of course it can't be used twice in its lifetime, I'm currently using DB that saves all the ID in a table, and I do the following,
ID table is (int key, char used(1)) //1 is used, 0 is not
1. lock table
2. get one ... |
I've seen many games on FB have queue which connects you to an opponent you should be playing against.
So my question is: In which language can it be coded? Is it possible to do it in PHP/Javascript?
Does anyone have any real/live example or tutorial how is this done?
Thanks in advance!
|
When posed with a problem, particularly when it is complicated in nature, I try to take some time to think about the approach I am going to take to solve the problem. Despite this, what often happens is, as I am programming the solution, I start to think of details of the problem that I missed, and I adjust the code a... |
I found my self often paused to check a certain usage of one core API when writing either javascript or Ruby. I am wondering how the other guys doing? Is it necessary to remember every Core API usages?
It the answer is yes, how did you guy do it efficiently?
|
As far as I understand it is a wide-spread opinion within the C++ community that certain features of C++ (including some features inherited directly from C), while still usable in themselves, do not fit well with the most recent C++ best practices.
For example, I read a comment on this site stating that new / delete sh... |
I've been the sole developer of a niche product for my company for nearly 6 years. I've grown quite attached to the project and I enjoy working on it. However, it was the decision of management to take the project out of my hands and move it under the wings of another team.
Unfortunately, I'm having a hard time letti... |
I'm looking for a bug tracking system (similiar as http://www.mantisbt.org) with these following requirements:
Requirement specifications are:
Upload picture and different files without any limitaton of the file's space.
If user belong to a specific group or businesss group, the GUI:s logotype should be changed into ... |
I like the command query separation pattern (from OOSC / Eiffel - basically you either return a value or you change the state of the class - but not both). This makes reasoning about the class easier and it is easier to write exception safe classes.
Now, with multi threading, I run into a major problem: the separation ... |
I am reading Evans's Domain Driven Design. The book says that there are entity and there are services. If I were to implement an operation, how to decide whether I should add it as a method on an entity or do it in a service class?
e.g. myEntity.DoStuff() or myService.DoStuffOn(myEntity)?
Does it depend on whether othe... |
Can Services in a domain-driven design be implemented as C# static class? What are the drawbacks of this choice? Can it be implemented as a non-singleton non-static class?
|
Over the years I've created a bunch of Java utility and helper libraries which I just attach to new projects. Then, when I deliver code to my clients, I send all the code except for the libraries themselves (not JARs but source code files).
A client complained that he could not compile the project as some libraries we... |
I searching for undestanding Docking Framework concept in web, but I don't understand its concept and benefit. I see exist several 'Docking Framework' in java such as Netbeans Platform or MyDoggy or Sanaware and etc but I don't understand its benefit.
Do you can explain it?
Thanks.
|
I am working on a CNC (computer numerical control) project which cuts shapes into metal with help of laser.
Now my problem is once in a while (1-2 times in 20 odd days) the cutting goes wrong or not according to what is set.
But this causes loss so the client is not very happy about it.
I tried to find out the the caus... |
Whate are alternatives to using cookies/client-side storage for a PHP/MySQL based site on Apache.
Scenario/Requirements:
I want to try using some anti-bot code to prevent specific scrapers etc. from accessing the site.
I would like to run this code before launching the rest of the site (before DB access etc.).
I ... |
If I am attempting to simulate a Rubik's Cube, how would you create a data structure to store the cube's state in memory, with X number of tiles per side?
Things to consider:
the cube can be of any size
it is a Rubik's cube, so layers can be rotated
|
I have this wish that so far Google hasn't been able to fulfill. I want to find a package (ideally in PHP, because I know PHP, but I guess that's not a hard requirement) that you point at a database, it builds an ORM based on what it finds there, and exposes a REST interface over the web.
Everything I've found in my se... |
Consider:
public class CtorInjectionExample
{
public CtorInjectionExample(ISomeRepository SomeRepositoryIn, IOtherRepository OtherRepositoryIn)
{
this._someRepository = SomeRepositoryIn;
this._otherRepository = OtherRepositoryIn;
}
public void SomeMethod()
{
//use this._some... |
About a year and a half ago, I entered a workplace that claimed to do Agile development. What I learned was that this place has adopted several agile practices (such as daily standups, sprint plannings and sprint reviews) but none of the principles (just in time / just good enough mentality, exposing failure early, ric... |
I want to give nice name to my function while returns drive, directory and file. Can you please suggest a good abstract name for this trio?
This is the function.
static IEnumerable<string> GetDriveDirectoriesAndFile(string path)
{
if (path.Contains('/'))
{
path = path.Replace('/', '\\');
}
... |
This isn't a huge deal, but I was approached by colleagues/friends to build an app using their new API. There was some potential for pecuniary gain for me depending on app usage. I spent a considerable amount of time polishing the mobile app, based on my assumption that, having been approached in a serious way, that th... |
A lot of the code I've been working on recently, both professionally (read: at work) and in other spheres (read: at home, for friends/family/etc, or NOT FOR WORK), has been worked on, redesigned and re-implemented several times - where possible/required. This has been in an effort to make things smaller, faster more ef... |
I have made a python code to smoothen a given signal using the Weierstrass transform, which is basically the convolution of a normalised gaussian with a signal.
The code is as follows:
#Importing relevant libraries
from __future__ import division
from scipy.signal import fftconvolve
import numpy as np
def sm... |
I have been making considerable progress lately on building an interpreter. I am building it from NASM assembly code (for the core engine) and C (cl.exe the Microsoft compiler for the parser). I really don't have a lot of time but I have a lot of good ideas on how to build this so it appeals to a certain niche market... |
I work on a large software application that must run on several platforms. Some of these platforms support some features of C++11 (e.g. MSVS 2010) and some don't support any (e.g. GCC 4.3.x). I expect this situation to continue for for several years (my best guess: 3-5 years).
Given that, I would like set up a comp... |
First of all, my ubiquitous language is PHP, and I'm thinking about learning Java.
So let me split my question on two closely related parts.
Here goes the first part.
Say I have a domain-model class. It has some getters, setters, some query methods etc. And one day I want to have a possibility to compare them. So it lo... |
Say a company wants to keep development of new features of a piece of software internal, but wants to make the source code for previous versions public, up to and including existing public features, so that other people can benefit from using and modifying the software themselves, and even possibly contribute changes t... |
Are there any Java-specific techniques (things which wouldnt apply to C++) for writing low latency code, in Java? I often see Java low latency roles and they ask for experience writing low latency Java- which sometimes seems a little bit of an oxymoron.
The only think I could think of is experience with JNI, outsourcin... |
I know this is probably a bad way to ask this question. I was unable to find another question that addressed this.
The full question is this: We're producing a wrapper for a database and have two different viewpoints on managing data with the wrapper.
The first is that all changes made to a data object in code must be ... |
Yesterday me and a friend were talking about the overuse of custom taglibs.
We create taglibs for everything. We create taglibs in order to wrap jQuery UI elements (tabs, button, etc), and other plugins elements as well. We often wrap them together in a single component. We use taglibs in a point that we almost have no... |
There are a number of competing best practices for software development. From what I have found, many teams have benefited from Agile practices in some cases. However, in some other cases, using the Unified Process has been championed by large companies like IBM.
The common themes that I find seemed to work well for t... |
I'm trying to figure out the right terminology for the different types of software development
Right now, the only development term I know is "web development", but I've also done a lot of Java and C# development for desktop applications. Obviously this isn't web development, but I'd like to be able to group these unde... |
I'm trying to understand better how Hadoop works, and I'm reading
The NameNode is a Single Point of Failure for the HDFS Cluster. HDFS is not currently a High Availability system. When the NameNode goes down, the file system goes offline. There is an optional SecondaryNameNode that can be hosted on a separate machine.... |
So I'm about to submit a game to a competition, but as I looked through the rules a chunk grabbed my attention:
All Entries become the sole and exclusive property of Sponsor and will not be acknowledged or returned. Sponsor shall own all right, title and interest in and to each Entry, including without limitation all ... |
I'm composing communication lyrics for client-server and what am I thinking about:
"authme username passord" (maybe encrytped)
"accept"
"get archive of H2O from 03.02.2005 to 20.12.2064"
transferring binary structure or "error descrtiption"
why I always need to do something like
0x0FA52FD + CRC
0x0D34423 + CRC
...
... |
I'm confused. I've seen two different terms: Javabean and Java Beans. Is there a significant difference between them?
|
Taking the following simple method, how would you suggest I write a unit test for it (I am using MSTest however concepts are similar in other tools).
public void MyMethod(MyObject myObj, bool validInput)
{
if(!validInput)
{
// Do nothing
}
else
{
// Update the object
myObj.CurrentDateTime = DateTime.Now;... |
Whenever I'm writing a typical if-else-construct in any language I wonder what would be the best way (in terms of readability and overview) to add comments to it. Especially when commenting the else clause the comments always feel out-of-place for me. Say we have a construct like this (examples are written down in PHP)... |
In my experience, trying to ensure that new versions of an application retain compatibility with data storage from previous versions can often be a painful process.
What I currently do is to save a version number for each 'unit' of data (be it a file, database row/table, or whatever) and ensure that the version number ... |
I've always validated my user input based on a list of valid/allowed characters, rather than a list of invalid/disallowed characters (or simply no validation). It's just a habit I picked up, probably on this site and I've never really questioned it until now.
It makes sense if you wish to, say, validate a phone number,... |
I don't work every day with big-endian and little-endian problems and thus I find very difficult to remember which one is what.
Recently I got an interview asking the difference between the two; since I didn't remember I decided to "guess" (50% chance, after all) but I failed.
So, is there any wide known pratical tric... |
We are trying to introduce some agile concepts to the business folks but one of our biggest hurdles is their expectations for documentation - the quantity, the authorship/ownership of the documents, the lifecycle of the documents, the timing of the authorship, and the material that should be documented. The business fo... |
I'm trying to understand the DataMapper pattern by implementing it myself for one of my domain objects.
So far, I have:
class MyDomainObject
<attributes>
<business logic methods>
class MyDomainObjectMapper
save
update
delete
get
Now, I need get many MyDomainObjects. These could possibly be held cached in... |
I have an application with a configuration file that is stored in the application bundle. This config file stores the names of images on a remote server. Whenever the application is started, I download the configuration file from the server and see if there are any changes or updates. If there are changes, I iterate ov... |
I'm using CMake to generate my projects IDE/makefiles, but I still need to call custom "scripts" to manipulate my compiled files or even generate code.
In previous projects I've been using Python and it was OK, but now I'm having serious trouble managing a lot of dependencies in two very big projects I'm working on so ... |
I have find this article Turning Your Code Inside Out and I want to know how this approach described in article is for OO programmers/languages.
Is this style of design used in OO programmers/languages? What's downsides and goodsides of this approach in a OO language?
Update:
OO objects have state and behavior, the des... |
To summarize: I can buy a book, people say "Just read the developer site", I like to be spoon-fed the early learning piece for a technology, what path through the developer site will give me that spoonfeeding I need (that is, examples tied directly to the section being discussed, a clear path, etc.).
I keep seeing that... |
In our environment we have multiple ERP servers plus data that are coming from multiple sources. I need to create a development roadmap for the coming years as it is obvious that side applications will be needed for many things.
The choice is that the development will occur with Microsoft technologies. This means that ... |
I am re-writing a section of my site and am trying to decide how much of a rewrite this will be. At the moment I have a web service feed that generates an xml once per day. I then use this xml file on my website to generate the general structure. I am trying to decide if this information should be located in the databa... |
So, the title is a little awkward. I'll give some background, and then ask my question.
Background: I work as a web GIS application developer, but in my spare time I've been playing with map rendering and improving data interchange formats. I work only in 2D space.
One interesting issue I've encountered is that whe... |
Possible Duplicate:
best way to handle a many to many relationship?
The relationship between product and supplier is many to many with a new class to be created? Or is it many to 1?
|
I am drawing a class diagram and I want to know what's the proper notation for many to many relationship between supplier and product?
Should I show the table created supplier_product or leave it out and have the relationship many to many between supplier and product?
I have seen various representations online.
|
I'm pretty new at using TFS and I'd like to know how you or your team use the "shelve" function of tfs.
We have the following guidelines in using TFS:
- perform a "Get Latest" before you check in and try to build/compile
- do not check in code that does not compile
- at the end of the day, if your work is not complete/... |
I'm looking to implement the command pattern in a web application (asp.net c#)... Since the commands come in text format from the client, what is the best way to translate the string to a command object? Should I use reflection? Currently I just assume the command that comes in matches the file name of a user control. ... |
Let's say we have a winform application with a buttonclick event. The buttonclick handles everything from the UI configuration to the database call and data manipulation. So you end up with a method that is 100's of lines of code long. Outside the fact that this code can't be considered test-able for various reasons... |
re: algorithm and data structure concepts
When accountants talk about Ledgers they have something very specific in mind. As a programmer I'm very used to thinking about tables of information, but clearly there are specific things that make a ledger a ledger.
So, given a simple list of transactions (date, money in, mone... |
Granted, every profession has it's technicalities. If you are an MD, you better know the anatomy of the human body, and if you are astronomer, you better know your calculus. Yet, you don't have to know these more advance topics to know that smoking might give you lung cancer because of carcinogens or the moon revolve... |
In JavaScript, there is no such thing as a "private" variable. In order to achieve encapsulation and information hiding in JavaScript, I can wrap a variable inside a function closure, like so:
var counter = (function() {
var i = 0;
var fn = {};
fn.increment = function() { i++; };
fn.get = function(... |
The following is all purely hypothetical and any particular portion of it may or may not accurately describe real persons or situations, whether living, dead or just pretending.
Let's say I'm a senior dev or architect in charge of a dev team working on a project. This project includes a security library for user authen... |
My time as a developer (~8 yrs) has been spent creating tooling/automation of one sort or another. The tools I develop usually interface with one or more API's. These API's could be win32, WMI, VMWare, a help-desk application, LDAP, you get the picture. The apps I develop could be just to pull back data and store/repor... |
I have an idea for a SaaS product I want to create, however, this product will store extremely sensitive data that needs to be encrypted at rest. The trouble is not so much the encryption, but the problem of securely storing the keys so that in the event the server was somehow compromised, the keys couldn't just be rec... |
As a freelancer, I am often asked by my customers what they must choose between similar elements, neither of which being better than another. Examples:
“Do I need my e-commerce website be in PHP or ASP.NET?”
“Do I need to host this ordinary web service in Cloud or use an ordinary hosting service?”
“Which one is better... |
I have a Swing application with a custom TreeModel that can refer to domain instances. I'm wondering what changes I could make if I consider moving to a web interface later on. Would a pluggable model be considered as good design? What would you do?
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.