What are "siblings" of .json files?

I was reading through the documentation for Bower here and I read this line: "The .bowerrc file should be a sibling of your project's bower.json." What does that mean exactly? Searching Google returned questions of people asking how to find siblings, but not what they actually are.


Doctrine 2 and Concrete table inheritance

I use Doctrine 2 and I've read some articles on inheritance strategies' mapping with ORM. I've seen three main strategies : "Class table inheritance", "Concrete table inheritance" and "Single table inheritance". With Doctrine 2, I managed an install of "Class Table Inheritance" (CTI) and "Single Table Inheritance" (STI). In some cases, I think use the "Concrete Table Inheritance" is most appropriate, but i didn't find any documentation which show this strategy in Doctrine 2. Why there is no "Concrete Table Inheritance" with Doctrine 2 ? Is it for performance ? What is the reason ?


When to use default access modifier?

I want to understand, from design point of view, in what situations I should use default access modifier, and when I shouldn't. I found this related question, that provides some basic explanations, how ever I am searching for an answer that will target encapsulation and single reason of change principles, and address it in more professional way.


Should security restrictions cause a service to return null or throw an exception?

I'm in a bit of a disagreement with a more experienced developer on this issue, and wondering what others think about it; our environment is Java, EJB 3, services, etc. The code I wrote calls a service to get things and to create things. The problem I ran into was that I got null pointer exceptions that didn't make sense. For example, when I ask the service to create an object, I get null back; when I try to look up an object with a known valid ID, I get null back. I spent some time trying to figure out what was wrong in my code; since I'm less experienced I usually assume I've done something wrong, but it turns out the reason for the null returns was security. If the user principal using my service didn't have the right permissions for the target service, then it simply returns null. Most other services here aren't documented very well either, so apparently this is just something you have to know. This is rather confusing as a developer writing code that interacts with the service. It would make much more sense to me if the service thew an exception that would tell me that the user didn't have the proper permissions to load this thing or to create that thing; I would then immediately know why my service wasn't working as expected. The more experienced developer who wrote the service argued that asking for the data is not an error condition, and that exceptions should only be thrown in an error condition, not when the user doesn't have access to the data. This data is often looked up in a GUI, and for those users without the right permissions, these things simply "do not exist". So, in short: asking is not wrong, hence no exception. Get methods return null because to those users those things "don't exist". Create methods return null when the user wasn't allowed to create that thing. Is this normal and/or good practice? I prefer using exceptions because I find it much easier to know what's going on. So I would for example also prefer to throw a NotFoundException if you asked for an object with an invalid ID, rather than returning null.


Where should I put a method that returns a list of active entries of a table?

I have a class named `GuestbookEntry` that maps to the properties that are in the database table named "guestbook". Very simple! Originally, I had a static method named `getActiveEntries()` that retrieved an array of all `GuestbookEntry` objects. Each row in the guestbook table was an object that was added to that array. Then while learning how to properly design PHP classes, I learned some things:   1. Static methods are not desirable.    2. Separation of Concerns   3. Single Responsibility Principle If the `GuestbookEntry` class should only be responsible for managing single guestbook entries then where should this `getActiveEntries()` method most properly go? ## Update: I am looking for an answer that complies with the SOLID acronym principles and allows for test-ability. That's why I want to stay away from static calls/standard functions. DAO, repository, ...? Please explain as though your explanation will be part of "Where to Locate FOR DUMMIES"... :-)


Out of all the projects out there, what is a good example to learn from?

Sometimes, you can learn a lot from just looking at a project rather than looking around for advice... What are good state-of-the-art projects out there that are very good examples to learn from?


Login from external application in MVC

We have an ASP.Net MVC application that use Identity provider to authenticate users. A new customer now wants to access owr application pressing a button inside their winform app. I started to modify my login controller adding a new HttpGet method that accepts username and password and follow the standard login path. It works yes, but now a security hole is open! Passing "password" as parameter is not a great idea. I'm thinking to implement an hashed-token system; the external app encrypt a token with username, password, timestamp, salt... I recive the token in the login method, compare token with locally generated one and continue with login. The problem here is that password inside identity schema is hashed (passwordHash property) so I cannot generate the token on my server side. **_Update_** I wrote a simple winform client with an HttpWebRequest to get the OAuth token from my web application. Now I've a valid token but how can I use this token to access my application?               var request = WebRequest.Create("http://localhost:2409/token") as HttpWebRequest;             request.Method = "POST";             request.ContentType = "application/x-www-form-urlencoded";             request.CookieContainer = new CookieContainer();             var authCredentials = "grant_type=password&userName=...     ...     token = dynamicObj.access_token;          ...          System.Diagnostics.Process.Start("http://localhost:2409/??????token=" + token);      Can someone help me?


Database design with performance issue and use of views

I am designing database for a school system. I am having to create a lot of tables and a lot of link tables to maintain a structure in the system. I am trying to maintain foreign integrity and trying to create unique data entry as possible. But this will create problem with queries when I start building out the system. I will have to make a lot of joins and I am afraid that this take a toll on optimization and performance. In this instance, I have a student who is taking a course for a subject. While he takes the course he can be borrow a book related to that subject from library. My tables would be a. Subjects with: id, name b. course with: id, name, subject id c. link table to know that the student is taking the course: id, user id, course id d. library item table id name e. a link table to know which library item the student is borrowing: library id, id from c I am trying to user primary key from c because this will make sure that if the user is no longer taking the course he would not be allowed to borrow a book. The link table will cascade if the relation does not exist between the course and the user. The problem with this is that. If i need to know the name of the subject that the student has borrowed book for. I have to join four tables. I can simply just add subject id id e to get the subject name. But that is what I hate. If this is really an issue with performance would using views make the queries faster and is it really feasible to implement views in a project. So I guess my questions in this are,   1. Is it really a big performance issue to make multiple tables with unique columns. I have heard indexing columns help quite a lot?   2. Are views helpful in maintaining the relational database and making the queries faster?   3. And in table c I have not used separate primary key id because I want to make sure that the one student can borrow one item at a time. Is this a good practice?


In PHP how to save directory the php file is in to a variable (centos)

so say my php file "example.php" is in the directory "/user/example" I thought that the line "$dir = getcwd();" would save "/user/example" to $dir but instead it is saving the directory that the user running the script is in, e.g. if I run the script from the root directory, the $dir variable will contain the root directory. Is there a command I can use or a tip you can give me so that I can save the directory that the php file is in?


What is latent parsing in NLP?

I'm reading a paper describing a NLP work, and I hardly catch the concept of a term, "latent parsing". Original paper: http://web.stanford.edu/~angeli/papers/2013-acl-temporal.pdf The figure in the page 6 seems to be helpful (I can't upload the figure because of my reputation)


How can I write complex validation and business logic that can be reused in both direct data model changes and pending dialog changes?

I was hoping for some advice: I need to design a software solution for a medium-sized java / Swing application. The application will have about 200 use cases requiring complex data validation and business logic. Typically, this is my usual design:   * Create a simple POJO for each use case, with a custom constructor and custom validation and business logic within it's execute method. These Operations implment simple and complex data validation such as required fields, unique names and more complex constraints.   * Create a single controller that has a method for every use case. Each method takes custom parameters, constructs and executes it's related operation.   * For the sake of simplicity, I won't mention details about Data Model notification or Operation queuing mechanism. This solution has worked will in the past because it encourages all developers to reuse existing controller methods and validation, however: The new application will use dialogs extensively for data entry; These dialogs are expected to implement the same complex data validation and business logic that the controller implements, however the dialogs are not expected to update the data model until the OK button is clicked. I hate the idea of writing multiple versions of the same complex validation and business logic, due to the maintenance nightmare it invites. How can I perform complex business logic and validation for both standard data model changes and "pending" dialog changes, given that the dialog doesn't commit it's changes until the OK button is clicked? The data model may be quite large, so creating an in-memory clone of it and the controller doesn't seem viable. Does anyone have any suggestions? If so, I'll be forever in your debt.


Why do some program after installation need the system to be restarted?

I was asked this question in an interview. After installation of programs on windows OS,some program need the system to be restarted while others not. What is the reason behind this? I googled but didn't get satisfactory answer. Thanks in advance.


How to test the data access layer?

I have a DAO method that utilizes Spring for JDBC access. It calculates a seller's success rate of selling an item. Here is the code:               public BigDecimal getSellingSuccessRate(long seller_id) {         String sql = "SELECT SUM(IF(sold_price IS NOT NULL, 1, 0))/SUM(1)                        FROM transaction WHERE seller_id = ?";         Object[] args = {seller_id};         return getJdbcTemplate().queryForObject(sql, args, BigDecimal.class);     }      How should I go about testing this method or any DAO method with JUnit? What are some best practices to test the data access logic? I am thinking of testing it against an embeddable database loaded with some data, but shouldn't we do integration tests similar to a production environment in terms of RDBMS and the schema?


combining ruby and C++

I've been discussing a conceptual project with a friend of mine and the the most effective way we've seen of doing it is writing the engine in C++ while the logic would be done in Ruby.   However, we would need data to be passed around often, for example:   * Engine reports that A happened, that gets triggered in a proc array (event "A" is passed but proc doesnt use it)   * Ruby decides that we need to wait for B to happen   * Ruby adds a proc to an array. The array of procs is iterated during each cycle in the C++ engine   * C++ engine reports that B happened and passes "event B (should be a ruby object)   * Ruby receives event B and decides what to do next I don't work with multiple languages often, and was wondering if it's possible to implement things in this way. I know that there's the ruby VALUE in C++, but would like to know the standard way of combining the two. (of course I know ruby follows the perl "more than 1 way to do it", but there's often a standardized way) Edit 1: I've ran a quick test with SWIG and met a problem really fast. From what I can see, ruby (1.9.3p286, though it uses the 1.9.1 gems afaik) can't load the shared object. I've put the code, actions done and more information here. Edit 2: Tried compiling to latest ruby and swig version (god, I love ABS) to see if maybe it was some compile error upstream. I got no errors and problem remains. Seems it might be an incompatibility between this SWIG version and Ruby version... Or a problem with the current Ruby version.


What architectures are used commonly in php?

I want to know what architectures are commonly used in developing PHP web applications. I've used MVC earlier for J2EE, but in J2EE everything is separated as part of the language itself (pojo/servlet/jsp). I don't know how to utilise MVC in PHP as the separation of concerns is code- only. Can we use MVC in PHP as well and if so, how? Are there any other architectures that I should be aware of?


Is it legal or ethical for me to use my previous employer's code in a new project?

I participated and wrote a large amount of code in a project which my current company outsourcing to my former company last year. After that I left my former company and recently join in my current company. Several days ago, my current employer asks me to continue the project on top of the existing code (my current company owns the copyright and they have the code). I think it is neither ethical nor legal to do this. So should I refuse my current employer? Could my former employer take me to court if I undertake the project?


What are the causes that lead to an overbloated software?

Today I decided to perform a clean install for Creative Sound Blaster drivers, as they always start glitching all by themselves after some time. And that meant I had to go through the whole cleanup procedure. And that took me almost 2 hours.. And honestly, I can't see a reason why?! And although Creative, IMHO, is an absolute 1st place winner for producing poor quality software that never works, the bloat problem is not exclusive to them. PC with Canon digital camera driver will have around 10 Canon entries that are interconnected with all sorts of connections. Visual Studio is also a prime example, there is around 50 or so entries for full install, and repairing that thing is only possible with complete nuking. And once it even managed to ruin the whole OS install when I was upgrading from VS2k8 to VS2k8SP1 or something. As it turns out 5GB of free space was not enough for 300Mb patch... So this really seem to be a widespread problem. Almost every application nowadays usually contains unpackers, multiple spywarish "friends" that are installed, drivers are usually around 600Mb for everything including printers and so on. But why? Is it developer fault? Applications like that are nightmare to support, they never work 100% nowadays, and almost all users I know are very negative about all that bloat they get as a mandatory driver install for USB thumb drive/Printer/Camera/Sound Card/Browser. It seems that NSIS from Nullsoft is the only clean setup system that is not bloated, from what I know, for example, Firefox install. Clean, pretty much xcopy based install without any problems. So why people are not using simple setups and applications that are not rooted over 30 layers of interconnection? Is it because developers are lazy? Use of codegen tools? Is it because corporations force heavyweight apps as something users will love? What's the cause, and is there a hope software will return back to basics someday? What are the steps to avoid writing bloat when you start new application from scratch?


Which languages I should learn to develop an android app

I have some free time. I want to develop some android apps. I know a little bit of html, css and basics in C programing. The problem is I don't know any java or .net. I have to start from scratch and should learn on my own. Is it possible? If possible what should I learn to make some quality apps? I can spend time if I can learn.


Worst practices in C++, common mistakes

After reading this famous rant by Linus Torvalds, I wondered what actually are all the pitfalls for programmers in C++. I'm explicitly not referring to typos or bad program flow as treated in this question and its answers, but to more high-level errors which are not detected by the compiler and do not result in obvious bugs at first run, complete design errors, things which are improbable in C but are likely to be done in C++ by newcomers who don't understand the full implications of their code. I also welcome answers pointing out a huge performance decrease where it would not usually be expected. An example of what one of my professors once told me about an LR(1) parser generator I wrote: > You have used somewhat too many instances of unneeded inheritance and > virtuality. Inheritance makes a design much more complicated (and > inefficient because of the RTTI (run-time type inference) subsystem), and it > should therefore only be used where it makes sense, e.g. for the actions in > the parse table. Because you make intensive use of templates, you > practically don't need inheritance."


Developing using a non-official kit on the Android?

I have been doing some research on developing on the Android platform and found that the only way to develop an app using C++ is using the NDK. I also came to know that the NDK has limited support to C/C++, with C++ having even lesser support than C. Here's the problem. I need to develop using C++ as I'm not very familiar with Java. In fact, not familiar at all. I'm still 18, so I don't have much experience with many programming languages. After doing some more research I have found a non-official NDK, called the NDK-CrystaX that implements more support for C/C++ than the official NDK. Before I start using I have to know if it would be legal to use this custom NDK in an Android app and still be able to sell it on the Android Marketplace. Is it? Or is it not? Another solution would be if the newer releases of the NDK had full support for C/C++. But I'm not sure of that either, so I'm seeking your generosity again and asking you to share your knowledge on this too.


Is partial classes modern Subject-Oriented programming?

Important discussion follows: C# and other language have made partial classes more popular. But isn't this really a tool that have reinvented the subject-orientated programming wheel? What do you guys think? Should subject-orientated programming be taught more and get more focus to help programmers utilize partial classes better? Resources: http://ptsoft.net/tdd/papers/MDSoC_Thesis_MsC_Final.pdf Low important optional side track for discussion follows: I my self use a form of subject-oriented when making a space imperium hobby project in unity3d. In unity3d gameobjects (3d models) that exist in the 3d engine can have "scripts" (read classes or any code file) attached to them with some special global functions that can run on each frame. This is a perfect ground to use subject orientated programming. Take for example a fleet gameObject, since i can attach one value class (weight, name, attack, defence), one gameRule class that handles all business logic and if i need a new subject, for example "Raid" i only add a raid class to the gameObject and all these are separated. These all implements a a general interface for their subject so they can be checked for and accessed by " IRaid = gameObject.GetComponent[of IRaid] if IRaid is not null: code "


Should I have different automated Selenium tests for different screen resolutions?

A website I'm creating is going to have three breakpoints: desktop, tablet landscape, mobile. Should I write a test for each resolution?


How to delete an object when other things reference it (and not making the code full of inter-dependencies)

**The situation:** In my program, there are a list of cues. To call a cue at a certain time, there are objects called Triggers. Cues have many public methods that allow them, among other things, to be "fired" (which causes them to perform an action). Triggers "fire" cues when they are activated. They do this by taking a reference to the Cue and then calling Cue.fire(). The triggers are all stored in a class called TriggerManager which keeps them in an array list. Cues are part of a linked list with eachother. So, in summery: Triggers know about Cues, but Cues don't know about triggers; Triggers call cues at certain times. **The problem:** When I remove a Cue from the linked list, it's still "alive"/hasn't been garbage collected because there's a Trigger with a reference to it. The natural thing would be to delete the Trigger, but that creates a host of issues that need to be solved: The main one is this: Since, the Cue doesn't know about the Trigger that references it, how do I get it to be deleted. (Especially since its referenced by a TriggerManager class). There has to be a way to do this without making Cues dependent on Triggers and Triggers dependent on their TriggerManagers OR Cues dependent on TriggerManagers, which should have nothing to do with Cues (Giving everything a bidirectional reference to each other will make the code complicated and hard to keep track of) **Question:** Is there a solution that will fix my problem while keeping the code manageable? Is my design inherently flawed? If so, how do I fix it?


Legal ramifications of use of the JavaScript trademark?

It's widely known that the name "JavaScript" is trademarked by Oracle (formerly a trademark of Sun, formerly a trademark of Netscape). However, others seem to have no problem using the JavaScript trademark. Google uses it in reference to V8, Mozilla uses it in reference to SpiderMonkey and in various other places, etc. Mozilla is the only one that seems to try to attribute the trademark to its owner (bottom of this page), although at the time of this writing it's incorrectly attributed to Sun rather than Oracle. For a long time, Microsoft used "JScript" as the name of their ECMAScript implementation rather than "JavaScript," presumably to avoid infringing on the trademark. Recently (I'm not sure when), Microsoft appears to have switched from the "JScript" name to "JavaScript." My understanding based on the version history is that they've written a new ECMAScript implementation and named it "JavaScript," leaving the old one named "JScript" (rather than retroactively renaming "JScript" to "JavaScript"). My question is this: Since JavaScript is trademarked, isn't it an infringement to use it in connection with the name of a product or technology (such as "Microsoft JavaScript") without permission? If so, where can I find records of agreements with Oracle/Sun/Netscape allowing third-party use of the trademark? I assume these documents would be publicly listed somewhere, but I don't know where to find them. And finally, if the trademark changes hands again, would previously-made agreements still be valid, or would they need to be re-forged with the current trademark holder? The reason I ask is because I want to know whether I can use the word "JavaScript" in the title of a product, for example a JavaScript library, without explicit permission, and whether I need to provide a disclaimer stating that JavaScript is Oracle's trademark.


How does a paid Saas actually work?

Could anyone explain to me how does a paid Saas work please? I know for free Saas you can just create some kind of registration and authentication process which allows the users to use all features. But how does a paid Saas work? Sites like Shopify, Volusion, and many others offer different features at different prices ranging from free to a few hundred dollars. But how do they manage to do it? Btw, I've only had experience with general purpose e-commerce sites, so this kind of advanced things are confusing to me. Thanks.


Options for software licensing for plugins?

I'm creating a software application where up until now, the majority of code and assets have been produced by me. There are smaller bits of code that I've taken from other places; these have all been licensed as "do what you want with it". I've gotten to a point however, where I want to incorporate fairly large parts of another project in mine, and this other project is licensed with GPLv3. I hadn't considered licensing issues with my software up until this point; as of right now it's just sitting on my machine with no official license. Incorporating this other project in mine would require me to adopt the GPLv3 license as well. I decided that while I'm okay with most of what I've written to be licensed under GPL, I want some of what I've written to be available for proprietary derivative works (which is incompatible GPL). So how do I get around this? What I've come up with so far is using "plugins" or add-ons for my app. While the base application is GPL, I can license the code I want for derivative works to be LGPL or even closed, and simply have them be plugins for my GPL app. Is this viable? My argument is that a plugin is simply something that adds functionality, and does not make my base application a derivative work of the plugin.


Allow entities owned by one user to be referenced by other users' entities

I am working on an Asp.NET MVC web application. I have the following (simplified) entities:               public class Course     {         public int Id { get; set; }         public string Name { get; set; }         public string Description { get; set; }         public User CreatedBy { get; set; }         public EventArea EventArea { get; set; }     }          public class EventArea     {         public int Id { get; set; }         public string Name { get; set; }         public string Description { get; set; }         public User CreatedBy { get; set; }         public CoOrdinate CoOrdinate { get; set; }     }          public class CoOrdinate     {         public int Id { get; set; }         public int Latitude { get; set; }         public int Longitude { get; set; }     }      Users can register and create their own Course entities. Each Course has a geographical location, represented by an EventArea which can also be created by a user. As an EventArea represents a geographical location it should be available for use by other users who want to create a course in the same location. However making EventArea entities available to users other than the creator raises the following questions:   1. What happens if the EventArea is modified or deleted by the creating user?   2. Who should be able to view/edit/modify an EventArea entity? Any alternative suggestions for how to approach a scenario where an entity created by one user can be referenced by a different user?


How to learn what the industry standards/expectations are, particularly with security?

For instance, I was making my first mobile web-application about a year ago, and half-way through, someone pointed me to jQuery Mobile. Obviously this induced a total revolution in my app. Rewrote everything. Now, if you're in the field long enough, maybe that seems like common knowledge, but I was totally new to it. But this set me wondering: there are _so many_ libraries and extensions and frameworks. This seems particularly crucial in the category of security. I'm afraid I'm going to find myself doing something in a professional setting eventually (I'm still a student) and someone's going to walk over and be like, _My god, you're trying to secure user data **that way?** Don't you know about the Gordon-Wokker crypto-magic-hash-algorithms library? Without it you may as well go plaintext._ How do you know what the best ways are to maximize security? Especially if you're trying to develop something on your own...


Long-term Freelance contract: should it have a salary-day or not?

I don't like to speak about money. I just like to work. I still believe in a relationship between good work and good compensation. Hence I don't want ask my employer about my compensations, actually they are asking me. So I created a liberal contract with unspecified salary-day -- I did not want to lose my rights to my own projects and I did not pay any attention to the salary-day.   1. Now the firm said that they would have paid me 1 month earlier if I had provided a tax -paper. I provided it before the next payment -day (unspecified).   2. During the next month, the co-employer pretty much blocks my working -- does not allow me to access working repository and the co-employer goes to cruise when we should finalize a project so I cannot do anything.    3. Now the project is not finalized, the co-employer has apparently provided some false statements to the boss about my doings (not getting anything for one month's work and 1 month when the co-employer pretty much wasted just my time) -- I was only allowed to debug the code of my co-employer and not to do anything.   4. I feel that co-employer did not allow me to work by purpose so that they have an excuse not to pay any salary.  The co-employer says that I cannot speak to the boss. The boss say that I need to speak directly to co-employer, not to him. I haven't said anything about the situation. I did not get things done because I was not allowed and now I am not even allowed to speak. Boss is the person who pays salaries. But both boss and co-employer have stages in the firm -- I think co-employer and boss are the same person pretty much, they created a theatre so that they get almost 2 month's work for free. Now I have multiple ideas how to avoid this kind of situations in the future:   1. specify the salary day   2. make sure you can speak directly to the manager and the boss, not through middle-hand   3. other?


many include files vs one large include file

The company I work for is in the process of completely overhauling our current intranet site by moving it onto a Drupal framework. One area I am questioning is the number of include files we have. As it exists right now, every single .php page has a corresponding .inc page. There are .inc pages that provide certain functionality, but aren't tied to a specific page. However, each .php page includes multiple files - at a minimum, it will load the .inc page corresponding to it, and a few general scripts. This makes trying to find a function definition a nightmare when debugging. My options right now seem to be the following: 1)Keep using this same system, but make it part of our convention to include a commented line stating where the function is defined 2) Consolidate all the include files into one large file. This would include class definitions, function definitions, everything. My concern here is that this file would get monolithic in a real big hurry. However, it would have the advantage of keeping all function definitions in one place. I don't like either option to be honest. My goal is to reduce dependencies and make our code readable and easy to navigate. What is our best method to handle this problem? I should also state that this is very much legacy code - it hasn't been refactored since it was created in 2003-2004. Just to give you an idea what I'm working with, there is a lot of php echoing html:               printf("\n");     printf("
\n");     printf("
\n");     printf("Select Division:	\n");     printf("<select name=\"div\">\n");     printf("  <option value=1 \"selected\">Division1\n");     printf("  <option value=2>Division2\n");     printf("</select>	\n");     printf("
\n");     printf("
\n");     printf("<input type=\"submit\" value=\"Next->\">	\n");     printf("
\n");     printf("
\n");     printf("\n");


Directory structure (file system design)

I was looking at how file systems are designed and noticed that most places say that the directory hierarchy can be implemented using a hash table. Could someone please explain me how using a hash table to store a directory structure works? For example, what would happen if I add a file/ directory or move a directory, how does that affect the hash table? Also, how are paths involved?


Polymorphic engines in C and/or C++

I stumbled across polymorphic engines and I don't know anything about them. However, I am curious about how they are written. Every example that I've looked up writes them in assembly, my assembly is not good at all; I know just a few instructions here and there but not that well. On the other hand, I am good in C and C++. I am familiar with the concept of polymorphism in C++ but after reading about polymorphic engines, I am assuming that they are different from the polymorphism in C++. I'm just looking for simple code that shows encryption/decryption and/or obfuscation of code using C and/or C++ How can techniques such as using virtual keyword in C++ be used to obfuscate or encrypt the code in an application? NOTE: I was told to transfer this question from stackoverflow.com to this place.


Functional testing in the verification

Yesterday my question How come verification does not include actual testing? created a lot of controversy, yet did not reveal the answer for related and very important question: does black box functional testing done by testers belong to verification or validation?   * ISO 12207:12208 here mentiones testing explicitly only as a validation activity, however, it speaks about validation of requirements of the intended use. For me its more high level, like UAT test cases written by business users   * ISO mentioned above does not mention any specific verification (7.2.4.3.2)except for Requirement verification, Design verification, Document and Code & Integration verification. The last two can be probably thought as unit and integrated testing. But where is then the regular testing done by testers at the end of the phase? The book I mentioned in the original question mentiones that verification is done by static techniques, yet on the V model graph it describes System testing against high level description as a verification, mentioning it includes all kinds of testing like functional, load etc. In the IEEE standard for V&V, you can read this: _Even though the tests and evaluations are not part of the V &V processes, the techniques described in this standard may be useful in performing them._ So that is different than in ISO, where validation mentiones testing as the activity. Not to mention a lot of contradicting information on the net. I would really appreciate a reference to e.g. a standard in the answer or explanation of what I missed in the ISO. For me, I am unable to tell where the testers work belong.


Problem in getting the array value at jsp page!

**js file:**               function savethechanges(){     for(var i=0;i<count;i++)     {         dropdown1[i]=document.getElementById("sel"+i).value;         kot[i]=document.getElementById("kot"+i).value;         item[i]=document.getElementById("itemcode"+i).value;         if(dropdown1[i] == 0){             document.detailsview.action="BillCB.jsp?method=" + "11" + "&itemcode=" +item[i]+ "&kot=" +kot[i]+ "&itemStatus1=" +dropdown1[i]+ "&billno=" +billno;         }         else if(dropdown1[i] == 1){             document.detailsview.action="BillCB.jsp?method="+"9"+"&itemcode="+item[i]+"&kot="+kot[i]+"&itemStatus1="+dropdown1[i]+ "&billno="+billno;         }         else{             document.detailsview.action= "BillCB.jsp?method="+"10"+"&itemcode="+item[i]+"&kot="+kot[i]+"&itemStatus1="+dropdown1[i]+ "&billno="+billno;         }     }     }      **JSP file:** > while retrieving here the dropdown1 length is 1.but for kot and item length > is 18 please provide your solution!                case 11:      gotMethod = true;      billdetails_be.billno = Integer.valueOf(request.getParameter("billno"));      String[] kotCB2=request.getParameterValues("kot");      String[] itemCB2=request.getParameterValues("itemcode");      String[] statCB2=request.getParameterValues("itemStatus1");      int[] kotarr2=new int[kotCB2.length];      int[] itemarr2=new int[itemCB2.length];      int[] statarr2=new int[statCB2.length];      System.out.println("IN AVAILABLE:length of array is:"+statCB2.length);      System.out.println("IN AVAILABLE:length of array is:"+kotCB2.length);      for(int i=1;i<itemarr2.length;i++)      {             kotarr2[i]=Integer.parseInt(kotCB2[i]);      }      for(int i=1;i<itemarr2.length;i++)      {            itemarr2[i]=Integer.parseInt(itemCB2[i]);      }      for(int i=1;i<itemarr2.length;i++)      {           statarr2[i]=Integer.parseInt(statCB2[i]);        }      for(int i=1;i<itemarr2.length;i++)      {          int kotint2=kotarr2[i];          int itemint2=itemarr2[i];          int statint2=statarr2[i];          System.out.println( i+"the value of kot in available"+ kotint2);          int availablebill = websrv.availablebill(billdetails_be.billno, kotint2,   itemint2,statint2);        }      **design page(jsp)**               <%     for(int i=0;i<count;i++){     %>
       <input id="itemcode<%=i%>" type="hidden" name="itemcode" value=" <%=billdetails_be.get(i).itemcode%>">	     <%=billdetails_be.get(i).itemdescription%>	       <input id="quantity<%=i%>" type="text" name="quantity"  style="width:  30px;" readOnly="readonly" value="<%=billdetails_be.get(i).quantity%>" >     <input type="submit"  id="inc<%=i%>" onclick= "doIt1(1,<%=i%>);"  value="+" style="width:20px; height:20px; border-radius:10px; padding:0 0; " />      <input type="submit"  id="dec<%=i%>" onclick="doIt1(-1,<%=i%>);"   value="-" style="width:20px; height:20px; border-radius:10px; padding:0 0; "/>     	       <%=billdetails_be.get(i).price%>	       <%=billdetails_be.get(i).itemstatusdescription%>	          <select name="statusi" id="sel<%=i%>">     <option value="0">Available</option>     <option value="1">Unavailable</option>     <option value="2">Delete</option>     </select>      	                     <input id ="kot<%=i%>" type="text" style="border: 0px solid #000000;" name="kot"   style="cursor: text" readonly="readonly" value="<%=billdetails_be.get(i).kotno%>">	               <input id="myquantity<%=i%>" type="hidden" name="quantity1" value="     <%=billdetails_be.get(i).quantity%>">
      <%     }      %>     <input style="width: 150px; " class="btn btn-green btn-large" type="submit" name="save" id="save" value="save"  class="button" onclick="savetheChanges(<%=count%>);">    	      **PROBLEM** > 1.this is in js file ,from which i am passing the value to BillCB.jsp                document.detailsview.action="BillCB.jsp?method=" + "11" + "&itemcode=" +itemcode1[i]+ "&kot=" +kot1[i]+ "&itemStatus1=" +selection[i]+ "&billno=" +billno;      > 2.this is in BillCB.jsp file (method :11)                String[] statCB2=request.getParameterValues("itemStatus1");      int[] statarr2=new int[statCB2.length];      System.out.println("IN AVAILABLE:length of STATUS array is:"+statCB2.length);      > In AVAILABLE:length of STATUS array is:1-this is the problem.


What is a "lifted representation"?

Just ran across this term here: http://www.codemesh.io/codemesh2014/viktor-klang > "We'll demonstrate the Flow API—a lifted representation—as well as a > pluggable way of transforming the lifted representation into the execution > representation—Flow Materialization." Googling did not help much.


Is it a bad practice to use inline styling with generated code?

If I'm using a technology like Grails. It's really easy to wind up with inline styling. Are there any downsides to auto-generating code with inline styling? Is this considered bad practice? Why?


Why use protocol, not call the method directly?

I was asked this question in an interview. For eg: `UITableviewDelegate` protocol has `CellForRowAtIndexpath`. Why make it a delegate method in a `protocol` not a method in the `UITableView` class and call it directly?


Syntax tree dump format

When writing a compiler, it is useful to include the ability to dump the abstract syntax tree in a human readable format, for debugging purposes. This output might also be useful for other tools like IDEs and code analyzers, so I might as well provide it as a documented feature. Given that, what format would be the most useful? It doesn't make much difference to me as long as I can eyeball it, so I might as well provide e.g. whatever other tools would find easiest to read.


How does one effectively implement the 80/20 rule for developer time?

I am a developer at a bank where an 80/20 rule is implemented. 80% of the time you work on your assigned project and 20% you work on something that interests you. However, I'm not really sure how to do that. I'm hoping there are others out there who can provide me with advice on how to. My problem is that when I really get 'in the zone', all I can think about is the task at hand. If this is a 20%'er, the last thing I want to do is stop and go, lose momentum and go back to work on my main project. Am I suppose to work 4 days on something and 1 day on something else? or 4 weeks and 1 week? I know this depends on the company, but I'm hoping to get a feel for how this is done industry wide.


Any reference doc /model/ implementation of enforcing events dependency/ordering in distributed computing?

For example, Process P is listening to events E(A) and E(B), but to process either of the events, P needs the other event available too. Naively, when P receives either of the events, it will check if the other event is already received. If not, it can wait. But 1) this does not sound very efficient, especially when each process has many different types of events to process. 2) Also as the number of distributed processes increases to a large number, events are more tangled between processes, processes dies/restarts, etc. all these make the events handling more complicated. So I would like to know if there are any reference doc / model/ implementations for events handling under such a distributed computing environment?


How to manually detect deadlocks

I understand the concepts of deadlock well enough, but when I'm given a problem like the one below I'm not sure how to go about solving it. I can draw a resource allocation graph, but I'm not sure how to solve it from there. Is there a better more formal way of solving this?               Consider  a  system  with  five  processes,  P1  through P5,  and  five      resources, R1 through R5. Resource ownership is as follows.           •  P1 holds R1 and wants R3      •  P2 holds R2 and wants R1      •  P3 holds R3 and wants R5      •  P4 holds R5 and wants R2      •  P5 holds R4 and wants R2           Is this system deadlocked? Justify your answer. If  the system is deadlocked, list      the involved processes.


If I define a property to prototype appears in the constructor of object, why?

I took the example from this question modified a bit: What is the point of the prototype method?               function employee(name,jobtitle,born)     {     this.name=name;     this.jobtitle=jobtitle;     this.born=born;     this.status="single"     }     employee.prototype.salary=10000000;     var fred=new employee("Fred Flintstone","Caveman",1970);     console.log(fred.salary);     fred.salary=20000;     console.log(fred.salary)      And the output in console is this: ![enter image description here](http://i.stack.imgur.com/YfGwp.png) What is the difference `salary` is in constructor but I still can access it with `fred.salary`, how can I see if is in constructor from code, status is still employee property how can I tell for example if `name` is the one of employee or has been touch by initialization? Why is salary in constructor, when name,jobtitle,born where "touched" by `employee("Fred Flintstone","Caveman",1970);` «constructor»?


Preparation for Coursework in Computer Science

I know some Ruby, but could never make anything great, or even good. I just know that I am interested in programming and that it's what I want to do. What kind of programmer? No idea. I will be going to school for Computer Science and I don't know what I should do in order to feel more comfortable in my classes. What should I learn? There is so much that I don't know. All I know is HTML, CSS, and some Ruby. I don't know ANY Java nor do I know anything about Apache, MySql, or PHP. I would like to learn something that would (hopefully) help me in school. I don't want to start out and drown right away because I don't understand basic concepts in **___ _**. <\--- Anything CS related can fit in that space. What should I learn next? One problem I face is that I have absolutely NO idea what kind of programmer I want to be. I know that I don't want to program video games and I am not sure I want to do web dev (although I'm sure I don't know enough to really know WHAT to do.) Can anyone offer advice on some things I should be learning now in order to prepare?


Insuring your hands

I'm a software engineer - this means that I type all day. I was doing some woodworking with a friend and he remarked off hand to be careful, an accident that cut off a finger or more might be catastrophic for my career. I am sure there are workarounds, but they are probably not as convenient. Is there any way to buy insurance against injury to your hands or wrists? If there is, how much does it cost? Would you recommend it?


How do you know what a program needs to do to complete a given task?

I am a noob when it comes to programming. I just know some Ruby, that's really it when it comes to programming, but it's definitely an interest. In learning to program, I give myself tasks to complete in order to better learn Ruby but I am finding that a lot of my problems in programming deal with how to execute a task. For example: In writing a SERP checker (which is, sadly, half complete because I can't read PHP) I found a PHP script of what I was programming. I used it as sort of a template in order to write my checker. (I'm not actually going to use my checker, just a task for me to learn.) Anyway, when I was investigating the PHP I learned that the script does a lot of things I wouldn't expect it to do. I knew NOTHING about how I was going to get the script to make a Google search, how it was going to collect the data, etc. How do I learn these things? If I were to make this script from this guy's template, all I would learn is how to make a SERP script. But how did this guy learn how to make the script? What elements to put in/use? Something a friend found in my script (a bug) that I never even considered was related to differences in Windows vs Linux (I unfortunately have to program in Windows until I partition my hd and slap a linux distro on there. The only reason I have Windows is because the whole Steam on Linux thing was a hoax.) It had to do with newlines, spaces, or something.. I don't remember off the top of my head. How was I supposed to have the foresight to know about the bug? How would I have caught the bug if my friend who is uber savvy hadn't pointed it out? And really, the most important part of my question is the above part: How do I know what elements* (*if I use the word 'functions' here I worry it would be confused with methods...) I need to put in a program in order to complete a given task?


How do programmer-seeking employers see Bioinformatics degree?

I love programming, but I also love biology. Basically Bioinformatics sounds fun to me. However, there is a fat chance that I won't get a Bioinformatics job and will be forced to build my career around regular programming. Therefore a question: does it matter (much) for an employer if he is looking for a regular programmer but finds a Bioinformatics diploma? Or is it the same _in the long_ run as a regular Informatics diploma?


How much AJAX is too much?

My current project is part of a highly linked architecture, with individual systems each owning certain pieces of data, and exposing them RESTfully. Both our web services and our user interface take advantage of this linkage, storing links to the resources in other systems rather than storing a copy of the data, and presenting composite views by fetching the current state of those resources. For example, my system might be responsible for a yearbook of people (I'm not using our real data and relationships here, of course). People are owned by another system, and perhaps have contact information (email addresses, phone numbers, twitter handles, etc). That contact information might be stored in another system that has details about the phone number or email address. In order to present a view in my user interface, I then have to fetch my own data and follow the links in order to present the appropriate details from these other systems. I could cache certain parts of this information but likely want to retrieve the newest details. In some of my pages, I have a reasonably small number of lookups to do this kind of data enrichment. In other pages, I am presenting a lot more information and end up with an explosion of data as I get a list, expand each element, expand each of those, and so on. I have experimented with providing a service which does this aggregation and returns all the data needed by the view in a single response. However, I am not sure whether this is the cleanest way to provide this. Can anyone suggest some strategies for determining when I should directly use AJAX requests to fetch this data? At what point should I switch from individual requests to providing aggregated services to build the data? Or is there some other technique I could apply?


Beginning Perl?

What is the best book for beginning Perl? Where to learn Perl from the basics? I only know bash/Linux at an intermediate level. I would like to learn Perl because it has the same syntax on every operating system unlike some shell scripting languages.


Use model for “everything” in MVC?

This question is a result out of the discussion HERE and was moved from HERE. Is it really good practice to supply EVERY value you display in any view via a model?   Especially variables like the current username. Even Microsoft odes the following in their default template for the `_LoginPartial` in ASP.NET MVC 3+:               "Hello " + User.Identity.GetUserName() + "!"      I think this is OK to not supply this via a model as it is much better in light of maintainability. Or should you obay the "MVC rules" and add a model/sub-model to every page/model to supply such stuff and pass it around in your views and partials? **How do you solve such "problems" or what do you think is the best way of doing such stuff?** Inheritance would be an option:               public class BaseUserModel     {         public string UserName { get; set; }     }      Require every model to inherit from a base model like above containing such values.   But could that cause problems if you need/want to inherit another class for some model?


Are there numbers that are not representable in base 10 but can be represented in base 2?

`C#` has the `decimal` type which is used for numbers that needs exact representation in base 10. For instance, `0.1` cannot be represented in base 2 (e.g. `float` and `double`) and will always be an approximation when stored in variables that are of these types. I was wondering if the reversed fact was also possible. Are there numbers that are not representable in base 10 but can be represented in base 2 (in which case I would want to use a `float` instead of a `decimal` to handle them)?


What is the definition of Time on Task?

Microsoft Guru Eric Brechner discusses measuring "time on task" in his book "Hard Code". The discussion comes up during a section on Agile - Scrum. My guess is that it means "time spent to complete task X", but then he goes on to discuss time on task in terms of percentages by team. So I don't know how to make this logical leap. In the Microsoft context, what exactly is "time on task"? * * * First > The daily stand-up meetings in Scrum are highly organized and collect useful > data. The team organizer (Scrum Master) simply asks all the team members > what they accomplished since yesterday (and how long it took) [...] Then > Tracking how long it took is my team's small contribution to Scrum at > Microsoft. By adding this information to the burn-down data (how much is > left to do), you can produce fantastic cumulative flow diagrams, measure > time on task and work in progress, and better estimate team capacity. > Typical time on task is around 42% for production teams; 30% for teams > focused on communication--like mine--and as much as 60% for co-located > feature teams.


What are the important factors for database table design and object design?

When I do database table design, I often wonder if I should try to make the table as simple as possible, or if I should make the object as clear as possible. The requirement is to store all month of the year's salesTon and gross profit. I design from the object.The object has fields year, month, salesTon and gross profit. For this situation when I need save data to the database, it will save 12 rows(one row one month). This object has a relationship with another object (customer). so when save it will save n(customer)*12 rows per one time. It will do a huge insert operation. I'm afraid that tihs will make the db slow. Another design is to just use one object. One object to save the whole year - no need to split the object in to months. But in the object will has 12*2's fields like(month1_sales_ton, month1_gross_profit, month2_sales_ton, month2_gross_profit.......), this situation make save least rows, base on n(customer) per time. But since the second situation doesn't have month, I can't write the common method when I want to search one year's one month gross profit which accept year, month parameters. Maybe I should just write the method to just pass year and get whole a year object? i don't know. So which principle should I follow when I design the table?


In .NET (Visual Studio), when do you create a new assembly?

I'm working on a Silverlight application. I've split it up in several assemblies:   * Domain   * Repositories (everything with persisting to the Sterling database)   * UI   * ... This is how I've learned it, but I wondered. If you know the DLLs are not going to be reused, is it necessary to split them up? Or could you put everything in one assembly and use folders and namespaces to keep it tidy? I've also seen projects that have too many assemblies. Instead of using namespaces where it would have been appropriate. So: when do you create a new assembly for some new piece of code? Any good resources on this subject? And do you split code up technically (domain, data, ui, etc.) and/or functionally (i.e. patient-administration, patient-medical, hospital-logistics, ... - probably only for bigger, enterprise level applications)?


Should you version web applications?

I've recently had a discussion with a coworker about versioning web applications. I don't think you need it at all, and if you just want a sanity check to confirm your latest release is live, I think a date (YYMMDD) is probably good enough. Am I off base? Am I missing the point? Should I use web application version numbers


Abstract event queue for GUI/model communication

I hope this isn't so general a question as to be thought a "discussion." I'm writing a simulation of an old (ca. 1960) computer, and I'm thinking about how to queue events from the GUI to the CPU "model." The GUI consists of momentary-on buttons (pushbuttons and typewriter keys) and toggle switches. Of course, I don't want either the GUI or the CPU thread to block. As I think about the various sorts of events, I realize that **(a)** some should not be replicated in the queue, **(b)** some should be "expedited" -- i.e., sent to the head of the queue, and **(c)** some should simply be ignored under certain conditions. Then I realized that I'm probably trying to re-solve an old problem. Undoubtedly others have encountered similar requirements when trying to design a GUI-to-model event queue. So I wondered - has some brilliant person abstracted the requirements of _any_ GUI-to-model event-passing system, perhaps anticipating some functionality I haven't even thought of yet? I'm coding in Java, but I would be implementing the queue, and the queuing, myself - and furthermore, I doubt there's anything Java-specific to this problem.


How do you get better working conditions?

I work at a business who has a software side and manufacturing side. The software we write is sold as a package along with other hardware that our customers purchase. I basically work in a warehouse. There is one door that seperates the engineers from the warehouse noise. I have asked for noise cancelling walls to be put in. I have asked multiple times over 6 months to be moved up front to one of two vacant sales offices, but they seem reluctant to let an Engineer move into a sales office. In fact, sales are the only ones with windows and they get commission though they make mistakes or overpromise to the customer. So, my question is how can I get better working conditions without necessarily having to leave my current job? It is very hard to work and concentrate. **UPDATE** I think I can finally close this chapter in my life. I have moved on to a large corporation which follows CMMI religiously and has even started using Agile in many of its projects. Nevertheless, there is organization, respect, and genuine care for the engineers and scientists that work for them. Pierre was right - quitting was the right answer. My life does not nearly have the amount of stress it used to have because I now work for a place that is organized and knows what it wants its engineers to do along with treating them like they should be treated.


OOP private method parameters coding style

After coding for many years as a solo programmer, I have come to feel that most of the time there are many benefits to write private member functions with all of the used member variables included in the parameter list, especially development stage. This allow me to check at one look what member variables are used and also allow me to supply other values for tests and debugging. Also, a change in code by removing a particular member variable can break many functions. In this case however, the private function remains isolated am I can still call it using other values without fixing the function. Is this a bad idea afterall, especially in a team environment? Is it like redundant or confusing, or are there better ways?


Does Mono have a place in the enterprise world?

For enterprise windows-based solutions, .NET is the best choice sometimes. How is Mono looked at by the enterprises who have to use Linux (or rather prefer to use Linux) ? Assuming that the developers aren't a problem and they are familiar with .NET/Mono and other possible competitors such as Java. Would a medium/large company run Mono on their servers as opposite to technologies such as Java? Do you know of any such company ?


What is the bug workflow on your agile/Scrum team? Here is ours: \- If the bug is related to a story in the current sprint, we fix it. \- If the bug is not related to a story in the current sprint and it is not critical, it is sent to the product owner for prioritization. \- If the bug is not related to a story in the sprint and it is critical, we fix it.


How useful are function points?

How useful is it to measure function points? We use function points at my new job. I've heard of function points but haven't had any training or experience... but I don't have much confidence in things that cannot be explained succinctly.


Is Google's Page Speed not working fine?

I've been making small improvements to a public ASP.NET site that I have and have ran it through Google's online Page Speed several times. I have a specific problem, but something that really threw me off was that even if I didn't make any changes and just kept running it time after time (5 minutes intervals) I'd keep getting different scores by +-1 or 2 points. That is just weird in itself. Anyways, The only medium priority item that I have left is that PageSpeed says that some of the images do not have an expiration date (or have the expiration date in a very near feature), which I cannot see how it's possible, since they are static resources (images), and I setup the expires to 60 days after the initial request. It's not even a week from now, and they are in the exact same location that the rest of my images are (and about 95% of them are not being marked as not having an expiration date) So, how could it be that for Page SPeed, some of my images have an expiration date and others dont? I also ran HttpWatch against my site, and I analyze the specific request of one of those images, and it does have the max-age=5184000 header. any ideas are greatly appreciated. Thanks.


Visual Studio extension to highlight code reuse?

I was under a tight deadline to finish a project in C#, and as a result I feel I didn't code things in the most efficient way. Now that I have time to go back and optimize the code, I was wondering if there was a Visual Studio extension or other program/service to highlight blocks of code similar to each other. This way I can break them off into functions as I need to.


Open source for software, copyrighting, etc?

This may be more of a legal question: Some guy claims to copyright his source code but he has several publicly exposed source code examples on his website but just puts a copyright notice at the bottom of the site. Is it automatically assumed he can claim copyright on the provided example code he has throughout his 'open source' software directory? According to the US copyright office, he would need to apply for a copyright on each software sample or software program with publicly exposed source code on his site. Am I right on this? Also, his software samples on the site have no declaration of any licensing at the top of each sample. Can he still enforce licensing or copyright protection without the declaration? He claims people can only read it but NOT copy it for their own use or distribution. I thought this defeats the purpose of open source although his site is declared an open source directory. Can I assume his source code is for the taking since he has no licensing declarations anywhere in the code? I thought you can only copyright screens and workflow. Can you legally protect algorithm or programming logic? Thanks for providing this great resource.


Is "PHP and MySQL Web Development, 4th ed." an outdated book to learn from?

I want to get into web stuff, and thought of going with PHP+MySQL. I have experience in C#, C++, desktop graphics, but no web stuff besides HTML, CSS which I started learning 2 months ago. On SO PHP-book question, the highest rated book is "PHP Objects, Patterns and Practice". However, I'm not sure if it's a book to start PHP with... or is it? Most of the books mentioned in that SO question seem to be for those who already know PHP. I considered "PHP & MySQL Web Development, 4th Ed.", but someone mentioned that "it uses the mysql_* functions which are almost deprecated." Help?


Advantages and disadvantages to making common unit test scaffolding code

For the project my team and me are working on we often find that we need large pieces of scaffolding code. Creating domain objects with correct values, setting up mocks for repositories, dealing with the cache,... are all things that occur commonly throughout the tests. A lof of times we're working with the same basic objects that are central to our domain (person,...) so lots of tests create instances of these objects for other objects to work on. We have a lot of different solutions using the base domain so this kind of code is often spread across those solutions. I've been thinking about creating common classes that do a lot of this scaffolding. This would allow us to request a fully instantiated person with everything set up (access via repository, caching...). This removes duplicate code from our individual unit tests but would also mean there is a large amount of code that probably does 'too much' per test (as it would set up a full object and not just the parts required). Has anyone ever done this? Are there any insights, remarks, thoughts... you can offer that might validate or invalidate this approach?


How do you deal with changing requirements?

In my current job it feels like we have a lot requirement changes. We are an "Agile" shop, so I get that we are supposed to adjust and what not, but sometime the change is large and nothing trivial. My question is, how do you effectively communicate the cost of the change? Because of being agile, if a change is big enough something will get dropped from the current sprint, but it usually just get added next time around. Since our model is SaaS, the end customer is effectively the business itself, and they know they will get the cut feature _n_ weeks later. I guess what I am trying to get at is the removal of a feature really isn't anything to use for communication as it was only delayed by _n_ weeks. What other ways do you have to get the business to understand what a change costs?


How to deal with requirement changes in agile development model?

I know that in agile requirement changes should not only be planned for but also embraced. But I still don't know agile how to handle these changes.


Arguments to homologate Firefox in a Company

I developed a web project for my company and this project was designed to use Mozilla Firefox (including the javascript (jQuery)). However, now the company wants the project to be transferred to Internet Explorer. I know that in Google, there are several explanations about Mozilla Firefox, which I can demonstrate to the company. But is there any link showing that Internet Explorer runs the W3C standards and has several justifications for why using Mozilla Firefox? I searched on youtube and slideshare, but both have a very weak argument for me to select them and show to the company. The company where I work is still very naive to keep Internet Explorer. 1) The project is intranet. Only 400 internal employees can access the web. 2) The company argues that Mozilla Firefox is not approved by the company. Any suggestions? Any link which shows that the developers of the world hate Internet Explorer? A link explaining why developers do not like Internet Explorer? After the answers, I'm thinking of making a great slide with all the necessary arguments to the company homologue firefox. And yet, published in slideshare. EDIT: Someone here must be wondering why I have not designed, also for Internet Explorer. Welllll... As the deadline for project completion is always short, I developed the project focused only on Mozilla Firefox, because the browser Mozilla Firefox most respects W3C standards (and javascript too) than Internet Explorer.


Pull Frequency Parameters in MVC architecture

Assume a simple SPA (Single-page application), _maybe a dashboard_ and these basic conditions:   * The **Model** contains methods for accessing and displaying data;    * The **View** contains methods to load templates and apply model.data to template;    * The **Controller** manages the user commands;   * The **Router** handles the navigation; In our example, we will make sure that the user can configure the dashboard to update itself every _N_ seconds pulling new data from _back-end_ ( _pullFrequency_ ). In which component is proper set up the _pullFrequency_ parameter:   1. Model?   2. View?   3. Controller?   4. Router?   5. Somewhere else?


Why does a proportional controller have a steady state error?

I've read about feedback loops, how much this steady state error is for a given gain and what to do to remove this steady state error (add integral and/or derivative gains to the controller), but I don't understand at all _why_ this steady state error occurs in the first place. If I understand how a proportional control works correctly, the output is equal to the current output plus the error, multiplied by the proportional gain (Kp). However, wouldn't the error slowly diminish over time as it is added (reaching 0 at infinite time), not have a steady state error? From my confusion, it seems I'm completely misunderstanding how it works - a proper explanation of how this steady state error eventuates would be fantastic.


is JS a gradually typed language?

I was researching on statically typed and dynamically typed concepts and found out there is another type system called gradually typed. From wikipedia > Gradual typing is a type system in which variables may be typed either at > compile-time (static typing) or at run-time (dynamic typing), allowing > software developers to choose either type paradigm as appropriate, from > within a single language. > > In particular, gradual typing uses a special type named dynamic to represent > statically-unknown types and gradual typing replaces the notion of type > equality with a new relation called consistency (aka. compatibility) that > relates the dynamic type to every other type. The consistency relation is > symmetric but not transitive If I understand those concepts correctly, "Javascript" is a gradually typed language. Am I correct?


Is there tool agnostic terminology for source control activities?

My team is entering into some discussions on source control (process and possibly tools) and we would like a tool agnostic terminology for the various activities. The environment does have multiple (old) VCS's, and multiple desired (new) VCS's. Is there a standard definition of activities, or at least some commonly accepted set? Example activities (in CVS terminology):   * Branch   * Check out   * Update   * Merge


Best way: restructure an existing Team Foundation Server (TFS) solution

In my department we are developing several smaller AddOns for some unified communication server. For versioning and distributed development we use a Team Foundation Server 2012. But: there is only one large TFS solution for all of our applications and libraries:   * Main Solution      * Applications         * App 1       * App 2       * App 3     * Externals      * Libraries         * Lib 1       * Lib 2     * Tools The "Application" path contains all main applications. Those are not depending on each other, but they depend on the Libraries and Externals projects. The "Externals" path contains some external DLLs referenced in our Applications and Libraries. The Libraries path contains commonly used libs (UI templates, Helper classes, etc.). They do not depend on each other and they are referenced in the Libraries and the Tools projects. The Tools path contains some helper programs like setup helpers, update web services, etc. Now, there's some major points why I'd like to change this structure:   * We can't use server builds.   * It's uncomfortable to manage TFS scrum management with sprints, impediments, etc. with a solution structure like that.   * Every developer always has access to all projects in the solution.   * A complete build lasts too long if one accidentally hits [F6] in Visual Studio... What would you change in this solution? How would you break those projects into smaller Solutions, how should those solutions be structured. My first approach would be, to create one TFS project for each Application, Library and Tool. But how can I ensure that e.g. App 2 always contains the newest version of Lib 1? Do I have to monitor changes on Lib 1 and update App 2 manually as soon as the Lib changes? Or can I somehow force Visual Studio to always use the newest version of an external project somehow? **Edit:** On the TFS, there's just one TFS Team Project Collection, containing one TFS Team Project. The Team Project contains one large Visual Studio Solution, which contains several folders containing (see the structure above) with each of them containing multiple VS projects. My question is now, how would you re-organize:   1. The TFS Team Projects   2. The VS Projects


Advantage of 2-way merge sort against n-way

It's known 2-way Merge sort takes N*logN time. I wonder, what would be the running time if we split an array **of the size** N into N subarrays and then do the same thing as we would do for 2-way Merge?


What to do when you are faced with programming task that you have never done?

I started my career as a .NET developer 3 months ago and after a long training plan on diverse technologies, patterns and concepts the developers who were supervising me have decided that I am ready to join one of the many projects the company handles. I am very excited to finally be able to start coding. The team I have joined is rather small for now because were starting with a new project, which is great because I get to be involved in the entire life cycle of the project. It is a web based SPA project with a backed that uses ASP.NET MVC/ASP.NET Web API and in front-end the Durandal framework and related libraries. My problem is that after having a meeting with my colleagues and establishing the tasks and estimations for the next month I find myself in a position that I do not know if I am capable of taking on any of the tasks. I have never done any of the created tasks and I do not know how should I proceed. For example one of tasks created is creating a generic error handling mechanism for the entire application. How does one usually proceed when faced with tasks that he has never done?


When to fracture a web application design into multiple products

Have you had this problem? You are building a complex web application for a target market, and after a while you reach a point in complexity where you can't decide if you are building more than one product. A decision has to be made. Do you add features to turn it into a framework for multiple domains or do you resist the urge and focus just on the one product. I'll give you a theoretical example; You are building a web application for reviewing Movies and Television shows. Users can login and write their own reviews. After months of hard work you start to see how useful the application would be for reviewing Automobiles. All the terms/themes are for the Movie/TV industry. So you would have to refactor and take into account a multisite structure to run the web application for two different markets. What do you call this type of problem, and how do you know when you should and should not split the project up into multiple domains.


object oriented analysis, missing methodology

I've studied design pattern and oop principles, still feel that there is something missing in most design theories. Maybe the fact is that there is not a 'theory' as it is in database design.   Let me explain with an example.      Suppose that i want to **model different ways to produce orange juice**.      Let say that i start by a class `Oranges`, that models a lot of oranges that will be of a certain variety, of a certain ripeness, they may have been froozen etc., ant these will by my Oranges class properties.   Then i continue by providing Orange with a squeeze method.      This seems to be correct, because ties togheter the method to the data it applies to, that is the precondition to achieve encapsulation and other valuable oop principles.   _But quickly it comes out that it has not been a good choiche_ because there is not just one way to squeeze an orange. It would be preferrable to have a `Juicer` class whose instances contains details of the juicing method: by hand, with an electric juicer, including the pulp, not to mention mixing different varieties of oranges. Where the latter opens an whole new cathegory of possibilities that were not available (or not achievable with ease) if each Oranges instance would have been processed using its squeeze method. Say that we have performed a 'refactoring' of our oo architecture and move to another similar example that will get us to the point.   It is now a common practise to use an ORM to save class instances to database and get them back later. In what is it similar to the Oranges class example? Well, here i have a class whose instances may be persisted to a database, that is 'allow a particular process'. _But the class itself does not contain the logic for doing so_ , that actually is in the ORM classes. So it seems that the same process of 'externalization' of the Oranges example has taken place in this case too. ### And here is the question Given that it is desireable to reduce the number of attempts-and-refactorings to the minimum, what are the questions that a programmer should put in order to determine precociously if a method should be externalized to another class? Are all the methods of a class exernalizable or is there a set of _core methods_ that are inherently of the class itself and so not externalizable? ### Ideas As i said in the beginning, i'm not completely clueless, i feel more like that a 'comprehensive' theory is missing.   It's easy to put some examples:   if i have a class whose instances represent invoices, i will have a method 'calculateTotalAmount'. This is clearly an inthrinsic, core method of that class, as oppsed to the methods for saving that invoice to the database that will be 'external' of the class itself. But this is not a 'final answer', but a starting point that serves to demonstrate that 'not all methods are equal', but methods may be divided into cathegories. How many (useful) cathegories can we make, and are there methodologies that put these questions?


Can this type of page be made client-side?

I'm planning on making a website that will have mainly articles and videos. I'm going to post the videos on YouTube and use the YouTube API on my site. What I am wondering, is if I can make a page like this without using any server-side technology, or if I would need server-side programming(PHP, MySQL, etc...) would it be very much? I'm new to web development and as a first webpage, I was hoping to do the whole thing with Client-side technologies(HTML, CSS, JavaScript). Is this feasible?


How to manage intermediate outputs efficiently?

I am implementing a C preprocessor in C... I have the three functions:   1. trigraph replacing function   2. Line splicing function   3. comment removing function However these functions work separately on files i.e. First function will take a file and replace the trigraphs producing a temp- file1 as output Second function will take temp-file1 as input and splice the lines and produce another temp-file2. Third function will take temp-file2 as input and remove comment and produce yet another temp-file3. And now the main preprocessing tasks will be performed on temp-file3 and a .i file will be produced as final output. Now, I have 3 options :   1. Use temp files   2. use pipes   3. instead of intermediate temp-files or pipes use strings(i.e. whole temp-file1, 2 and 3 will be three big strings!!) I have three doubts...   1. Option 1 seems less efficient than option2   2. option 2 seems to be perfect but will I be limited by size of that unnamed pipe? (since I have **_single process_** i.e. function 1 2 & 3 will be called one after another) What if temp output size > pipe's total capacity?   3. option 3... Is it efficient, easy over previous two? Please tell me, Which option should I choose?


What makes an application memory bandwidth bound?

This has been something that's been bothering me for a while: What makes an application memory _bandwidth_ bound? For example, take this monstrosity of a computer that calculated the 5 trillionth digit of pi (and later 10 trillionth digit). I was surprised that they choose the lower but faster 98 GB RAM at 1066 MHz instead of the larger but slower 144 GB at 800 MHz. This is especially surprising considering they are using 22 TB HD array to store the results from computation; more RAM means less need for hard drives. Maybe its because I don't write applications for HPC servers, but how would RAM be the bottleneck? Are there any other non-HPC applications that usually run into this problem?


What Tool Do You Use For Reading Technical Ebooks?

I consider an e-reader a software development tool and would like to hear some opinions on reading technical e-books. Questions that I have are things like:   * What are the usability issues you have experienced with e-books as opposed to physical books, what are the advantages/disadvantages of both?   * What experiences have people had with eye-strain on tablets/PC as compared to an e-ink based reader?   * What are people's specific experiences with the Kindle as a technical e-book reader? Does the screen size impact readability? Have you had any other concerns/issues?   * Any other experiences/issues with reading technical e-books...resolution of text/diagrams; ability to keep a page open while referencing another, etc...?   * Any suggestions as to solutions for any of the issues encountered with reading e-books on the device with the issue? P.S. I would like to hear people's actual experiences, and why/how they believe whatever device is currently a superior tool for reading e-books.


Any good references for Learning C++ ?

I am totally novice in programming. So be very good hand in C++ from where I should start? Could Anyone suggest me some reference books and materials.


Minimizing use of paper

I've recently faced this problem in a dynamic programming curriculum, and I honestly have no idea about how to determine the appropriate state. You're given **N** (1 <= N <= 70) paragraphs and **M** (1 <= M <= N) figures. Each paragraph **i** requires **PL_i** (1 <= PL_i <= 100) lines and references at most one figure. Each figure is referenced exactly once (i.e., no two paragraphs can reference the same figure, and for each figure there's a paragraph that references it.) Each figure requires **PF_i** (1 <= PF_i <= 100) lines. The task is to distribute those figures and paragraphs on paper in the order they're given, where one paper fits for **L** lines at most. No paragraph or figure is too large to fit on one paper. If a paragraph **x** placed on paper **x_p** references a figure **y** then **y** must be placed on either the paper **x_p - 1** or **x_p** or **x_p + 1**. We have to find the minimum number of lines (and thus pages) to allocate in order to distribute all the figures and paragraphs. Any help would be extremely appreciated. Thanks in advance!


Notifying multiple listeners

I am building an Android guitar application and I need a way for `GuitarString` objects to notify multiple listeners that it has just been played. This includes the current `Activity` and all instances of `GuitarStringView` that have it as their `GuitarString` (the guitar is displayed twice, zoomed in & out). I have so far handled this by having a `ArrayList<OnPlayedListener>` on `GuitarString` and each `GuitarStringView` or `Activity` adds themselves to that list. My `Guitar` class is a Singleton (which I know some may frown upon) so now I have to make sure objects remove themselves from the array of listeners when they're disposed of. So my question is, is this a good approach, or is there a pattern that I should be using to handle this?


Scalability of using environment variables

I just moved into the Ruby on Rails world and with it I am being introduced to much more liberal use of environment variables than what I have been exposed to in the past. Specifically, it appears like there's an accepted convention to store third party API keys and secret tokens as environment variables. _NOTE: this is not a RoR-specific question. I only mention it to illustrate a point of view._ I certainly see the benefit of this approach; the largest of which is that one codebase can be identically deployed to multiple servers without changing code or fear that the the app will be using the wrong resource. However, I am wary about jumping on the band wagon. First, the approach doesn't seem scalable on my development work station (laptop), or on servers. If I am working on 10 different websites, and each are using Amazon S3 (for instance), I need 10 different EVs. Management will be difficult:   * naming collisions are a distinct possibility (especially if I am working on legacy projects that I dont have complete control over);    * visibility is murky (which EVs exist on the target machine? which have been or can be decommissioned?);    * no version control (who changed the EV? when? why?) Second, one of the main selling-points as I understand it, is that using EVs takes the sensitive data out of the repository where prying eyes could see it. This only seems like it should be an issue for public repositories, which I have none. All my repos are private, often because of contractual issues like NDA or ownership rights. How does all of this play out in real life scenarios? Is this approach better for some situations than others? Are there other pros that outweigh my concerns here?


How valuable and rare is being able to create something from scratch?

I just found out the other day that the previous web company where I worked for 8 years will pretty much be shut down except for occasional updates and support of existing applications. I was thinking back to my days over there and I came to the realization that I was really the only programmer there who could build stuff from scratch. It got me wondering just how valuable that skill set is and I'd like to hear your input. When I say build stuff from scratch I mean you start with an empty website and take the ideas and concepts a customer has in his head and turn it into a working functional application. How valuable is that skillset? Is this something that all programmers can do or do I just take it for granted that all programmers can build stuff from scratch?


Shallow or deep equal, which one is idiomatic in Java?

I have a domain model in which I use a few aggregation relations, i.e. an object of class `A` contains zero or more objects of class `B`. I use Java for the implementation and I represent such an aggregation as a field of type `List<B>` in `A`, and a field of type `A` in `B`. In this way, each object can be the root of an aggregation tree. Classes `A` and `B` may also contain other **shallow** fields, i.e. fields of type `int`, `float`, `String`, and so on. Now I need to define different kinds of equality methods on my model:   1. **Shallow equality** : compare two instances of `A` by comparing its shallow fields only, i.e. leaving out references to other domain objects. In this case, I am only interested to know if two nodes have the same contents.   2. **Deep equality** : compare two instances of `A` by comparing its shallow fields **and** by recursively comparing its children. In this case, I want to check if two complete trees are equal. I considered overriding the `hashCode()` and `equals()` methods for class `A` but I do not know if this should be the shallow equality or the deep equality method. Once I decide which of the two equality methods is implemented as `A.equals()`, I will define the other method with another name. This is an important choice because the `equals()` method determines such things as membership in a `Set`. So, is one of the two possibilities (shallow versus deep equality) considered a more idiomatic choice for implementing the `equals` method in Java?


ASP.NET MVC - should the MVC's M, V and C be explicitly aware of domain entities?

Since this question seems to be pretty subjective, I'm posting it here. Let's say you're writing your own version of Stackoverflow using ASP.NET MVC, so there are classes like `Question`, `Answer`, `User`, etc. Since you're lazy, you decided to use entity framework. So, all the classes mentioned above have navigation properties: `Question` knows its `Answer`s, `Answer` knows the `User` who posted it, etc. You've read a lot of Martin Fowler's books, so for sure you're going to have a service layer to implement all the business logic there. You're going to use ASP.NET MVC only for the UI and application logic related functionality. There are 2 questions:   1. Will you directly expose objects of `Question`, `Answer` and others to the controllers?   2. Will you do the same for views? I'm basically neither going to provide a REST API to my application, nor I'm too conservative to just have any fears like "hey, MY VIEW is aware of what the `Question` is, I don't know if it's bad or not, I just don't like it!". I'm especially curious about the case when the `Question` class has a field like `TimePosted` and you bind your `PostNewQuestion` view to that class. I know that in case I'm not binding that field to any control on the page, it won't be posted, so I'll have that field set to `null` when I got the object on my controller side. Is it considered fine or is it bad idea? 2 opposite approaches I'm thinking of are "using DTOs/ViewModels everywhere" and "wtf, less classes is always better!" What do you think is a _right_ approach? (I know there's no direct answer, so the question in fact is "what should one consider to decide whether using DTOs/ViewModels/Whatever else is _good_ for its app's architecture?") Also please note we're considering a very simplified clone of Stackoverflow, so:   1. It's a web-only project (we're not going to expose REST API or whatever else)   2. There are users, questions, answers, tags and search functionality (no outstanding business logic)   3. There are like 100 active users per day (no special performance requirements)   4. The code should be readable and there should be no surprises or places of special interest in case a new member joins the dev team. You may also express your thoughts in case any of first 3 points get changed - "the customer now wants our service to allow 10000 simultaneous users" or "we now need to only allow every single user to post once per 15 minutes", etc. Thanks!


Passing a dependency to a controller class

I'm looking for an approach to the following problem: I have a reusable library. It contains a controller class, in the MVC sense. Let's say it's called `UserAdministrationController`, and it's for editing users. This class requires an object implementing `IUserStorage`, for storing its data. The library doesn't need to know the details of how this object works. Now I want to write an application that includes the library. In it, I'll provide an implementation of `IUserStorage`. To instantiate this, I'll need to pass it some dependencies, like a database object, and other things that my application only knows about at runtime. But how would I then pass this object from my application to the library? I'm not instantiating the `UserAdministrationController` directly from my application; it gets created by the library itself. Hope this makes sense. I'm trying to keep my description abstract and not specific to a particular framework or language.


Dealing with profanity in source code

How do people deal with profanity in source code and VCS comments. Keep or delete? What about soft-expletives like WTF or Arrgggh? Is unprofessional, offensive or something to be shrugged off?


Do FOSS version control systems work for enterprises?

Let's say a large corporation is planning to replace it's existing version control system. Let's say it is only considering systems from major vendors that cost hundreds of thousands of dollars because they have "support." Does version control in an enterprisey environment have to be expensive? Does your medium/large corporation use a FOSS VCS such as SVN/Git/Mercurial? What has the experience been? I have to think it doesn't need to be expensive since there are so many free options, and there are probably companies that provide paid support for FOSS VCS if that is the main concern. I don't intend this question to compare VCS or decide which is best, rather just understand experiences with VCS in a corporate IT environment.


how to write unit test for AND logic gate

I'm learning about unit tests, and have a doubt for a test i want to do, to implement an "AND" logic gate               A   B   A^B     0   0   0     0   1   0     1   0   0     1   1   1      how can i test for a method that works like AND gate?, is this what a mock object is? or stub? Thanks, Please provide pseudo code,


What is the logic behind the use of different arrows (-> <-) in Haskell?

I've been thinking about language design lately, and reading over some of the new things in Haskell (always a nice source of inspiration). I'm struck by the many odd uses of the left `<-` and right `->` arrow operators. I guess the many different usages comes from prior art in math and other languages regarding arrow syntax, but is there some other reason not to try and make the usage more consistent or clear? Maybe I'm just not seeing the big picture? The right arrow gets used as a type constructor for functions, the separator between argument and body of lambda expressions, separator for case statements, and it's used in pattern views, which have the form `(e -> p)`. The left arrow gets used in `do` notation as something similar to variable binding, in list comprehensions for the same (I'm assuming they are the same, as list comprehensions look like condensed `do` blocks), and in pattern guards, which have the form `(p <- e)`. Now the last examples for each arrow are just silly! I understand that guards and views serve different purposes, but they have almost identical form except that one is the mirror of the other! I've also always found it kind of odd that regular functions are defined with `=` but lambdas with `->`. Why not use the arrow for both? Or the equals for both? It also gets pretty odd when you consider that for comparing some calculated value against a constant, there's nearly a half-dozen ways to do it:               test x = x == 4          f     x = if test x then g x else h x          f'    4 = g 4     f'    x = h x          f''   x@(test -> true) = g x     f''   _ = h x          f'''  x | true <- test x = g x             | otherwise = h x          f'''' x = case (x) of                4 -> g x               _ -> h x      Variety is the spice of source code though, right?


Mod lines in Java code

Often in C code (and some other languages as well) I have seen a section in the top-level comments for mod lines. These include the date a modification to the file was made, the user who made the modification, and a brief description of what was changed. I have not yet seen an equivalent of this in Java. I think this information is useful, especially when trying to track down bugs in code I did not write. Is this because Java code is often under version control, or are there other reasons? Are there any suggestions as to how to include the information in the code file?


How to extract JSON schema, using Java, from data without using available libraries?

The problem in extracting schema from any given data is that they can have other JSON objects embedded in them which in turn have others. Also the types of the values in the name-value pair have to be recognized. How can it be done effectively in Java?


How to code a function to be used with or without callback on Javascript?

I'm wondering how (if possible) I can create the same function, with exactly the same functionality, but to be used with a callback or without it. Here is an example with the "wanted effect" that is not working:               function getUsers(req, res, onComplete) {         // If the user is not logged in send an error. In other case, send data         if (!req.session.session_id) {             if (typeof onComplete === 'function') {                 onComplete({error: true, msg: 'You are not logged in'});             } else {                 res.json({error: true, msg: 'You are not logged in'});             }           } else {             //Another similar code...         }     }      It's not working because if I call "getUsers(req, res)", the typeof onComplete is always function, so I cannot detect when I call with or without the callback. The exact problem is that I can call this function from inside my code, with callback (a normal call, like `getUsers(req, res, function(cb) {//Do something with cb});` OR I can call this function from an AJAX call in my website, like `http://localhost:8080/api/getUsers`, what in that case is when it don't works. In the last case I get `typeof onComplete === 'function'` as true, so I never get the else part executed. I'm supposing that the "request" done by the http call have more parameters than req&res, and that's the reason why onComplete is a function, instead of undefined. The usual AJAX call is like this (javascript in the client side):               function getAllUsers() {         $.ajax({             url: '/api/getUsers',             type: 'GET',             success: function(data) {                 // Remove item and set as main topic the assigned on the server                  printUsers(data.users[0]);             },             error: function(XMLHttpRequest, textStatus, errorThrown) {                  alert(XMLHttpRequest.responseText);              }          });     }      And the route defined in the config.json of my Node.JS to call the final function is like that:               {"path": "/api/getUsers", "method":"get", "callback": "api#getUsers"},


How related is coding/information theory to computer networking?

I am taking a networking class(data communication) this coming semester. In many courses in my computer engineering degree, the books lack mathematical content. I am not a math wizard, but I think mathematics has the potential to give a much deeper understanding of different concepts, but it requires more work. Is it a good idea to focus on information theory(found a cool book by a researcher from Bell Labs) and use a more "high level" book like Computer networking, A top down approach as supplementary text?


Why it is necessary to to test my iPhone app on actual iPhone device

I developed one application for iPhone and now I want it on App Store. So many my iOS geek friends told me to test it on actual device i.e. on iPhone. So I wonder that why it is necessary to to test my iPhone app on actual iPhone device though they (Apple) have given "simulator" which is near about same as my device?