instruction
stringlengths
34
19.9k
I am developing an ASP.Net MVC 3 intranet site that will use Integrated Windows Authentication exclusively. What are the vulnerabilities of the challenge/response authentication traffic being sent in plain text? Will someone sniffing the network traffic be able to hijack an authenticated session?
I'm writing a web service with several APIs, and they will be sharing some of the implementation code. In order not to copy-paste, I would like to ideally implement each API call as a series of tasks, which are executed in a sequence determined by the business logic. One obvious question is whether that's the best stra...
Is there, somewhere, a freely usable/accessible script, source file, or whatever, that is able to measure the compliance of a given C++ compiler? For example, the Acid3 test for browsers: http://acid3.acidtests.org/ The results I dream of would be a global percentage note (or multiple notes, one for each standard, e.g....
We are working on automation of deployment using Jenkins. We have different environments - DEV, UAT, PROD. In SVN, we are tagging each release and placing same binaries in DEV, UAT, PROD. The artifacts already contains config files w.r.t each environment but I am not understanding why we are storing binaries in enviro...
There is a a program that I want to use that is released in two (fully copyrighted) ways: Stable binary form Beta release, mostly-stable binary form that is easy to derive the source (uses jars) (this version is free) Question: Can I legally download the beta version, make the necessary changes to work properly on m...
I would like to build some Ruby tests to test my non-Ruby website. I love the Ruby testing tools (webrat, capybara, etc.) but they seem to be targeted to testing local sites. How can I use these great tools to test external websites? Is there a way to override their settings so that they don't hit http://localhost fo...
I couldn't find the answer anywhere, but let's say we have a B-Tree with min = 1 and max = 2: What is the formula to calculate the maximum number of nodes in this B-Tree if the depth is say 100? This question was given on an in-class test to which most everyone had no idea what the answer was. I was completely stumped ...
This is not a technical question but rather about the right logic on handling delete with foreign key constraint. In my exercise app, I cascaded the record with OneToMany relationship with other records. In other words when I delete the record, Hibernate will automatically delete the associated records. My problem is, ...
Recently, we worked with a graphic designer (arranged by the client) to provide the skin for a Django+Bootstrap application we had built. The designer provided a series of static images of the new layout, along with a document describing some technical attributes (font sizes, colours, a few dimensions etc). It turned o...
For example I have these two classes: First public class Example { public Example() { } public int ReturnSomething { return 1; } } Second public class Example { public Example() { } public static int ReturnSomething { return 1; ...
I've adopted a tagging system of x.x.x.x, and this works fine. However, you also need to leave a comment with your git tag. I've been using descriptions such as "fixes bug Y" or "feature X", but is this the best sort of comment to be leaving? Particularly, what if a tag encompasses several fixes, it seems not to make s...
I'm currently coding an API for a social network with the Slim Framework. My question is: What are the best practices when there are no rows to return in the json structure? Lets say that this call /v1/get/movies returns 2 rows from the table movie names: [ {"name": "Ghostbusters"}, {"name": "Indiana Jones"} ] ...
Basically, the objective is to create a visual representation of the software specification document. This visual representation would capture various scenarios involved in the software. Benefits: Picture speaks louder than words Catch scenarios so that they need to be handled by the developer Becomes a knowledge map ...
I'm securing a WCF webservice with TransportWithMessageCredential security that uses certificates. So I'll have to choosee between signing headers & body or signing and encrypting. Now my question is, after reading Understanding Protection Level what the advantage is of just signing? The fact that WCF will notice that ...
My understanding is that the first step of defining user stories is to define roles. The problem with role-based systems is that this form of authorization is often too coarse-grained. Hence, people created task-based authorization where roles are still used to lump tasks into groups (see for example rhino security . A...
I do freelance web development and front end dev is not my strongest point. This question came to me in my recent fixed bid project. Nowadays we use Jquery and Bootstrap and these take care of lots of cross browser stuff. Still, there are lots of errors in different browsers. It requires testing tools and a whole lot o...
I'm currently trying to get my head round MVVM for WPF - I don't mean get my head round the concept, but around the actual nuts and bolts of doing anything that is further off the beaten track than dumb CRUD. What I've noticed is that lots of the frameworks, and most/all blog posts are from 'ages' ago. Is this because ...
Suppose you're getting the latest version of a file from source control and a conflict occurs. There are four possible types of changes in the conflict: Yours Theirs Both Conflicting Naturally, in cases 3 and 4 you'd want to review the changes manually (in the latter case you even have to resolve it). Regarding cases...
By default, I want all my local variables and method parameters to be final. Unfortunately, the Java language designers chose a different default: variables&parameters are by default non-final, and final variables&parameters need to be declared with the final keyword. So I need to add lots of finals. (And obviously I d...
I am doing contract work for various clients and I was wondering how best to go about safeguarding myself against non-payment. The projects will be ASP.NET web applications, most likely intranet-based. I don't have any more details than that. I imagine that the client will want to run and test the applications from the...
In Mark Seeman's Dependency Injection in .NET he injects a repository into his UI layer. I believe that he is doing this so that he can store everything in the UI configuration, however this just strikes me as bad design. Wouldn't it be better to pass the service reference into the UI? What is to stop a future develope...
I am a DBA fledgling with a lot of experience in programming. I have developed several CLI, non interactive apps that solve some daily repetitive tasks or eliminate the human error from more complex albeit not so daily tasks. These tools are now part of our tool box. I find CLI apps are great because you can include th...
Suppose I own a copy of a physics book containing original research. Suppose that this book is licensed under a non-free license. If I use the formulas and concepts explained in that book in my program, am I infringing the book's copyright? In my opinion the answer is no because I'm copying ideas, not text, and ideas c...
We've been getting the head revision of the JEDI Code library for a while, we only use it a tiny bit so never have bothered to manage which version we're getting. The problem is they appear to be totally untethered from SVN now and we'd been including it in our repository as an external and now my build server it kapu...
I'm trying to wrap my head around TDD, specifically the development part. I've looked at some books, but the ones I found mainly tackle the testing part - the History of NUnit, why testing is good, Red/Green/Refactor and how to create a String Calculator. Good stuff, but that's "just" Unit Testing, not TDD. Specificall...
I want to understand the architecture of web apps that use subdomains. I don't think that I'm phrasing this well, so let me explain. Many web apps, like tumblr or shopify create a user's site on a subdomain. Say for example my tumblr account was johndoe then you could find my tumblr blog at johndoe.tumblr.com. Can some...
I have an SVN repository set up like so: trunk branches UAT QA DevelopmentTeam programmer1 projectA projectB programmer2 projectC projectD programmer3 projectE projectF projectG projectH Each programmer can have multiple projects which are branches, and can be merged to their "programmer" branch. All programmers br...
I came across this question in a textbook, but there are no solutions and I'm not sure how to solve this. The question is: Suppose Host A wants to send a large file to Host B. The path from Host A to Host B has three links of rates R1=500Kb/s, R2=2Mb/s and R3=1Mb/s. Assuming that there is another busy flow that travels...
I am inquiring about a web app which uses Spring MVC and hibernate on the server and ExtJS 4 (Sencha JavaScript framework) for the client framework (widgets). The app is cloud-hosted - it is not "distributed" to users. It is required that users of the app shall need to purchase a license from the vendor in order to u...
Does a domain specific language use other languages like c++ or java, or is it standalone?
I have a client who would prefer to host their application on Linux. However, my coworkers and I have very little experience with Linux. This is a short project with a low budget, so making choices that save time and money are not just desired, they're a must. We are also heavy on continuous integration and automation,...
Where I work we have over a dozen internal SW systems that we have developed in-house using a variety of technologies, frameworks, and languages. Those include various from Microsoft (ASP.NET Web Forms, WebAPI, WinForms, SharePoint, Office Automation, Win8 Native Apps, SQL Server, SSRS) and others not from Microsoft (p...
I am an intern at a small software company, doing typical grunt work. Many tasks that the actual developers are doing are above my head however I finally got to see some real "action" and write some code myself. I will admit the task was perhaps a bit too difficult for me but I managed and my coded worked in the end. W...
I have a cross platform math library that I am working on and I want to make sure that some common operations are performed in an optimized manner, so I wish to use some intrinsic functions wrapped in inline functions to compute things such as sqrt(float/double). I should mention that at this point I only plan on targe...
We are developing an application; it includes a library developed by another coder, this library communicates with server via multiple network connections, and this involves multiple threads working together. The server side code is quite complicated, and we don't have access to the source code. Recently I've discov...
I'm a bit green to web applications although I am in the final phases of developing one for a client. I'm using Django with Gunicorn/Nginx on an AWS m1.medium. The database (MongoDB) is on a separate instance. The client is paranoid about scaling and so I threw together a crude monitoring server which has the ability t...
Many of us coders, programmers and developers struggle with repetitive stress injuries, carpal tunnel, etc. I've been curious about introducing voice control into my workflow in order to save myself some stress. This has led me to my current question: Would it be possible or practical to implement a programming languag...
I hope this is right area on Stack Exchange to ask this question. People out there have built emulators for every game console but I don't understand how they do it. I consider myself (and have the professional title of) a senior level developer in several languages including Javascript but I don't have the faintest i...
Ok, so this is not the most advanced programming question - and it kind of borders on e-commerce, but it has specifically come up twice in my career - which is only 10 years old, so I figured I would ask it. Question: I want to markup a price 10% from its original cost for a website, which is the proper way to do it: N...
Background: We have a class that both listens on a socket and sets values on itself based on what it reads off the socket. I believe that adheres to SRP. To adhere to ISP we created one interface for socket stuff (eg. StartListening, StopListening) and another interface which contains read only fields for the values r...
So I'm not sure if this is really the right place to ask or even the right question but I want to give it a try. Requirements: We should have a database & webservice (or something similar) which runs in OUR office, clients cann access the application via the internet ("wohooo"). Clients must be able to create orders in...
If we assume we have this little snippet of code: string str = "checked"; bool test1; if (str == "checked") { test1 = true; } else { test1 = false; } Is it bad practice to change a simple statement like this to the following?: bool test2 = (str == "checked"); Because they work exactly the same, and work as r...
Sue is designing a JavaScript library, Magician.js. Its linchpin is a function which pulls a Rabbit out of the argument passed. She knows its users may want to pull a rabbit out of a String, a Number, a Function, perhaps even a HTMLElement. With that in mind, she could design her API like so: The strict interface Magic...
Most of my work is creating websites in Django (a Python web framework) and deploying them to my own or clients' servers. I work from a virtualenv to separate site from system packages and have perhaps 60-80 packages installed in there and that lot is shared between two-dozen sites. This obvious limitation to this app...
Is it possible to build an operating system that contains some Turing complete compiler (language?) but is unable to run any malware? Or is there any definition for a malware? This question popped on my mind as I was wondering why Windows has more malware than Linux. If Linux contains a C programming language and its c...
I'm trying to figure it out some nice workflow for our company, and we have so far the main repository on the github's organization account and we all, the members of the team working on the branches of that repo. Could you please mention some advantages on forking the repo or some use, by the members of the organizat...
We've been using Git as our version control but as the team grows, there are more and more pains when it comes to getting all our changes onto a single branch ready for a deployment. I'm wondering if maybe we're outgrowing Git as an effective collaboration tool. I know there are large OSS projects with many developer...
I've inherited a hosted system (system "A") which can be used to manage products, inventory, and orders, and can send those products to various third-parties. Quite simply, system "A" doesn't work. The product and inventory systems are slow, convoluted, and buggy. The third-party integration doesn't work at all. The co...
As Semantic Versioning (and common sense) declares - the major version is incremented in case if non backward compatible change is introduced. Now let's assume we have a project called Project that has a current version 1.0.42 and a library Lib it depends on that is of a 2.1.3 version at the moment. Does that mean that...
Mocking frameworks are useful for creating mock objects that isolate the code under test from its surrounding software environment. Some mocking frameworks cannot mock non-virtual methods, so they require that you create an Interface for each class, if you don't want to make the methods virtual. How do you distingui...
The amount of servers and the complexity of our application is growing and we now have servers in different regions (hosted on AWS). Certain database operations require low latency so we have stuck a database in each region (which is basically a user cache) to keep the network latency low. The way the application ser...
I can easily follow the Semantic Versioning recommendations if I develop a library or API, but what if the developed product is a website or a desktop application? When would you increment a major component in that case? In case of a complete UI redesign? Or something else? Thoughts?
After 2 years, I'm still struggling with MVVM as a practical method of producing working software. In some cases it's great. I did a multithreaded application that controlled a small assembly line that would have been a nightmere without MVVM concepts. An abstraction from the physical assembly line was almost a no b...
New with Mongodb, and I'm not sure what implications or benefits there are between the use of an array vs an object. So.. As above what are the implications and benefits between the use of arrays and objects? For example my case. The idea is to store a document with a "capture" time, and a 2000 slots of "packet" count...
I have a MVC which has this structure: ui controller db model Basically the controller doesn't really do much more than connection ui with db layer. Do I need to provide JUnit tests for the controller (if the program's point matters, it's my semester project)? Would that help me somehow as there isn't much code - I b...
I am currently thinking of the following branching strategy Main branch Development branch Feature branch Release branch Basically the whole idea is to have a release branch so that hot fix can be applied quickly for specific release. Here is the issue what if I have an urgent feature that I need to do for a specif...
Please can you answer a couple of questions based on the code below (excludes the try/catch blocks), which transforms input XML and XSL files into an output XSL-FO file: File xslFile = new File("inXslFile.xsl"); File xmlFile = new File("sourceXmlFile.xml"); TransformerFactory tFactory = TransformerFactory.newInstance()...
When forming opinions, it is a good practice to follow scholastic tradition - think as hard as you can against the opinion you hold and try to find counter-arguments. However, no matter how hard I try, I just cannot find reasonable arguments in favor of antivirus (and related security measures) on development machines....
I'm have been doing some research into making code more testable and modular, but after reading alot about AMD based JavaScript, it doesn't appear to fit the needs of a static website. Is this assumption correct? Is AMD based development geared more toward highly interactive web applications that simple websites?
For what I know, encapsulation is useful because: if you use directly an attribute and change its type in a static typed language you have to change all the code that uses the class. On the contrary, if you have declared getters and setters for that attribute you have not to do this it hides the internal functioning o...
I have a service where users can upload/download/replace/delete files. These files have about a dozen attributes that are saved to a SQL Database. Periodicaly throughout their session they will have to download a summary (FileName, size0in-KB, and ID) of a subset of files. When working in the service it creates an obje...
I'm currently working on a client's project that involves programming in multiple languages. It has gotten to the point where the amount of source code for each language has grown to such a large volume that it's difficult to navigate. Especially when returning to that code base after an extensive break working on othe...
Technically not my first, but my new client wants to enter into negotiations regarding the cost of a website. It's fairly straight-forward, it's a little bit more than a portfolio page, and I should be able to finish it without much complications. However, I don't know how to make an estimate to enter negotiations. O...
I have two git branches with almost the same code, but some minor changes in order to support different platforms. I need to maintain these changes because I need them to run the software on different computers. So there is no master and development branch, both are equally important. Nevertheless, I need to "synchro...
We want to be able to offer users of our software the facility of having a miscellaneous folder for each of their clients. All these client folders would be stored together in another folder called 'miscellaneous data' for example It would be accessible via an icon in the client record window in our software and would...
I do Entity Framework stuff using repository patterns that are passed to the controller to than be called by the client using jquery AJAX.. Is there any basic rules on in what format I should be passing around these lists? Within the server code I suppose I could just pass around an Iqueryable? yes? And to the client...
I started out with a script that was a few hundred lines. Later, I realized I wanted another script that would require much of the same code. I decided to wrap certain areas of the original script that would be shared, into definitions. When I was deciding exactly what should be in a function, I came across various thi...
I'm in the beginning of creating a website that uses Google Datastore to store information related to clients and I'm curious if the record is too deep for NoSQL or if I'm fine. Essentially I'll be storing details about clients at a fitness business that get's fairly detailed. A completely made up record example could ...
Statistically speaking, user story maybe the most popular requirement technique in Agile but I am curious to know the alternatives and why.
I would be interested in formally defining (and consequently demonstrating) a "type system" for, well, a type system. More specifically, I would like to explore the idea of what C++ calls concepts for my bachelor's thesis. How would one go about defining such system (formally) ? It's basically a meta-language for gene...
Say you have a list of "vehicles" - you have an observableArray of these ko.observable()s. You let your user add a new vehicle with the following: var emptyVehicle = { "make": "chevrolet", "model": "corvette" }; app.on('CLICKED_ADD_VEHICLE', function () { var vehicle = new vehicleViewModel(emptyV...
I have the following user story: As a registered user i can request for a new license key with the following condition When the user request a license key they required to enter some hardware id Should i create another user story base on this condition? example As a registered user i can request a new license key ...
I keep hearing about early and late binding, but I do not understand what they are. I found the following explanation which I do not understand: Early binding refers to assignment of values to variables during design time whereas late binding refers to assignment of values to variables during run time. Could someone ...
The C standard states that any character in the machine's standard printing set will never be negative.But the following code: char c=1234; printf("%d\t%c",c,c); gives a negative output and prints a strange character,meaning that the character is in machine's printing character set.Is the C standard being violated her...
From MSDN, we have the following definition of WCF Binding Bindings specify how a WCF service endpoint communicates with other endpoints. At its most basic, a binding must specify the transport (for example, HTTP or TCP) to use. You can also set other characteristics, such as security and transaction support, through ...
I'm writing an optimizer for a language similar to JavaScript, and need to choose an intermediate code representation. The obvious/typical choice these days is Static Single Assignment (SSA). However, Modern Compiler Implementation in C also discusses functional intermediate form, which basically means going pure funct...
The C standard states that if an attempt is made to change a const type,the result is implementation defined.This gives error on my system,but what does it depend on(compiler,os)? What are the possible results(implementation defined) on various machines?
Currently, I am using Android/Java. I am looking for the most efficient means to determine the average of the highest 100 pixel values taken from a greyscale preview. The preview part I am more or less okay with; however, it determining which sorting methodology is the most efficient. The other option is to apply a t...
Well, actually it's a assignment project and I've already implemented a simple yet functional forum with NodeJS. But now we've been required to use ORM frameworks to refactor part of your code worth refactoring. As I use Node.JS, there's no such type-safe benefits from ORM I could get. Besides, the code is already func...
The C Programming Language by Ritchie says that: The library routine sqrt expects a double type and will produce nonsense if inadvertently handled something else. So if n is an integer, we can use sqrt((double) n) to convert the value of n to double. But the following code works fine on my system: printf("%f",sqrt(9)...
I'm creating the design for a browser bookmark merging program and I've ran into a design problem that I've seen before yet I've never come up with a good solution for it. So lets say I have a Browser class: Browser: String bookmarkFilePath String type Bool bookmarkFileExists() When my program runs I will want ...
I'm adding copyright notices to all my source code files: Copyright (C) 2013 My-First-Name My-Surname But what if someone else is also named My-First-Name My-Surname? What does courts think about that? How would they know who is the real author? Is there something I can/should do about this situation? (So they'd know...
To be specific, I want to know which function/types in libpri and being used in the Asterisk project. I'm not traditionally a C programmer, but I know some basic stuff because I took a class in college.
Can anyone give an example of instances in which the AF_UNIX i.e unix domain sockets are used for process communication in a unix-based system
I need a little help understanding the implementation of radix exchange sort algorithm. Radix exchange (I don't know if it's the exact name in english based literature) is a lot similar to quicksort, but uses binary representation of numbers. Firts we look the highest digit in binary representation, and then using two ...
I'm writing a lexer in JavaScript. It's pretty typical - rules are specified with regular expressions and produce a token. I am unsure of the best way to handle when multiple rules are matched. The existing lexers I've looked at handle this by picking the rule with the longest match. It also seems like a viable strateg...
Say I have a model written in php whose properties are the columns of a table in a db and each instance of the model represents a row in the table. I also have a page ('view') where I display the contents of each column one row at a time, starting with the first row (id=1). Above this display are two buttons, one which...
Reading the Go language specs, I read in the intro: "The grammar is compact and regular, allowing for easy analysis by automatic tools such as integrated development environments." Is the word "regular" here a technical term, or should it be interpreted just as a vague English word?
I'm reading the Go language specification. The section on comments states: Line comments start with the character sequence // and stop at the end of the line. A line comment acts like a newline. What is the point of specifying that a line comment acts like a newline? Couldn't line comments simply act like empty strin...
For some time now our Scrum teams have experienced recurring impediments caused by external factors to the team. The teams have discussed the impediments in their retrospectives and also brought it up on "Scrum of Scrums". It seems that the impediments may require involvement by management as it requires some rather si...
I have searched around for a way to run a program meant for ARM processors on an Intel computer, but I can only find ways to do the reverse, to compile Intel programs for ARM. Are there any open-source cross-compilers that will allow me to do so? Thanks for your help.
Lest's say I have user stories about using product catalog in shop: As an administrator I can add/modify/delete catalog items (one or more user story, doesn't matter here) As a customer I can search product catalog As a customer I can view product details Each of this stories rely on predecessor: design and create d...
The source code I'm working on at the moment performs numeric calculations between a bunch of different properties belonging to different data models. All the calculations are coded in a big method with a lot of If statements than make it very complex, difficult to change and it contains some bugs. I have not found a ...
My program should perform following task: It listen on http port after getting request it does following things. Connect to gearman Parse gearman payload to JSON (Upto 100 bytes) Connect to Redis Parse redis payload to JSON (256 bytes to 10KB. 80% cases it will ~256 bytes) Put some data in MySQL Put data in Redis...
Similar question here (but not the same) because I am interested in which specific algorithms work particularly well in Lisp. Lisp tutorials always give the example of finding factorials, but wanting to find factorials is not a good enough motivation to use Lisp. I've heard that Quicksort has a particularly elegant imp...
I am completely new to designing algorithms with graphs. I am following CLRS and other video lectures in Youtube, notably from IIT/MIT. They are pretty good, and I currently have decent idea about graph data structures, search, spanning-tree, etc. However, I am completely clueless as to how to identify a coding problem...
I've got an existing SQL table structure that looks like this: Orders - order_id - organisation_id - [all the rest of the order data] Organisations - organisation_id - [all the rest of the organisation data] Users - user ID - [all the rest of the user data] I'm trying to change the Orders table so that an Order can ...
I have been trying to understand the DOM, and although I have a fair idea of what it is, there are certain ideas I just cannot pin down. I will list down what I think the DOM is and my questions will be inline. The DOM is a fully object-oriented representation of the web page. The W3C DOM standard forms the basis of ...
As I have been taught - one controller = one use case. But I have: OutsiderController SupplierController (which extends OutsiderController) SubContractorController (which also extentds OutsiderController) And I want to do the SSD for SupplierController and SubContractorController. What do I do? Do I write in both SSD...
Initial situation: We are developing a software platform where products can be generated by configuring different components and adding additional ones. The platform is developed several years by a little developer team. Now the platform is more and more used, we get new developers as well as testers. We are currently ...