instruction
stringlengths
34
36.1k
I am trying to build a system for my company which wants to check for unusual/abusive pattern of users (mainly web scrapers). Currently the logic I have implemented parses the http access logs and takes into account the following parameters to calculate the potential of a user being a scraper or bot: It checks v/s HTT...
I'm about to start writing a library to support machine learning algorithms (decision trees, ANNs, Bayes nets, etc.), and I'm planning on making this a very general library. By this, I mean I want to be able to plug this module into as many languages as possible. To clarify, here's why I've started writing it in C++ (...
I need some help with a correct design. I have a class called BufferManager. The push() method of this class reads data from a source and pushes it to a buffer repeatedly until there is no more data left in the source. There are also consumer threads that read data from this buffer, as soon as new data arrives. There i...
What are the best tools / frameworks / libraries available to implement and run algorithms on graphs? In particular I need a tool that can load a set of nodes, edges and values assigned to these edges and then allows me to perform operations on them. I already found R but I'm wondering if there is a more "programmer fr...
My coworkers tell me there should be as little logic as possible in getters and setters. Yet, I am convinced that a lot of stuff can be hidden in getters and setters to shield users/programmers from implementation details. An example of what I do: public List<Stuff> getStuff() { if (stuff == null || cacheInvalid())...
So, I'm trying to teach my much younger cousin a little bit about programming. My initial thought was something like Scratch or Alice, but there were a few downsides to that. Everyone seems to be really in to game programming and developing video games (because everyone loves playing video games, and as far as pla...
I have some software application managed using Git. I just released a new version 2.x which I plan to maintain on the long term (bug fixes mostly). In the meantime, I would like to start working on version 3.x. What is the recommended way to manage this? Should I create a branch for version 2.x and have the 3.x develop...
My programming environment / language (gamemaker) gives the source files as "XML-files". Each resource has its own XML file. Where the properties (code is a property) are stored inside xml tags. Is there a source control which can handle these? With subversion collisions don't seem to be handled correctly: when a colli...
Following is the Url for my website, http://www.price-tag.org . If you visit any category link, you will see it performing very slow. For example, if you visit http://www.price-tag.org/Store/Section/Computers , you will see a lag before the sub categories are loaded. This is just the very first phase and i have just a...
I'm still a relative novice with OOP, so I am still trying to understand some of the best practices for how to design "good" objects. I know this question is probably a rather subjective, which is why I am here rather than on stackoverflow. I am designing an object that will have 20 separate string properties, none of...
We have a unique situation (at least for me, first time seeing this). We have a web form where accountants can fill in requests and that part is taken care of. But after their login we redirect them to a third-party website where we need more information from them. The process is crazy right now since we have to give ...
In my current project, we have an ongoing discussion about whether or not it's a good idea to include an artifact representing a web page in an UML sequence diagram for a web application, making explicit which page starts a business interaction. I think it's a bad idea to include a web page, for me a sequence diagram s...
I've just started my first IT job in a team with two developers (junior and senior), a project leader and an architect. My role is not yet completely defined and I said I'd be ok with both programming or testing. For now they put me on use case analysis since the PL says that it would leverage my analytical skills (I'm...
I've dipped my toes in C++ programming but I haven't actually delved into it. I want to know if I actually need to learn it or any other languages before I go to college for Computer Engineering or am I just going to learn it at school anyway?
I understand this is a very broad question, but I have worked with various aspects of this problem individually and am struggling to bring all the concepts and technologies together. I'd like to specify that answers should include these technologies: C# MVC 3 w/ Razor Javascript w/jQuery Anything above and beyond ...
So my friend's boss brought in four junior candidates with some work experience, she is one of them. Her manager wants them to be experts on the subject matter of tomcat in a matter of two months in order to justify them as billable to other clients as a technical trainer. My biggest concern is this, they only have a y...
I am considering investing time to learn Hadoop and it's related technologies. The problem is that my current day job will not be using Hadoop any time soon and even if I learn from books, blogs personal projects I will not have much to backup when I actually need to show that I have Hadoop experience. So while contin...
I'm doing the same. When there is something "to-do" in my code, I write //TODO .... But I'm curious to know when this started and if there is a reason for writing "to-dos" in all capital letters?
Prior to actual question, let me summarize what I'm trying to do. I plan to implement a small, JIT-enabled, register-based VM runtime. Instead of making a proper compiler (which is hard IMO) for a super-fancy home-brew language, I decided to implement a binary translator from a appropriate bytecode (much like Dalvik VM...
I have a graph with an Eulerian cycle and no Hamiltonian cycles. I would like to divide this graph into simple cycles. Edges may not be repeated in simple cycles. How can this be done?
I've been hearing about using the dependency injection over Singleton for my colleague. I still can't make out if it they are two orthogonal patterns which can be replaced with one another? Or is DI a method to make the Singleton pattern testable? Please take a look at the following code snippet. IMathFace obj = Si...
I have 3 years experience in ASP.NET with C# and now I am learning Silverlight with Beginning Silverlight 4 in C# book. As I have completed my first 4 chapters, I am getting the feeling that Silverlight is just about creating RIA which can also be done with Flash. What is a scope of Silverlight for a C# programmer?
I would like to know how I can use a switch statement with enum values for the following scenarios: I am making a small program for a flight reservation system. The program is meant to enter certain details about the passenger. The program also restricts the user to choose destinations other than the following 3 destin...
If you have a single property that is relevant across a full project, but you should logically have only a single representation of, how would you represent this? In my case, I am developing a simple drawing app where the user can select a colour. This colour should then be available to all the pen/shape classes in th...
I have been looking for Time Series models over in SO, but I figured this place was the best site to actually ask the question. I am wondering what is the "best" way to handle Time Series in .Net. First, I would define a Time Series as a mapping of different DateTime with a single value of type T. The value can possib...
In the current semester at the university we are working on OOP with C++. I would like to understand the difference between a pointer and a reference operator. The differences that I understand are: 1. Cannot change the object that the reference variable is binded to 2. we can use the reference variables to refer to ...
In Knuth's Fascicle 1 on MMIX, the "Memory and Registers" section on page 4 states: "thus if x is any octabyte, M[x] is a byte of memory." and "thus if x is any byte, $x is an octabyte." How can x be an octabyte (64 bits) and M[x] be a byte (8 bits)? Conversely, how can x be a byte and $x be an octabyte?
Ok, already up front, I'm going to tell you, that this is a bonus task for Data structure course I'm taking. That should take care of all the questions whether or not this is for a homework. Route creator I have a task, where a company has to create a route for a given data set. The data set can be input for every ope...
For studying advanced topics, what's the better and nearer to complete approach? Can books cover what's in research papers, journals or those ACM transactions, or Springer's LNCS? Or reading research papers is indispensable for getting advanced? If we can't depend on books for information, how can a learner know of wha...
I'm starting to tinker with process forking, just to get a feel for it. I thought I'd write an example where work is distributed among child processes and the results handed back to the parent; this way, it could be run in parallel on several processors. In my first attempt, I'm forking in a loop, which means that each...
It seems less common with newer websites, but many websites I need an account on (like for paying bills, etc.) prevent me from creating a password with spaces in it. This only makes things more difficult to remember, and I am aware of no database or programming restrictions on spaces in passwords, encrypted or (heaven...
I have a series of arrays which represent file system paths, so each next value is actually a directory deeper, for example: var a1 = ["Desktop", "Pictures", "Summer 2011"]; is the equivalent of Desktop |-Pictures |-Summer 2011 I'm trying to find an elegant way to: Flatten/merge all the different arrays I have to...
What are some good practices in debugging multiprocessing programs in Python?
I have documents that contain an arbitrary amount of key/value fields. The value can be a primitive or a list. Completed documents all have an associated state (such as passed, failed, halted, etc.). Using completed documents as training data in a machine learning algorithm, my goal is to pass the system an incomplete ...
Periodically, I wonder about this: The short-circuit OR would always return the same value that the unshort-circuited OR operator would? I expect that the short-circuit OR would always evaluate more quickly. So, was the unshort-circuited OR operator included in the C# language for consistency? What have I missed?
When I first started learning Android, I found a fantastic series of YouTube videos by Marakana that stepped through building a Twitter clone. It walked me through all the steps and thus explained to me the basics, common libraries, best practices, resources, etc. Looking over an expert's shoulder while building a prac...
What visualization method would you recommend for event driven programs? Are there industry standard diagrams, such as flowcharts?
Some languages (mostly ones made in the last 2 decades or so) can now not only run (after some compilation step or directly) on several platforms, but also can be compiled to run on several virtual machines. For example, take Scala. Pure Scala code can be either interpreted , compiled to run on the JVM (Java Virtual Ma...
Using C#, I have been doing multithreaded development for about 5 years, and consider myself quite proficient (I wrote my own lock-free queue and task parallel framework before Microsoft made TPF). However, I find it incredibly difficult to find information on practical multithreaded system design patterns anywhere. Th...
I'm a bit of a neat freak and tend to keep my projects by cleaning references and usings in each class to keep only what's actually used. What other argument could I make (besides calming my OCD nerve) of keeping to the essentials? I'm thinking mostly system references, any reference to custom work will bring its lot o...
I am seeking some ideas for how to build and install software with some parameters. These including target OS, target platform CPU details, debugging variant, etc. Some parts of the install are shared, such as documentation and many platform independent files, others are not, such as 64 and 32 bit libraries when these ...
EDITED FOR CLARIFICATION In the past, I have seen a whole manner of resolutions and fudges. Some really stand out. One particular resolution that I initially thought of as a fudge possibly deserves a category of its own. It could be considered a hack or a pattern, as a design pattern is just a piece of reusable code. ...
I was reading another thread where a guy asked about C++ books for beginners, and one of the programmers answering wrote this: Some warnings: avoid all books that present an "hello world" stating with #include <iostream.h> I opened my C++ book and sure enough it included the iostream header like the example above. ...
In a previous question, I asked about finding a route (or path if you will) in a city. That is all dandy. The solution I chose was with the A* algorithm, which really seems to suit my needs. What I find puzzling is heuristic. How do I find one in an environment without constant distance between 2 nodes? Meaning, not ev...
Warning 1 The field 'MCS_SPS_School.Fees.DiscountAmt.rtvalue' is assigned but its value is never used G:\Jagadeeswaran\Nov 17\MCS-SPS School\MCS-SPS School\Fees\DiscountAmt.cs Warning 2 The field 'MCS_SPS_School.Fees.DiscountAmt.dt' is never used G:\Jagadeeswaran\Nov 17\MCS-SPS School\MCS-SPS School\Fees\Discou...
I have been recently working on Objective C and came across use of Delegate pattern. I had seen most of the common patterns theoretically in Java, thanks to the Head First book. But at times looking at differences in Dynamic and scripting languages I get confused about need of certain design patterns. For example lets ...
I whipped up a demo on Friday before the holiday weekend of using the Model-View-Presenter pattern (the "Passive View" version, I believe) that I want to show to my co-workers this week as an example of how to architect our WebForms application moving forward and get maintainable, clean code. We currently keep almost ...
I run some basic performance tests in C# on simple methods, but there are also legacy monolithic pieces written in C# as well as other languages. So, when testing, I often end up working with a black box that takes a number of parameters. I can write code to get a bunch of sample data out, but making sense of it (e.g. ...
I need to come up with a custom recursive object locking mechanism\pattern for a distributed system in C#. Essentially, I have a multi-node system. Each node has exclusive write permissions over n-number pieces of state. The same state is also available in read-only form on at least one other node. Some writes/updates...
As anyone who has used Smalltalk knows, one of the main benefits (other than a late-bound language that discourages many poor practices), is that the system is totally transparent and reflective, which makes understanding APIs and existing code easy, and locating functionality pretty easy. Is there anything that create...
Let's say I have a page, accessible by several people concurrently, that lists information that must be processed in some way by the user, after which it is either marked as "completed" and effectively disappears, or is left unprocessed and thus left in the list to be tried again later. What is the best way to ensure t...
I am a contractor to a big company. Currently, there are three developers on the project, myself included. The problem is the other 2 developers don't really get it. By "it" i mean the following: They don't understand the best practices for the technology we are using. After 6 months of me and others giving them ...
I am currently working on a solution written in JavaScript. I plan to release two versions: For free: the lite one with base options, which is plug and play (it just works when loaded in the page) For a subscription fee: the full version that has more options and requires support I am wondering which license(s) would...
I am a graduate student in aerospace engineering. A lot of my Master's thesis has been on developing an OOP software architecture in MATLAB to facilitate control of Arduino-based vehicles (blimps, cars, quadrotors, etc). All my code is heavily documented, but my thesis itself needs to be more than a reference of every...
What is the suggested way (specifically in the open-source world) for the package name when porting a library. Say I am porting someone else's library where they have used a reverse domain name stucture for there package name, so there library package name was some thing like com.therename.thelib. What should I do if I...
One of the most popular questions on stackoverflow.com is this one: https://stackoverflow.com/questions/4025768/what-do-people-find-difficult-about-c-pointers Many of the answers seem to gravitate toward the fact that students often don't get a good understanding of what is physically going on when code executes... the...
I'm going to be developing an Intranet site for my specific plant, and our company standard for web-development is IIS + ASP.Net + VB.Net + Microsoft SQL Server (note that we have about 10+ plants). The Intranet site will only be used by my plant, and I'm the only one who will support it. I'm much more proficient with ...
We are going to start using Git (not using it yet), and I want to define the workflow. We have 4 teams at 4 different global locations, developing together the same product. Each team owns a part of the product's code, but sometimes they also have to make changes in the code owned by other teams. Is there a recommendat...
I am staying in an environment, where people believe: Java generics are the feature exclusively used for library writing and not for the real coding. C++ is an OO programming language; template is an optional and avoidable feature Though, these people rely highly on the libraries written using generic programming (e....
This question was inspired by this one. While that other question was deemed localized, I believe the underlying problem is something that is extremely common in our industry. I know there are some developers, who will read this and think I'm making this stuff up and then they might reply how everyone cares about their...
Is it a good rule of thumb to always write code for the intent of re-using it somewhere down the road? Or, depending on the size of the component you are writing, is it better practice to design it for re-use when it makes sense with regards to time spent on it. What is a good rule of thumb for spending extra time on...
Possible Duplicate: Elegant ways to handle if(if else) else In a function where there are multiple returns, what is the best style to use? This style, where there is no 'else' because it is frivolous and you think it is more concise? f() { if (condition) { return value; } return other_value; } ...
Possible Duplicate: How do you manage extensibility in your multi-tenant systems? I asked this on StackOverflow, but I thought it might be more appropriate for Programmers. I've got a few big web based multi-tenant products now, and very soon I can see that there will be a lot of customizations that are tenant spec...
I would like to launch an in-house user group/forum for the developers in my company, but I'm not sure how to get started. We have several teams of developers spanning many technologies and levels of experience. I envision this as an opportunity for all of us to come together and share techniques, best practices, less...
I'm looking for an algorithm to either use or as a jump point for load balancing. Environment: We have ~7 job types that can be scheduled at any time by our users. Some jobs are fast, others are slow (lot of data processing). We have a single instance of a "job processor" that will discover jobs that have been schedul...
Just browsing the google maps source code. In their header, they have 2 divs with id="search" one contains the other, and also has jstrack="1" attribute. There is a form separating them like so: <div id="search" jstrack="1"> <form action="/maps" id="...rest isn't important"> ... <div id="search">......
I am looking for examples of general purpose algorithms (meaning non-graphics related) that have been proven to run an order of magnitude faster on a GPU than on a CPU. I will use these examples to think creatively about other algorithms that I could implement on a GPU.
I'm doing some high-level sketching of a system that will require users to register, when they do they get an account and can invite others to that account. To be clear, an account would be similar to a private workspace, and the users will belong to that account and cannot exist outside of that account. The users will...
I was checking out what version of Firefox I'm using and it was telling me that I'm on the 'release update channel'. So I googles "Update Channel" and I finds this seemingly antiquated MSDN article which has a confusing bit of ASP.NET pre-processed into the article to give you the sense that you both should not use th...
I've got a few big web based multi-tenant products now, and very soon I can see that there will be a lot of customizations that are tenant specific. An extra field here or there, maybe an extra page or some extra logic in the middle of a workflow - that sort of thing. Some of these customizations can be rolled into th...
I'm looking for software to organize and maintain projects internal documentation, specification, requirements, etc. Currently we store all documentation as lots of MS Word DOC files in a source control repository, which gives us version control, and that's nice. But you can't search this information, create links betw...
What do I mean by high-level plan? The kind of plan that outlines product's functionality that needs to be developed but not going into too many details that are done afterwards. This kind of plan helps deciding functionality development order (priority) or even eliminating non-necessary ones. A great high level plan i...
I am using curl_multi_exec to process over 100K requests. I do 100 requests at a time because curl_multi_exec can only handle 100 requests at a time to eventually get to 100K requests. We have added multiple servers to this system to spread the load [we are using load balancing]. What is the best way to have curl handl...
I'm new to PHP and MySQL and I've only seen posts related to this on Zend and ASP so I'm looking for some advice to point me in the right direction for a LAMP project. I'm putting together a webform for a project of mine that logged in users will access to upload a submission. Each user will reuse previously uploaded f...
I'm interested in machine learning in relations to the stock market (predicting future values of stocks etc). What topics would I need to learn - e.g. what branch of AI to look into etc? and what libraries/tools do I need?
I wrote the following a while back, but I've come to review it recently, and now don't think it's good design. The design is for a kind of modular database layer using Entity Framework 4. There is a single database object which loads (lazily) entity framework contexts from external libraries in a specified location, an...
Let's say that I want to show a form that represents 10 different objects on a combobox. For example, I want the user to pick one hamburguer from 10 different ones that contain tomatoes. Since I want to separate UI and logic, I'd have to pass the form a string representation of the hamburguers in order to display them ...
I was developing a WindowsForm application in C#, with 2 forms. Regardless of what they both did specifically I needed to access values in form2 and send them to form1 and vice versa. For this to happen I found someone talking about constructor overload and it worked for me as I explain in the code. Form1: namespace mi...
I am programming in Windows Forms and MySQL. If I declare this in the program, I can use the connection and command objects in the whole .cs page: MySqlConnection connection = null; MySqlCommand command = null; MySqlDataReader Reader; But if I write the code below, connection and command objects are declared twice:...
I often write tests when I need to set data object for integration tests involving a few pages with forms. Herein each form on a page could be represented by a different data object class. There are are times when test end up in filling same data for a specific page while varying it for other pages and validating the o...
I have a GitHub repository with toy programs that I write when I learn something. For example, when I read an about an algorithms or data structures, I write up a quick implementation of of it to make sure that it works and I understand it. I sometimes solve algorithm and data structure puzzles and that gets pushed int...
I'm currently working mostly alone on a project (in Java). I'm mostly alone as I have an advisor that gives me high level instructions on what to do, and will seldom make any code contribution. She will code in a couple of acceptance tests from time to time, though. I've never used an issue tracker before, and was thin...
What is best way to learn these technologies which would enable me to understand all the 3 in a combined perspective rather than individually?
I'm about to start coding a documentation oriented wiki, as a pet project. The core features are: Extremely easy grouping of documents per version Markdown syntax (subset of) Multiple authors & projects I'm still undecided on storage options. The obvious approach would be a database. Since this is a pet project,...
I would like to improve my user stories writing abilities so I need your experience and guidance. I think that each variable part of a user story can be improved by following certain guidelines. 1. Role Defining possible roles may be the easiest part. The only problem is that user stories usually just describe functio...
I have an application that will access interface service A which is to run from windows startup. This service is used by program B and my application functions on B's presence after getting a pointer to A. The scenario is translated as follows, public interface A{} ///my program public class MyProgram { public MyP...
There's thread on stackoverflow about this https://stackoverflow.com/questions/5524046/is-telerik-extensions-for-asp-net-mvc-free It says that it is ok for internal site, but I think it is still not clear (also in faq notice about internal site usage is gone I think). They say, as long as website is internal, you shou...
We have several hundred ASPX files (could be more than that, into the thousands, I haven't actually counted) that currently use no architecture and have all the logic/data access in code-behind files. Moving forward I want to push using Model-View-Presenter (probably the "Supervising Controller" version) to try and ge...
Which the real benefits of rapid release development cycle adopted by the Mozilla Foundation in comparison with the strategy adopted previously?
I'm working on a project that involves loading batches of 3000+ files to several dozen tables. There is no user interface, and the tables are simply available for querying. What are the best practices for testing this type of process? Loading a small set of data and validating each and every member? Loading all the ...
I'm a 16 year old high school student, with a passion for computer programming. I'm in grade 11, and I've been learning it as part of the school syllabus for about 8 months. I've gone beyond what's being taught at school, and witten a few (reasonably good) applications. The language that I program in is C++, on the win...
What are the best practices and strategy for designing and developing a website? The key parts I want considered are: DLL deployment IIS publishing project versioning namespace Please answer these questions with recommended steps you take for your own web sites. A sample walk-trough** (Please correct it with yours....
In our team all task's steps are always done by the same developer. I.e for task 1, person A does design, development, and testing; for task 2, person B does does design, development, and testing, etc. Does it make sense to use Kanban in this case?
My company has developed a web application based on GWT (Google Web Toolkit) and Ext GWT in the browser, JBoss application server and Oracle in the backend. The app allows users of different departments of the same company, working in different locations, to collaborate in order to employ a fairly complex approval proc...
This is going to be a web service that returns a JSON object. Currently, I'm using C# technology and simply using ASP.Net MVC to create the calls. This is not a web page, so SEO is not a concern. I've come across a number of instances where I want to get the "next" or "previous" item in a list. For example, I've got a...
<input id='input1' type='text'></input> <input id='input2' type='button'></input> <input id='input3' type='checkbox'><input> <textarea id='myTextArea'></textarea> In HTML markup, most places where the user can interact with the page are denoted with the <input> tag. Why is it that textarea has its own tag, <textarea>...
I have two test cases to test a fix to code that is using the wrong criteria for selecting objects from a collection: Given one object in the collection matching the bad criteria, ensure that no object is returned. Given two objects in the collection, with the later one matching the bad criteria, ensure that the earli...
I've been a developer now for a number of years. I'm pretty good at what I do and can "get the job done". But, there is a difference between "getting the job done" and "doing the job properly". Let's use an example. Recently I developed a web site from scratch. The website runs fine and I've had no issues. Looking thro...
I'm doing some general research for a potential SaaS project. The solution we are considering creating will need data integration capabilities with various enterprise systems. I understand that SaaS adds complexity to enterprise integration since it lives in the cloud and outside of the firewall. I've read a few artic...
I work at a company that is looking into "upgrading" our version control system. We have about 200 websites that operate in their own directories. However, all of these websites use the same shared code. We basically use the 200 directories for the display code (html/css) and then the shared code for the processing and...