答:
What impact will this soon-to-be failed project have on your career at the firm, and beyond? In my experience, merely being associated with successful projects is not an indicator of your own personal excellence.

The qualities that you exhibit in the face of adversity and sometimes what looks to be certain failure, often gets noticed by the higher-ups, more so than you think. And I'm talking about beyond your immediate manager.

I personally have experienced seeing my immediate manager get fired for incompetence, and then found myself promoted into his position the very same day. Not pleasant, but it showed that people were watching me, and liked what I did.

Oftentimes, the same chaos and disorganization that comes with a failing project, affords you the opportunity to shine.

So look at the project this way: what opportunity does this failing project afford, for the light to shine on all of my strengths and best qualities? What lessons am I learning from this experience, that will make me a better professional and a better person?

Essentially, the sum of experiences drawn from failures is what fuels true success.

Note: Thomas Owens asked, what specific things a person can do in a project like this. I have a few general suggestions, which I've used as personal guidelines in these situations. Will it help a distress project to miraculously succeed? No - but I've found it has helped me to keep a proper perspective on things, and find personal success in spite of the bad situation.

1) Focus on personal excellence - strive to write ever better code, meet ever higher standards of quality and functionality.

2) Focus on personal metrics - how much code do you write, that spawns subsequent bugs? Reduce that ratio to as low as you can. When asked to provide an estimate for a task assigned to you, are you generally accurate, or do you find that you've over/under buffered the timeline too much? When actually assigned a task, do you provide a good level of feedback on the progression of work, including giving well-and-ahead advance notice of delivery timeline problems?

3) Focus on team metrics - These are just some things off the top of my head: Are other team members lagging because of a dependency on a task you are working on? Are you good at delegating or dividing your task/subtasks to others in the team? Do you find it difficult to communicate with one or more members of the team? All areas that I work on to regularly improve in.


问:
How should I behave as a developer in a project that's headed for failure?
I am a developer in a 5-member team and I believe our project is headed for disaster. I'll describe why in a moment, but my question is: how should I behave?

The deadline is in 1.5 months, and I feel no matter what we do, this project will fail. I'm of the opinion that we should just terminate the project and stop wasting our time, but politically I think it's impossible for our manager to do that.

What should I do in this case? Should I put in extra effort, or should I just take it easy? And what should I say to the manager?

Reasons this project is headed for failure:

With deadline approaching many of the must-have features are not finished

Application is unstable and very difficult to use

System is very convoluted, code very hard to understand, very difficult to change - Data model is too driven by a complex relational database (100+ tables)

Unclear leadership; the manager responds to new information with major changes

Almost no automated tests or unit test

Heavily depends on other systems, but no integration tests yet

In fact, we actually just inherited this project (along with the mess) around 1-2 months ago from another dev team under the same manager, who has worked on it for a few months.

答:
In a situation like this, as the lowest rung of the ladder, there is only so much you can do to help the project.

Make sure your work is spotless

help identify the biggest problem areas

Try to provide answers, not just problems. Look like you are trying to fix them.

Aside from that, you really do have to look after number 1.

Document everything

keep all emails, IM conversations

Try and find a way out of the project if it all possible

ContentLicense: CC BY-SA 3.0


问:
What capabilities of Adobe Flash are not present in the WinRT API?
As from March 2013, Microsoft allows Adobe Flash content to play by default on its immersive Internet Explorer 10: http://redmondmag.com/articles/2013/03/11/new-ie-10-flash-policy.aspx

When asked about Silverlight, Microsoft says

Silverlight will not be supported in immersive Internet Explorer 10 since these capabilities are superseded by the new WinRT API.

Does this mean that there are capabilities of Adobe Flash not present in the WinRT API that forced Microsoft to allow Flash? What are these capabilities?

答:
This decision to support Flash in the touch version of IE10 really had more to do with continuing to allow legacy Flash sites to run during the majority of the Web's transition to HTML5.  WinRT API and HTML5/CSS3/JS do contain all of the core capabilities like rich, hardware accelerated animations, audio, and video, and is the superior platform to use, but MS understands that there are some folks who aren't quite there yet, so their older Flash apps still need to be viewable in the meantime.

Short Answer: This decision to allow Flash in IE10 has more to do with backwards compatibility than Flash or Silverlight being a better option than HTML5 or the WinRT platform for apps.


问:
Dependency injection and ease of use
I'm writing a handy library (we'll call it Thinger) that goes off and fetches an XML document, does some X-Path query on it and does something helpful with the result of that. (What I'm actually doing is far too boring to bother you all with, this is just a simplified example.)

Because I'm a wise and lazy programmer I'm making use of two third-party components, one for fetching remote XML documents (we'll call it Fetcher) and one for running X-Path queries (we'll call it Querier).

My library provides a Thinger class, into which one must inject a Fetcher and a Querier. I could do this via setters or a constructor.

But then I think about the poor people using my library, who now have to think about injecting my dependencies when all they really want to do is call something like

```<code>new Fetcher()->fetch(someurl);
</code>```

So far, I have written a static factory which instantiates a new Thinger, Fetcher and Querier, assembles them as appropriate and returns the Thinger.

That left me feeling slightly unclean.

Surely there's a better way?

EDIT

Most frameworks etc would probably get around this using a Dependency Injection Container or similar, but since I'm writing a fairly small third party library that seems like a bad approach.

答:
Use an inversion of control container. In .NET this includes Castle Windsor or NInject

You can just specify which components you need in the constructor, and you can get an object like this

```<code>IThinger thinger = container.Resolve<IThinger>();
thinger.DoTheStuff();
</code>```

The code above doesn't care about which implementation of IKing you have, what dependency must be injected, etc.

It doesn't need a lot of setup or complicated configuration. Normally, you need to write only one method or one file where you register all your services (like Thinger, Fetcher) and initialize the container with that registration

Title: Dependency injection and ease of use

Body:
Use an inversion of control container. In .NET this includes Castle Windsor or NInject

You can just specify which components you need in the constructor, and you can get an object like this

IThinger thinger = container.Resolve<IThinger>();
thinger.DoTheStuff();

The code above doesn't care about which implementation of IKing you have, what dependency must be injected, etc.

It doesn't need a lot of setup or complicated configuration. Normally, you need to write only one method or one file where you register all your services (like Thinger, Fetcher) and initialize the container with that registration


答:
As Dependency Inversion seems to get more and more popular, I would go for a dual approach.

Design your components to be used with a Dependency Injection Container, if possible for use with an arbitrary one so you don't constrain your users in their choice.

As a convenience option, also provide a factory(-method) for creating a Thinger with the default Fetcher and Querier.

Title: Dependency injection and ease of use

Body:
I'm writing a handy library (we'll call it Thinger) that goes off and fetches an XML document, does some X-Path query on it and does something helpful with the result of that. (What I'm actually doing is far too boring to bother you all with, this is just a simplified example.)

Because I'm a wise and lazy programmer I'm making use of two third-party components, one for fetching remote XML documents (we'll call it Fetcher) and one for running X-Path queries (we'll call it Querier).

My library provides a Thinger class, into which one must inject a Fetcher and a Querier. I could do this via setters or a constructor.

But then I think about the poor people using my library, who now have to think about injecting my dependencies when all they really want to do is call something like

```<code>new Fetcher()->fetch(someurl);
</code>```

So far, I have written a static factory which instantiates a new Thinger, Fetcher and Querier, assembles them as appropriate and returns the Thinger.

That left me feeling slightly unclean.

Surely there's a better way?

EDIT

Most frameworks etc would probably get around this using a Dependency Injection Container or similar, but since I'm writing a fairly small third party library that seems like a bad approach.


答:
What's wrong with providing a nice clean default implementation for the common scenario while allowing an injected version for people who want that flexibility?

As long as your default implementation doesn't put undo constraints on usage (like manually deleting the Fetcher and Querier) or your default implementation is only common for the minority, that seems perfectly fine.

Title: Dependency injection and ease of use


问:
Defining a status between last check and now
I have sets of probing data from an internal monitoring tool which represent the availability of different services (databases, webservices and so on).

Now my task is to visualize this data and I reached a point where I should make a decision concerning the data interpretation for the most recent data set.

Quick overall definition, each data set reflects the given status at the time when it was verified and the probing intervals vary from service to service, so there is no constant time window. Hence if there is an interval of e.g. five minutes between set A and B, for these five minutes (assuming with B there is a change) the status of A is always assumed.

So far no problem, my question now however is what should be assumed for the time between now and the most recent data.

I see two solutions

Only visualize data up until the most recent check, and ignore the passed time since then

or

Assume the status from the most recent check is still valid up until now (like between two given data entries)

I could see arguments for both and hope someone can point me in the right direction as to which approach would be the most logical one.

答:
The counter-question is, what is the apparent probing interval you want to present to your users?

If the apparent probing interval should be the actual probing interval, you should only present actual data points to the user without interpolation or extrapolation.

If the apparent probing interval should be a real-time status, you should extrapolate the values from the last probe in the same way as you interpolate values that fall in between two probes. So, if you assume a value remains unchanged until an actual probe tells you otherwise, this should also be the method in which you extrapolate the value after the last actual probe.


问:
Is there any way to get faster at solving bugs? I've just had a warning from my boss
I've just been told by my boss that I will receive a negative performance review on Monday. He wants to talk to me about why I am so slow and why my bug fix rate is so low.

I love programming and solving problems but I actually do find my job really really hard.

I've actually been a programmer for about 10 years. But this is my first multithreading embedded linux job - I've been here 2 years and it's obvious to everyone that I'm still struggling. And I think I've become so demoralised and feel so marginalised that I've lost a lot of the fire that I had at the start of the job.

Has anyone ever been in a similar situation and how do you go about increasing your bug fix rate?

Update:
I had the review. I have been put on a 3 month 'employee development program' (of the type mentioned by Dunk ). Not sure whether I can turn this around. But even if I do have to move on, I've learned a lot from this experience.

Another Update

It's now about 6 weeks since the first review.
My advice to anyone facing the same situation is to be humble enough to take criticism and learn from your mistakes. And to not be afraid to look dumb. Ask loads and loads of questions. Let people know you're trying to learn and keep asking until you understand.
But be prepared for it not to work out. I'm constructing a portfolio of code ... as well as giving it my best shot.

Yet another update

I am hesitant to put this on here, since I'm concerned that I will not be able to refer future employers to my stackoverflow profile... But anyway, it might be of interest for someone reading this question, but I actually lost my job a few weeks ago. I'm in the midst of brushing up on all the skills I need to - I've taken a lot from the advice given here.

答:
While you may love programming and solving problems, there may be the question of how well are you applying what you are learning to other areas.  Are any of the last dozen or so bugs you've fixed similar enough that what helped you fix one was useful on another?  This is part of looking back over what you did do and how long did it take to get that done.  Just an idea to consider.

Secondly, I'd look over how are you doing your work.  Are you getting interrupted regularly and so as you try to fix bug A, you get told that bugs B and C are higher priority?  Consider carefully what kinds of changes in how you do your work may help you here as that is likely part of what your boss is going to want to know.

I have had some work places tell me that they didn't like how long it was taking me to get some of my work done.  Course these were those places where if I got one thing done, 5 new things would be dropped in my lap and thus it was easy to be overwhelmed.  While I may no longer work there, I didn't have a good solution for how to get my attention down to a few things so that I'm not feeling like I'm trying to master 1,000 things all at once.  If I can know a few key things to get done and how my work will be judged, then I'm much better than if I have a "to-do" list that is a mile long and no one seems to care if I get parts of it done.  Thus, it could be that there is a cultural component to this within the organization though I would be careful about asking for things here to change.  I remember one work place I asked for more frequent feedback and ended up getting micromanaged until I was terminated because I wasn't keeping just to what was on my list of things to do.


答:
After two years on the job, it should be obvious to everyone (you, your boss, your colleagues) as to where you stand. I.e., you should never find out that you've been doing poorly only once a year; an ideal work environment will provide continuous feedback.

Anyway, regarding how to debug multithreaded code: you haven't mentioned whether this is your code or someone else's. There are some new debuggers and static analyzers that can handle concurrency. But really, knowing the patterns will be your best bet since you'll know what to look for.

If you understand how critical sections and race conditions and deadlock work, then you'll be in a better position to spot things that are unexpected. If you see "communication" between two threads without condition variables, or if resources are mutexed without a particular order, or if a local variable is declared static for no apparent reason, then you've got a potential bug! So learn the best practices of your domain and you'll be in a better position to judge when something is out of the ordinary.

Title: Is there any way to get faster at solving bugs? I've just had a warning from my boss

Body:
I've just been told by my boss that I will receive a negative performance review on Monday. He wants to talk to me about why I am so slow and why my bug fix rate is so low.

I love programming and solving problems but I actually do find my job really really hard.

I've actually been a programmer for about 10 years. But this is my first multithreading embedded linux job - I've been here 2 years and it's obvious to everyone that I'm still struggling. And I think I've become so demoralised and feel so marginalised that I've lost a lot of the fire that I had at the start of the job.

Has anyone ever been in a similar situation and how do you go about increasing your bug fix rate?

Update:
I had the review. I have been put on a 3 month 'employee development program' (of the type mentioned by Dunk ). Not sure whether I can turn this around. But even if I do have to move on, I've learned a lot from this experience.

Another Update

It's now about 6 weeks since the first review.
My advice to anyone facing the same situation is to be humble enough to take criticism and learn from your mistakes. And to not be afraid to look dumb. Ask loads and loads of questions. Let people know you're trying to learn and keep asking until you understand.
But be prepared for it not to work out. I'm constructing a portfolio of code ... as well as giving it my best shot.

Yet another update

I am hesitant to put this on here, since I'm concerned that I will not be able to refer future employers to my stackoverflow profile... But anyway, it might be of interest for someone reading this question, but I actually lost my job a few weeks ago. I'm in the midst of brushing up on all the skills I need to - I've taken a lot from the advice given here.


答:
Your boss may be correct: you may be "underperforming" (more on that in a minute). But it may not be just your level of competence that's to blame. I don't think it would be a reach to suggest forces outside your control are causing you stress, which is having a negative effect on your performance.

Let's have a look at a few of the reasons your boss may now be bringing this up:

Culture and Politics

There may be forces beyond your control requiring your boss to now voice his concern. It's important to understand the system you are working in. Your job is to make your boss look good. The only way to do that is to understand the pressures he/she is under.

Ability

It's possible that ability is not up to par, as you say he openly stated. Here is what I would do in this situation:

Get specific feedback from your boss on how he measures performance. Are you not closing as many bugs as person X? Is there a set number of bugs you should be solving? If you are working alone then you need to make sure that the people measuring your performance are measuring it fairly and not based on some preconceived idea.

If your performance is slow and based on a real gap, identify that gap and put a detailed plan together with your boss with the aim of closing it.

This review is also a good opportunity to bring up the fact that you are not happy. It's good that you've identified that you don't love this job. But figure out why. What part of your job do you like and what don't you? It might be that this job isn't for you...


答:
Try to be proactive about finding a new way to achieve success for the project.  Think about how you can propose some alternatives.  Right now your boss is probably getting beat up about the project being a failure, wouldn't (s)he appreciate someone coming in with solutions instead of problems?

Maybe there is a way to split the features into staggered deliverables?  There are often degrees of "must have", so see if you can get those prioritized and group them into milestones.   Better to have some product at the end of the timeline than nothing.  Or consider splitting the team between people working on new functionality and others working on the stability, this way you can show some progress on both fronts.

If these efforts succeed, you will have shown that you are a team member who can find a way to succeed, if not, you will still have demonstrated that you don't give up and will work to find a solution.

Title: How should I behave as a developer in a project that's headed for failure?

Body:
I am a developer in a 5-member team and I believe our project is headed for disaster. I'll describe why in a moment, but my question is: how should I behave?

The deadline is in 1.5 months, and I feel no matter what we do, this project will fail. I'm of the opinion that we should just terminate the project and stop wasting our time, but politically I think it's impossible for our manager to do that.

What should I do in this case? Should I put in extra effort, or should I just take it easy? And what should I say to the manager?

Reasons this project is headed for failure:

With deadline approaching many of the must-have features are not finished

Application is unstable and very difficult to use

System is very convoluted, code very hard to understand, very difficult to change - Data model is too driven by a complex relational database (100+ tables)

Unclear leadership; the manager responds to new information with major changes

Almost no automated tests or unit test

Heavily depends on other systems, but no integration tests yet

In fact, we actually just inherited this project (along with the mess) around 1-2 months ago from another dev team under the same manager, who has worked on it for a few months.


答:
I'm going to recommend you take a little time to read 2 books.

Death March is the canonical book that describes a pathological project management style that is widespread in software development. Due to schedule compression, feature bloat, or mismanagement, many projects end up in a bad state; it helps to understand that you are not alone and your project is not the only death march. Author Edward Yourdon categorizes dead-end projects into 4 quadrants, each of which has different coping strategies. Sometimes the only coping strategy is to walk away. I think this book will help you figure out what your range of options is and narrow down what you can and cannot do.

Catastrophe Disentanglement is written more for project managers. It is aimed at figuring out how to triage a broken project: What needs to be cut, what can be cut back, and how to pitch that to customers? "Conventional" software project management gets us into messy projects, and we won't escape our problems using the same thinking that got us into them in the first place. This book is a little harder to read than Death March, but a good one to have on your bookshelf.


答: Don't struggle alone unless you have to. Recruit colleagues. Get them to help on bug hunts. Ask them about their thought process and tools. Perhaps mention this in your review as part of your plan to improve. If everyone around you is doing better on this system, maybe they know something specific?


答:
You should go to work and do what you would do on any project, whether it was succeeding or not. You are being paid to perform your job. Do it to the best of your ability. Assuming you aren't the project manager/lead, it is not your responsibility to decide that a program should be cancelled or not. You deciding to slack is the same as you making the decision to cancel the project. That's not part of your job description.

However, in the bigger picture, that doesn't mean that you should be working 50, 60 or more hours per week to try and meet the schedule. Once again, that's management's job to figure out how to achieve the project objectives. 50+ hour work weeks is not a reasonable option unless they are willing to pay overtime and you are willing to put your family life on hold. Once again, it was management's job to put together an achievable schedule. They can't assume that they can force employees to ignore their family life in order to meet unrealistic schedules.

Also, while the schedule may say 1 1/2 months remaining. That is probably not the "drop dead" date. Some customers may take what you have by that date, even if it isn't all. Some customers may come up with extra funding, since they've already sunk a lot of money into the project. Sometimes the company itself may take on the extra costs to ensure a satisfied customer.  All of that is out of your control. Do your job to the best of your ability. That will give management options to work with that could turn a disaster project into a great success story. I've seen it happen many times.


答:
Failing projects can be toxic to the soul, cause depression, over work and low self-esteem.

It's all relative to perspective.

I've worked on horrible projects while sitting across from another guy who had a smile on his face every single day. Oh how I wanted to slap that smile off his face.

Some people aren't bothered by the current state of affairs on a project. They enjoy their contribution, their tasks and are working with in the domain of their interestes. While others, have a strong negative reaction to the current state of things. It's all about our perceived expectations for our daily jobs.

While you might be doing some of the work you enjoy. There is clearly elements in the current project you dislike.

You need to identify what those problem elements are, and address them.

deadline pressure

quality control

professionalism

guidance by management

There are many teams and companies that don't find the above aspects of development important. What I've found is they often think the following.

Deadline pressure is perceived as way to motivate people.

Quality costs more and returns limit.

Professionalism applies to other areas of the business.

A manager is a timekeeper and not a person who contributes to development.

These problems aren't yours. It's theirs, and you shouldn't waste any energy over their behavior. If you aren't one of the guys who smiles and enjoys his job even as it heads for a cliff, then you should think about finding a place of like minded developers.

You'll be much happier.


问:
using ant colony algorithm to create cross word game
I have difficulty to learn about ant colony algorithm (ACO), I have read about generating crossword game using (genetic algorithm) GA.I Know both of GA ant ACO usually used for optimization, but my question is Is possible if create crossword game generator using ACO and how it can work for optimization in this case? </p>

答:
The problem you're having with ant colony algorithms and the reason that no one has applied it to solving crosswords is because ACO poorly suited for the problem of crosswords.

Artificial intelligence is a MASSIVE field of study. There are a ton of methods and approaches. There are also quite a lot of problems out there that can have AI applied to them. Arguably, all of them per the definition of "problem".

For some problems, we have observed how nature solves them and we strive to emulate and improve on those methods. Things like genetic algorithms emulates the process of evolution. Neural networks emulates brains. ACO emulates, you know, ants. And ACO helps us figure out how to solve hard problems like finding the shortest path. But it's probably not the best method for object recognition or finding what words fit in a crossword puzzle. I can't really think of any way to correlate finding the shortest path with finding how to fit words together.

It's tempting to think that neural networks, genetic algorithms, machine learning, genetic programming, or even ant colony optimization are general solutions that can solve everything, given enough tuning, abstraction, and processing time. But that's just not the case.

tl;dr No.


问:
How is transparency defined in context of the broker architecture?
I would like to know how transparency is defined, and what is the measurement for this in the context of a broker architecture.

For example :

from a developer point of view, [in the broker architecture] distribution is transparent. you talk to a broker one way or the other and it introduces an object model in which distribute services are encapsulated within objects.

答:
Good software in general is composed of decoupled layers. The application layer understands the object model. The messaging layer is decoupled  from the object model. Changes in the object model does not affect the message broker.

Another aspect is the composition  of different components in the application layer into a distributed system. Fault tolerant architecture one component is decoupled from failure in another component. Without a broker when component A sends a message to component B a failure of B would directly affect A. The broker can store messages and forward them when B recovers. This is done transparently for A.

Routing between components also is a source of coupling. In SOA each service has an entry point (reverse proxy) that masks the server fron the client. In messaging architecture the broker could route messages without the component A even knowing that component B  would be handling the message.

Notice how in all these cases the architecture takes responsibilities from the components making each component more coheseve and decoupled from each other.


答:
First, note: this answer may only apply to certain regions where it is illegal to dismiss an employee without severance. That said...

This could be a case of Constructive dismissal and which is illegal.

The tactic is to demoralize and lower the self-esteem of an employee until they quit the job. It's a way for the company to save money by not having to pay severance, or solve the problem of having to confront the employee and fire them.

He wants to talk to me about why I am so slow and why my bug fix rate is so low.

This fault is very ambiguous. It's impossible for either side of the party to claim the other is wrong. You took a month to fix one bug. So what! This places you in a defensive position, by having to present facts to support your claim that a month was required. Given your current skill, experience and knowledge as factors. As an employer it's the employer's job to manage the time and efforts of his employees. The employer must be the person engaging in the risk associated with having the bugs fixed. Not the employee. He always had the choice to assign the bug to someone else.

If you are a contractor, and it states in your contract that will be responsible for the fixing of bugs, then it's a completely different story.

Is it wrong for the employer to complain that you are taking too long? Absolutely not, but he can not hold you accountable for it, and he can not fire you for it. He can say to you "We have no more bugs that require your skills, and you are placed on leave," but they must tell you the moment a new issue comes up that you can fix. Otherwise, they must terminate with severance. What he can not do is give you work you can't handle and then complain about it. I think this is illegal.

I love programming and solving problems but I actually do find my job really really hard.

There is a big difference between taking a job you find hard, and your employer giving you work that is too hard. If you feel the tasks assigned to you were done to discourage you from having a career with the company, this could be illegal.

I've actually been a programmer for about 10 years. But this is my first multithreading embedded linux job - I've been here 2 years and it's obvious to everyone that I'm still struggling.

This is why I think you've found yourself in the middle of a constructive dismissal. They aren't happy with you so they pile the crap on you until you leave.

And I think I've become so demoralised and feel so marginalised that I've lost a lot of the fire that I had at the start of the job.

An employer is responsible for providing a safe and positive work environment. Without more information (most likely personal) it's difficult for outsiders to say what is really going on here. Ask an employment lawyer for a free consultation. They will be able to tell you if you are being played.

References

I'm not a lawyer, but did Google some documents discussing the topic of Constructive dismissal which are worth reading before you enter your review on Monday. The main point here is to watch out for a reduction in salary, humiliation and sudden changes to your career with the company.

Relevant facts watch out for:

Failure to properly support an employee during difficult working conditions

Excessive disciplining of an employee Imposing a change in the employees place of work at short notice

Imposition of a reduction in salary or wages

Legal Q&A: Constructive dismissal

Reasons to claim for constructive dismissal

Wikipedia

elements of a constructive dismissal


问:
Is RESTful API appropriate for services which are nearly computational in nature?
Is RESTful API appropriate for the following scenario?

A time-limited token is obtained, which will last for one minute only

Image is uploaded to a server

Server performs some CPU-heavy image processing upon request, within the time limit

The result is available for download, within the time limit

When the token expires:

The image, computation, result are all discarded / terminated, and any open connection will be closed.

All other necessary aspects of web services, such as authentication / service authorization, quota, encryption etc., might still be necessary.

Since the "resource" is only allowed to exist for less than one minute, does it still make sense to make "resource" the first-class citizen in this API?

Update

I have found this link that talks about a REST API for job queueing in RabbitMQ. However it is an "idea page", so I'm not sure whether this is relevant or not.

答: REST as a transport protocol is suitable, as an architectual paterrn it might not be enough. Lets assume that you would want to distribute the computation accross multiple servers. This would require round robin load balancer to even out the load, and sticky sessions to ruote the result request to the same server that processed the image. You should take a look at master worker job distribution frameworks such as cellery that are based on queues, and at low latency computation frameworks such as storm.</p>


答:
3 simple and cynical strategies to maintain career/sanity.

See a train wreck in the making - get off the train: Failing projects are terrible for morale and unless you have ninja upward management skills will have some negative impact on your career. Jump now if you can see any soft landing.

If that doesn't work keep your head down: People are going to start looking for people to blame - don't make it easy for them! While escalating concerns up the management chain might be the right thing to do it is both ineffective and risky. Your own manager is unlikely to pass your concerns on up and bypassing him/her will not only make you both look bad but could brand you a 'troublemaker' i.e. the kind of person who can be blamed for undermining the project in the first place etc. This of course also means be professional, put in your hours but no heroics.

Plan for an emergency exit on T+1: give yourself some options and do the groundwork for a potential internal or external transfer now. Talk to people; there's no reason to wait for others to decide what to do with you when the project funding gets cut or to get swamped in the inevitable 'stampede' of people migrating away in a couple of months.

Apologies if it sounds overly cynical but if you've called it correctly then there is no upside to suffering the unpleasantness coming your way. Be professional, be optimistic but always be realistic.


答:
Some work environments are unworkable. I've seen environments in which no one could survive (save for those who were in at the beginning) because so much was undocumented and questions were so vehemently discouraged.

You really need to be honest with yourself regarding the expectations and the resources provided to help you to meet them. The problem may not be you.

You mention that there are people doing similar jobs to yours who are, I presume, not having difficulty, but that have 5+ years of experience to your 2. How do you feel in comparison to your peers? Are they rockstars who entirely outclass you (in this respect), or are they just like you? Perhaps they just got to know the system when it was more simple... You mentioned having 8 years programming experience before this line of work. How did you do there? If you did great, then that should tell you something.

The part that struck me is the bit about your describing yourself as being in the dark with respect to all the bugs that come your way. It could be that the code base is so vast and uncharted that the expectations may not be reasonable.

For you to have made it as far as you have means that you have done something right and have something going for you.

Bottom line, I think, is that you need to feel good about yourself and about what you are doing. And if that means moving on, then so be it.

Better to move on than to have a job ruin your life.


答:
Sounds like most projects I've been on. It probably won't end as badly as you think, however:

Do your job. Don't worry so much about the overall project as long as you complete your responsibilities.

CYA also known as Cover Your Backside. If the project does fail and you suspect the manager will start blaming everyone but himself, make sure you have enough proof that you did everything required of you (see item 1).

Make a few polite suggestions for improvement. Don't sound the warning bells, don't be doom and gloom, just be polite and subtle.

For example, if the team isn't writing effective unit tests (or any tests), write a few unit tests closer to what you would like to see and causally mention how doing so helped you solve a particular problem, or saved you time.

Whatever it ends up being if you want to affect change focus on the positive steps that have concrete results. This project may never turn out to be a winner, but maybe the team can learn for the next one.

Also:

Opportunistic refactoring is your friend.

ContentLicense: CC BY-SA 4.0


问:
Log defects for failures of other systems?
We build products which often integrate with third party systems.  Sometimes these systems error, which in turn causes our system to error.  For example, we call a web service when a user updates their data after we've saved to our own database.  While testing, the service on the other end is not functioning correctly.

I can see both sides; on one hand the software won't work until the service is fixed, and so we need to track that somehow.  On the other, there's nothing we are going to do that will resolve the defect and having a critical defect in our system sitting there seems to be a waste (and may concern others looking at the tracking system wondering why we have defects we're not acting on).

My question is, should these be tracked as defects in our tracking system, or should our QA people not be logging defects if they know this is the reason (typically they do as they'll ask me if unsure)?

Edit: A few people are making assumptions.  The web service were calling is developed by another shop, and we are both being paid by the same client to integrate our systems.  Our UI handles the error correctly it doesn't show a ysod.  It tells the user they cannot change their account at this time.  The defect being reported by our qa team is of course that the user ought to be able to change their account, but they don't know if the issue is something we need to fix or the other company.  According to our requirements, we cannot save the users changes if the service call fails.  Its been decided that these failures should be uncommon enough that this design is ok.  Were also working with the other company to iron out some details that have come up during our testing.

答: You need to track everything that degrades the overall performance of your system.  Otherwise you're left with "it didn't work, and no one knows why".</p>


答:
Your system is YOUR SYSTEM no matter what 3rd party software/services you are using. Defects should be tracked and reported. If your software isn't working (regardless of the cause) it is still a bug in your software.

When Microsoft releases a new OS and an old program that uses an undocumented, intended only for Microsoft's internal use purposes causes the old program to break. Is it a bug with Microsoft's OS or the old program's code? To the customer, it is a problem with the new OS. Period. Same goes for your software.

EDIT: As for leaving a critical defect that you aren't going to fix sitting in your tracking system. Once the bug is reported and tracked, management could decide not to fix it, to fix it, to come up with a work around or to keep it in the list as a low priority item.  If management decides to not fix it then the defect is closed. It won't be sitting there as active. If the defect is critical then I have no idea why on earth you would decide not to fix it, even if the fix is to simply display an error message to the user informing them that a necessary service is currently down.

Also, I think it is a defect in YOUR SYSTEM if you aren't properly handling a "critical" error that you know exists in 3rd party software.

Title: Log defects for failures of other systems?

Body:
We build products which often integrate with third party systems.  Sometimes these systems error, which in turn causes our system to error.  For example, we call a web service when a user updates their data after we've saved to our own database.  While testing, the service on the other end is not functioning correctly.

I can see both sides; on one hand the software won't work until the service is fixed, and so we need to track that somehow.  On the other, there's nothing we are going to do that will resolve the defect and having a critical defect in our system sitting there seems to be a waste (and may concern others looking at the tracking system wondering why we have defects we're not acting on).

My question is, should these be tracked as defects in our tracking system, or should our QA people not be logging defects if they know this is the reason (typically they do as they'll ask me if unsure)?

Edit: A few people are making assumptions.  The web service were calling is developed by another shop, and we are both being paid by the same client to integrate our systems.  Our UI handles the error correctly it doesn't show a ysod.  It tells the user they cannot change their account at this time.  The defect being reported by our qa team is of course that the user ought to be able to change their account, but they don't know if the issue is something we need to fix or the other company.  According to our requirements, we cannot save the users changes if the service call fails.  Its been decided that these failures should be uncommon enough that this design is ok.  Were also working with the other company to iron out some details that have come up during our testing.


答:
Ask your superior what is your speed of fixing bugs and what's the team's mean speed of fixing bugs. More important, ask him how is the speed of fixing bugs measured...

This is kind of metric isn't really a metric; if it would be, it would be even more unreliable than LOC (although measuring different stuff). And without a proper measurement there is no reason accusing you of anything.


问:
idquantique .vs. rdrand
We are currently looking at using the idquantique random number generator device to provide random numbers.  There are some issues though.  We would only be using one device and we have at least 5 servers that would need to use it and this number will probably increase in the future.  This implies that blocks of random numbers would have to be sent to the servers in some way.  All the servers are running Linux.

All of our servers are Intel based and have the RDRand random number instruction available.  It would be easier to use RDRand since no networking calls would need to be made and RDRand also appears to be significantly faster.

But, the question I would like answered is - is there a difference between the quality of the random numbers generated by RDRand and those generated by idquantique?  Has anyone ever measured or tried to measure how well these two random number devices perform against each other?

答:
There is no software in Intel's random number generator.
The point of an on chip hardware TRNG accessed through the instruction set is reduced attack surface and performance. Sending random numbers over the network for security purposes is frankly wrong.</p>

Title: idquantique .vs. rdrand


问:
MVC View Question
In my PHP web page (index.php), I have a simple script that calls a "page" class, and then builds the page from it.

Index.php executes methods within an instance of the 'page' class, such as "add_to_body("bla bla bla")". It can then call a "build()" method, where the page class will return a string with the user input and some other HTML elements pre-added in, that index.php can echo. Essentially the page class is a template of sorts.

I'm trying to have some kind of MVC hierarchy here (I'm a student learning about programming 'best practices' in my own time), my question is: would 'index.php' be a view? Or, would the instance of the page class be the view (as it constructs the page, but it doesn't actually show it, it returns a string), or: would the 'page' class be a controller?

Also, is a view 'allowed' to talk to (eg: get data from) a controller (for example: by calling a method that controller owns)?

Many thanks for your help!

答:
generally the idea with a "View" is that its as 'dumb' as possible. it has the bare minimum of code to display the page. the "Model" is typically the methods talking to a database, validating data, creating and returning data structures -  object, array, etc. the "Controller" is in the middle of the View and the Model.

so like if you have a contact form - the controller tells a model to validate the form data and add it to a database. if the model comes back with "validation failed" - the controller says - show this form again - and passes relevant data to relevant view. or if the model says "new contact added" - the controller says - show the thank you page.

when you are comfortable i would suggest taking a look at a basic php framework like codeigniter. it can make it easier to see how the MVC parts relate to each other.

response: the view should be separate file, and there should be separate view files for different needs. remove as much logic as possible from view files. this means you will end up having more files, but otherwise your view file "Knows" too much about your application. classic example is having some kind of check in a view file if the person looking at it has admin privileges. the view file should not know this. just make separate files.

in a small application you can combine controller and model in same file. and that is a good way to start - build out your application, and then as the methods become clear, you refactor the methods from the controller -  into your models.

i would hasten to add that you should learn a php framework like codeigniter, even if just to see examples of MVC. the framework gives you a good starting place and you can also look at other peoples applications.

Title: MVC View Question


问:
OOP (php) for beginners - some unclarities
I started reading some tutorials about OOP, because I want to learn the basics.

I have a question about it. I understand how you can have a object "Car" and give it a color like this $oCar->setColor("white");

But there are some things unclear to me. Let's say I have a database with all kinds of cars. What is the best way to create the object "car"? A SQL-query instead the class?

And the other question is: how can I output a list of all cars? Do I need to create a object called "Garage" with has only one method within that selects all the cars from the database? Or does this kind of method belong in the "Car" object?

答:
the practical part of object oriented comes not so much from "Getting" things (like from a database). its when you are Changing things in a sequence over time. so for example - lets say you have an app where someone can call up a model of car - and then they can change the color, view, change the color again, view.

they request a car model, you get it from database as an object $carModel with a default color.

they request to see the color Red - you take that "instance" of $carModel, and run it through the changeBodyColor() method to change it to  Red, then you pass the updated $carModel to your view and display it.

so obviously this could be a lot more complicated - different doors, tires, interior etc. but its all happening to the same object. AND that object is unique to the requester! here is where it gets amazing -- with the same class code -- you can have many simultaneous users -- each one will have a $carModel object -- AND that object is unique to them!!

thats why sometimes you will hear classes referred to as 'blueprints'. with one set of blueprints you can make 50 houses. but even though they came from the exact same 'blueprint' (class), each house (object) is unique.


问:
Are Compiler Directives an Antipattern?
I'm working on a legacy system that has a helper class that is symbolically linked into many different .Net projects within a solution.  The logic is riddled with compiler directives that change it's internal behavior based on which .Net project it happens to be compiled in. For instance, there's a compiler directive that interogates a "HAS_UI" variable and if true, compiles in a frmProgress instances and displays progress to the user.

I'm trying to explain to colleagues why this is a poor design by referencing specific anti-patterns.  All I can come up with so far are "positive" patterns that should have been used, like the Single Responsibility Pattern or the Observer pattern.

Can anyone suggest specific anti-patterns that might apply here?

Thx

答:
I think you're taking this from a backwards approach. Anti-patterns are a way of naming things that are known to have bad characteristics - they are diseases, not symptoms. It's really the symptoms we care about, even if we haven't named this specific disease yet.

The way you should be talking about this is in terms of actual functional defects or deficits that this way of programming has:

It's nearly impossible to test in a meaningful way because the code depends on the environment

It's very dangerous to make edits because you have to test your change under so many different conditions

It's hard to read the code because you have to know the value of many external factors

The combinatorial complexity of all these flags makes a large number of configurations that have to be reasoned about

You have to recompile a large amount of code to see if you broke anything

And so on.

Title: Are Compiler Directives an Antipattern?


问:
OOP principles and method names
```<code>class Boxer:

    def punch(self, punching_bag, strength):
        punching_bag.punch(strength)

class PunchingBag:

    def punch(self, strength):
        print "Punching bag punched with strength", strength

boxer = Boxer()
punching_bag = PunchingBag()

boxer.punch(punching_bag, 2)
</code>```

No doubts that punch is a good method name in case of a boxer.
But is name punch also good for the method of punching bag?
In both cases I mean punch as a command (i.e. do punch).

答: hmmmm. i'm questioning punching bag as a class, because you dont really care about the punching bag -- you care about the impact and strength of the Boxers fist. so the methods should be about whatever is measuring and reporting the punch impact. even if this is coming from the 'punching bag', the naming should still reveal the responsibility - like punchImpactMeter etc. </p>

Title: OOP principles and method names


答:
Perhaps you are being compared to one of the original programmers of a project. I know that as the original developer of one of the projects I work on, I have a tremendous advantage when fixing bugs in it. I don't think it is because of lack of documentation, it is just that I can intuitively leap to potential problems because my brain knows all of the code.

If you're being compared to that, then you just aren't going to measure up. It is always going to take you more time to come up to speed with the project and you won't know where all of the potential interaction points are.

I read your comment about not finding out about tools and tricks other programmers are using to solve problems. Perhaps for your next bug fix you need to try pair programming. This can be incredibly useful. Take turns driving the keyboard. Do a lot of talking.

You can use a notebook or a whiteboard to chart out function paths, threads and lock lifetimes, and mark where you observe various bits of behavior and where you can insert new probes.

Solving these kinds of low-level threading problems can be really hard and I have a lot of sympathy for you. I've had to analyze several gigabytes of log files before to spot a two-line problem. And you know what? I stared at that for days before I asked for help from a junior engineer who'd been an intern the year before, and he came up with a new approach and spotted the problem in an hour. So, after you put some time into a bug, get some new eyes on it. It can help a lot!


答:
"It depends"

Compiler directives can be exceptionally useful tools.  They can provide ironclad rules that keep development (debug) acceptable aspects out of production (release) builds.  Likewise, an assembly can be made more lightweight by removing tracing instructions once the build is switched to release.

On the other hand, they can be abused.  I once had the displeasure of pulling a shoddy API apart that had directives for 7 or 8 different platforms as well as debug & optimized code.  It was a bug-ridden mess that wouldn't compile in my environment.

Beware of falling into your own anti-pattern of "I didn't write it so therefore it's crap."  Presumably, the project has had at least one release and has held up under a degree of maintenance.  It's an anti-pattern to declare the code as crap simply because you can't wrap your head around it.

To be clear, I'm not saying that what your project is doing is right but it's not necessarily wrong.  The impetus is upon you to fully understand what's going on within the code and then be able to explain why it's wrong.  The examples you provided didn't jump out and scream "ew, that's bad" so I suspect you may have more research to do with the code.

Ultimately, you should be able to point at specific sections of code and say "this is bad because of XYZ."  You shouldn't need to rely upon colloquial anti-patterns to prove your case.

Title: Are Compiler Directives an Antipattern?

Body:
I'm working on a legacy system that has a helper class that is symbolically linked into many different .Net projects within a solution.  The logic is riddled with compiler directives that change it's internal behavior based on which .Net project it happens to be compiled in. For instance, there's a compiler directive that interogates a "HAS_UI" variable and if true, compiles in a frmProgress instances and displays progress to the user.

I'm trying to explain to colleagues why this is a poor design by referencing specific anti-patterns.  All I can come up with so far are "positive" patterns that should have been used, like the Single Responsibility Pattern or the Observer pattern.

Can anyone suggest specific anti-patterns that might apply here?

Thx


问:
How to use GPL v3 with Apache License 2.0?
Based on this page, I can see that only Apache License 2.0 is compatible with GPL v3.

Now my question is, in layman's term, how do I make those two work together?

My current situation is that I am developing an application that is made from a GPL v3 licensed programming language. I want to put some form of security on the application and figured I can achieve that via a web service. However, I don't want to expose my web service's code as GPL v3 since it is part of a larger system that I am working on which will be closed source. Is there any way to use the Apache License 2.0 in this scenario?

EDIT: For clarity's sake, the programming language I am going to use is LiveCode.

答:
IANAL but from what I understand it's compatible in the sense that you can use Apache licensed code under the GPL, not the other way around.

So if the code was licensed under the Apache license, you can use it in a GPL licensed application. If the code was licensed under the GPL, any derivative work must be also under the GPL and cannot, without the copyright holders permission, be used under the Apace license.


答:
Your question blurs the line between project management and software development.

How do you define what is and isn't a "defect"?

Are you logging a defect each time the web service fails?

For me, I would put this down as a project issue.  You still want to document the cause / research etc. you have put into it.  I don't like polluting my defect / bug list.

Each time you have to explain to the customer or user "The defect list has grown by 43 defects this week, but 39 are the third party problem" just makes managing your defect all the more confusing.


问:
Effective team meetings
I'm a team leader of a team of 8 programmers in a company of about 20 technical people. They're working on a range of projects, these projects also involve people from other teams that are outside of my control. My organisation is not doing proper agile development, and they're somewhat resistant to change, but I've been holding daily stand up meetings within my team and we've all been finding them useful and everyone is engaged and we're done within 10-15 minutes. I also have weekly individual catch ups with every team member where we discuss various general topics (both technical and non-technical) in more detail, as well as various ad-hoc topical meetings.

What I've been struggling with, however, is my weekly team meeting. It is losing steam and I have not been able to keep people interested.

I still want to hold a longer meeting, even if it has to be fortnightly or monthly. The purpose was to discuss various topics that cannot be done during a stand up meeting because they require more time. Updates from me include a summary on every current project that they're working on (whether it is on schedule, various delays, etc), any changes in direction, future projects, changes to development process, etc. However, it ends up being a lecture from me, and at least 2 people are obviously zoned out and the rest are at most mildly interested.

I tried getting people to be more engaged by getting them to talk about their week, but with 8 people it takes a long time and (partly because a lot of their work does not cross over all that much), most of the rest team does not care what their co-workers have been working on in more detail (they get a high level overview during stand ups).

So, during these meetings, at least some people are very bored, and it is almost embarrassing for me to keep holding these. It is a stark contrast to our energised morning stand up meetings.

Any advice on what I can do to keep people more engaged and more interested? And how can I get them to present things on their or start discussions that involve everyone instead of it being a monologue from me?

答:
Welcome to the world of middle management!

You are going to find this type of problem happening a LOT!

You have 3 options:

Big Stick
Do this or you are sacked - never works.  Don't do it.

Ownership
Get them to facilitate the meetings.  Take a step back and nominate someone else.  Have it as a rotating position where a different person hosts each time.

Speak the unspoken
From what you have said, everyone is bored - then why not ask them that?  Are you bored ? / Is this a waste of time etc.  Why are we hear?  What's the value in this?

It wasn't clear in your question why you want to do this.  If you are the only one who feels these are valuable, are you willing to change?  Ask them what they want.  They are software people, their job is to solve problems all day - solve this one!

Title: Effective team meetings


答:
One of the most common management dysfunctions in this industry is not understanding that debugging is intrinsically difficult.  I've got nearly 20 years of experience and I still regularly have to spend a full week finding the one-line mistake that makes the program crash one time out of fifty.  And then, if my manager doesn't understand these things, they hassle me for taking a week to change one line of code.

What can you do about it?

Take notes as you debug.  Just always have an editor window open, and write down your stream of consciousness.  It doesn't have to make sense to anyone but you.  You may find that this helps you debug faster, but it also means you have something concrete to point at to demonstrate that you weren't playing Nethack all week.

Compare notes with all your coworkers.  How long does it typically take them to fix bugs?  Do their bugs stay fixed?  How often do they change one little thing and find themselves buried under a pile of cascading consequences?  The answers to these questions will give you some sense of whether you're really struggling relative to the rest of the department.

Make friends with the QA people and the customer support people.  They are the ones with the best idea of how important the bugs are.  Often this has little or no correlation with how difficult the bugs are, so you can game the system a bit and try to get assigned all the high-importance, low-difficulty bugs.  (This isn't really cheating.  A well-organized team always goes after those bugs first.)

If your boss hasn't been giving you adequate feedback on your performance for two years running, that is a problem to first bring up at this performance review, and then when you get given the runaround on it, to raise with your boss's boss.  Be polite, and especially don't let them see how angry you are, but get specific criticisms in writing.


答:
I've just been told by my boss that I will receive a negative
  performance review on Monday. He wants to talk to me about why I am so
  slow and why my bug fix rate is so low.

Be aware that in any non dysfunctional company things don't happen on this order. If your boss is concerned about your performance, he should set short term goals, and talk about your results to find out where the problem lays.

Instead, he decides to give you a negative review, then find out why. Sounds like he is not willing to involve himself in the problem, and he just want results in the table.

Don't aim to solve bugs faster. Aim to evaluate your own ability, check how your colleagues work, how they know what they know, and be aware that this is not an ideal company.

As for practical tips, I use code snippets, and my own mediawiki to take notes. I always have in mind what books to read next, and what direction to go to continue my learning. Learning is the path to a better job and a happier life.


答:
The logic is riddled with compiler directives that change it's
  internal behavior based on which .Net project it happens to be
  compiled in.

Compiler directives aren't the problem, they're just the means used to create the alleged problem. You'd probably have the same objection if you had to comment out and uncomment various blocks of code based on what kind of target you're building. At least the compiler directives let you avoid that.

So, the class in question relies heavily on conditional compilation. The main reason that that can become a problem is that it makes the code less clear -- you've got one piece of code that's trying to be eight different things at the same time. One way you can reduce the problem is to create target-specific subclasses of the class in question, and use compiler directives just to select the right subclass when you want to instantiate the class. That'll make the code easier to understand, but it can be difficult if the various targets each use different combinations of features.

Title: Are Compiler Directives an Antipattern?


答:
Can the meeting or hold it much less often.  Write your lectures in a regular email and send it out to everyone.

Only have meetings if the people in them actually have reason to participate in them.  Otherwise, you really are wasting folks' time.

Title: Effective team meetings

Body:
I'm a team leader of a team of 8 programmers in a company of about 20 technical people. They're working on a range of projects, these projects also involve people from other teams that are outside of my control. My organisation is not doing proper agile development, and they're somewhat resistant to change, but I've been holding daily stand up meetings within my team and we've all been finding them useful and everyone is engaged and we're done within 10-15 minutes. I also have weekly individual catch ups with every team member where we discuss various general topics (both technical and non-technical) in more detail, as well as various ad-hoc topical meetings.

What I've been struggling with, however, is my weekly team meeting. It is losing steam and I have not been able to keep people interested.

I still want to hold a longer meeting, even if it has to be fortnightly or monthly. The purpose was to discuss various topics that cannot be done during a stand up meeting because they require more time. Updates from me include a summary on every current project that they're working on (whether it is on schedule, various delays, etc), any changes in direction, future projects, changes to development process, etc. However, it ends up being a lecture from me, and at least 2 people are obviously zoned out and the rest are at most mildly interested.

I tried getting people to be more engaged by getting them to talk about their week, but with 8 people it takes a long time and (partly because a lot of their work does not cross over all that much), most of the rest team does not care what their co-workers have been working on in more detail (they get a high level overview during stand ups).

So, during these meetings, at least some people are very bored, and it is almost embarrassing for me to keep holding these. It is a stark contrast to our energised morning stand up meetings.

Any advice on what I can do to keep people more engaged and more interested? And how can I get them to present things on their or start discussions that involve everyone instead of it being a monologue from me?


答:
You said that the meetings feel like you are lecturing them.  If it feels that way to you, and the team doesn't seem interested in what you have to say, then why still have the meeting?  If you're just throwing information at them, and it isn't holding their attention, why not just summarize everything in a weekly email instead?

If you want to make use of that hour you have with the whole team, you may want to consider running a retrospective.  You can introduce the retrospective with simple honesty on your part: tell them that you don't feel the previous meetings have been productive and that you want to try something different to help everyone to benefit from the hour they have together.

In retros where I work, we will have three columns on a whiteboard, usually putting a smiley, meh, and sad face at the top, e.g. :), :|, and :(.  Then the team members get to put anything on the board that they would like to talk about with the whole group.

In the happy column, you can celebrate successes (like congratulating Alice and Bob on the release of a project they worked on together), and you can declare victory with new processes you're trying (like the new bug tracker is much better than the old one).

In the meh column, you put things that aren't exactly happy or sad for the week.  Maybe you purchased licenses for the new version of your IDE, and somebody hasn't seen any advantages of the new IDE -- they could put that on the board to figure out if everyone else feels like the upgrade was worthless or if other people have found ways that it is actually superior to the previous version.

In the sad column, you put things that haven't gone well for the week.  Identifying the pain points for the week is probably the biggest benefit of a retrospective in my opinion.  The whole team gets to discuss solutions to a real problem.  On teams that all work on a single codebase for instance, someone might say that the FooBar class is unmaintainable and has been the cause of hours of debugging.  Suddenly you find out that everyone else on the team has also lost multiple hours this week to FooBar, but nobody spent any time to clean it up.  In that case, the team may collectively decide it makes sense for someone to spend time refactoring that code next week.

After everyone writes their proposed topics on the board, I like to briefly go over each topic and have its author give a 10-30 second explanation of the topic.  This section of the meeting is easy to derail, so you'll have to be careful to keep people on topic -- e.g. someone will say that X has been a problem, and someone else starts talking about a solution to the problem; solutions shouldn't be discussed until after voting.  In introducing the topics, you may find ways to group together multiple, closely related topics.

After the introductions, everyone gets three votes that they can distribute among the topics however they see fit.  Finally, the votes are tallied, and whichever topics have the greatest number of votes is what the team discusses.  For each topic, determine if there is an action that needs to be taken.  Celebrating a success usually doesn't have an action item, but refactoring specific code can be assigned to one person.  The action items should usually be completable by one person, but sometimes they are "whole-team" action items such as being mindful of having good commit messages.

Most retros tend to focus on topics in the sad column, and virtually no retros discuss everything that's written on the board.  The meeting tends to finish whenever time is up.  Immediately after the meeting, see that the action items are assigned to specific people; do this in whichever way makes sense for your organization.

I've had great success with retrospectives.  They are a great way to build cohesion in a team, and they're a great way to reflect on the previous week and to refine your process.  I think that if you try these out with your team, they will be much more engaged for your meetings.

Title: Effective team meetings


答:
Don't hold long meetings and leverage project managing software.  If you want to keep people interested, then condense and highlight what matters and save the rest for project logs and reports. Concentrate on milestones, deliveries, highlights and goals, and if only applies to 1/3 of the people, shelf it for a project discussion thread.

Keep your meetings short

Leverage Project Managing Software

Keep it personal, purposeful and connect with emotions and goals

Problem solve in focus groups, not in forums

Get feedback from your peers

Also, don't let others jump into the conversation and go on about their work unless they have set points that they want to address.  If you want feedback, prepare for it, or shelf it for a comment thread somewhere online where people have the time to address it.  This is one of the most annoying issues with meetings; giving time to the floor to peers out of respect.  Keep that stuff at the end after you have addressed everything thing you need to get across.

Take directive on the your project management approach, and encourage good development practices by leading through example.

Title: Effective team meetings


问:
Training old timey fortran programmers to better code design. hints?
I need to quickly train Fortran 90 developers into object oriented design, good coding, and general coding practices to make code maintenance easier and accessible to everybody. Their current style is the usual:

long routines that do too much

modules are aggregated in "family mode" (routines that have something to do with different kind of objects who share a common use are all in one module, instead of having different modules for different type)

huge globals module with hundreds of variables

general un-greppability of identifiers

This is just out of my head. I did a course to one of them explaining OO and modularization in terms of a Pen (with methods such as uncap(), and members like inkLevel) and I was very successful in diverting his point of view. I also gave him the exercise to code in OO style a very simple textual adventure, where the player can move around rooms. I also introduced the concept of patterns and antipatterns.

I would like to know any hints and suggestions on how to perform this task at best.

Thanks

答:
I found it useful to use a framework which used OO. I was forced to think about how to use it and wondered why things were done in certain ways. I know it's not the whole solution but it helped me at the time.

The framework I used was the Open Class library for OS/2. Lots of GUI stuff but also collections, string-handling etc. How about getting your guys to use .Net and Forms. They will deal with objects such as Window and Control, will call methods and perhaps notice the inheritance hierarchy.

Just an idea...

ContentLicense: CC BY-SA 2.5


答:
Try giving the developers more value in your meetings. A few examples might be:

short demos showing new features developed in the recent sprint. (presented by everyone)

a lessons-learned discussion in which they have a chance to change the way the team work and improve (discussion led your right hand in the team, and you are there to justify your management decisions. similar to a 1-on-1 venting session but bigger)

a lecture on a new open-source project that could be relevant or a different coding language such as functional Lang or Golang or green threads in python. (perhaps presented by one of the younger developers, or in the form of an an online video)

a discussion led by a sales engineer describing an awfully difficult engineering problem that his customer is trying to solve. (same deal with the support/services manager trying to reduce support costs by improving product usability)

a manger that reveals the various strategic alternatives the company could have taken and how it would have affected engineering given the competitive landscape.

an external advisor that gives consulting sessions on technologies you already use but not to the max (usually nosql, cep, RDBMS, networking, security, monitoring...)

a code walk through in which everyone could learn new coding or debugging or testing productivity tips ( by that developer that has 10x productivity).

a coding session where no mouse is allowed. Learn the IDE shortcuts thingy.

talk by an accountant on money 101 related issues pension, investments

talk about social programming and career (stack exchange, twitter, github, personal blogs, LinkedIn, meetups in your area)

Title: Effective team meetings


问:
How important is Domain knowledge vs. Technical knowledge?
I am working on a Trading and Risk Management application and although from a C# background, I have been asked to work on SSIS packages. Now I can live with that. The pain point is that there is too much emphasis on business understanding. Trading (Energy Trading to be exact) is a HUGE area and understanding every little bit of it is overwhelming. But for the past two months I have been working on understanding the business terms - Mark To Market, Risk Metrics, Positions, PnL, Greeks, Instruments, Book Structure... every little detail (you get the point). Now IMHO, this is the job of a BA. Sure it is very important for developers to understand the business but where do you draw the line?

When I talked to my manager about this, he almost mocked me by saying that anybody can learn a technology in a week. It's the business that's harder. My long term aspiration is to remain on the technical side, probably become an architect (if possible). If I wanted to focus so much on business I would have pursued an MBA!

I want to know if I am wrong or too naive in understanding the business importance or is my frustration justified?

答:
I've been working in the banking sector for over ten years developing trading applications and agree that it's important for developers to understand the business well. But time and time again, during interview processes, if the person doesn't have good knowledge of the business, they don't get through the door.

This has led to a substantial number of critical applications and systems being developed by these people with strong business knowledge but weak to mid level technical skills. These systems always end up being designed badly which constantly crash, riddled with bugs, don't scale, almost impossible to fix without breaking something, and that's if the project doesn't end up getting cancelled due to insufficient technical skill to actually get it into production.


问:
What is the benefit of the MoSCoW technique?
I do not see how the MoSCoW Method's "Must, Should, Could, Would" prioritisation is better that simply 1,2,3,4? If I receive the requirements from the customer, they already are prioritised, usually using this range.
Also what is so interesting on this MoSCoW thing, why it is so 'famous'?</p>

答:
Acronyms and such like often develop a greater importance than the ideas themselves. They are just hooks for remembering parts of a larger framework like DRY, KISS, SOLID, YAGNI etc.

I do agree however that in this case, it does appear to be rather contrived. Numbered priorities have always served us well in the past although there is disagreement as to how far down you go. For example, in one company I worked at, the priorities went as far as 5:

```<code>1 Critical

2 Required

3 Necessary

4 Nice to have

5 Don't hold your breath
</code>```

People kind of understood the numbers but argued somewhat over the difference between Required and Necessary. In a similar way, Could and Would in MoSCoW aren't particularly clear to me.

Body:
Acronyms and such like often develop a greater importance than the ideas themselves. They are just hooks for remembering parts of a larger framework like DRY, KISS, SOLID, YAGNI etc.

I do agree however that in this case, it does appear to be rather contrived. Numbered priorities have always served us well in the past although there is disagreement as to how far down you go. For example, in one company I worked at, the priorities went as far as 5:

1 Critical

2 Required

3 Necessary

4 Nice to have

5 Don't hold your breath

People kind of understood the numbers but argued somewhat over the difference between Required and Necessary. In a similar way, Could and Would in MoSCoW aren't particularly clear to me.


答:
should our QA people not be logging defects...

The answer to above is solid NO. Testers should log defects as it's their job; they are responsible for quality issues to be adequately reflected in the issue tracker. Telling them not to log defects is equivalent to telling developers not to code or telling managers not to work with people.

More realistic question you should be asking instead would better be, should QA not be opening new defects if it is a known bug?

If you (or testers) open a "generalized" issue like <Third Party System> is freaking unstable, things will get much simpler. Instead of polluting the bug database with multiple hard to aggregate defects, they will be able to update the known "umbrella" defect with the details of various related incidents (and re-prioritize its importance if needed).

If the issues with third party system are as frequent as you describe, such a list of related incidents will eventually form sufficient evidence that some effort is needed to invest in order to address an underlying problem. When developers and QA raise a consolidated concern about reliability of particular system, supported by the evidence of 20... 30... 100 incidents related to it, it is much easier for management to decide that this is worth further investigation and taking care of.


问:
How does MySQL blob actually work?
This is a question driven by curiosity. I am learning Oracle database and Oracle database handles Blob data in a separate tablespace, which I believe reduces overhead while trying to read large Blob data. I am wondering how MySQL handles Blob? I am actually planning to start a project and I wish to give a try on saving images in MySQL databases instead of standard approach of saving files in the file system.

Thank you.

答:
If I interpret the following two links correctly at least when using InnoDB the blobs seems to be stored in the same B+Tree as the other data but depending on the row format the data can be stored in so-called overflow pages. In the (old) COMPACT format InnoDB stores the first 768 bytes of the page on page and the rest off page. The DYNAMIC format seems to store only the full value (if small enough) or a single pointer on the page. So this one seems better.

I personally have customers having roughly 20-30 GB of binary data in a MySQL database. The blobs are stored in a separate table and then just referenced via a key. I actually like this scheme better than filesystem storage since it works well for the small amount of data and if the data grows you can switch out the table to a different mechanism. The filesystem will also make it more difficult to add more nodes to your system since you will have to add a clustered/networked filesystem. In that way, you can use MySQL as a poor mans fileserver. It works quite well for small to medium workloads.

I am no MySQL or Oracle expert but I hope this helps.

Links

blob-storage-in-innodb

innodb-row-format.html

Title: How does MySQL blob actually work?


答:
I'm not sure it is an anti-pattern as such but it would seem to violate the SRP.

But that being said, there were probably perfectly good reasons the developer did what they did at the time.

Despite the great strides made in design patterns and various methodologies, software entropy will continue to be an unfortunate feature of legacy systems.

I'd be more worried about how you'd test such a thing. You want to make a tiny change in such code and you immediately don brown trousers as there are myriad branches of code that it could affect.

Title: Are Compiler Directives an Antipattern?


答:
I'd say that for the given example (if it is indeed a real world example) you should definitely be filing that as a defect in your own tracking software. The way I read that, the issue is that your system does not cope well with a third party failing. Even if it's a simple mechanism to record the event and inform someone then your system should be able to cope with that scenario.

More generally, I still say that yes, it's a defect in your system and should be tracked as such if your application is mishandling an error situation. It needn't be filed as a critical issue if the third party only disappears once in a blue moon, but if it's a regular occurrence then you could/should handle it.


答:
The compatibility of the two licenses means that it is possible to release code under a dual license of both GPLv3 and Apache Licence 2.0.

The thing with the GPL license is that it requires that if a single line of your application is licensed with it, then all of the application must be made available under the GPL license, even if that first line is contained in a library you link into the application.

On the other hand, the license under which a programming language is released should not affect the licenses you can use for programs written in that language, although the license on the language's translator and standard library might be a different matter.
Only those who hold a claim to the copyright of a program have a say in that program's license. Programs you write and compile clearly contain your ideas and parts of it might contain ideas of whoever wrote the translator or library. But the language designer has as much claim to copyright as the British people have to texts written in English (i.e. none).

To be entirely sure, consult a lawyer.

Title: How to use GPL v3 with Apache License 2.0?

Body:
Based on this page, I can see that only Apache License 2.0 is compatible with GPL v3.

Now my question is, in layman's term, how do I make those two work together?

My current situation is that I am developing an application that is made from a GPL v3 licensed programming language. I want to put some form of security on the application and figured I can achieve that via a web service. However, I don't want to expose my web service's code as GPL v3 since it is part of a larger system that I am working on which will be closed source. Is there any way to use the Apache License 2.0 in this scenario?

EDIT: For clarity's sake, the programming language I am going to use is LiveCode.


问:
Should a web developer know how to do slicing?
I am a web developer. I'm doing all kinds of web-sites and web applications.

It's very strange for me that a lot of customers do not know the difference between a web developer and a slicer. They just want to "give you the PSD" and expect you to give them a web site with a DB back-end and so on...

I'm just asking here: am I wrong in my thinking?

Of course, a web developer MUST know html and css but I don't think that he should slice the PSD and do all the work a css guru can do...

I would like to hear your opinions on this.

答:
if you're a web developer (mostly coding and little css and no photoshop), you would do just as well to stop all coding learning and concentrate on CSS until you are equal at both.  If you are strong at backend and don't know css well, you are ineffective at meeting deadlines in creating a website.   If you know both well, you will be more respected.

Best advice :dont worry about photoshop, that for a designer,  concentrate on CSS, cross browser, and different versions of browsers.   And DON'T go for the css version fixes'  so far, and I was lucky to learn from a very good one, there is always a way to do it right with no css hacks.  so far in all my work have not needed a css hack.  I don't think there will be a good 'slicer' program for a couple more years.  You will have to slice it up and use the appropriate css.  Css is a lot easier than learning C# or something .  enjoy and ALWAYS VALIDATE CSS and HTML!   When I come across a page with like 45 css errors or something like that it makes me want to hurl!


答:
It is an easy to remember method for prioritizing 'Critical Success Factors'.
For projects with a strict deadline or budget, this could be used for each iteration for example of a SCRUM-sprint.

This list can then be transformed into a roadmap in Mantis or Trac-Server or whatever suits your needs, or even a SCRUM board.

Short abstract explenation for MoSCoW:

Must have   : without it the product delivery fails

Should have : without it users are going to drop off from using the product

Could have  : if we have time left, we implement this for customer satisfaction

Would have  : this might be implemented in a next release, because we dont have time/budget right now

Title: What is the benefit of the MoSCoW technique?

Body:
I do not see how the MoSCoW Method's "Must, Should, Could, Would" prioritisation is better that simply 1,2,3,4? If I receive the requirements from the customer, they already are prioritised, usually using this range.
Also what is so interesting on this MoSCoW thing, why it is so 'famous'?</p>


答:
I think the main difference bw 1,2,3,4 and MoSCoW is that you are using words, instead of numbers. Of course they can mean the same, but if you use numbers you have to clarify what does they mean. Using words are much much better, because we are people and they (should) mean something for us. Just think about: does people want a smartphone or a ph_v10.54.32 ?

And why it is so famous? Because all about is the customer. The customer tries to find out what he needs - ofc many times he can't, but it makes easier for him, then easier for the dev team.


答:
It's not about using acronyms at all. It's about perception.

If you ask a business to rank everything 1, 2, 3, 4 or High, Medium, Low then everything becomes a high priority. You're not really explaining, in those systems, why you're asking.

If you ask businesses to rank things as must have, should have, could have, would have, then you are simultaneously selling the point that, in all likelihood, they're not getting everything by the set release time. So, what MUST they have, for the product to even be viable? What SHOULD they have for it to be truly useful? What COULD they have, if there's time to do it? And what WOULD just be nice to have? (ie. what seems like a good idea, but they'll probably never use it.)

And, if the business do this right, and give a balanced rating, it also manages the expectations of the developers.

Rather than "Ok, let's work through the 1s and see what time we have left," it becomes very real, it becomes "the business literally cannot use this product without this pile and it's not going to benefit them much unless we can do this pile here." A useful product is a strong driving force for many developers.


问:
Pros and cons of the following Parsing methods?
I'm thinking of making a Python-JavaScript converter/compile. I've been wondering about the pros and cons of the following methods to parse the Pythonic code, into JavaScript equivalent.

Working with the output of ast.dump(ast.parse(code))

Working with tokens.

I've been trying weigh the pros and cons of these methods, but well I'm unable to think of any major one, as I've never used them..

So, Basically could someone help me by telling me what the pros and cons of the two methods I've mentioned above are?

Also, if there is something better that I can use for this purpose, notify me about it..

PS: I'll be using Python to write the converter..

答:
Big con of tokens: You'll have to parse, and this is both unnecessary and nontrivial.

Big con of ast.dump(ast.parse(code)): It's pointlessly stupid. ast.parse gives you a perfectly good AST, structured in an appropriate data structure. ast.dump gives you a string representation of that data structure, so you'd have to parse that to get back what ast.parse already gave you!

Leaving out ast.dump and using the AST from ast.parse, there are two big pros:

You don't have to worry about parsing Python code at all (and doing so is moderately complex).

ASTs are really the minimum you need to look at for any compiler-ish project at this scale. While the ast AST may have some complexity you don't need (e.g. line information, or Python features you don't support), I assume that simplifying a Python AST to your custom AST is simpler than generating your custom AST from tokens.

A minor benefit: There's already a visitor class built into ast, so you don't have to create one (a simple but somewhat boring task) for easy AST traversal.

Cons? Not so much. Go for ast, but don't be afraid to use additional data structures beyond that.


问:
Notation for the average time complexity of an algorithm
What notation do you use for the average time complexity of an algorithm? It occurs to me that the proper way would be to use big-theta to refer to a set of results (even when a specific try may differ). For example, average array search would be Θ(n+1)/2.

Is this right?

Explanation of average search time being Θ(n+1)/2: Given that the access time sum for the n first integers is n(n+1)/2, the average time for a large number of random access to the array will be (n(n+1)/2)/n = (n+1)/2. In this case I would say that Θ(n+1)/2 will be the average access time. It makes sense (to me) but since I'm new to asymptotic notation (and programming in general), I'd like to know if this is common practice.

I'm asking because I'm confused to see big-O being used for everywhere in pages like http://bigocheatsheet.com. eg: average case of array search O(n).

答:
```<code>f ∈ Θ(g)
</code>```

is the same as

```<code>f ∈ Ο(g) ∧ f ∈ Ω(g)
</code>```

So, if you can prove that f ∈ Ο(g) ∧ f ∈ Ω(g), then by all means use Θ.

Note that this has absolutely nothing whatsoever to do with time complexity of algorithms, average or otherwise. Θ, Ο, ο, Ω and ω are about the growth rate of functions; whether those functions describe average time/step/space complexity of an algorithm, worst-case time/step/space complexity of an algorithm, best-case time/step/space complexity of an algorithm, expected case time/step/space complexity of an algorithm, the population of China, the number of users on StackOverflow, or the size of Lara Croft's bra is completely irrelevant.

Body:
f ∈ Θ(g)

is the same as

f ∈ Ο(g) ∧ f ∈ Ω(g)

So, if you can prove that f ∈ Ο(g) ∧ f ∈ Ω(g), then by all means use Θ.

Note that this has absolutely nothing whatsoever to do with time complexity of algorithms, average or otherwise. Θ, Ο, ο, Ω and ω are about the growth rate of functions; whether those functions describe average time/step/space complexity of an algorithm, worst-case time/step/space complexity of an algorithm, best-case time/step/space complexity of an algorithm, expected case time/step/space complexity of an algorithm, the population of China, the number of users on StackOverflow, or the size of Lara Croft's bra is completely irrelevant.


答:
I certainly would go with Intel over IDQ.

Intel offers two different instructions:

RdSeed - Each output contains new hardware entropy of the requested size. Uses AES based post-processing. Similar to /dev/random

RdRand - Reuses exiting hardware entropy occasionally mixing in new one. Uses an AES based process to produce arbitrarily large outputs from the current pool. Similar to /dev/urandom except that /dev/urandom can sometimes be accessed before it has been properly seeded. That can't happen with RdRand.

Personally I'd seed a software PRNG with entropy obtained from RdSeed. But if you trust Intel you can use RdRand directly.

Obtaining randomness securely over a network is complex and it might go wrong in subtle ways. If you use IDQ use a separate device for each server.

There are also many myth surrounding random numbers, such as "exhausting entropy". In practice seeding a crypto PRNG once is enough. Once you seed them with sufficient entropy (at least 128 bits at the same time) they will produce practically unlimited amounts of pseudo random data. As long as the cryptographic primitive behind them remains unbroken, that pseudo random data is indistinguishable from real random data by an attacker with reasonable computational bounds.

There have been stories about /dev/urandom producing bad numbers, but all of them were related to outputting data before the PRNG was seeded with sufficient entropy.

Title: idquantique .vs. rdrand

Body:
We are currently looking at using the idquantique random number generator device to provide random numbers.  There are some issues though.  We would only be using one device and we have at least 5 servers that would need to use it and this number will probably increase in the future.  This implies that blocks of random numbers would have to be sent to the servers in some way.  All the servers are running Linux.

All of our servers are Intel based and have the RDRand random number instruction available.  It would be easier to use RDRand since no networking calls would need to be made and RDRand also appears to be significantly faster.

But, the question I would like answered is - is there a difference between the quality of the random numbers generated by RDRand and those generated by idquantique?  Has anyone ever measured or tried to measure how well these two random number devices perform against each other?


问:
Interaction between programs
I am writing an interactive program in which it takes speech input from the user for a specific list of commands.

The list of commands will be stored locally in a graph and based on the usage their weight will be modified.

The speech input is taken and processed into text and then it's executed by bash scripts.

I am thinking what I should use to interact (synchronize) between the speech recognition engine and then the list and the bash program.

I am using C++ and Bash on a Unix system.

I thought of mutex but the problem is what if the user gives multiple inputs then I'll have to buffer it and then process it sequentially and that will make the system slower.

The bash script is used to call the system utility commands as requested by the user.
Should I only use C++ or Bash too?

I am thinking of storing the graph in a binary format. Is this the best way to store the graph?

Please suggest alternatives.

答:
You don't seem to picture the design of your system very clearly yet. So a bit of advice:

Make it as simple as possible.

Write down several scenarios of interaction between the user and your program. Be careful to include cases when the user changes his mind in the middle of saying a command, and other scenarios when things go wrong.

Don't proceed until you have a clear picture of interactions with the user, common special cases like the 'cancel word', etc.

Stay away from mutexes and other hairy stuff. (I'd advise to stay away from C++ too, but probably your speech engine has a C++ interface.)

If in doubt about concurrent access, use a database. It does all the locking for you, and is a well-tested piece of software. See SQLite for the simplest solution.

Title: Interaction between programs