问:
Config Class/Struct: Pattern or Anti-Pattern? Alternatives?
If you add new configuration options to a program, it can often have tons of ripple effects in terms of getting the options to where they need to be acted upon.  There are three basic ways to deal with this that I'm aware of:

Pass all configuration settings to the parts of your program that need them explicitly as primitives.  This is the most explicit way and the way that decouples things the most.  The downside is that this is both verbose and brittle.

Make the most frequently used configuration settings global/static.  This is the simplest way but introduces action at a distance, hinders testability and assumes that the configuration truly is global (that you'd only want one configuration at any given time).

Make a configuration class/struct that contains all the configuration options for the whole program or for each major concern within the program, and then pass this around explicitly.  This is less explicit than (1) but more explicit than (2).  If you want to change a setting just for one function call, you can clone the config object and change this one value.  This is useful in both testing and in practice.  However, you still end up potentially passing tons of info to a function that it doesn't need and changing a value in the config class/struct can still cause action at a distance.

Would you consider (3) a pattern or an anti-pattern?  If it's an anti-pattern, what do you do instead?

答:
Imagine if your configuration file was written in XML.  You could then just pass fragments of this XML to each of your components, so they get their configuration data.

If you are using .NET, you can create classes with DataContracts that you can use the XmlSerialiser to create an object hierachy from your configuration Xml, and pass these objects around as configuration.

This then introduces you to the next problem.  Your configuration data has three different parts to it.  The structural application configuration that organises your code libraries to behave as this specific product.  Site configuration settings that contain your installation specific settings and User preference/settings data that varies with each user on your system.

Knowing which part is which, and keeping these data settings seperate will make installing updates much simpler (without loosing customers settings)


问:
Are 9 to 5 programmers looked down upon?
I would consider myself a 9 to 5 programmer.  What I mean by this, is that I have a programming job, but after I leave work, I leave my work there and do not take it home.  I very much enjoy my career choice, and I enjoy the work that I do at my current job.  I also enjoy learning new things in my field, such as new technologies and advancements in the programming industry.  It's just that outside of my job I have other hobbies that I feel are more important and I'd like to devote more of my time and energies to.  I also feel that devoting >40 hours a week to a single subject is a little exhausting, so are there really that many programmers that want to come home from their programming job and do more programming?

Maybe it's just my current employer, but I feel like they leave little time for career development.  The only way for me to keep up on the newest technologies and programming techniques is to do so on my own time, because my employer does not allocate time during work hours to do these sorts of things (deadlines == $$$).  Does anyone else feel the same way about their employer?

From your experience, do managers and people who hire programmers see 9 to 5 programmers as a less valuable resource?  I know that I could improve my resume by contributing to and open source project etc, but I just feel like I don't have the time to spare.

Could the opposite be said, such that devoting your spare time to other subjects such as the arts show a well-rounded-ness that could be a desirable trait to the company?

答:
I am an 8 - 6 programmer, but more importantly, I am an 8 - 6 PC USER. Before I graduated from my University I used my PC some 8-9 hours a day, between programming, playing games, surfing the web and chatting. The day I started working, from 8 am to 6 pm, I hardly ever get home and sit on my computer, to code, chat, surf or play (or whatever). Honestly, I don't even want to look at a computer, I get my email and chat from my phone.

Now, I love my job and I couldn't picture me doing anything else. But one thing is work and the other is hobbies. If your hobby is to code also, then you might get home and keep working, otherwise you'll want to get home and do something else.

If other programmers look down on that fact, then its really their problem. So far I have never met a programmer who looked down on me for it. But to be honest, of all the programmers I know, only a handful actually code in their free time.

ContentLicense: CC BY-SA 3.0


问:
Which functional language is good for a beginner?

Possible Duplicate:

  Choosing a functional programming language

I am a C++ programmer looking to learn a functional language as a hobby and out of sheer curiosity. I am not looking to be an expert, but just to get a grasp on functional programming. This language should be simple to learn and have good tutorials and resources for beginners. Are there any such languages?

答:
You have essentially two choices: A language in the Lisp family (Scheme, Common Lisp, Clojure) or a language in the Haskell family (Haskell, ML, OCaml, F#, Scala)

The Lisp languages aren't as pure, but are simple to approach, with a fairly minimal syntax, especially Scheme. Haskell and it's derivatives have a much more complex type system, which is intimidating at times, but allows for more sophisticating thinking about functions.

I recommend Scheme or Haskell, since you aren't looking to make production code.


答: The best solution would be to make several configuration interfaces and implement them as you wish. This both limits accessibility and keeps things localized. However, it's far too much effort to be worth it over simply chucking all the config in a single class and moving on to a problem with a lot more gravitas. This is the configuration, not the UtterlyCrucialAlwaysChangingClass- it's pretty much going to stay the same. As long as you don't make it all global, and the implementation is consistent, I wouldn't worry about it.

Title: Config Class/Struct: Pattern or Anti-Pattern? Alternatives?

Body:
If you add new configuration options to a program, it can often have tons of ripple effects in terms of getting the options to where they need to be acted upon.  There are three basic ways to deal with this that I'm aware of:

Pass all configuration settings to the parts of your program that need them explicitly as primitives.  This is the most explicit way and the way that decouples things the most.  The downside is that this is both verbose and brittle.

Make the most frequently used configuration settings global/static.  This is the simplest way but introduces action at a distance, hinders testability and assumes that the configuration truly is global (that you'd only want one configuration at any given time).

Make a configuration class/struct that contains all the configuration options for the whole program or for each major concern within the program, and then pass this around explicitly.  This is less explicit than (1) but more explicit than (2).  If you want to change a setting just for one function call, you can clone the config object and change this one value.  This is useful in both testing and in practice.  However, you still end up potentially passing tons of info to a function that it doesn't need and changing a value in the config class/struct can still cause action at a distance.

Would you consider (3) a pattern or an anti-pattern?  If it's an anti-pattern, what do you do instead?


答:
I would make the class in option #3 static. So instead of

```<code>//create SomeCl
Foo f = new Foo();
f.setConfigInst(cfg);
...
...
//Inside Foo
public void setConfig(MyAppConfig c) { localCfg = c; }
...
//somewhere else:
x = localCfg.getConfigForX();
</code>```

You can just have:

```<code>//Inside Foo
x = MyAppConfig.getConfigForX();
</code>```

Let the details of loading/saving configuration data happen inside MyAppConfig class.
And of course you could have more complex variations, such as different classes for different purposes.

The only case where this approach would be a problem would be if you for some reason needed to work on multiple instances of different configurations at the same time, although I have yet to come across such a situation.

Body:
I would make the class in option #3 static. So instead of

//create SomeCl
Foo f = new Foo();
f.setConfigInst(cfg);
...
...
//Inside Foo
public void setConfig(MyAppConfig c) { localCfg = c; }
...
//somewhere else:
x = localCfg.getConfigForX();

You can just have:

//Inside Foo
x = MyAppConfig.getConfigForX();

Let the details of loading/saving configuration data happen inside MyAppConfig class.
And of course you could have more complex variations, such as different classes for different purposes.

The only case where this approach would be a problem would be if you for some reason needed to work on multiple instances of different configurations at the same time, although I have yet to come across such a situation.


问:
Why is naming a table's Primary Key column "Id" considered bad practice?
My t-sql teacher told us that naming our PK column "Id" is considered bad practice without any further explanations.

Why is naming a table PK column "Id" is considered bad practice?

答:
I don't think it's a bad practice if it's used properly.  It's common to have an auto-incrementing ID field called "ID" that you never have to touch, and use a friendlier identifier for the application.  It can be a little cumbersome to write code like from tableA a inner join tableB b on a.id = b.a_id but that code can be tucked away.

As a personal preference I tend to prefix the Id with the name of the entity, but I don't see a real issue with just using Id if it's handled entirely by the database.


问:
Will B-Trees and Other Data Structures Become Obsolete With The Advent of Solid State Drives?
Many (perhaps most?) database applications today use B-Trees and variations to store data, because this data structure optimizes the read, write and seek operations on a hard disk (and these operations in turn play an important role in the overall efficiency of the databases).

Should Solid State Drives (SSDs) completely outplace traditional hard disks (HDDs), though, could we say that B-Trees and variations will become obsolete, giving room for data structures that are more efficient operating on direct access memory? If so, what will those structures be? (e.g., hash tables, AVL trees)

答:
B-Trees are most often used for database indexes on hard disk, but they have advantages even as an in-memory data structure, given the modern memory heirarchy with multiple layers of cache and with virtual memory. Even if virtual memory is on an SSD, that won't change.

I use an in-memory B+-style multiway tree library that I wrote quite a lot in C++. It can have performance advantages - the reason it was originally written was to try to use cache better - but I have to admit it often doesn't work that way. The problem is the trade-off which means items have to move around within nodes on inserts and deletes, which doesn't happen for binary trees. Also, some of the low-level coding hacks I used to optimise it - well, they probably confuse and defeat the optimiser, truth told.

Anyway, even if your databases are stored on an SSD, that's still a block-oriented storage device, and there's still an advantage to using B-Trees and other multiway trees.

BUT about ten years ago, cache-oblivious algorithms and data structures were invented. These are oblivious to the size and structure of caches etc - they make (asymptotically) the best possible use of any memory heirarchy. B-Trees need to be "tuned" to a particular memory heirarchy to make the best use (though they work fairly well for quite a wide range of variation).

Cache oblivious data structures aren't often seen in the wild yet, if at all, but it time they may well make the usual in-memory binary trees obsolete. And they may also prove worthwhile for hard disks and SSDs as well, since they don't care what the cluster-size or hard-disk cache page size is.

Van Emde Boas layout is very important in cache-oblivious data structures.

The MIT OpenCourseware algorithms course includes some coverage of cache oblivious data structures.


答: There has always been the balance of work and life.  9-5'rs are those that are there for the paycheck.  I've worked some of those jobs where the management has sucked all the fun out of why I was there.  I usually ended up leaving to find those jobs that others inspire you to learn more or just the technology you use makes the programming fun and makes you want to do some OT or sacrifice free time.  But as always too much of one thing leads to stagnation.  I have at least 4 hobbies outside of work plus a family and I have found that a few times those hobbies have helped my career in very odd ways.  So yes program 9-5, do some OT when needed, but for gods sakes have fun in life.</p>

Title: Are 9 to 5 programmers looked down upon?

Body:
I would consider myself a 9 to 5 programmer.  What I mean by this, is that I have a programming job, but after I leave work, I leave my work there and do not take it home.  I very much enjoy my career choice, and I enjoy the work that I do at my current job.  I also enjoy learning new things in my field, such as new technologies and advancements in the programming industry.  It's just that outside of my job I have other hobbies that I feel are more important and I'd like to devote more of my time and energies to.  I also feel that devoting >40 hours a week to a single subject is a little exhausting, so are there really that many programmers that want to come home from their programming job and do more programming?

Maybe it's just my current employer, but I feel like they leave little time for career development.  The only way for me to keep up on the newest technologies and programming techniques is to do so on my own time, because my employer does not allocate time during work hours to do these sorts of things (deadlines == $$$).  Does anyone else feel the same way about their employer?

From your experience, do managers and people who hire programmers see 9 to 5 programmers as a less valuable resource?  I know that I could improve my resume by contributing to and open source project etc, but I just feel like I don't have the time to spare.

Could the opposite be said, such that devoting your spare time to other subjects such as the arts show a well-rounded-ness that could be a desirable trait to the company?


问:
Why has C prevailed over Pascal?
My understanding is that in the 1980s, and perhaps in the 1990s too, Pascal and C were pretty much head-to-head as production languages.

Is the ultimate demise of Pascal only due to Borland's neglect of Delphi? Or was there more, such as C being a more robust language? If the latter, what were the perceived advantages of C over Pascal?

I'm interested in historical facts and observations one can back up, rather than likes and dislikes.

答:
I don't think C prevailed over Pascal. For the majority of programmers, Java prevailed over Pascal. The category of programmers who used to program in Pascal, would now pick Java (or C#) for the same job. Those who used to program in C stuck with C (and C++).

The demise of Pascal is IMHO mainly caused by Borland sticking to it's GUI way of working, while its customers moved on to the Web. Borland never had a really attractive offer for server-side development. Only in the last few years, with Delphi dead for all practical purposes, have those who stuck with Delphi moved on to C#.
C/C++ has always been a different crowd than the Pascal/Java/C# crowd I think, with the C(++) guys much more technical/low-level in their focus.

ContentLicense: CC BY-SA 4.0

Title: Why has C prevailed over Pascal?


答: I prefer your option 1 because the decoupling enables easier testing, and the configuration settings the object depends on are made explicit.  If an object requires a configuration setting, then explicitly provide it to the object by a constructor argument or setter method.  Reduce the verbosity by using a dependency injection framework to inject those configuration settings into the object.</p>


问:
How to convince a teammate, who sees oneself as senior, to learn SVN conceptual basics?
To start with some background, I took up a new developer position this summer and ended up being the newest member on the team, yet with most experience under the belt.

So far I have managed to push sanity initiatives through easily enough because of low adoption costs (in terms of time and effort). However things have leveled up a bit.

One of my teammates, although experienced, does not really understand SVN. Naturally, blank areas on his mental map depicting oceans of SVN cause him to adopt rather strange usage patterns.

For example, he had declared a policy of "1 SVN commit per day per developer" because otherwise "the server would soon run out of disk space". When I explained him that SVN commits are deltas, not full copies, he responded with doubt and even today I'm not entirely sure if he understands what it means.

We also had a heated argument about whether to include Eclipse .project configuration in SVN. My teammate insisted we should, although it has caused numerous pointless conflicts. I was against keeping individual developer configuration files in SVN. Finally, it turned out that my teammate had a practice of re-checkouting the entire source tree after every commit to just make sure "code committed into repository works". That was the reason he was so adamant in keeping the project configuration in SVN - so it would be easy to re-import the project. When I explained that commit synchronizes working copy to remote byte-by-byte which makes re-checkout unnecessary, my teammate responded with doubt again and eventually waved the whole issue off as insignificant.

In my opinion, our team wastes time by resolving SVN conflicts in project configuration files which contain only developer-specific settings that need not be shared to SCM at all. All this mess because someone tailored the process around incorrect assumptions.

How can I convince a teammate, who sees oneself as senior, to get a better understanding of SVN basics?

答: Get the guy fired and be done with his heel dragging and obvious taint towards newer technology.  Or really blow his mind and start using GIT.  If he can't understand SVn then he surely will be blown away by GIT.</p>


问:
How does a developer set up an environment to hack on an OS like Linux, Plan9 or BSD?
I've always found it daunting and confusing how an OS hacker sets up their workflow. As a web-developer I find it easy to set up a workflow because web-sites run on servers and as such my OS is never touched. But an OS programmer, how do you do it? Do you develop on one machine and then somehow transfer code to the other machine? Do you develop on the OS you are developing, that last option seems rife with paradoxes? So how you do it?

P.S.

My similar Quora question still has no answer to this question...

答:
The traditional way to do low-level hacking - I assume we're talking about the likes of device drivers - was to have 2 systems connected by a debug cable. This approach is still used to various degrees when developing embedded systems, although emulation and virtualisation make this largely a niche approach now.

The debug-cable approach means the controlling machine can inspect memory/registers on the slave even if the OS is in an unusable state - really valuable in some circumstances. JTAG debugging can take you even further, but I that's drifting off-topic into embedded systems.


答:
There's two extremes that personally I look down upon:

The programmer who works 6-7 days a week for 10-14 hours a day on work stuff.  Management loves these types, because they get lots of free work from them (though hours at work is not always a good measure of productivity).  In fact management will do their best to get the 40 hour a week programmers to feel they've gotten behind and try getting this type of free work out of them.  I'd consider doing this only if the pay is right.  (E.g., above $200,000 a year for me; my free time is valuable.)

The strict 9 to 5 programmer, who on nights and weekends doesn't care about programming or anything technology-related at all when they are outside of work.  This is bad as their skill set may decay, they don't learn about new technologies, they don't seem to be truly interested in it, its just a job for a paycheck.

I prefer having balance.  I try not to regularly spend (much) more than 40-50 hours on work related stuff, unless its an exceptional circumstance (where I feel its largely my fault as opposed to unrealistic expectations).  However, I still keep up on my programming skill set and try to learn tech things in my off-time and sometimes spend time with pet projects, because I find programming is interesting and pet projects are fun.  Sure if you have other important commitments (e.g., children) you obviously have to reduce this sort of stuff down; but you should still at least have desires to do this sort of stuff if given the time.  A week is 168 hours, take out 56 hours for sleeping, 40 hours for working, 30 hours for commuting+eating+weekly chores, and you are left with about roughly 6 hours a day for other stuff.  Maybe you choose to watch a lot of TV/movies/sports or have other hobbies or spend most of the time with the wife and kids.  That's great and being well rounded is good, but maybe you can find  30 minutes to 2 hours on most days (when you aren't swamped) to just keep up a little?  Buy a random tech book?  Read stackoverflow and related?  Play around with html5 canvas; learn what the fuss is with NoSQL, node.js?  See how difficult it would be to make an android/ipad app?  Learn a fun (and maybe impractical) language like haskell?


答:
You seem to be fighting a losing battle but you can pull through.  Machiavelli in The Prince described how difficult it is for one to change the status quo.  I would suggest reading that chapter again and then maybe not doing what he suggests -- it can be harsh.

You should bring your concerns to the senior developer in private and make sure you criticise constructively the way things are done and not him or any other developers.  Then offer to do a talk and write a best practice guide.  Show them how understanding SVN better will make their lives easier.  Ultimately, it's all about costs and efficiency.  If you can prove that your way improve things without stepping on toes then you may win this one.

Try to understand why the senior guy(s) is(are) using the repository as it is.  What are their concerns?  What are they trying to achieve?  How can you help them be more productive?  Above all, do try to keep a calm and professional approach.  It is easy to get frustrated.  Be assertive: Assertiveness at Work: A Practical Guide to Handling Awkward Situations by Ken Back and Kate Back is a good read.  Finally, think "how would I convince myself to switch?".  Be an honest devil advocate and that may help you come up with good answers and questions to ask.

As a side note, I would be careful to use humour.  It may work wonders or it may make you sound like an asshat.  Thus, I would avoid it.

Fundamentally, do pick your battles carefully as you may not win this one.  If that is the case, either do not care any more or look for a different job.  Harsh, I know.

Title: How to convince a teammate, who sees oneself as senior, to learn SVN conceptual basics?

Body:
To start with some background, I took up a new developer position this summer and ended up being the newest member on the team, yet with most experience under the belt.

So far I have managed to push sanity initiatives through easily enough because of low adoption costs (in terms of time and effort). However things have leveled up a bit.

One of my teammates, although experienced, does not really understand SVN. Naturally, blank areas on his mental map depicting oceans of SVN cause him to adopt rather strange usage patterns.

For example, he had declared a policy of "1 SVN commit per day per developer" because otherwise "the server would soon run out of disk space". When I explained him that SVN commits are deltas, not full copies, he responded with doubt and even today I'm not entirely sure if he understands what it means.

We also had a heated argument about whether to include Eclipse .project configuration in SVN. My teammate insisted we should, although it has caused numerous pointless conflicts. I was against keeping individual developer configuration files in SVN. Finally, it turned out that my teammate had a practice of re-checkouting the entire source tree after every commit to just make sure "code committed into repository works". That was the reason he was so adamant in keeping the project configuration in SVN - so it would be easy to re-import the project. When I explained that commit synchronizes working copy to remote byte-by-byte which makes re-checkout unnecessary, my teammate responded with doubt again and eventually waved the whole issue off as insignificant.

In my opinion, our team wastes time by resolving SVN conflicts in project configuration files which contain only developer-specific settings that need not be shared to SCM at all. All this mess because someone tailored the process around incorrect assumptions.

How can I convince a teammate, who sees oneself as senior, to get a better understanding of SVN basics?


问:
How do I dual license?
I'd like to open source a project of mine under GPL v3.  Additionally, I'd like to sell a license for those who wish to use the code in a proprietary application.

How do I go about releasing my source code under GPL v3, while also reserving the right to release it under another license of my choosing?  Do I still put the GPL header at the top of each of my source files?

I'm rather new to the legal side of software.

答:
You don't need to put a GPL header in the source - you don't need to do anything. Although a copyright notice of your name and date in the file is useful and may be required in some areas.

I would probably include your name/email/website in the header and a note saying "see licence.txt for terms" then you don't have to worry about having different source files for GPL/Commercial.

The GPL is a distribution licence, when you distribute a copy of your project under GPL you include the GPL text file (and make the source available). When you distribute it yourself you include whatever commercial license file you wish.

The only complexity is if you accept fixes from GPL users - they own those fixes and you can only distribute them under GPL. Unless you can get the authors to assign the copyright to you.

OwnerDisplayName: Andrew

Title: How do I dual license?


答:
I'm sorry, but no job deserves more than 40 hours of your time per week, period. There are certain professions who (arguably) matter a lot more to society than others, e.g. doctors, policeman, EMT's, etc. Even they shouldn't have to (note: have to) dedicate more than 40 hours a week doing this, it should be up to the employer to hire more workers if they don't have enough to get things done without people working OT.

40 hours a week is almost too much already. Think about it, the average human lives to be what, 80 years old or so? They start going to school at age 5/6, and from that point on, basically are busy for 8 hours every weekday (minus 3 months) until they are ready for college. I'll crunch some average numbers here:

You live 700,800 hours on average.

1st grade to 12 grade takes up an average of 19,200 hours (without summers)

Usually you work through the summers in high school, so tack those back on: 1,920 hours

College takes up about 35 hours a week for 4 years (with intern/work study time/studying): 7,280 hours - summers (1,680) = 5,600

Then say you get a job and work from that point (22 yrs old) to when your 65 (?): 89,440 hours - (3 weeks off per year) 5,160 = 84,280 hours

Add them all up and get the % of your life: 111,000/700,800 = about 16%

16% of your life, dedicated to WORK. You live once, and this incredible lifetime we each get to experience, its about 1/6th shorter because of your "job". And this is ONLY if you work 40 hours a week. You should never be giving more than that away. Cherish your life.


答:
During the 70s and into the early 80s, C compilers were relatively easy to come by for personal computers, although most only did a subset of C (which is why you'll see so many different "tiny C" compilers adverts in the older magazines). Pascal was a larger more cumbersome language back in the days when only the wealthiest computer hobbyists had hard drives (and a 5 meg hard drive was several hundred dollars). For the Apple 2 (my first computer, and it wasn't even a "plus"), running Pascal required purchasing an extra memory card (it needed 64k of RAM!) and took several floppies to load up, while "tiny C" compilers fit on a single floppy (and could get by with 16k of RAM).

Pascal was taught in computer science curricula, while C was mostly self-taught (sometimes taught in electrical engineering curricula). Pascal got a reputation among the cowboy coders for being a "bondage and discipline language", which I thought was undeserved as they never met ADA.

The major drivers of Pascal in the 80s were Apple (because the APIs used Pascal calling standards) and Borland. Borland's "Turbo" compilers were probably the best available ones in the marketplace, and the "like a book" license made them a lot more popular than companies with more vicious licensing.

Borland lost their lead in the development market when Microsoft hired away their lead developers and project managers (such as Hejlsberg, Gross and more than 35 others), eventually developing .NET and Visual Studio. Borland and Microsoft settled the lawsuit a couple years later, but Borland never recovered from the loss. In my opinion, Delphi started withering at that time (as the folks who gave it focus and drive were hired away), and the change in CEO at the same time took Borland away from a compiler company into an ALM (application lifecycle management) company, changing their name to Inprise a couple years later. The ashes of Borland are now owned by Micro Focus.

Title: Why has C prevailed over Pascal?

Body:
My understanding is that in the 1980s, and perhaps in the 1990s too, Pascal and C were pretty much head-to-head as production languages.

Is the ultimate demise of Pascal only due to Borland's neglect of Delphi? Or was there more, such as C being a more robust language? If the latter, what were the perceived advantages of C over Pascal?

I'm interested in historical facts and observations one can back up, rather than likes and dislikes.


问:
How can I get my startup working with Agile development?
In our startup, we've worked until now using the traditional waterfall model, but we want to try our next project using Agile Methodology.

We are pretty much alien to the entire Agile process, so considering this, what is the best way to understand Agile (resources and a practical handbook can be of help), decide on a specific methodology (Scrum, etc), and start it in our next project?

答: For agile book read. I would strongly recommend hiring someone with experience in agile projects. Also start by reading  agile manifesto</p>

OwnerDisplayName: andy

OwnerDisplayName: Emmanuel N


问:
What's the best Java equivalent to Linq?
Are there any libraries in Java that come close to providing the functionality of Linq?</p>

答:
See:

https://stackoverflow.com/questions/1217228/what-is-the-java-equivalent-for-linq - Some say there is no equivalent or that you can utilise Lambdaj to mimic it.

https://stackoverflow.com/questions/346721/linq-for-java-tool - There's a mention that before Java 8 you can also utilise Google collections to fake it and that Scala the language does support it as a language feature, (Scala is another popular language on the JVM).

http://www.infoq.com/news/2007/09/quaere-linq - A Java library that in theory provides LINQ functionality (I've not tried this myself).


答: No. Linq requires lots of langage features that Java just dosent have</p>

Title: What's the best Java equivalent to Linq?

Body: Are there any libraries in Java that come close to providing the functionality of Linq?</p>


答:
I ran into two of them that I would qualify as simple to learn:

Scheme (a Lisp dialect, dynamically typed)

Standard ML (statically
typed)

I personally prefer SML; if you decide to look at it, my suggestion is the SML/NJ compiler which also comes with REPL, unlike Mlton which is an excellent optimizing compiler, but maybe a little less comfortable as a learning tool.

Title: Which functional language is good for a beginner?

Body:
Possible Duplicate:

  Choosing a functional programming language

I am a C++ programmer looking to learn a functional language as a hobby and out of sheer curiosity. I am not looking to be an expert, but just to get a grasp on functional programming. This language should be simple to learn and have good tutorials and resources for beginners. Are there any such languages?


问:
Does directly accessing an applications database break the license agreement?
We have purchased a fairly light-weight application that uses a database on SQL Server for its back-end.  This application has no API.  There is a small web-based feature we need to add, that can easily be added by connecting to the database directly.

Generally speaking, and all issues relating to future schema changes aside, is this typically allowed by the software license?

A co-worker made the argument that in the spirit of the software license, we are reverse-engineering their code.

I hold the belief that it is our data in the database that we would be accessing and potentially modifying, no license is required for the actual data.  In addition, since we still pay for a license to use the software, that means we also have a license to use its schema, as the schema is part of the software.  It is also my understanding that it is common practice (at least, everywhere I have worked) to access an application's database directly for reporting purposes.

Which is considered correct?  I am interested in input from both a legal standpoint, and an industry commonly understood standpoint.

I also understand that this will vary from license to license.  I am looking for a general answer that will apply to most software.  Thank you.

Edit: Perhaps another way to look at it...  What is generally considered acceptable?  Throw out the license agreement, since the legal question cannot be properly answered without the license.  As a developer, would you be unhappy with your users accessing the database directly?

答:
I also understand that this will vary from license to license. I am
  looking for a general answer that will apply to most software.

That's a contradiction. What you're allowed or not allowed to do with a piece of software depends specifically on the license. You really can't generalize something like that. You can say that in general you're allowed to make a backup copy for archival purposes, but that's because that right is written into copyright law. I don't believe that there's a similar provision governing an unintended use of a piece of software.

If the license prohibits such use, you're in violation of the license if you do it. If it doesn't, then you're probably fine. Nothing else matters.

And btw, I am not a lawyer. Talk to your lawyer if you need legal advice.


问:
How to test the tests?
We test our code to make it more correct (actually, less likely to be incorrect). However, the tests are also code -- they can also contain errors. And if your tests are buggy, they hardly make your code better.

I can think of three possible types of errors in tests:

Logical errors, when the programmer misunderstood the task at hand, and the tests do what he thought they should do, which is wrong;

Errors in the underlying testing framework (eg. a leaky mocking abstraction);

Bugs in the tests: the test is doing slightly different than what the programmer thinks it is.

Type (1) errors seem to be impossible to prevent (unless the programmer just... gets smarter). However, (2) and (3) may be tractable. How do you deal with these types of errors? Do you have any special strategies to avoid them? For example, do you write some special "empty" tests, that only check the test author's presuppositions? Also, how do you approach debugging a broken test case?

答:
Try making the individual tests as small (short) as possible.

This should reduce the chances of creating a bug in the first place. Even if you manage to create one, it's easier to find. Unit tests are supposed to be small and specific, with low tolerance for failure and deviation.

In the end, it's probably just a matter of experience. The more tests you write, the better you become at it, the less chance you have to make crappy tests.

ContentLicense: CC BY-SA 2.5

Title: How to test the tests?


答: Unless the license says otherwise, then the data you create with the application is your data. You can read it however you want.  Otherwise, you wouldn't be able to open your MS-Access files in another program that happens to be able to read them, or open your MS Word files in OpenOffice.  You wouldn't be able to open the SQL Lite database that Firefox uses to store it's data. Even the old bookmarks.html could be construed as a database. Reading the data you created from a database is completely within your rights.  </p>

Title: Does directly accessing an applications database break the license agreement?

Body:
We have purchased a fairly light-weight application that uses a database on SQL Server for its back-end.  This application has no API.  There is a small web-based feature we need to add, that can easily be added by connecting to the database directly.

Generally speaking, and all issues relating to future schema changes aside, is this typically allowed by the software license?

A co-worker made the argument that in the spirit of the software license, we are reverse-engineering their code.

I hold the belief that it is our data in the database that we would be accessing and potentially modifying, no license is required for the actual data.  In addition, since we still pay for a license to use the software, that means we also have a license to use its schema, as the schema is part of the software.  It is also my understanding that it is common practice (at least, everywhere I have worked) to access an application's database directly for reporting purposes.

Which is considered correct?  I am interested in input from both a legal standpoint, and an industry commonly understood standpoint.

I also understand that this will vary from license to license.  I am looking for a general answer that will apply to most software.  Thank you.

Edit: Perhaps another way to look at it...  What is generally considered acceptable?  Throw out the license agreement, since the legal question cannot be properly answered without the license.  As a developer, would you be unhappy with your users accessing the database directly?


问:
What is the best book to prepare for a Java interview?

Possible Duplicate:

  How to prepare yourself for programming interview questions?

I found older questions but I was wondering if newer, better books/guides have been published in the last two years.

I am interviewing for a technology analyst position in finance and I expect to have a lot of technical questions based on running time/data structures etc. This is for an entry-level position so I have not had previous experience programming for work, only experience through my coursework.

答: I would recommend Effective Java and another one would be Generics and Collections. Assuming that they will ask you OOP, Head First Java, very easy to read.</p>

OwnerDisplayName: flapjackery

OwnerDisplayName: DarthVader


答: I highly recommend Head First Design Patterns and Clean Code. Forget the interview, and read them regardless.</p>

Title: What is the best book to prepare for a Java interview?

Body:
Possible Duplicate:

  How to prepare yourself for programming interview questions?

I found older questions but I was wondering if newer, better books/guides have been published in the last two years.

I am interviewing for a technology analyst position in finance and I expect to have a lot of technical questions based on running time/data structures etc. This is for an entry-level position so I have not had previous experience programming for work, only experience through my coursework.


问:
Is Safari Books Online still the best game in town?
I'm a Safari Books subscriber and have been for years.  I like having all the books available immediately.  I was wondering if there was a better competing service.  Does anyone know if there's another comparable service that maybe has a better search function (my frustration with which is what prompted me to ask this in the first place...)?</p>

答: I've used books24x7.com for a long time, but I don't think its that great at searching either. I did searches of the same keywords in both sites and the search results look pretty similar. </p>


答:
Follow this http://www.lulu.com/items/volume_11/192000/192463/5/preview/PREVIEW_JAVA_J2EE_BOOK.pdf. Most of the interview questions are asked from this book.

Other SE links https://softwareengineering.stackexchange.com/questions/93384/how-can-i-really-wow-an-employer-at-an-interview

How to prepare yourself for programming interview questions?


答:
Effective Java by Joshua Bloch

The SCJP study guide

Java/J2EE Job Interview Companion


答:
From an introductory to mid-level perspective, I believe the best book to give you a very good overview of most of the features of Java is the Sun Certified Java Programmer.

I highly recommend this book for nearly any Java programmer to sharpen their skills and understanding of core Java concepts.

One of the best ways to quickly sharpen your Java skills is to prepare for the certification test, even if you aren't going to take it.  The SCJP test covers a very good base of skills and this book is an excellent preparation tool for that test.

It covers the majority of important topics in Java

It's easy to read and enjoyable — it is written in a tone which can be easily understood by programmers of all levels

It goes deep enough to sharpen your skills but not so deep that you can't take most if it in all at once.


答:
Holy smokes this is a one sided load of hooey, where are all the folks who started out on this site who had Delphi as their favorite language?

Nearly everyone mentions Borland and 2/3rds of the folks consider Delphi to have kicked the bucket.  Well, sorry folks, Embarcadero bought the CodeGear unit of Borland a few years ago (for money, not charity) and they've been doing some pretty amazing things, amalgamating some pretty amazing tools into their pretty amazing IDE and creating a pretty amazing platform for cross platform development IN OBJECT PASCAL. Not to mention Lazarus and FreePascal on the open source side of things.

So, if this is a historical question why C prevailed over Pascal, then OK, that's an acceptable claim to start a question. But authorship of code in Object Pascal has been growing, I don't know that the TIOBE index means a whole lot for it, but it should be clear that people are still writing code in Object Pascal and interest spikes whenever Embarcadero releases new tools, therefore actual humans interested in writing new (not just maintaining old) code are interested in Delphi.

I'm not sure you can say the same for anything related to C.

Title: Why has C prevailed over Pascal?


问:
Purely technical reasons for PHP as a first choice?
I know this may come off as a flame-y / troll-y, but I hope you will take my word for it that it's not my intention.  I am just trying to understand the PHP phenomenon.

After looking at the many technical issues with the language design of PHP, I am hard pressed to find any redeeming technical advantages where PHP surpasses all other languages.  Before coming to the conclusion that there would simply be no reason to choose PHP as a development language on purely technical grounds, I would like to ask, if all non-technical factors were equal (such as what language the developers already know, what languages the hosting provider offers, language of existing code, cost, license, corporate fiat, etc.), would there be any type of new software system that would indicate making PHP a first choice for development?  If so, what technical advantage does PHP have over all other languages that would cause you to choose it?

EDIT: I am not interested in comparing PHP "out of the box" with other languages "out of the box".  If PHP has a certain feature "out of the box" that another language has only after installing some readily available add-on, that is not considered an advantage for PHP for the purposes of this question.

答:
If there is a language out there that doesn't have tradeoffs, please let me know.

While what you have eliminated as "non-technical" factors does take away a number of the common PHP benefits, I can think of a few technical factors for which PHP might be favorable:

PHP is scripting.  That means deployment can be as simple as one new file on a PHP server.

PHP has OOP.  PHP's OOP5 is not by any means a shining example of "good" OOP but it is decent.

PHP is a template language.  PHP and output (HTML or even JSON) can so easily be intertwined that it's very easy to create rough controller/view separation.  It can be as easy as two files, or even a single file with clear delineation.

PHP does a lot of things out of the box. File-reading, HTTP requests, XML/JSON reading/writing, image manipulation are all very easy, right in the core language or ubiquitous extensions.*

This is a combination thing — I don't think you would pick PHP for it's "strength" in any of the above alone (except maybe what it does out of the box with very little effort).

None of these are necessarily advantages in 100% of cases.  Some of them are actually negatives given some developers or some project needs. But together, they might just provide the right set of advantages for a given project.

Picking any language is about determining which tradeoffs you can and can't live with,  and those features you can't live without.  Just like most common languages, the advantages above (and others I may have missed) combine to fit some developers' needs the best.

* In many cases, libraries, plugins, etc. can turn a language into a direct competitor with any other.  Out of the box is still a real technical advantage:

Libraries come with an installation and maintenance overhead.

Libraries often must be moved around with a project (or use a build automation tool) instead of just a single requirement of "must use Language version X.0.0"

Each library comes with its own update cycle, which may or may not be compatible with the core language version or other libraries.

May heaven help you if you end up with circular dependencies and need to upgrade anything.


答:
I am just trying to understand the PHP phenomenon.

PHP was at the right place at exactly the right time.

There are no purely technical reasons to take PHP over another language. When doing language comparisons in the past, for me, it's boiled down to what I feel most comfortable with and which language yields the highest ROI (which also ties into which language I feel the most comfortable with obviously). My decisions have usually also been peppered with a hint of ab benchmarks as well. Every language offers the ability to do everything that another one does.

The benefits to using PHP over other languages lies purely in its community and available of PHP programmers (note, I didn't mention quality of ;)). It'd be a whole lot easier (and cheaper) to outsource portions of a PHP application than, say, an Erlang app (note, again, I didn't mention anything about quality ;)).

Title: Purely technical reasons for PHP as a first choice?

Body:
I know this may come off as a flame-y / troll-y, but I hope you will take my word for it that it's not my intention.  I am just trying to understand the PHP phenomenon.

After looking at the many technical issues with the language design of PHP, I am hard pressed to find any redeeming technical advantages where PHP surpasses all other languages.  Before coming to the conclusion that there would simply be no reason to choose PHP as a development language on purely technical grounds, I would like to ask, if all non-technical factors were equal (such as what language the developers already know, what languages the hosting provider offers, language of existing code, cost, license, corporate fiat, etc.), would there be any type of new software system that would indicate making PHP a first choice for development?  If so, what technical advantage does PHP have over all other languages that would cause you to choose it?

EDIT: I am not interested in comparing PHP "out of the box" with other languages "out of the box".  If PHP has a certain feature "out of the box" that another language has only after installing some readily available add-on, that is not considered an advantage for PHP for the purposes of this question.


答:
PHP has grown (because you really can't say it was designed) out of a need to easily generate web pages. And it has succeeded at that:

In its default use case scenario (with Apache) it follows a very simple request/response-model. No multi-threading, no nothing. The only thing you ever might have to worry about is using transactions for DB access when necessary.

You can easily take a static web page and just add bits of logic here and there.

It is dynamically typed, very forgiving and has one general purpose data structure

From the way it is used on web servers, it is not inherently different from Perl, Ruby or Python. However those three were designed as general purpose languages (yes, one could argue Perl wasn't), that later became available as web development tools.

PHP has had a bit of a head start and simply offers the lowest entrance barrier ever to web development. For that reason, there's simply a lot of PHP developers around, there's a lot of PHP code around and if you get web space or a managed server, it usually has PHP off the shelf. Getting PHP up and running is trivial (at least if security is not a concern). Finding a library that does what you want is trivial (at least if speed is not a concern). Finding a replacement for a developer who's gone is trivial (at least if quality is not a concern).


答: What you need is a good OOP book. And IMHO one of the best relating to Java is Thinking in Java. Bruce Eckel is a very good author, check the "Best Java book" answer here and read the reviews on Amazon to see why many people recommend this book.</p>


答:
Use Scala, for the reasons explained here:

use the .NET port of Scala. It gives you full native access to everything in .NET, which obviously includes LINQ.

If you can't, you can try to use libs like functionjava or lambdaj, but you won't come really close to LINQ.


答: The easiest and fastest way to do it nowadays is to use a virtual machine. Regarding Plan 9, even though it can be installed on QEMU, its distributed nature can only be exposed by using a client (computer with limited computing and disk space capabilities) server (multicore CPU server, huge capacity file server, etc.) organization.</p>

Title: How does a developer set up an environment to hack on an OS like Linux, Plan9 or BSD?

Body:
I've always found it daunting and confusing how an OS hacker sets up their workflow. As a web-developer I find it easy to set up a workflow because web-sites run on servers and as such my OS is never touched. But an OS programmer, how do you do it? Do you develop on one machine and then somehow transfer code to the other machine? Do you develop on the OS you are developing, that last option seems rife with paradoxes? So how you do it?

P.S.

My similar Quora question still has no answer to this question...


答:
I'd add guava to the list of libraries that may help you achieve some of the things LINQ does.

But as others have pointed out, there is no equivalent in pure Java.


答:
I've been a subscriber to the unlimited version of Safari Books Online since it was first offered.  Since Safari is owned by O'Reilly, virtually all of their books are available which is a big plus for me as I had been a fan of O'Reilly's print books.  It comes as no big surprise that none of O'Reilly's books appear to be available on books24x7.

As Jeremy mentioned, doing searches on the same keyword on both sites returns roughly the same number of books, so books24x7 apparently has some additional publisher(s) to make up for the omission of the O'Reilly titles.

Another thing I like about Safari Books Online is their token system, which allows you to download either chapters or entire books as PDF files.  A chapter typically costs one token.  You get five free tokens each month as part of the unlimited and "10-slot" subscriptions.  You can buy additional ones for two dollars apiece.  I don't know if books24x7 has a similar system.

O'Reilly's unlimited subscription and books24x7 both cost about $500 a year, so that is a wash.

Title: Is Safari Books Online still the best game in town?

Body: I'm a Safari Books subscriber and have been for years.  I like having all the books available immediately.  I was wondering if there was a better competing service.  Does anyone know if there's another comparable service that maybe has a better search function (my frustration with which is what prompted me to ask this in the first place...)?</p>


答:
It of course does depend on what access the software vendor allows through its written license. Software vendors vary wildly on whether they allow database access or not.

You cannot be denied your data and if you move to another vendor, generally they can be forced to create data files for the new vendor to import. But you can't always access the database directly.

Most companies who feel strongly that the schema is proprietary data either store it only on their servers that you can only access through the application or they encrypt the data/sql code that is being run. These companies also tend to have very expensive consultants who will write any custom reporting for you. Since they are charging for custom reporting, they are losing money if you do your own reporting and thus their licenses tend to forbid you to do such things. The database schema is part of their particular company's marketing advantage. If you figure it out, then you don't need their product anymore as you coudl write your own. Certainly I wouldn't want our schema to be made available to our competition.

Others either don't want to get into such custom reporting or don't have the people to do so and tend to be much more open to the customer accessing the database directly. Of course unless they do the database admin of the data, they will need to grant admin rights to someone on your team to do database backups and restores.

The time to check such things is before you buy the product not afterwards. If you bought the product, you need to live with whatever their license specifies.


答:
I will try to give you some hints backed by my personal experience.

One of my teammates, although experienced, does not really understand
  SVN. Naturally, blank areas on his mental map depicting oceans of SVN
  cause him to adopt rather strange usage patterns.

For example, he had declared a policy of "1 SVN commit per day per
  developer" because otherwise "the server would soon run out of disk
  space". When I explained him that SVN commits are deltas, not full
  copies, he responded with doubt and even today I'm not entirely sure
  if he understands what it means.

Even if disk space were an issue, you could always commit a lot of files at once, so I think what he suggests is the wrong solution. Furthermore, it is possible to waste a lot of space by checking in large binary files because SVN does not store deltas for binary files.
One check-in per day is also bad because it forces you to commit changes that do not belong together, e.g. in case you fix more than one bug per day.

The solution we have adopted in our company is that there is a filter rejecting any commit containing binary files. We can force the commit by using a special keyword in the check-in comment (we have to show SVN that we know what we are doing). Once in a year or two a project manager archives old branches and removes them from the repository. With this strategy we do not have space problems that I know of (our repository supports several different projects and has over 100000 revisions).

Summarizing, you could tell him that you agree with him that disk space is an important issue but, on the other hand, point out

the importance of feature-related check-ins instead of one monolithic daily check in;

the fact that by checking in one large binary file per day, one could fill the disk anyway.

Then you could suggest that you have a meeting (possibly with other developers or system administrators as well) to discuss strategies for keeping disk space usage under control (e.g. binary-file filters, regular backup and clean up of old unused branches).

We also had a heated argument about whether to include Eclipse
  .project configuration in SVN. My teammate insisted we should,
  although it has caused numerous pointless conflicts. I was against
  keeping individual developer configuration files in SVN. Finally, it
  turned out that my teammate had a practice of re-checkouting the
  entire source tree after every commit to just make sure "code
  committed into repository works". That was the reason he was so
  adamant in keeping the project configuration in SVN - so it would be
  easy to re-import the project. When I explained that commit
  synchronizes working copy to remote byte-by-byte which makes
  re-checkout unnecessary, my teammate responded with doubt again and
  eventually waved the whole issue off as insignificant.

In my opinion, our team wastes time by resolving SVN conflicts in
  project configuration files which contain only developer-specific
  settings that need not be shared to SCM at all. All this mess because
  someone tailored the process around incorrect assumptions.

Do you use a build server? We have a build server that checks out the complete project and compiles it every night. The next morning the testers have a ready-to-test installer of the product (if the master build ran correctly) and we (the developers) have a build report with all the warnings (and errors, in case there are any). Of course, you need to set up standard configuration files for the build server and check them in. Each developer can then check them out along with the rest of the project, but they are not allowed to check in any local changes.

In this scenario you address his need to be able to check out the complete project and build it at any time. You also avoid spending time to merge changes that should not have been checked in the first place because they are not part of the product: the product is the master build, and that must be kept clean. If someone breaks the master build (e.g. checking in his own .project file) you can revert the changes or force that developer to fix the problem.

Maybe if he brings up the issue again, you can again suggest to have a meeting (possibly with other developers) and find a common strategy together.

How can I convince a teammate, who sees oneself as senior, to get a
  better understanding of SVN basics?

I think the best strategy would be to avoid bringing the conflict to a personal level and rather discussing the issues at hand and possible solutions. If you have the impression that he is looking for a personal confrontation, here are some suggestions (again, from personal experience):

How is your team dynamics? Are your other colleagues having a similar experience with this team mate? There are a lot of small, not too explicit hints that a team can give to one of its members to discourage certain behaviours (small jokes or observations) and encourage constructive confrontation (proposing a meeting, or bringing up a topic informally during a coffee break). Sometimes a good team can quickly isolate a disturbing element and bring things back to normal.

How good is your personnel management? We had one conflict case in our company and the head of personnel had to intervene to clear the situation. It was not nice, but sometimes the working atmosphere deteriorates so much that it will not get better by itself. I hope this is not your case (I do not have the impression it has gotten that far yet) but it is always good to know if you have a good personnel administration or if you have to solve conflicts on your own.

Why am I writing this? You say that you want to "convince a teammate, who sees oneself as senior, to get a better understanding of SVN basics". To me it sounds like the conflict might be getting too personal. Some psychologists maintain that 70% of our communication is at the emotional level, if this level is not working, then people stop speaking about facts because they are too busy dealing with emotions.

So, besides explaining your points, you could also try doing something to improve the communication. Inviting for a coffee or to have a lunch break together, having a short conversation about a topic that is not related to work, etc, can improve the communication and bring your colleague's attention back to the important facts that you want him to understand. If he accepts this kind of communication, then maybe the conflicts that you had so far were related to the fact that you do not know each other well and there were some small misunderstandings but he is probably open to build a constructive collaboration. If he refuses, then there might be a deeper hostility on his side.

In this case, I think you should wait until your roles become clearer. If you team mate does not officially have a higher rank than yours he has no point getting irritated at your attempts to improve things. With time he will have to accept it or make a fool out of himself if he keeps trying to show he knows better.
If he does have a higher rank, you should find a way to let him understand that this is not under discussion: your observations are aimed at improving the productivity and not at undermining his position, this must be 100% clear.
When the roles have been clarified, if he still cannot accept constructive suggestions or criticism, then he really must have some problem with self-esteem or something like that.

So if all the strategies above fail and you keep feeling (very) frustrated, I am afraid the only reasonable thing to do will be to pack your things and look for a better place. I made this experience three years ago and found a much better company in which I am very satisfied now. Maybe this is not your case (I hope not of course) but try to understand this point too.

Just my 2 cents.


问:
Stuff every programmer needs while working
I've been tasked with creating a fun and relaxing environment, one thing I know that I want is ergonomic mice and keyboards, others have suggested exercise balls and bands.

What is it that every programmer needs while working? What might not be necessary but would be nice to have anyway?

Note: this question was asked previously, but has been recommended to be posted here. See this link for the previous responses: https://stackoverflow.com/questions/3911911/stuff-every-programmer-needs-while-working-closed

答:
A change room with a good shower, and somewhere to store your stuff. </p>

<p>Going for a run in the day or riding to work make the day so much better, except if you stink for the rest of the day. Plus, it enables people who might not bother getting outside the chance to do so. </p>

Body:
A change room with a good shower, and somewhere to store your stuff.

Going for a run in the day or riding to work make the day so much better, except if you stink for the rest of the day. Plus, it enables people who might not bother getting outside the chance to do so.


问:
Need advice on which route I should take for porting app from Android to iOS
I have developed this android application  and I am looking to port it to iOS.

My questions are:

1) I am planning to finance the iOS development with the money earn't from the android sales which is about $200 at the moment. Would it be reasonable to get the project done for this amount even if it is outsourced to elance or odesk etc?

2) I have heard the code quality for outsourced iOS projects to be bad, I dont want any memory leaks and crashes because of overflows etc.

3) I currently dont have a full time job so I can technically do the project myself, however I dont have a apple pc or iPhone (dont really want to get them either).

I know C pretty well but I haven't really released a major C project that must be 100% stable. How many hours to learn iOs and do the port? And would it be worth my time taking into consideration that if I do enjoy it I may get into it fulltime.

4) What would the demand be like for someone that can do Android and iOS?

Thanks

答:
Reports are that many cross-platform developers make between 2X to 10X more money in the iOS App store than for their paid Android apps, so you might want to consider investing more. Total iOS app development costs have been reported in the range of $25k to $250k for quality apps from experienced developers, so $200 may not even get you started.

Strictly ported apps are likely to not look or act right to the majority of your customer base, so you may want to consider a redesign rather than a port if you want to maximize revenue.

There does exist a demand for developers who have experience with both iOS and Android development.  Check you local job listings for some stats.


答:
To get full LINQ query syntax, you would need an update to the language spec and compilers supporting the new keywords and syntax structure. This is far beyond most readers here.

In order to get Linq-like method-chain syntax in Java that looks and works like what's in C#, you need two things Java doesn't support; extension methods (static methods that can be applied to an instance as if it were an instance method), and lambda expressions (anonymous delegates). However, those two can be spoofed with existing Java constructs, if you're willing to incur a little extra coding verbosity. One thing I find particularly amazing about Java is the ability to create anonymous interface implementations; applied to an interface with a single pure function, that basically allows for simple anonymous delegates, provided you have an interface for each method signature you'll need.

So, the IEnumerable (Iterable for the Javaheads) side of Linq, as a method chain, should be possible to approximate in Java; you'd basically implement it as a fluent interface that controls a monad. You'd need a class like a LinqIterable, implementing Iterable, that:

can convert any Iterable input into a LinqIterable instance

has methods for basic list processing, such as filtering, grouping, concatenation, intersection, ordering, etc that accept single-function interfaces and produce new LinqIterables, allowing chaining of these methods, hopefully in a "lazy" fashion.

has methods to transform the LinqIterable back into "concrete" objects such as ToList, ToArray, ToMap, etc

So, you could probably define a "fluent" library that would allow a statement such as:

```<code>Map<String, Integer> results = Linq.FromIterable(sourceList)
                           .Where(new Predicate{public bool Op(SomeStruct in){return in.SomeString == "criteria";}})
                           .OrderBy(new Func{public String Op(SomeStruct in){return in.SomeOtherString;}})
                           .Select(new Func{public SomeOtherStruct Op(SomeStruct in){return new SomeOtherStruct(in.SomeOtherString, in.SomeInt);}})
                           .ToMap(new Func{public String Op(SomeOtherStruct in){return in.StringField;}},
                                  new Func{public Integer Op(SomeOtherStruct in){return in.IntField;}});
</code>```

Creation of the actual library is an exercise far beyond the scope of an answer on an internet Q&A. I just said it was possible, not easy.

Expression trees are not rocket science, but it would be a significant project to implement what .NET has in this area; not only do you need the ability to build an expression tree, you need to be able to "compile" this tree on the fly using emitted bytecodes; I don't know if Java's reflection is quite that powerful.

Body:
To get full LINQ query syntax, you would need an update to the language spec and compilers supporting the new keywords and syntax structure. This is far beyond most readers here.

In order to get Linq-like method-chain syntax in Java that looks and works like what's in C#, you need two things Java doesn't support; extension methods (static methods that can be applied to an instance as if it were an instance method), and lambda expressions (anonymous delegates). However, those two can be spoofed with existing Java constructs, if you're willing to incur a little extra coding verbosity. One thing I find particularly amazing about Java is the ability to create anonymous interface implementations; applied to an interface with a single pure function, that basically allows for simple anonymous delegates, provided you have an interface for each method signature you'll need.

So, the IEnumerable (Iterable for the Javaheads) side of Linq, as a method chain, should be possible to approximate in Java; you'd basically implement it as a fluent interface that controls a monad. You'd need a class like a LinqIterable, implementing Iterable, that:

can convert any Iterable input into a LinqIterable instance

has methods for basic list processing, such as filtering, grouping, concatenation, intersection, ordering, etc that accept single-function interfaces and produce new LinqIterables, allowing chaining of these methods, hopefully in a "lazy" fashion.

has methods to transform the LinqIterable back into "concrete" objects such as ToList, ToArray, ToMap, etc

So, you could probably define a "fluent" library that would allow a statement such as:

Map<String, Integer> results = Linq.FromIterable(sourceList)
                           .Where(new Predicate{public bool Op(SomeStruct in){return in.SomeString == "criteria";}})
                           .OrderBy(new Func{public String Op(SomeStruct in){return in.SomeOtherString;}})
                           .Select(new Func{public SomeOtherStruct Op(SomeStruct in){return new SomeOtherStruct(in.SomeOtherString, in.SomeInt);}})
                           .ToMap(new Func{public String Op(SomeOtherStruct in){return in.StringField;}},
                                  new Func{public Integer Op(SomeOtherStruct in){return in.IntField;}});

Creation of the actual library is an exercise far beyond the scope of an answer on an internet Q&A. I just said it was possible, not easy.

Expression trees are not rocket science, but it would be a significant project to implement what .NET has in this area; not only do you need the ability to build an expression tree, you need to be able to "compile" this tree on the fly using emitted bytecodes; I don't know if Java's reflection is quite that powerful.


问:
Rendering trillions of "atoms" instead of polygons?
I just saw a video about what the publishers call the "next major step after the invention of 3D". According to the person speaking in it, they use a huge amount of atoms grouped into clouds instead of polygons, to reach a level of unlimited detail.

They tried their best to make the video understandable for persons with no knowledge of any rendering techniques, and therefore or for other purposes left out all details of how their engine works.

The level of detail in their video does look quite impressive to me.

How is it possible to render scenes using custom atoms instead of polygons on current hardware? (Speed, memory-wise)

If this is real, why has nobody else even thought about it so far?

I'm, as an OpenGL developer, really baffled by this and would really like to hear what experts have to say. Therefore I also don't want this to look like a cheap advert and will include the link to the video only if requested, in the comments section.

答:
I think of all of their claims, the compression of memory seems like an exaggeration, I could understand something like RLE compression having a great impact. In the ends I think this system will have a lot of "pros", but a lot of "cons", much like ray-tracing, or iso-surface rendering with marching cubes.

As far as rendering 'trillions' of atoms; I don't think they're saying that. What they are instead doing is searching for W * H atoms, i.e. one atom per pixel on the screen. This could be accomplished in a lot of slow difficult ways. Some ways of speeding this up are KD Trees, and BSP Trees, Octrees, etc. In the end though, it is a lot of data being sorted through, and the fact that their demo apparently sorts 1440x720 atoms, more then once per frame, because of shadows / reflections in their demo, is amazing. So cudos!

OwnerDisplayName: Baring


答: In terms of #1 - I think it's a good idea to pair / code review for this side of things. It's easy to make presuppositions or just get things wrong but if you have to explain what your test is doing, what the point is, you're more likely to pick up if you're aiming at the wrong target. </p>

Title: How to test the tests?

Body:
We test our code to make it more correct (actually, less likely to be incorrect). However, the tests are also code -- they can also contain errors. And if your tests are buggy, they hardly make your code better.

I can think of three possible types of errors in tests:

Logical errors, when the programmer misunderstood the task at hand, and the tests do what he thought they should do, which is wrong;

Errors in the underlying testing framework (eg. a leaky mocking abstraction);

Bugs in the tests: the test is doing slightly different than what the programmer thinks it is.

Type (1) errors seem to be impossible to prevent (unless the programmer just... gets smarter). However, (2) and (3) may be tractable. How do you deal with these types of errors? Do you have any special strategies to avoid them? For example, do you write some special "empty" tests, that only check the test author's presuppositions? Also, how do you approach debugging a broken test case?


问:
How often to release in Scrum sprint
How often to you release during a sprint. Only at the end of the sprint or every time a feature is ready. And how to you handle bugfix releases?</p>

答:
Never during.  That violates the basic premise of a "sprint".  You run until you finish what you committed to finish.  After you finish, it's really done and really works.  You can then release it.

Release can be a separate kind of sprint where things are packaged for release.

Bugfix releases can be just short sprints.  Not having a regular schedule of same-length sprints is considered by many to be a bad idea.  Therefore, the usual rule is that bug fixes are simply high-priority work that happens during the next sprint.

If it's an emergency, you've got too many things going on -- support and development -- and you should consider changing the organization to have fewer things going on.

Title: How often to release in Scrum sprint


问:
Is there any circumstance in which a strict waterfall project can succeed when requirements are not clearly defined?
I can not see how a software project can make any meaningful progress under a waterfall methodology if the requirements cannot be clearly stated from the outset. Am I missing anything?</p>

答: We use waterfall and have completed lots of projects with changing requirements. Waterfall isn't as bad as it's been made out to be and Agile isn't the silver bullet that fixes everything (as many badly done agile projects as waterfall projects as far as I can see.) Neither methodology has a particularly high success rate, in part because users don't know how to define what they want and in part because there are alot of incompetents in our field.</p>


答: The requirements not being clearly defined doesn't automatically doom the project, IMO.  The probability of failure is high I'll concede though there can be cases where it still succeeds.</p>

Title: Is there any circumstance in which a strict waterfall project can succeed when requirements are not clearly defined?

Body: I can not see how a software project can make any meaningful progress under a waterfall methodology if the requirements cannot be clearly stated from the outset. Am I missing anything?</p>


答:
It can. You just have to build contingency into your initial estimates and explain that if the requirements are uncertain, so are your estimates. If requirements are coming in at the same pace that development is progressing, it will work just fine.

Remember that Waterfall is not the opposite of Agile. All you are saying is that you will not deliver components incrementally. It's just "give us your requirements as soon as you can and we'll code, delivering you a product at the end. But if you don't bring us requirements quickly enough, your product will be delayed."

However, Scrum is designed to manage uncertainty and change and I still think that's the best way to go. I'm just saying that if the client isn't interested then that doesn't mean you're certain to fail.


答:
Comment by "Andrew" above is valid. Also, which part of the requirements is missing. The waterfall methodology is not as rigid as some thinks it is. Waterfall focuses on moving between major stages after enough information and facts have been collected. There is nothing stopping you from refining your analysis as long as you are not re-doing major parts of it.

For example, you can start design without knowing all the required reports and you can start design without knowing all the validation rules. All of that can always be added later.

However, you don't want to start the design with only 1/3rd of the columns in the database identified. Water fall is a great methodology and is quite suitable for most applications where the business is not being invented from scratch and where users know the business.

You can make progress in your database design, screen design, system architecture, use cases and more without knowing all the details up front.

The art here is dividing the problem to pieces that can start and progress with least dependency on other grey areas. This is a generally good approach regardless of the employed methodology.


问:
Delegate vs Interfaces-Any more clarifications available?
After reading the article-
When to Use Delegates Instead of Interfaces (C# Programming Guide),
I need some help  understanding the below given points, which I found to be not so clear (for me).
Any examples or detailed explanations available for these?

Use a delegate when:

An eventing design pattern is used.

It is desirable to encapsulate a static method.

Easy composition is desired.

A class may need more than one implementation of the method.

Use an interface when:

There are a group of related methods that may be called.

A class only needs one implementation of the method.

My Questions are,

What do they mean by an eventing design pattern?

How the composition turns out to be easy if a delegate is used?

if there is a group of related methods that may be called,then use interface-What benefit it has?

if a class only needs one implementation of the method,  use interface-how is it justified in terms of benefits?

答:
The biggest clarification I can offer:

A delegate defines a function signature - which parameters a matching function  will accept and what it will return.

An interface deals with a whole set of functions, events, properties, and fields.

So:

When you want to generalize some functions with the same signature - use a delegate.

When you want to generalize some behavior or quality of a class - use an interface.


答:
The last Agile job I worked at had releases every sprint; code was frozen every other Thursday (two-week sprints), and then the product was packaged and published to a UAT server for our clients to work with. This was during initial development of the product; for a mature product, especially a distributable program and not a web app, you probably wouldn't want to burden your users with upgrading every two to three weeks.

Virtually all our releases included a mix of story points and defects (bugs). Defects counted as "non-ideal hours"; there are 5 ideal hours in a workday, meaning heads-down coding of new point work. The other three to four hours a day are meetings, discussions, design, sometimes "spikes" (focused research/proof-of-concept development), and defect work; stuff that contributes to a better product and is a necessary part of the process, but simply cannot take up the entire team's entire sprint. The only time we did defect-only releases was when there was no story-point work available in the backlog as of an IPM; then we simply scheduled a QA sprint where we were instructed to "kill as many defects as you can". Because not having requirements ready to go is ALWAYS the PO's fault (and the PO worked for the clients), we could simply issue a contract change notice and work with what we had. Of course, once the actual story work was over and we were into "warranty" development, defects were all there were.

In a well-managed Agile project, running out of requirements should never happen; the backlog should always have a sprint's worth of work ready to pick up. But, sometimes the PO gets swamped producing requirements; sometimes the BAs/testers hold up release of stories to the development backlog, for reasons relating to requirements quality or story conflicts; sometimes a team decides they have to "punt" on a story that wasn't well-defined or well-estimated, and there isn't something that can easily take up the remaining cycles. In short, even in Agile, shit happens.

Title: How often to release in Scrum sprint

Body: How often to you release during a sprint. Only at the end of the sprint or every time a feature is ready. And how to you handle bugfix releases?</p>


答:
If the work the team is committing to is conducive to doing multiple releases within the sprint, release it as often as you want.

The same holds true for defect-fix releases--if it makes sense to release them, do so.

Title: How often to release in Scrum sprint


问:
Is an ASP.NET site in a Linux environment possible?
I found some software a while ago that claimed to execute ASP.NET applications on a Linux server, I remember that the information said that takes the code and converts it to Java. I never downloaded or tested the software. Does anyone know the name of this software?

Also, is possible to execute ASP.NET on a Linux server in the first place?

答:
There have been several attempts to provide CLI/CLR compilers to the JVM, but I don't think any one has become particularly popular. See, for example:

http://xmlvm.org/clr2jvm/


答:
I have never heard of a project using a waterfall methodology that did not incorporate change orders.  So in practice, if the initial requirements are wrong (they are always wrong to some degree except perhaps on a tiny project - I've never seen them be 100% perfect) you just have change orders, and redo whatever you have to.  Does that mean it's not really waterfall?  It's really a philosophical question.

Can it succeed?  It can, but the methodology isn't as focused on dealing with changing requirements, so it may not cope with it as well.

Actually, what I've seen a lot is that when requirements are not accurate then waterfall succeeds pretty well for the software developers , not as well for the clients.  The reason is that most of the time a waterfall methodology was adopted in the first place because the client, quite reasonably, wanted to know up front exactly what the project would cost.  Unfortunately nobody knows how much a software project will cost.  Sometimes clients never figure that out and refuse to hire anyone that won't give them a fixed price.  Since at that point developers trying to get the client's business are competing primarily on the basis of quoting a low price, they underbid and hope to profit on the change orders, which cover anything beyond the initial requirements and usually carry a high hourly rate.

Therefore, when the requirements are bad that means the developers get more of the profitable part of the contract (change orders) and less of the unprofitable part (the list of requirements the client thought he wanted back when this all started).

But eventually the true requirements are uncovered and the changes made, so for the client it "succeeds" in the sense of getting done, though at higher cost in time and money than if the requirements were right initially.

So I like Agile personally for two main reasons - first it aligns the interests of the client and the developer better than the "is this a change order?" battles waterfall can lead to, and second because frequent deliverables help mitigate the risks.  But "pay us and we'll try to write you some software, but we don't yet know how much you'll get for your money" is a tough sell sometimes, even if it's really only admitting the underlying reality of the situation.


答:
What do they mean by an eventing design pattern?

They most likely refer to an implementation of the observer pattern which is a core language construct in C#, exposed as 'events'. Listening to events is possible by hooking a delegate to them. As Yam Marcovic pointed out, EventHandler is the conventional base delegate type for events, but any delegate type can be used.

How the composition turns out to be easy if a delegate is used?

This probably just refers to the flexibility delegates offer. You can easily 'compose' certain behavior. With the help of lambdas, the syntax to do this is also very concise. Consider the following example.

```<code>class Bunny
{
    Func<bool> _canHop;

    public Bunny( Func<bool> canHop )
    {
        _canHop = canHop;
    }

    public void Hop()
    {
        if ( _canHop() )  Console.WriteLine( "Hop!" );
    }
}

Bunny captiveBunny = new Bunny( () => IsBunnyReleased );
Bunny lazyBunny = new Bunny( () => !IsLazyDay );
Bunny captiveLazyBunny = new Bunny( () => IsBunnyReleased && !IsLazyDay );
</code>```

Doing something similar with interfaces would require you to either use the strategy pattern or using an (abstract) base Bunny class from which you extend more specific bunnies.

if there is a group of related methods that may be called, then use interface-What benefit it has?

Again, I'll use bunnies to demonstrate how it would be easier.

```<code>interface IAnimal
{
    void Jump();
    void Eat();
    void Poo();
}

class Bunny : IAnimal { ... }
class Chick : IAnimal { ... }

// Using the interface.
IAnimal bunny = new Bunny();
bunny.Jump();  bunny.Eat();  bunny.Poo();
IAnimal chick = new Chick();
chick.Jump();  chick.Eat();  chick.Poo();

// Without the interface.
Action bunnyJump = () => bunny.Jump();
Action bunnyEat = () => bunny.Eat();
Action bunnyPoo = () => bunny.Poo();
bunnyJump(); bunnyEat(); bunnyPoo();
Action chickJump = () => chick.Jump();
Action chickEat = () => chick.Eat();
...
</code>```

if a class only needs one implementation of the method, use interface-how is it justified in terms of benefits?

For this, consider the first example with the bunny again. If only one implementation is ever needed - no custom composition is ever required -, you can expose this behavior as an interface. You will never have to construct the lambdas, you can just use the interface.

Conclusion

Delegates offer a lot more flexibility, while interfaces help you establish strong contracts. Therefore I find the last point mentioned, "A class may need more than one implementation of the method.", by far the most relevant one.

An additional reason when to use delegates is when you want to expose only part of a class which you can't adjust the source file from.

As an example of such a scenario (maximum flexibility, no need to modify sources), consider this implementation of the binary search algorithm for any possible collection by just passing two delegates.

Title: Delegate vs Interfaces-Any more clarifications available?

Body:
After reading the article-
When to Use Delegates Instead of Interfaces (C# Programming Guide),
I need some help  understanding the below given points, which I found to be not so clear (for me).
Any examples or detailed explanations available for these?

Use a delegate when:

An eventing design pattern is used.

It is desirable to encapsulate a static method.

Easy composition is desired.

A class may need more than one implementation of the method.

Use an interface when:

There are a group of related methods that may be called.

A class only needs one implementation of the method.

My Questions are,

What do they mean by an eventing design pattern?

How the composition turns out to be easy if a delegate is used?

if there is a group of related methods that may be called,then use interface-What benefit it has?

if a class only needs one implementation of the method,  use interface-how is it justified in terms of benefits?

Body:
What do they mean by an eventing design pattern?

They most likely refer to an implementation of the observer pattern which is a core language construct in C#, exposed as 'events'. Listening to events is possible by hooking a delegate to them. As Yam Marcovic pointed out, EventHandler is the conventional base delegate type for events, but any delegate type can be used.

How the composition turns out to be easy if a delegate is used?

This probably just refers to the flexibility delegates offer. You can easily 'compose' certain behavior. With the help of lambdas, the syntax to do this is also very concise. Consider the following example.

class Bunny
{
    Func<bool> _canHop;

    public Bunny( Func<bool> canHop )
    {
        _canHop = canHop;
    }

    public void Hop()
    {
        if ( _canHop() )  Console.WriteLine( "Hop!" );
    }
}

Bunny captiveBunny = new Bunny( () => IsBunnyReleased );
Bunny lazyBunny = new Bunny( () => !IsLazyDay );
Bunny captiveLazyBunny = new Bunny( () => IsBunnyReleased && !IsLazyDay );

Doing something similar with interfaces would require you to either use the strategy pattern or using an (abstract) base Bunny class from which you extend more specific bunnies.

if there is a group of related methods that may be called, then use interface-What benefit it has?

Again, I'll use bunnies to demonstrate how it would be easier.

interface IAnimal
{
    void Jump();
    void Eat();
    void Poo();
}

class Bunny : IAnimal { ... }
class Chick : IAnimal { ... }

// Using the interface.
IAnimal bunny = new Bunny();
bunny.Jump();  bunny.Eat();  bunny.Poo();
IAnimal chick = new Chick();
chick.Jump();  chick.Eat();  chick.Poo();

// Without the interface.
Action bunnyJump = () => bunny.Jump();
Action bunnyEat = () => bunny.Eat();
Action bunnyPoo = () => bunny.Poo();
bunnyJump(); bunnyEat(); bunnyPoo();
Action chickJump = () => chick.Jump();
Action chickEat = () => chick.Eat();
...

if a class only needs one implementation of the method, use interface-how is it justified in terms of benefits?

For this, consider the first example with the bunny again. If only one implementation is ever needed - no custom composition is ever required -, you can expose this behavior as an interface. You will never have to construct the lambdas, you can just use the interface.

Conclusion

Delegates offer a lot more flexibility, while interfaces help you establish strong contracts. Therefore I find the last point mentioned, "A class may need more than one implementation of the method.", by far the most relevant one.

An additional reason when to use delegates is when you want to expose only part of a class which you can't adjust the source file from.

As an example of such a scenario (maximum flexibility, no need to modify sources), consider this implementation of the binary search algorithm for any possible collection by just passing two delegates.


问:
Config Class/Struct: Pattern or Anti-Pattern? Alternatives?
If you add new configuration options to a program, it can often have tons of ripple effects in terms of getting the options to where they need to be acted upon.  There are three basic ways to deal with this that I'm aware of:

Pass all configuration settings to the parts of your program that need them explicitly as primitives.  This is the most explicit way and the way that decouples things the most.  The downside is that this is both verbose and brittle.

Make the most frequently used configuration settings global/static.  This is the simplest way but introduces action at a distance, hinders testability and assumes that the configuration truly is global (that you'd only want one configuration at any given time).

Make a configuration class/struct that contains all the configuration options for the whole program or for each major concern within the program, and then pass this around explicitly.  This is less explicit than (1) but more explicit than (2).  If you want to change a setting just for one function call, you can clone the config object and change this one value.  This is useful in both testing and in practice.  However, you still end up potentially passing tons of info to a function that it doesn't need and changing a value in the config class/struct can still cause action at a distance.

Would you consider (3) a pattern or an anti-pattern?  If it's an anti-pattern, what do you do instead?

答:
I'm working on a project where we are using the "3 layers (interface, business logic, data access)" approach. The application can be a multiuser web server or client server.

We work with 3 different configurations, the first specific for the P.C., wheter the user is working. The second specific for the current user, and a third global configuration for all users & client apps.

Each configuration is represented in each instace of the application by an object.

This approach may help your project.


答: If you're just looking for a book to help you out on your interview I'd recommend Programming Interviews Exposed.  It answers questions in C and C# as well as Java.  Even the questions it doesn't answer in Java it does a good job at explaining the concepts behind the question.  It's helped me out a lot to review the few days before a big interview.</p>


答:
This series of blog articles all talk about setting up and running different versions of asp.net MVC using the Mono runtime with serveral different flavors of Linxu. My take on it, yes you can.

Get MVC3 Razor Running on Mono

Setting up Mono 2.8 with Asp.Net 4.0 and MVC2 on Ubuntu with MySql
Membership

Installing OpenSuse 11.2 with Mono 2.6.1 and Apache Using Text Mode Configuration – Porting to Mono

Title: Is an ASP.NET site in a Linux environment possible?

Body:
I found some software a while ago that claimed to execute ASP.NET applications on a Linux server, I remember that the information said that takes the code and converts it to Java. I never downloaded or tested the software. Does anyone know the name of this software?

Also, is possible to execute ASP.NET on a Linux server in the first place?


问:
Are 9 to 5 programmers looked down upon?
I would consider myself a 9 to 5 programmer.  What I mean by this, is that I have a programming job, but after I leave work, I leave my work there and do not take it home.  I very much enjoy my career choice, and I enjoy the work that I do at my current job.  I also enjoy learning new things in my field, such as new technologies and advancements in the programming industry.  It's just that outside of my job I have other hobbies that I feel are more important and I'd like to devote more of my time and energies to.  I also feel that devoting >40 hours a week to a single subject is a little exhausting, so are there really that many programmers that want to come home from their programming job and do more programming?

Maybe it's just my current employer, but I feel like they leave little time for career development.  The only way for me to keep up on the newest technologies and programming techniques is to do so on my own time, because my employer does not allocate time during work hours to do these sorts of things (deadlines == $$$).  Does anyone else feel the same way about their employer?

From your experience, do managers and people who hire programmers see 9 to 5 programmers as a less valuable resource?  I know that I could improve my resume by contributing to and open source project etc, but I just feel like I don't have the time to spare.

Could the opposite be said, such that devoting your spare time to other subjects such as the arts show a well-rounded-ness that could be a desirable trait to the company?

答: If you want to excel at something, you need to sacrifice other things. That's the only way. Want to make shitload of money as a software developer / entrepreneur? Then say good bye to your family life at least for a few years. Everyone has to make this choice themselves. It's a deal, you can take it or leave it.</p>