What are good HTML 5 and PHP 5 books to get?

I am looking for beginner books into PHP 5 (Maybe with a bit into MySQL?) and HTML 5. I started self-teaching myself PHP although it has become a problem as the tutorials online are either outdated or just crap. I also managed to start learning with very little HTML knowledge so I am looking to brush up on my HTML knowledge and get more into PHP. I also am unsure weather I should be looking into XHTML or HTML5, or both so an answer to that would be splendid. I just want to become more self-sufficient and less reliant on other for my programming needs. I've searched Google for books but I'm just not sure which one is the "best" for me and makes for good practice and habits which brings me here.


Is the reason why everyone complains about flash app performance due to the fact that most flash apps are built with the flex framework?

Do you think flash performance is bad mainly due to the fact that most people build flash applications using the flex framework? As opposed to the problem having everything to do with the lower level flash system. What percent of flash apps are built with flex?


Would it be harmful to have a company that frequently has security blunders on your resume?

I'm about to take a position with a certain group that hasn't been getting very good press about their computer security. Even if my job doesn't really pertain to that sort of work, am I still in danger of my resume being thrown in the trash for being associated with them?


What resources about business should an internal IT department programmer be familiar with

I am developer / analyst in an internal IT department at a medium sized business. I have to deal with business people all the time and many of the things I create can have profound impacts on the business. I am starting to regret not taking any business classes in college because I don't understand the first thing about running a business so I don't always understand what people are wanting, the best I can do is "think through it". Does anyone have suggested methods of learning this stuff, maybe some resources. And please don't just say to ask people who work here. I have tried that before and I get no where.


Is Entity framework reliable enough to use in a Corporate Project? Should I use Entity?

> **Possible Duplicate:**   >  Is Entity framework reliable enough to use in a Corporate Project? Should I > use Entity? I'm a junior developer who's just completed a project using Entity framework. Unfortunately I was chewed out by one of the Senior Developers at my work citing that I should have used ADO.net and that Entity Framework quote: "Is not reliable or feasible in a corporate application". Although I think this is mostly exaggeration - are there any truth to his claims? If so, what are the facts / sources (and will this change with the release of Entity Framework 5)? If not - what can I use to justify my position that Entity is as reliable as ADO.net.


Best practice for processing a list of items

I have a list of objects that need to be processed in some way. That way may not be correct for an item and thus raise an exception. In pseudo-code, it would look like:               proccessItems (list)       error = new empty list       for item in list:           try:           process_item(item)         catch Whatever, err:           error.append(err)       return error      Is there a pattern for doing this sort of things? Are there any anti-patterns to avoid? A better code (exception not used for control flow), but still following the same logic would be:               proccessItems (list)       error = new empty list       for item in list:           ret = process_item(item)         if null != ret            error.append(ret)       return error


If a new feature is implemented and there is a bug, should QA reject that feature or accept it and file a new bug?

At work, we use a bug tracker called Pivotal Tracker (www.pivotaltracker.com) that allows engineers to file features and bugs. If a feature or bug fix is delivered, it is QA's job to accept or reject it accordingly. If an engineer implements a new feature that has a bug in it, should QA accept that feature and file the bug separately, or should QA reject that feature and report the bug in a comment? Potential advantage of rejecting the feature: Better chances of engineers noticing and fixing the bug before releasing the code Potential advantage of filing a separate bug: It allows engineers to better assess how many bugs there have been (if that is really useful)


What does CR mean in version numbers?

Hibernate has CR postfix in their releases for the 4.0 version of hibernate, for example 4.0.0.CR7. What does the CR part mean? When would I use this kind of release numbering?


Postmortem scripts that run in case of your untimely death?

Do you know of any interesting real life stories where programmers have written scripts that executed in case of their deaths? Do you have any scripts that would run in case of your untimely death? If you were to write a such script, what would it be? If you have already written one for yourself, what does that script already do?


Looking for a certain datatype if it exists

I'm looking for the kind of a certain datatypes. The main idea of this datatype is to describe a productionline containing several steps. Each step should be represented as a "vertex" containing an object of any type. Then for every "vertex" there are possible "subproductionlines" joining the line. So it could look something like:                                 O   ->   O   ->   |                    #   subproductionline                                         |                    #   joiningpoint     O   ->   O   ->   O   ->   O   ->   O   ->   O   ->   O  # main productionline                                         |                    #   joiningpoint              O   ->   O   ->   O   ->   |                    #   subproductionline                                |                             #   joiningpoint                       O   ->   |                             #subsubproductionline      Does anyone of you know such a datatype? If I were to code such a datatype... I see there two options of doing this:   * A datatype as an Array (main productionline) containing Arrays (containing as first element the containing data of each vertex) and the rest of elements containing subproductionlines as recursive this datatype or   * A datatype as an Array containing the data stored in the vertex. Last element is either the element, where this subproductionline is joining, or a specific element representing the end of a main productionline, if it is one. What do yout think is the better solution? The programming language I think of using for is c / c++.


Who designed exceptions?

Where did exceptions and exception handling come from? I like how .NET uses it, I like how C++ supports it (but libraries unfortunately use return code or is written in C instead). I know its pretty much standard in all new languages, but who designed it first or where did it come from? Is C++ the first language to use it? I don't know of any other that is older.


Which design better when use foreign key instead of a string to store a list of id

I'm building online examination system. I have designed to table, `Question` and `GeneralExam`. The table `GeneralExam` contains info about the exam like name, description, duration,... Now I would like to design table `GeneralQuestion`, it will contain the ids of questions belongs to a general exam. Currently, I have two ideas to design GeneralQuestion table:   1. It will have two columns: general_exam_id, question_id.   2. It will have two columns: general_exam_id,   list_question_ids (string/text). I would like to know which designing is better, or pros and cons of each designing. I'm using Postgresql database.


How are composite tables generally handled when there is no ORM tool available?

I am developing a Windows Runtime Component (C#) to be used in an HTML/JS frontend for a Windows Store App. Now, one of the requests is to have a database on the local system to store metadata about files that will be downloaded. After looking everywhere I have started using SQLite combined with the sqlite-net wrapper library. This seems to be widely regarded as the best option but it is a serious hassle for me to get working. Perhaps my biggest problem with it is that it cannot map collection types to composite tables. This lead to me writing my own SQL queries for the entire database structure but this quickly turned out to be a very inconvenient solution. To clarify, this is the situation I'm referring to:               class School {         string Name { get; set; }         List<Person> Students { get; set; }     }          class Person {         int Id { get; set; }         string Name { get; set; }     }      For such a small example you could surely write the SQL queries for the three tables yourself but in the actual situation I have an object that holds several collections which in turn also hold collections several levels down. Maybe I am spoiled by Entity Framework but it is hard to believe that either everyone uses basic models that only hold the (very) limited set of types supported by sqlite-net or everybody writes his own wrapper around it to account for models with some more complexity. How are these situations handled generally? Am I overlooking some very easy solution?


How to specify a functional requirement?

I have this requirement:               The application must allow the Administrator to edit, create and delete Users.      Now, I have heard that each action must go in a functional requirement, and my question is: What of the following statements would be the more appropriate(if any): 1:               The application must allow the Administrator to edit, create and delete Users.      2:               The application must allow the Administrator to edit Users.     The application must allow the Administrator to create Users.     The application must allow the Administrator to delete Users.


What is .NET framework backward compatibility?

We develop a windows application in .NET 4 with a database of MySQL. When we are about to deploy that application, we install the .NET 4 framework in our client, then when installing the .NET Connector for MySQL, it requires a .NET framework 3.5. But the .NET 4 is already installed. Wasn't .NET framework backward compatible? We end up installing two .NET framework (3.5 & 4) which isn't small in disk size. What exactly does backward compatibility means?


Is it a bad practice to have an interface to define constants?

I am writing a set of junit test classes in java. There are several constants, for example strings that I will need in different test classes. I am thinking about an interface that defines them and every test class would implement it. The benefits I see there are:   * easy access to constants: "MY_CONSTANT" instead of "ThatClass.MY_CONSTANT"   * each constant defined only once Is this approach rather a good or bad practice? I feel like abusing the concept of interfaces a little bit. You can answer generally about interfaces/constants, but also about unit tests if there is something special about it.


What kind of exception to ask for out of range arguments?

What type of exception should I throw? I have a console class which describes rectangle of cells which a user can index by passing in a coordinate:               width, height = 80, 25     console = Console.new(width, height)          x, y = 2, 5     point_on_screen = Point.new(x, y)     console[point_on_screen] = 'a'      I am now wondering what types of exception to throw when an index occurs out of bounds . That is, outside of the (constant!) domains x:[0, width] and y:[0, height]. I could throw a `RangeError` or an `ArgumentError` *.   1. Does it matter which type of exception to throw as long as the error message is useful?   2. Should I use the same exception type for both the construction of the console and the indexing? Are the two really semantically different? * returning a kind of out of bounds object is possibly a better option - something like a Null Object Pattern - but not what I am wondering about here. ### ArgumentError One option is to throw an `ArgumentError` because the argument is obviously wrong, dimensions can never be non-negative. This is what I throw in example 1, because we ought to know in advance that the dimensions should be non- negative. Example 1:               console = Console new(-3, 4) # Argument error      ### RangeError Another option is to throw a `RangeError` because the argument is out of the valid range. I use these for indexing. The argument is always out of range if x < 0, but if x ≥ 0 then it depends on the width of the console if the x is in the domain. Example 2:               console = Console.new(20, 40)     pt = Point.new(-3, 4)     Console[pt] # RangeError


How to support a product built with agile development?

Two of the functions our company provides our customers are:   * Our Development team of ~10 employees creates software products for businesses in a particular industry. The software is used on hundreds of our customers' computers. Although the product is, for most customers, off-the-shell, larger customers drive its development, so it's somewhere between shrinkwrap software and custom software.   * Our Support team of ~25 employees provides technical support for both our own software and a few other software products for which we are the vendor. Our Development team recently switched to Scrum for their development methodology, and while I support this change, I worry that our Support team is going to have more trouble in the future. With a quicker release cycle, our customers will have features and products in production which Support isn't even aware of until the customer calls. We've never been particularly good at getting documentation and information from Development to Support, but I fear Scrum will just exacerbate the problem. What are good references on how companies reconcile Development's desire to release frequently with Support's desire to have full documentation and support information before customers see the product? How should a company structure their release and change management when using agile methods? EDIT: What I'm interested are specifics on how companies structure themselves to deal with these issues. Does the scrum team push releases to customers? Does the software have to go through a release/change management team who will not deploy until Support has been given documentation and brought up to speed? How do you get releases to customers quickly yet still keep everyone informed of changes and new features?


What are some good practices before checking in source code?

My team uses Team Foundation Server for source control, and today I fixed some bugs and smoke test application before I checked it in but I forgot to comment some code. (This code made the UI a little bit strange.) I want to know what good practices there are before checking code in - I don't want to make this kind of mistake again.


Use my own GPL licensed code in a commercial product

I am developing a software project in Java/Swing licensed under GPL v3. Later, I want to create a Android application which uses the algorithms of the Java/Swing application. This Android app will be a commercial product (sold on Google Play Store). Is this a problem, when I use my OWN GPL code in a commercial SW developed by me?


Is quitting the only reasonable response to this situation?

I read an interesting article, _10 reasons for quitting IT_. I quote a part of this text: > "This misunderstanding of both duty and technology does one thing: It makes > your job impossible. When the powers-that-be begin to micromanage your > department for you, every single bad element is exacerbated. You know your > job and you know you know your job. Management does not know your job, but > they don’t know they don’t know your job. It’s all a vicious Mobius strip of > stress." This is exactly what is going on on my project at the moment. The client, that is, the one that pays, wants to be everything. He wants to play every possible role in the project. He even wants a detailed technical explanation even though he doesn't know a single thing about programming. And when something doesn't work he blames it on someone else. Has anybody had some similar experience? Any advice on how to deal with these situations?


Does work experience gained while waiting to join a company, count?

My cousin has got his offer letter from a software company (he got placed while in his final year of engineering), but the company has said that he'll have to wait for an unknown number of months before he can start working. In the meantime, he's decided to work at some other company because he does not want to while away his time. If he works in some other software company (thru one of his Dad's contacts), will his experience count? Will it be worth it for him?


how to change the sequence used in planning poker

Is it possible to change the used sequence in Planning Poker, for some stories, it is thought that when the stories gets larger it contains more uncertainty but stories have nearly exact time estimations and these estimations don't drop into two bounds defined by Fibonacci series.


Good practice to pass this information through URL parameter

Basically, let's suppose an application that manage some user's meetings.   I have a filtering zone on a page that aims to specify the category of items I need to specifically return. Supposing two kind of filters:   * Retrieving **my actual meetings** (meetings currently occurring or planned in the near future)    * Retrieving **my past meetings** (meetings that are already past)  I think of passing a kind of url parameter like this: `www.myapp.com?me=actual`   or   `www.app.com?me=past` Indeed, I can't have both `actual` and `past` in the same call since it would not be appropriate for the listing. So in my server side, I would handle through a simple conditional the passed value to filter the query. Is it right enough to pass a `string` like this (`past` or `actual`) or is there a better practice to handle this case? Note that by default, meaning without filtering, all meetings are returned.


Building general programming skills?

I currently am quite new to programming, I've had exposure to a few languages (C#, PHP, JavaScript, VB, and some others) and I'm quite new to OOP. I was just wondering what is the best way to build up general programming/problem solving skills without being language specific? I was thinking maybe of something like Project Euler but more geared towards newbies? Thanks! Edit: I am looking at getting into Game Scripting/Programming, I'm already in Games but in a different discipline :)


Is a 64-bit Laptop going to be a problem for "Metro" apps?

I'm looking at a sample Windows 8 C# "Metro" style app (bingPushpin). When I 2-click MainPage.xaml, it gives me, "Design view is unavailable for x64 and ARM target platforms." My Acer Aspire laptop is, indeed, 64-bit. Is this going to continue to be a problem for me, or is there a workaround? If the former, can anybody recommend a Windows 8 dev machine (laptop)?


Functions returning pointers

C++ noob here. I have a very basic question about a construct I found in the C++ book I am reading.               // class declaration     class CStr {       char sData[256];      public:       char* get(void);     };          // implementation of the function     char* CStr::get(void) {       return sData;     }      So the `Cstr::get` function is obviously meant to return a character pointer, but the function is passing what looks like the value (`return sData`). Does C++ know to return the address of the returned object? My guess would have been that the function definition would be `return &sData`.


Calculate which quantity packages to use based on quantity of bookings

In my app, many appointments can be booked for activities. Each activity has many price packages with a price and a quantity. On showing the cart, I need to work out what combination of packages to use to get the user the best prices and allow all the appointments to be accounted for. There is not always a quantity 1 package. Is there a common pattern to apply to this? Here is where I got to before I realised how hard this was going to be:               cost = 0     i = appointments.count     activity.packages.order(:quantity => :asc).each do |package|              if i >= package.quantity &&  i.modulo(package.quantity) == 0                             cost = cost + (package.price * i/package.quantity )          i = i - i/package.quantity        end       end     if i > 0        raise "error: packages do not cover number of children."     end       That's in ruby(rails). So the problem I didn't see until I wrote the above is, what if there are 8 appointments, and packages for 4 & 5 - it will use the 5 package, then the last 3 won't fit in a 4 package and it will fail. EDIT: More detail So the structure is               activities has_many packages     packages:        quantity: integer      price: float      So a package defines a price for a bundle of appointments for an activity. So for example, sailing lessons are $500 for 5 or $430 for 4. If the user orders 8 sailing lessons, the app needs to work out that it should use two of the quantity 4 packages = $860 If the user order 9 sailing lessons, the app should work out they need 1 Quantity 5 package, and one quantity 4 package. etc


Using branches for a mini project or module of project: Good practice?

In my repo I have 3 closely related mini projects: 1 server and 2 clients. They are all quite small (<3 files each). Since they are so small and so closely related I just dropped them in folders in one single repo. However now that I know I can't clone a single directory in my VCS of choice (Mercurial), I'm considering splitting them up. However I'm confused about general best practice: Is it okay to put different small projects in different branches, or should they all go in different repos? I'm currently leaning towards branching since I can't easily splice out the file history of the different projects but then your using a feature in a way it wasn't meant to be used.


Should I be looking for developers with specific skill sets or generalists that need to learn?

Thanks to the great help of this site and SO, I've been able to make a prototype of a software I want to sell but unfortunately although the prototype works I think my code quality is very low. I didn't use much OOP or design patterns so although my code is understandable to me, I think a normal developer would faint if they had to read it. So I wanted to hire a developer to make it a bit more better quality and improve some of my implementations of API's that I may have not done correctly. I'm having problems hiring a developer though. I have met 2 developers and had them read my software specs.The problem is, they lacked my business's domain knowledge(which is completely understandable and no biggie) but they also lacked knowledge of the underlying tech systems I used such as Hadoop, Hbase, Cuda, etc..I spent alot of time explaining map/reduce, bigtables and other technologies I used. I thought it was common knowledge because of my interactions with people on this site but the people I met with mentioned they never had to deal with these things so they didn't know it. My question is, for software projects that are hiring contractor developers is it a danger if the developer does not have experience with the underlying technologies? or can a general developer who is accomplished in another area realistically pick up new technologies? I did a very very quick back of envelope calculation and I think the upfront costs would be similar if I hire a student or developer with no experience in my technologies who will work many hours versus hiring a highly experienced developer who charges double but finishes in half the time but what other risks should I be considering or worried about? Also, should if I do hire a generalist, should I be paying for the time it takes them to learn hadoop or cuda if they are contractors(seems to make business sense but not sure how fair it is to them if they do not use the skill again). I'm a bit confused so any suggestions would be great.


How can you use an LGPLv2.1 licenced AS3 library in a proprietary Flex app without "giving away the farm"?

Consider a Flex (actually AIR) application that is considered proprietary, but needs to use an LGPLv2.1 AS3 library, so that it is considered a "work that uses the Library" according to the license text and is thus required to be distributed according to the terms of Section 6 of the LGPL. What provision in AS3 or Flex is there for using a "suitable shared library mechanism" (Section 6b) to create the executable to use the library, allowing the end user to replace the library (somehow) and debug the new lib's use, thus not requiring that all the source for the proprietary app to be supplied (Section 6a,c,d,e) for recompiling/relinking? I've already had a false start with RSL's, because replacing the RSL causes "Flex Error #1001: Digest mismatch with RSL".


Should I implement slugs with my already fairly long URLs?

I'm considering implementing slugs in my blog. My blog uses MongoDB. One of the side-effects of using MongoDB is that it uses relatively long hex string IDs. Example before: http://lastyearswishes.com/blog/view/5070f025d1f1a5760fdfafac after: http://lastyearswishes.com/blog/view/5070f025d1f1a5760fdfafac/improvements-on- barelymvc Of course, that's a relatively short title.. I have some longer ones, but intend to limit the maximum character limit for slugs to something reasonable. At what point does a URL become so long that it hurts SEO instead of improves it? In this case, should I leave my URLs alone, or add slugs?


UML Receptions and AcceptEventActions

What shall be the relationship between the receptions of a class (was classifier before Aadaam correction) and the AcceptEventActions in the activity describing the behavior of its instances? I understand the former is related to signals reception of the type while the latter is related to runtime ReceiveSignalEvent events of the class instances (objects). But it is not totally clear to me how to express consistency among these constructs. I am defining a set of M2M and M2T Transformations (by means of QVT and MOFM2T). However independently of what I am trying to do I am curious to know what is the correct syntax for such models.


Using account (login) password in generated PDF?

Ever since I heard about programming, I was told that any password (especially the one used on login) should be stored in database using any kind of one-way hashing algorithm, and never ever as plain string. So, it can't be read directly from database, using any method. Today I noticed that my bank (country department of Citi Group) is using my account (login) password to password-protect PDFs generated at the end of each month. I'm curious: Are they breaching one of the most important security issue and are storing passwords in plain text in DB? Or is there any way to use hashed password from DB to password-protect generated PDF? As far as my limited knowledge tells me, this isn't possible. And to use in PDF the same password as on login, it has to be actually read from DB upon PDF generation, which leads to a conclusion, that it is being stored there as plain text string. This is a general question, on concepts of programming, not related to any particular language or technique, so I assume, it should be asked here, not in StackOverflow.


Any good planning tool or method for managing several competing projects?

I look for a tool or a "best practice" whose focus is on managing how the current staff of programmers can get assigned and re-assigned to different projects depending on changing priorities. Progress on projects should be tracked, too. Our department is not faced with a single, overly complex project (for which I'd know several good tools to manage it), but with a seemingly ever increasing stack of new project requests of small to moderate size. Most projects can be completed by a single programmer within 1 to 4 weeks, and only some rare beasts might take several months. It does happen that work on a project is interrupted because a more important job pops up. Usually a programmer is working on several projects at once (at example, one short-term, one medium-term, and one long-term project, or helping out at someone else's project because of his special knowledge). Most projects are done by a single programmer of the pool. I speak of a team of less than 10 programmers. Since most project requests are unrelated to each other, the order in which they are done is mostly decided arbitrarily or by how loud the request is shouted. The requests come from different in-house departments and are dictated by internal demand and not with a pareto optimum in mind. Needless to say this leads to constant discussions about why a certain project needs to be done first. I know that there is a management problem behind it, but my question is not about how to change the way the company works, but about a tool whichs helps to improve coordination and communication "in the meantime". What I am looking for is a tool that can visualize the current assignments, give projections about how long a programmers is already booked up by projects, reflects how changing an assignment change the timeplan of projects etc. Its purpose is less about self-coordination of the team, but more to provide a high-level view that can be communicated to and is easily understandable by other departments. It should provide a solid foundation for discussing priorities and for deciding the order of projects. The ability to track time boundaries (like "must be finished Oct 1st latest") and cost factors would be a bonus. Can a ticketing system fit the bill or is Microsoft Project the answer? Has anyone got any experience with such a situation and can suggest a good solution?


What is the use of Spring's init-method and destroy-method?

While learning Spring framework, I found that Spring framework provides `init- method` and `destroy-methods` which can be used to initialize some properties or to do housekeeping stuff. We can do all those things in the bean's constructor so why do Spring provides these things and in the real world what is the actual use of these two things?


Common techniques to integrate social media login to a website that requires account registration

I have developed websites where users would register with a username of their choice and an entry would be created in a database table that holds their username and some sort of salted password. They would then use this account to interact with the services that the site provides. Now I am interested in providing the ability to sign up an account using facebook, twitter, and basically anything else that might be popular. However, I don't know how to integrate the login workflow into my system. I have read the docs for `Facebook Login` but am still not sure how I would integrate it with my user-account design. This is how my own registration workflow works   1. Choose username/password   2. Create an entry in the "users" table   3. Authenticate by checking the username and see if the password matches With facebook login, they would ideally simply click a button that says "login with facebook" and they would authenticate with their facebook credentials. However, I don't know where I would go about creating a user to associate with their facebook identity. So my question is... What is a common way to use facebook (or other social media such as twitter or linkedin) to register an account into the system? I would like to manage all users uniformly, so no matter how they choose to register an account, they would all be handled in a single `users` table where I could do queries and associations without having to worry about how the account was created or how they logged in.


When writing specs BDD-style, should you use "should", or should you not?

I realize this is somewhat subjective, but I can't find a good case for one or the other : > it "should do something"   >  it "does something" Proponents of the should style mention that it forces you to actually question what it is you are trying to achieve, while detractors find it just redundant. Is there a consensus on this, or is it purely a matter of style ?


Defining and overriding open and closed intervals

I have been considering the following situation as part of documenting and interface (`A`) and an implementation (`B`) of that interface. The interface `A` contains methods which involve the following two arguments:   1. A _percentage_ , passed as an integer.   2. A _name_ , passed as a string. The valid values for the _percentage_ are the closed range [0, 100]. No matter how you implement the interface, it is an error to allow a value outside this range as an input. The _name_ , as defined in the interface, allows any string containing [1, 100] characters. I want to document the interface in such a way that it neither _requires_ nor _disallows_ an implementation to support a _name_ with more than 100 characters. Clearly the valid range for _percentage_ is a closed, inclusive interval. **How would you refer to a range like I defined above for the number of characters in _name_?** I can't refer to the interval as right-open, because the implementation might not support values with more than 100 characters.


Installation from RPM, instead of making source code?

I am trying to deploy a _Redis_ server in Linux. The _Redis_ official site provides source code to download, so I have to use ' _make_ ' to install Radis. The ' _make_ ' works, but my problem is how can I use **rpm** file to install it? Because of policy, I must obey the policy of software installation for this specific environment. The policy also bother me to install other software by making source code. What is your opinion? Thanks!


Problem solving skills and job interviews

Probably few of you are interviewing wannabe programmers. I'm 28, never worked as a programmer, but spent few months learning C and solving problems. I loved it so much that I do it every day just because I can, now and started studying CS at local university. Now I'd like to try make living from it and am trying some job interview questions I find on the internet. Some are obvious for me, but some scare me and take me long time to find a solution.   * When you do job interviews, how long you wait for someone to come up with solution? - - Does freezing for some time on problems that take 5-line code disqualify me as a programmer?   * Do you even consider people like me when browsing CV's?   * If you do interview someone like me, what do you ask that person?   * What are your expectations when you meet interviewee like me?


collabrative Embedded C/C++ programming projects

This is a generic question.....I am looking to join group or groups of Software Engineers who are working collaboratively on C and C++ programming projects. My goal is to become a contributor to hone and keep my skills sharp. My background comes from developing Embedded C programs which were used to verify/validate hardware designs.


Why is it hard to make a Java program 'appear native'?

Most Java applications don't look the same as C/C++ applications. Swing might have been designed on purpose to have a distincitve look, but based on what I've read, SWT for example tried to 'look native', and doesn't completley succeed. My question is: Why is it hard for the developers of the Java language to design a GUI system that copies _exactly_ the look of native GUIs? What's different in native GUIs? Isn't it only a matter of designing buttons that look like 'native' buttons? Or does it go deeper than that?


How can I measure my experience as a hobbyist?

If you have a job programming with a language then it's safe to say that the number of years at a job is the number of years of experience you have. But a hobbyist doesn't always program with the same regularity as a professional. How can I measure my experience as a hobbyist, for example, on a résumé? Is it effectively equivalent to work experience, or does it need to be qualified in some way?


Is it bad practice to follow up a call to a terminating function with exit()?

I'm currently working on a php frontend. Specifically, the authentication process. I'll spare everyone the exact details of the decision tree, but it includes a lot of checks and about half of them branch to a call to `do_logon()` which generates the login page and then calls `exit` to stop processing further. Currently, I follow up each of those calls with _another_ `exit` statement in the branch itself:               if($db->authenticate($user,$password)) {          ... continue processing checks...     } else {         $message='Invalid password';         do_logon($message,true);         exit;     }      Despite knowing that that final `exit` will never actually be called because `do_logon` ends on an `exit`. My reasoning is that while _I_ know that `do_logon` will always exit, other people who may wind up working on this codebase may not, or if I'm asked to maintain this code half a decade from now I might not remember, so adding the superfluous exit statement doesn't alter the code flow but does make it clear that processing will stop there, but am I overlooking something?


Required technical knowledge for developing high-level to high-level language translators

I have seen a tool (Shed Skin) to translate one high-level language to another high-level language. Apart from knowing those languages what are the other areas of technical knowledge required to develop this kind of translators?


Why should a class be anything other than "abstract" or "final/sealed"?

After 10+ years of java/c# programming, I find myself creating either:   * **abstract classes** : contract not meant to be instantiated as-is.   * **final/sealed classes** : implementation not meant to serve as base class to something else. I can't think of any situation where a simple "class" (i.e. neither abstract nor final/sealed) would be "wise programming". Why should a class be anything other than "abstract" or "final/sealed" ? **EDIT** This great article explains my concerns far better than I can.


How to create a Python interview question to write a method

If I'm giving an interview coding question in Java, I can specify the most of the question just by giving a method signature. (Made-up example follows.)               public class Table {       public String identifier;       public int seatCount;     }          public static List<String> tablesWithEnoughSeats(List<Table> tables, int minSeats)      If the candidate prefers Python, how do I present the problem for them? The Python method signature doesn't specify the data type. Is there some standard Python way of doing this? If I look at Python coding challenges online, they tend to specify the requirements as taking certain input to produce certain output. I don't want the candidate to waste their time writing code to parse an input file. (My example has just String and int, but the actual interview problem might contain more complex data.) What's the best way to express the parameter constraints so that the candidate can implement the algorithm I'm interested in without doing a bunch of plumbing?


Observing multiple observables at once / Network of chained observers

## Quick example:   * HM observes CM   * SM observes CM   * HSM observes HM and SM, but wants to be updated only after both have their new value derived from CM. ## More detail: (this is still a made-up example, but the closest and simplest I can come up with) `class ColorModel`:   * can store any RGB color.   * observable by a ColorObserverInterface object. `class HueModel implements ColorModelObserverInterface`   * can store the hue value derived from an RGB color.   * observes a ColorModel object to update its hue value.   * observable by a HueObserverInterface object.   * observers are notified only if the hue has actually changed. `class SaturationModel implements ColorObserverInterface`   * can store the saturation value derived from an RGB color.   * observes a ColorModel object to update its saturation value.   * observable by a SaturationObserverInterface.   * observers are notified only if the saturation has actually changed. `class HueSaturationMonitor implements HueObserverInterface, SaturationObserverInterface`   * display a point whose x-coordinate represents the hue, and the y-coordinate represents the saturation.   * observes a HueObserver object and a SaturationObserver object. ## Problems:   * Whenever the color in ColorModel changes, up to two updates are triggered on the HueSaturationMonitor object.   * in case that the new color has the same saturation as before, only the hue update triggers - and vice versa.   * The order in which the two updates trigger depends on the subscription order of the two observers on the ColorModel.   * There is going to be an intermediate state when the x-coordinate of the HueSaturationMonitor is already on the new value, while the y-coordinate is still on the old value, because only one of the two updates has triggered yet. For the sake of the example, let's assume that any such intermediate state of the HueSaturationMonitor is undesirable, and we want to switch directly to the final x/y position.   * The HueSaturationMonitor can only function correctly if both HueModel and SaturationModel are subscribed to the same ColorModel. There is no way to enforce that from within the HueSaturationModel. ## Question: How can I organize interdependent observers, without depending too much on the order in which they are subscribed to each other? How could I delay a trigger until all sources are updated? ## Why is this not a duplicate? There are other questions that deal with multiple observers and observables plugged together to form a network. This network can be drawn as a directed graph. The distinctive feature of this question is in the nature and topology of this network / the graph:   * The HueSaturationMonitor observes two observables, and its behavior depends on the combined values of both observables. Most other questions have observers that observe only one thing, or where the values from the two observables don't need to be combined.   * The directed graph we are dealing with is acyclic, BUT if you ignore the direction then it becomes cyclic. This is part of the challenge in this question. The directed graph represents a partially ordered set, but not a tree.   * The directed graph contains directed chains with length > 1, which means there is a two-level dependency. E.g. HSM observes HS observes CM. Some of these characteristics appear in other questions too, but it is their combination that is relevant and that causes the problem I want to solve.


Which Computer Vision / Image Processing technique would solve light imbalance in images?

Given a colour image whose light intensity is dim at the edges and bright in the middle, such as **[dim bright dim]** , which computer vision technique would be recommended to correct this imbalance? While I believe Histogram Equalisation could help, I've read that it also introduces an unrealistic look to an image by exaggerating the blue channel. I consider implementing an image processor for this task.


What do you think of this new if-then syntax

I was just thinking of something that would be really cool to have in my if- elif-else controls.               if condition:         stuff()     elif condition:         otherstuff()     then:         stuff_that_applies_to_both()     else:         stuff_that_doesnt_aply_to_either()      So basically a `then` will be run when any of the conditions are run EXCEPT the else condition. Do you think this is useful? It's similar to the try- except-else of python. I think some of you are nitpicking a very preliminary implementation. The `then` block would be just like the `else` block in a `try-except` block in python. The real reason I suggest this is for situations like this.               m = {}     if condition == '1':         m['condition'] = condition     elif condition2 == '3':         m['condition2'] = condition2     elif condition3 == 'False':         m['condition3'] = True     then:         run_test_that_relies_on_one_of_the_conditions_being_true()          return m      The `then` block is scoped to the first if just like the `else` is. So nesting works fine. And if you need to run a method before the if statements, that really has nothing to do with this use case.


What, in reference to DDD, is a bounded context?

When working through the book "Implementing Domain Driven Design" by Vaughn Vernon, I have been unable to gain a good grasp on what a bounded context actually is. The book defines a bounded context as "a conceptual boundary where a domain model is applicable. It provides Ubiquitous Language that is spoken by the team and expressed in its carefully designed software model" (the "Guide to this Book" prefacing section). This definition would make it sound as though a bounded context is the model and language of a subdomain, where that subdomain may happen to be the core domain (which seems like it ought to be referred to as a "core subdomain", but that is another discussion...). This still leaves some ambiguity as to what a bounded context provides. Is it a grouping of one or more subdomains? If only one subdomain corresponds to a bounded context, what is the bounded context actually telling us? Chapter 3 of the same book, however, refers to the integration techniques between bounded contexts. This, however, would seem to imply that the bounded contexts are actually software systems or artefacts of some variety. Martin Fowler briefly discusses the idea of a bounded context (http://martinfowler.com/bliki/BoundedContext.html), but does not really clarify the issue. At the end of the day, what _is_ a bounded context? Is it a grouping of subdomains? The model and language for a subdomain? The implementation of a subdomain? Without these answers, it seems rather difficult to understand how to decompose a real-life problem space into bounded contexts.


How to make support for bindings for a scripting language

### Main I'm making a scripting language using C++. I plan to use it with a simple test game editor. But I have to make a support for bindings to call game engine's nodes' methods to update positions, rotations, etc. What are the main approaches for this? The game engine I plan to use also supports lua, so maybe I can also use this fact. ### Details The problem I have faced lies in the fact of how can I call library C++ object methods within a script. English is not my native language and the lack of knowledge in that sphere prevents me from making a good query on the topic. So I don't know what to search. Google shows me information on how to make bindings to some scripting languages not the fundamentals by search phrases like "how to make bindings support to a scripting language", "scripting bindings". At this time I came up to the following things. I have to inherit all objects that will be used in script from a service class, ex. CLangObject. With its help I can identify the object's type within a C++ library objects' methods. Then I have to define the most general pointer to method types. I have also define a callback service class to pass it to a byte machine when C++ library method returns value. The game engine I want to use has bindning to lua, so maybe I can use its LuaObject and LuaCallback classes. At this time I don't know if this approach will lead to a normal result.


What happened to VM based deployments?

Watched some MountainWest RubyConf 2014 talks and noticed an interesting theme. Many dynamic programming environments back in the old days used to be self-contained VM images, e.g. SmallTalk, GemStone/S. One could checkpoint, modify, and ship these images wholesale and have it up and running with very little effort. Fast forward to now and I'm still using Make files to configure and install binaries. What happened?


Learning the Theory Behind Programming

I'm interested in books that would introduce / explain the theory behind programming and programming languages. My logic is that by truly understanding the theory behind programming it will only take a few weeks to pick up new languages and implement some simple software. As far as the type of books I'm looking for they would be similar to SICP. I've done some research on this site and also on stack overflow. I know there are some large threads about books which discuss software architecture but I'm looking for information specific to programming. I have an okay understanding of Python which I've received from an into CS class on programming but I need to advance my knowledge. Thanks


Why are people so strongly opposed to #region tags in methods?

I hear a lot about keeping methods short and I've heard a lot of programmers say that using #region tags within a method is a sure sign that it is too long and should be refactored into multiple methods. However, it seems to me that there are many cases where separating code with #region tags within a method is the superior solution to refactoring into multiple methods. Suppose we have a method whose computation can be separated into three rather distinct phases. Furthermore, each of these stages is only relevant to the computation for _this_ method, and so extracting them into new methods gains us no code reuse. What, then, are the benefits of extracting each phase into it's own method? As far as I can tell, all we gain is some readability and a separate variable scope for each phase (which will help prevent modifications of a particular phase from accidentally breaking another phase). However, both of these can be achieved without extracting each phase into its own method. Region tags allow us to collapse the code into a form which is just as readable (with the added benefit that we no longer have to leave our place in this file should we decide to expand and examine the code), and simply wrapping each phase in `{}` creates its own scope to work with. The benefit to doing it this way is that we don't pollute the class level scope with three methods which are actually only relevant to the inner workings of a fourth method. Immediately refactoring a long method into a series of short methods seems to me to be the code-reuse equivalent to premature optimization; you are introducing extra complexity in order to address a problem which in many cases never arises. You can always extract one of the phases into its own method later should the opportunity for code reuse arise. Thoughts?


I cannot understand the application of oops How can I develop the understanding of application of oops?

I am struggling hard to learn the application of Object Oriented Programming since last 2 years. I am a developer in PHP technology, I am aware of almost all the basics of OOPS, but still cannot find out the way to apply those concepts over a procedural programming. I do it in very orthodox way, but I don't know why I am coding it in that way. I never have reasoning to justify my oops applications, which has inferred me that I am worst in OOPS, Please help me guys to learn to think over the application of OOPS.


ZeroMQ and Majordomo protocol

I am learning ZeroMQ and came across the Majordomo Protocol. I am wondering if I'm understanding this correctly, is the use case the same as.. for example.. the Microsoft Azure AppFabric service? Would I use Majordomo if I wanted to create an AppFabric-like servie bus? Or would I do Pub/Sub+Request/Reply? If you are not familiar, azure service bus is a way to connect applications to services (or applications to applications, etc) -- at least for the purposes of this discussion: ![Azure AppFabric Service Bus](http://i.stack.imgur.com/PY6xJ.jpg) Does it seem like this is a Majordomo protocol use case, or am I looking at a different pattern here (the bottom "direct-connection" line notwithstanding). How would eventing work (a worker initiated message)? \-- (EDIT) Thanks Adam. Distilling the question down to its essence, if I were to implement the Azure AppFabric messaging protocol with ZeroMQ, would I be using the Majordomo protocol, or would another pattern be more appropriate? Also as reference, link to ZMQ Majordomo: http://rfc.zeromq.org/spec:7


Storing last polled database timestamp unix

I have a Unix script which is called by a scheduler (CTRL M) every 3 seconds. The script queries an external database(not belonging to my application and therefore I can only query it) to check for new records. Currently it stores the last run timestamp in a local table and on the next poll queries the external database for all records > timestamp. Now I want to avoid updating and querying this local table. The only option I see is to store and read this timestamp in a file.However chances of the file getting corrupted or overriden are higher than data in a database. Google had lot of java options but I need this in a script. Is there any better way to store the timestamp or better design for the functionality as a whole?


want to learn more about implementation of object oriented design in web application using asp.net c#

Can some one guide me about How can i have complete grasp for object oriented design. basically i am looking for a book about that or any good website you people can share . bottom line is that i want to develop a web application for my learning from start to finish which is completely object oriented in asp.net c#.


What's a good naming convention for generic types in C#?

I decided to ask this question here instead of on stack overflow because it is rather subjective. In C#, typically I see generic types with very poor names. Specifically, "T" is commonly used but is not a meaningful name by itself. For example:               class Fruit<T>     {         T fruit;     }      While this is the typical approach, would anyone recommend against this? And if so, what would a reasonable naming convention be for generic types in the context of C# for generic functions and classes? In my previous example, let's assume that generic type `T` must always be a type of fruit, such as `Apple` or `Orange`. The type `T` needs to make it obvious that it's a type of fruit, so maybe a better name would be `FruitType`, so we end up with:               class Fruit<FruitType>     {         FruitType fruit;     }      This is just to give you guys an idea of what I'm looking for. What's an acceptable "rule of thumb" for this issue?


How to run a function and load Viewbag on every page load?

Here is my issue. On my _Layout, I have a help button that shows up on every page in my MVC application. Is there a way to assign the Viewbag with my simple model without having to put in every ActionResult method throughout my application? A global method?               public ActionResult Index()     {        var query = db.OnlineHelp.Where(a => a.PageUrl == Request.RawUrl).FirstOrDefault();        ViewBag.htmlraw = query.PageContent     }      and on my _Layout.chtml               @Html.Raw(@ViewBag.htmlraw)      The Request.RawUrl tracks the user and depending on the page, the database is queried and returns the result such as /Home/Index


What "sublicense" actually means?

First, it is clear that the right to sublicense doesn't give you the right to relicense. Let's say we have a library with MIT license(1 file), someone adds some features to the library but puts them under GPL(in the same 1 file). Or if someone wants to sublicense they have to separate the code? If someone wants to use the library, how are the licenses handled?   Let's say that the developer uses only the features under the MIT license even if in the file there are some features under GPL.   Does he have to GPL his application because of the GPL licensed code?   Does he have to remove the GPL code in order to be free of the GPL restrictions or he can just use the library under MIT permissions/restrictions as long as he doesn't use the GPL code?


Strategy for securing paid Data as a Service API

When creating a webservice/api that is intended to be used by javascript/flash/mobile clients, what is a good method for making sure that a paying client's credentials are not stolen and reused. To clarify further, lets say I want to charge $1 for every 10,000 requests against my API. If someone wants to farm my data for free, they would just need to find another client app that already uses my API and construct requests using the credentials of the paying customer. I don't see any way that I can "hide" what is going on the client, someone will always be able to easily reverse engineer the "auth" scheme. So what are good ways to mitigate abuse? EDIT More in depth example of the scenario... Lets say my data service is bus schedules. The purpose of the services is for developers to write apps consuming the data. There's nothing personal about the data, it is the same for everyone. The intention is for the developer to write javascript/flash/mobile apps **directly against** the api (I'm aware of cross domain restrictions). But the developer has to pay when users of his app make requests against the bus schedule api. How do I keep another developer going to the original developer's site and just lifting the credentials that are used by his browser to talk to the bus schedule api, and writing his own app using those credentials?


How do you maintain focus when a particular aspect of programming takes 10+ seconds to complete?

I have a very difficult time focusing on what I'm doing (programming-wise) when something (compilation, startup time, etc.) takes more than just a few seconds. Anecdotally it seems that threshold is about 10 seconds (and I recall reading about study that said the same thing, though I can't find it now). So what typically happens is I make a change and then run the program to test it. That takes about 30 seconds, so I start reading something else, and before I know it 20 minutes have passed, and then it takes (if I'm lucky!) another 10+ minutes to deal with the context switch to getting back into programming. It's not an exaggeration to say that some things that should take me minutes literally take hours to complete. I'm very curious about what other programmers do to combat this tendency (or if I'm unique and they don't have this tendency?). Suggestions of any type at all are welcome - anything from "sit on your hands after hitting the compile button", to mental tricks, to "if it takes 30 seconds to start up something to test a change, then something's wrong with your development process!"


Which is the correct licence?

So I found this very interesting library in Google Code site. It turns out it is advertised as "LGPL", which is good enough for me. However, in the README file of the library the author contradicts himself saying it is not available for commercial purposes. I'm guessing that when you sign up to create your project in Google Code you can only choose open source licenses. Open source licenses allow selling software, offering commercial support, etc. So my guess is that either the author confused the word "commercial" with "proprietary", or that he just wanted a good place to host his software even violating GoogleCode standards... The thing is, if I want to use the library, which licence should I consider the software to be under? I've already asked the author by email but he has not replied. Thanks very much.


Managing 'done' but not releasable code in TFS

I am working in an organisation with 11 scrum teams developing on the same code base. Currently, all development is done in trunk, and at the end of a sprint everything MUST be releasable, or it must be backed out (an arduous process) as a release is cut. My opinion is that while work in a sprint is (ideally) 'done' at the end of the sprint, this doesn't necessarily mean ready for release. You may be at a point where you do not have a Minimum Viable Product to release, but have some stories complete. If a story is not done, or the story is only part of a larger feature, it should be easy to keep this separate from the release ready code. At the moment it is all backed out, the release cut is taken, then it is checked back in. A huge waste of time! We use continuous integration, which is the main argument for everyone developing on trunk. Occasionally teams use a team branch, but this is currently frowned upon. I've been considering simply having a 'dev' and 'release' branch, and pushing features to release when they are an MVP, or having a branch for each story or feature, but this is very admin heavy in TFS. Have other people dealt with similar issues in the past, and what are your thoughts on the best way forward? Unfortunately, we are tied to TFS in the short term.


Essential management tools for a small/medium software development shop

I've recently started work with an organisation that is rapidly expanding and is recruiting or growing several development teams (including two web-based products and a data warehouse/BI team). They are basically working to agile methodologies but haven't formalised a standard way of working yet. Despite the fact that it is early days, I've been surprised by the lack of tools being used to manage the development processes (e.g. no issue tracker, no tool to manage the product backlog etc.) Although it's not my primary responsibility, I'd like to help them out with some recommendations on the most important tools they should get in place. What are the 3-5 top priority tools to establish for management of a good development shop? Why are they necessary? How do they improve the software development process, and how do I justify them to my bosses?


What is this algorithm for converting strings into numbers called?

I've been doing some work in Parsec recently, and for my toy language I wanted multi-based fractional numbers to be expressible. After digging around in Parsec's source a bit, I found their implementation of a floating-point number parser, and copied it to make the needed modifications. So I understand what this code does, and vaguely why (I haven't worked out the math fully yet, but I think I get the gist). But where did it come from? This seems like a pretty clever way to turn strings into floats and ints, is there a name for this algorithm? Or is it just something basic that's a hole in my knowledge? Did the folks behind Parsec devise it? Here's the code, first for integers:               number' :: Integer -> Parser Integer                                             number' base =          do { digits <- many1 ( oneOf ( sigilRange base ))            ; let n = foldl (\x d -> base * x + toInteger (convertDigit base d)) 0 digits            ; seq n (return n)            }      So the basic idea here is that `digits` contains the string representing the whole number part, ie `"192"`. The `foldl` converts each digit individually into a number, then adds that to the running total multiplied by the base, which means that by the end each digit has been multiplied by the correct factor (in aggregate) to position it. The fractional part is even more interesting:               fraction' :: Integer -> Parser Double     fraction' base =         do { digits <- many1 ( oneOf ( sigilRange base ))            ; let base' = fromIntegral base            ; let f = foldr (\d x -> (x + fromIntegral (convertDigit base d))/base') 0.0 digits            ; seq f (return f)      Same general idea, but now a `foldr` and using repeated division. I don't quite understand why you add first and then divide for the fraction, but multiply first then add for the whole. I know it works, just haven't sorted out why. Anyway, I feel dumb not working it out myself, it's very simple and clever looking at it. Is there a name for this algorithm? Maybe the imperative version using a loop would be more familiar?


What HTTP verb is appropriate for an api route that restarts an application the server?

I got asked to do a code review of a very simple one-route web service that when hit would simply restart an application on the system. The developer had coded this up as a POST which strikes me as odd. Now I realize that this is not really the type of thing that HTTP is all about - you can't even query state - but is there a more appropriate HTTP verb? My intuition is that since this is mostly idempotent and creates no new resources it should be a PUT.


Restful WebAPI VS Regular Controllers

I'm doing some R&D on what seems like a very confusing topic, I've also read quite a few of the other SO questions, but I feel my question might be unique enough to warrant me asking. We've never developed an app using pure WebAPI. **We're trying to write a SPA style app, where the back end is fully decoupled from the front end code** Assuming our service does not know anything about who is accessing/consuming it: WebAPI seems like the logical route to serve data, as opposed to using the standard MVC controllers, and serving our data via an action result and converting it to JSON. This to me at least seems like an MC design... which seems odd, and not what MVC was meant for. (look mom... no view) What would be considered normal convention in terms of performing action(y) calls? _My sense is that my understanding of WebAPI is incorrect._ The way I perceive WebAPI, is that its meant to be used in a CRUD sense, but what if I want to do something like: "InitialiseMonthEndPayment".... Would I need to create a WebAPI controller, called InitialiseMonthEndPaymentController, and then perform a POST... Seems a bit weird, as opposed to a MVC controller where i can just add a new action on the MonthEnd controller called InitialisePayment. Or does this require a mindset shift in terms of design? Any further links on this topic will be really useful, as my fear is we implement something that might be weird an could turn into a coding/maintenance concern later on?


Looking for a very subtle unit testing example

In the context of Continuous Integration, I need to **teach** unit testing to a 20-people audience of programmers. Everything will be all right, but I am still trying to find the perfect unit testing example. More than writing tests like a robot, I want to show that unit testing can help prevent very subtle errors. I am thinking of the following **scenario** to happen when doing a live TDD demo:   * the test cases would already be written,   * we would have to write methods together,   * most of us would naturally have forgotten to handle a specific case for a method,   * everyone would then be surprised, when seeing that all tests don't pass,   * the failing test would make us think more and realize that we forgot an important case. My question will probably finish as "too broad" or "not clear what you are asking", but we never know, one of you might have a great idea. Your answer can use Java and JUnit, though any other language will be fine since only the idea will matter.


Layering Design Pattern in Java clean code style

As a Java developer, I am developing trying to use the clean code rules. But in my team we are facing a concrete problem: We have a business layer offering a service called "createObject", this service makes a lot of operation which can result to problem. E.g: parentObjectDontExist, objectAlreadyExist, dontHaveAuthorizationToCreate, operationFailed... and we want the UI using this service to display different information messages depending which error occurred. In old java dev, we should have create all signed exception type and throw it in createObject. As Clean code says, it is forbidden to use Exception for business logic AND signed exceptions are evil... Why not...But i don't know how to solved this problem and i don't want to use return code. How do you do? Thanks for youre experience return.


Git alternative to a shelveset in TFS

I use git for my personal projects, so I have never run into any issues with Git, however I had a discussion at work today and its something that I haven't thought about. In TFS you can store your changeset into a shelveset, this shelveset can be viewed by other developers, say for a peer review. From what I understand in github you are working on your local copy of the repo (possibly with custom branches for different features) and then comes a point for a peer review. How would you go about sharing a specific changes on your local repo with someone else?


Strong Name signing order for dependant projects

I have two project A(.EXE) and B(.DLL) in the solution. A references B. If I delay sign both and send them for full signing. Will A be able to load B after ? Or do I have to get B fully signed first, and then add a binary reference to that in Project A, delay sign A and send for full signing ?


Naming convention for main arguments

I recently started using arguments in my main program (here written in `C++` but could be any programming language)               #include <iostream>          int main(int argn, char* argv[]) {         // do stuff depending on argv[1], argv[2], etc.     }      For now I am using mostly random naming conventions like `-t` for testing, `-d` for debugging, `-l` for printing logs e.g. There is no need for adding `-`, it is just that most shell parameters are named that way. I also use `--` for second parameters. Is there any established naming conventions for main arguments ?


How do you unit test Application and UI code?

I love writing unit tests and agree they are an excellent way to test code, prevent regressions, etc. However, I find myself unable to write them much as the vast majority of the code I work on day-in and day-out is application code that displays a UI to the user. Is there a good way of unit testing application code? What are the best practices here? I am not looking for a specific answer such as a framework, etc. But rather, in general, how do you approach this problem?


copyleft licensing question

I'm writing an app and referring to some open source, source code (copyleft licensed.) I am not using the original source code because it's for a completely different operating system using a different language, and as far as I am aware, no-one has ported that source into the language I am using nor my target operating system. Am I still covered by the original copyleft license?


Alternative Web model

One of the problems web apps have against native apps, especially on the mobile front, is the constant need to re-download each web page on request. Ultimately, this leads to slower performance. Why if web apps only download new pages if they're actually needed, not because they're simply requested. For example: perhaps the server can store a web page version in a cookie. Every slight change to the page on the server-side changes the version number. Now instead of the browser requesting a new page each time, why not just check the version number and have the server send the page if they're different? If the page similar, the user can just use a cached page. I'm sure browsers doesn't necessarily have to change to accommodate changes to this, correct?


Converting Business Process Maps into Software

I am fairly new to web application development. I have defined my problem domain through talking to various stakeholders and putting a process map together - basically a flow chart showing the different steps and processes that the web application must be able to recreate. The problem I am having is that I'm struggling to map this process into application design and code. I was wondering if there are any best practices or development methods that help map a business process into an application design? I have briefly read up about Domain Driven Development and that seems like it may be a good approach. To clarify, I am after a methodology or design principle that will help turn the business process into code. For example, I COULD just map every box in the process map to an identically named class in my code. Thus translating the business process into a domain model (i.e. object orientated) in my code. But is this the best way to do it?


A license like the LGPL, but compatible with JavaScript

I have written a library that is quite extensive and has taken up a lot of my time, so I would like to license it properly. The LGPL seems to have many of the things I want, but does not work with Javascript or other interpreted languages. Here are the things I want my license to say:   * My library can be used in commercial application (either web or desktop applications).   * My library can be used in open source applications (again, any platform is fine).   * You may not redistribute my unmodified library in any form, except for when the javascript is downloaded to the client's browser.   * I would like to remain as the copyright owner.   * If possible, I would like users of my library to be able to use other libraries under any license (though this is less important). I am fine with distributing source of my library, and I'll have to since it's JS, the thing I don't want is others distributing my unmodified library and saying it is purely their work. I am ok with people modifying and redistributing the library, though I would rather they submitted their work to me and I would give them credit. If they do modify and redistribute the library, they must give me partial credit. I have also thought about using the MIT license, but it clearly states that people could redistribute my library unmodified, which is the most important thing to me, to make that impossible. I sincerely apologize if an identical question has been asked on this network, I have done several days' research and have not found one (this is the closest I've gotten, but the answer didn't help me). Also, IANAL so if any of this is legally contradictory or impossible, please explain rather than just stating that it is impossible.


Looping Exhaustive Test Cases - A Good Practice?

Sometimes we have code like this:               private static final List<Goat> INEDIBLE_GOATS = [GOAT_A, GOAT_B, GOAT_C]           void eatGoat(Goat goat) {        if(INEDIBLE_GOATS.contains(goat)) {            throw new CantEatGoatException();        }        ...     }      Should it best tested (along with whatever tests for the actual eating) as:               for(Goat goat: INEDIBLE_GOATS) {        // forgive abuse of syntax        assertThrows(CantEatGoatException, eatGoat(goat));     }      Or more like?               assertThrows(CantEatGoatException, eatGoat(GOAT_A));      Should tests verify each and every sort of inedible goat? Or should they test a representative goat from the list and trust that it works for the other goats?


Should I use a single platform for common services or modularize them?

I am designing a suite of web applications that have the same base functionality. That is, they all will know how to create and operate on widgets. The differences will be in their target audience and how a user will interact with a widget. Essentially, if these applications were developed independently, there would be _a lot_ of duplicated effort. To simplify this I have thought of two solutions. I would like all of your feedback on the pros and cons for each solution, and which you would prefer.   1. "Platform" -- The idea is that there is an independent service layer, a la web services. It wouldn't be a web service, but simply a back-end for all the applications. The platform would talk to the applications via messaging or object serialization. I would want to write the platform with Java, but the intention would be that the applications could be written with any web framework such as Rails, Django, Flex, or just something in Java. The platform would abstract the database, so all interaction with the back-end would be done via the platform. One potential problem with this is that updating the platform will entail taking down all the applications. But at least all the applications will be consistent in regards with the back-end. I like how this is cut horizontally, and that the application really only has to focus on the front-end, rather then worrying about how to organize the back-end.   2. "Modules" -- The idea is that I just write everything with Java and develop modules which would live in their own jars. Each module would represent a Guice module and each application would just include the modules they want, and create their own Injectors. This approach would make each application completely independent from each other, aside of sharing a common database. So, theoretically, it would be much easier to deploy an application in a different environment with out worrying about the platform. I would be stuck in one language environment, Java. Although, JRuby and Jython would be available. So maybe that isn't much of a concern. Also, I foresee it being easier to customize an application with out effecting the platform. The one con is that if I update a module, I would want to redeploy each application using that module. This would be easy with continuous integration, though. Thank you for your time. * * * In regards to Gary's answer, I've decided to take a hybrid approach. I'm going to develop a platform, which will be the access point for the web applications to data and services. I will then modularize the platform, but all the modules will remain under a single repository with a parent POM. While I could just keep them all in a single JAR, I would like the classpath separation for development purposes, to make me/others think before requiring a module to depend on another.


How to model the components of a non Information System?

I am working on a kernel-related project (specifically related to the TCP/IP stack of the kernel). I need to build some models to describe the functionality and components of my system. Initially I thought about using a Class Diagram, as it can describe the general architecture of my system. But it doesn't make sense since my code is VERY structured (written in standard C). I also thought about DFDs: they'd describe the processes of my system, and how the data is flowing. But they contain something which doesn't really fit in: data-storages. I have no databases here (at all). For the functionality, other team members suggested using Activity and Sequence diagrams, which is kinda okay with me, but what about the system components? So basically my question is: If I want to describe the components of my system, what do you suggest as a meaningful diagram ? Again, the project is a research low-level systems-oriented project with almost no user-interface at all.


2D Image Creator for a video game

I need to make a few images for an arcade video game I'm making in Java. As of right now, I have drawings that animate, but there are two problems.   1. The drawings are horrible, and as a result, the game won't get enough attention.   2. It's a pain to have to change each coordinate for the drawing, as the drawings are fairly complex. I'd like to use images. I feel they could solve my problem. They would look better than the drawings, and it would only have an x and a y coordinate, rather than the many coordinates I need for each drawing. So, in a sense, I have two questions.   1. Would images actually help? Would they solve my 2 problems? I just want to clarify.   2. How would I make these images. I don't think I can copy them off of the internet because I plan on publishing this game. So, is there any software where you can make your own images? (It has to be in an image type that Java can support. I'm working with java).  It also, as stated by the header, needs to be a 2D image; not 3D


What is the name of the functional argument in fold

In the higher order function fold/reduce what is the name, if any, of the functional argument? I am working on a monadic tabular processing library where rows are folded to produce simple analyses (like finding the minimum, maximum, average of a column). I am therefore looking for a sound name for the argument of the `fold` function and any name which is well-established in the ML community (or Haskell or Common Lisp as second and third candidates) would be interesting. A name like `f` is common in the description of `fold` functions, it is however undescriptive and a noun would be better suited.


How does having assets saved on a secondary domain(s) reduce the load time of the website?

I went for an interview yesterday where I was asked this question: "How does having assets (images/videos) stored on a secondary domain (assets.example.com) reduce the load time of example.com?" To that I answered that by having the code "call" those assets from a secondary website it reduces the traffic that is coming to the main domain and therefore only applying bandwidth to the main domain vs having to also serve bandwidth to request assets. Is that correct? Also, If i am correct, would you say it makes sense to start new websites with this in mind or do you prefer having it done after large traffic rates are achieved?


Advantages and Disadvantages of Forced Code Reformat

I'm currently working at a place that may be looking at forcing developers to use an automated code formatter on version control check-in. I'm looking for developers opinions on the advantages and disadvantages of doing this ... how you think it would help or hinder developers. My specific case involves Java/JSPs, but I think the question could apply to any language.


Is it possible to successfully transition out of being embedded software engineer?

I'm a recent college graduate, and I'm mainly involved in high-level programming (e.g., Java, C#, and Python). I've received an offer form a good company for an embedded software engineer position, where I'd be programming devices with C, handling interrupts, and so forth. If I take this job and decide to go back into high-level software development later on, will I be at a disadvantage? Are there development practices specific to embedded development that will sour me to high-level development gigs? In a nutshell, if I'm mainly interested in high-level development, would this just be a very long diversion with very little benefit?


Bypass HR to get an interview

I recently sent in an application for a position that I am qualified for and received this response: "We regret to inform you that your current qualifications do not match those needed for our current openings. We will retain your resume and if a position opens that closely matches your skill set, we will contact you at that time." The position listed required technical skills A, B, C, D, and E with nice-to-haves of X and Y. I listed in my resume and cover letter that I had experience with A through E as well as X. I don't have any experience with Y. This leads me to believe that I am qualified for the position and the Human Resources representative (who does not appear to be a part of the company) is wrong. I asked for a clarification of what qualifications I was missing, but have yet to receive a response. I did a good bit of research about the company and the developers I would be working with and I think it would be a great place to work. I don't want to take no for an answer so easily. I am thinking about directly contacting the development lead (via Twitter) at the company and asking him to look at my resume. He does not know who I am. Is this a good idea?


What are the organizational benefits of TDD over functional development backed by unit tests?

I've heard of TDD as an organizational development paradigm, where all developers are asked to let testing drive development, and I've also heard of organizations who don't embrace TDD so long as unit test coverage reaches close to 90 percent for the application. One thing I never hear is why an organization would set a standard for TDD specifically when it is an individual development discipline.


Sell code using dynamically linked Open Source GPL code?

I am really confused. The GPL states that if you start with GPL code, and modify that code, that you must release your code with modifications free of charge also under a GPL. But what if you simply use the existing GPL code without modifications as a library? Can you then write software to interface with that code, unchanged, that is closed source?


Open source licenses (specifically GPL) & gamemaker's source format

Now with gamemaker studio source files are no longer stored in a proprietary format - instead they are stored as simple XML files containing all data. Now I am wondering, can projects created with gamemaker be licensed using an open source license - especially wondering about the GPL and BSD/APACHE families? And if so how to? The biggest objection I see is that all files are generated by gamemaker - and regenarated each time gamemaker saves/loads. The main problem with this is that GM will remove any "unrecognized" data from the xml (so any comments). Including copyright notices.   A second problem is that gamemaker typically creates a few dozen files, basically for each function a separate file is created. A typical generated xml looks as following:               <!--This Document is generated by GameMaker, if you edit it by hand then you do so at your own risk!-->     <object>       <spriteName><undefined></spriteName>       <solid>0</solid>       <visible>-1</visible>       <depth>0</depth>       <persistent>0</persistent>       <parentName><undefined></parentName>       <maskName><undefined></maskName>       <events>         <event eventtype="0" enumb="0">           <action>             <libid>1</libid>             <id>603</id>             <kind>7</kind>             <userelative>0</userelative>             <isquestion>0</isquestion>             <useapplyto>-1</useapplyto>             <exetype>2</exetype>             <functionname></functionname>             <codestring></codestring>             <whoName>self</whoName>             <relative>0</relative>             <isnot>0</isnot>             <arguments>               <argument>                 <kind>1</kind>                 <string>xml = FS_xml_open("C:\Users\user\Documents\filesystem\student.xml");          </string>               </argument>             </arguments>           </action>         </event>         <event eventtype="9" enumb="13">           <action>             <libid>1</libid>             <id>603</id>             <kind>7</kind>             <userelative>0</userelative>             <isquestion>0</isquestion>             <useapplyto>-1</useapplyto>             <exetype>2</exetype>             <functionname></functionname>             <codestring></codestring>             <whoName>self</whoName>             <relative>0</relative>             <isnot>0</isnot>             <arguments>               <argument>                 <kind>1</kind>                 <string>var root_elem = FS_xml_root_element(xml);     show_message("start with root element: " + FS_xml_get_elem_name(xml, root_elem));     xml_test_display_func(xml, root_elem, "");     </string>               </argument>             </arguments>           </action>         </event>       </events>       <PhysicsObject>0</PhysicsObject>       <PhysicsObjectSensor>0</PhysicsObjectSensor>       <PhysicsObjectShape>0</PhysicsObjectShape>       <PhysicsObjectDensity>0.5</PhysicsObjectDensity>       <PhysicsObjectRestitution>0.100000001490116</PhysicsObjectRestitution>       <PhysicsObjectGroup>0</PhysicsObjectGroup>       <PhysicsObjectLinearDamping>0.100000001490116</PhysicsObjectLinearDamping>       <PhysicsObjectAngularDamping>0.100000001490116</PhysicsObjectAngularDamping>       <PhysicsObjectFriction>0.200000002980232</PhysicsObjectFriction>       <PhysicsObjectAwake>-1</PhysicsObjectAwake>       <PhysicsObjectKinematic>0</PhysicsObjectKinematic>       <PhysicsShapePoints/>     </object>      (where you can see that the amount of non-generated actual code programmed corresponds to 4 lines). Adding something like `<!-- copyright 2013 ....... >` to each file does not work as the notice will simply get replaced the moment gamemaker "saves". Is using a central COPYRIGHT notice file "enough" for open source formats? Can that be used with GPL/APACHE? If it is incompatible, what would cause this?


WCF Service in an N-tier Application

Is it recommended to use a WCF Service Library in developing an N-Tier Windows Application? Also is it better to use the VS wizards to create the DataTables and DataSets? And if so should I add all of my tables to 1 dataset or have a dataset for each table? This is all new to me and I want to learn it the right way.


Alternatives for saving data with jquery

I am not sure if this question is considered too broad, but I would like to reach out to my fellow programmers to see what alternatives are out there for saving data using jquery. I have a content management system that generates an set of HTML pages called an IETM (Interactive Electronic Technical Manual). The HTML pages are written in HTML and uses jquery. The ITEM is meant to be light weight, portable and run on most modern browsers. I am looking for a way to save data. I have considered cookies and sqlite. Are there any other alternatives for saving data using jquery?


Does your company have architectural principles? Which ones?

Does your company have architectural principles that are written and agreed upon? How did they come about? How do you manage ownership and acceptance of these principles? Are they helping you or hinder you?


What's the idea behind defining rectangles with two points?

It's not that this doesn't make sense, but it just works out awkward 99% of the time. Often in 2D graphics rectangles are initialized, stored and manipulated as a pair of points. In no particular language,               class Rect:        p1, p2: point      It makes more sense to define a rectangle as two x values and two y values, like this:               class Rect        xleft, xright: int        ytop, ybottom: int      With two points, if at some place in the source code you want to make use of the y value of the top, you'd have to say rect.p1.y (hmmm, stop and think, is it p1 or p2) but with the four values as plain data members, it's clear and direct: rect.ytop (no thinking required!) The use of two points means that in dealing with the vertical, you have to tangle the horizontal; there's an extraneous relation between indepenent elements. How did this two-point idea come about and why does it persists? Does it have some benefit over bare x and y coordinates? ADDED NOTE: This question is in the context of X-Y aligned rectangles, such as in windows managers and GUI toolkits, not in the context of arbitrary shapes in drawing and painting app.


What is wrong with Java's generics?

I have seen several times on this site posts that decry Java's implementation of generics. Now, I can honestly say that I have not had any issues with using them. However, I have not attempted to make a generic class myself. So, what are your issues with Java's generic support?


Refactoring or upgrading databases to handle new features

Several responses to a database schema question, suggested an additional table to normalize a database for a feature that is not part of the current requirements (A UserDepartment table to allow for a many-to-many relationship between employees/users and different departments they may belong to.). Not against normalization. Seems like when it comes to database design, there is a strong push to include features that they're 'sure' someone will want in the future. Is it so difficult to add tables/fields to the database to accomodate features that there is a tendancy to over-engineer? Wouldn't they be refactored or upgraded just like the rest of the app if needed? Redoing things is never fun, but moving data from one table to a new one can be done. Just not sure where this line of thinking will end. Edit: There is so much of an aversion to this, I wonder how many projects end up not adding a feature that requires a drastic database change or are non- normalized approaches taken like adding a DepartmentID2 field instead of a new table. The need for multiple departments for an employee is a common domain problem. I just haven't noticed many database schemas that are littered with many-to-many relationships.


How to organize a MST when one node disappear?

I'm doing my research and stuck with a question: I am having a minimum spanning tree (prim algorithm), now one node in my tree gets deleted, I wonder if there is a way i can re-organize my tree such that the optimality still maintains? I'm looking for some suggestions here and I will appreciate your help. Thank you! Note: All edge weights are 1 (unit graph)


Dependency injection with Finite State Machines and the Interface Segregation Principle

I am trying to figure out what is the best way to setup a FSM and also keep my interfaces clean and use an IOC container to use DI. Let's just visit the Head First design pattern textbook example of the gumball machine.               interface IState     {         InsertQuarter();         EjectQuarter();         TurnCrank();         Dispense();     }      Is the best practice to just thrown an exception for an invalid state? Why add the state if it's not even applicable? I guess that is the portion where I am confused. I could see this simple example getting more complex. My other related question is, how do I perform DI to these states? Should a state machine and states should be registered in my IOC container? Let's suppose I have an Order Service and an Inventory Service that have a dependency on a `StageOrderState`. What might this object model look like? I'm having a hard time digesting how to actually inject the dependencies in to these states. My guess is that I _could_ register the states and pass the container around to the states.


Mac Dev Team, suggestions for an remote windows testing environment?

Alright, so my situation is as follows:   * 1 Front End Developer   * 2 Back End Developers   * 1 QA Tester We all currently have Virtual Machines, or Second PC's set up with our windows environments to test. Now, the real issue is our Windows Environments expire. We're now running into points where randomly parts of our team forget to set up their refreshed environments, and we lose a few hours of productivity. **What I'm hoping to accomplish?** I'm looking to try and set up an external environment that we can all remote to and test on. Something that's separate and external. The only people that really need the environment regularly would be the Front End, and QA parts of the team. They'd also be working on the same section. Anyone have a suggestion for this setup? Has anyone accomplished something similar? Anyone have a suggestion for a better method behind consolidating these Windows Environments? **Clarifying:** by 'windows environments' I mean a local machine running a copy of windows to test on, not a Windows Server where we would deploy code.


Feedback on setting up a "Programmer Dojo" -- suggestions?

Looking for a case study, or operational plan for setting up a "programmer/hacker dojo" in the United States. Here's an example of one, **hackerdojo.com**; it's possible this info is on their site, but I have been unable to find it. * * * **UPDATE (1):**   * **Wikipedia** \- http://en.wikipedia.org/wiki/Hacker_Dojo   * **WSJ** \- Techies Get to Work at Hacker Dojo (2011/03/10)   * **venturebeat** \- Hacker Dojo, finally a hangout where coders can go 24/7 (2009/08/13) * * * **UPDATE (2):**   * Learning Space Matrix - Microsoft Corporation (MS Word Doc, Google Preview)   * **KEYWORDS:** Community Centric Working Space


Two git repositories, one project

I am building an app using Code Igniter, it is being based on CI-Bonfire. I am pulling in the dev branch of CI-Bonfire using git, I want the entire project to be git controlled as well, but I want to be able to just pull the latest changes from the dev branch of CI-Bonfire, but push my entire app to a different repository. All changes that I make to the files that come from bonfire will be config changes, so all pulls will be able to merge automatically. Is this possible?


Why would one ever want to use a synchronized method in Enum?

I stumbled upon this question and a couple of other along the same lines. While we know creation of enum is thread safe and `enums` are by birth singletons . It kind of confuses me that why would any one want to have a `synchronized` method with in an `enum`. Yes I am fully aware that methods in an `enum` are not thread safe but then what? They must **not** try to change the state of an enum any way . If we are not concerned about change of state of an enum then why would we ever like a method in an enum to be thread safe.


How to properly use Hibernate

I am new to Hibernate so my question could be seen as a very straight forward one, also I will try not to be too generic (as I am always told off because of that), although as with all architectural question it is hard to avoid that... I never know where to ask these questions. I have setup a webapp using Spring + Hibernate. My architecture uses a series of Controllers which make use of Services that ultimately call DAO methods to obtain my domain objects. I also have a GenericDAO which implements all the basic data access methods (findAll, findById, save, delete, update...) which I extend for my concrete Dao so I only have to implement specific data access methods. So a request to view all users will have this flow: the proper controller is called through request mapping, which feeds the view with the result from calling `userService.getAllUsers()` which at the same time makes a call to `userDao.findAll()`. This is all nice and I think I'm doing it properly enough. My question relates to relationships among domain objects, so let's say users have accounts and for one view I want to show the user's details plus his list of accounts. I never found out what's the best way to gather the accounts object list. Should I mark the relationship as Eager? Should I make a call like this:               user.accountList = accountService.findAccountsByUser(userId);      if that's the case then what's the point of specifying the relationship in the first place? Or maybe I am missing some other way here? What happens with Many to Many relationships? Am I forced to create a domain object called UserAccount (assuming an account can be associated to several users) that maps the relations between the two?


Is it required to differentiate between js framework and js library?

While searching through many javascript libraries/frameworks, I observed that the terms are sometimes used interchangeably. So, conceptually is it important to distinguish between framework and library? Do people seriously make their decisions based on whether it is a library or framework? Would a user like to browse two separate areas - libraries and frameworks while looking for a solution?