问:
Sharing a database while we work on local copies?
A friend and me are working on a webapp. We're using git so each of us has a local copy of the app. But the problem is the database. We want to be able to see the latest changes the other person made. From what I understand, we have two options:

Host the database on a server

Add the .sql file to every commit we make.

For the first option, we might expose our system to some risks (which I'm scared of).
For the second option, we're adding unnecessary work to our daily tasks (importing the .sql file and then creating the .sql file).

I'm new to this stuff - so any suggestions are welcome!

答:
There are two distinct issues here:

Schema management

Test data

By far the bigger and more challenging problem is schema management - you need to have confidence that every instance of the database (that is notionally the same "version") has the same schema.

There are many and various approaches to this (migrations are built in to Ruby on Rails for example) but fundamentally it comes down to two things:

Having a mechanism to identify the schema version in the database

Organising your schema changes so that they can be applied sequentially (and consistently)

The simplest mechanism (and one that works well for me) is to have a schema version number table (e.g. id, date applied, summary of changes, author).

In terms of organising schema changes, I use code - one method per version of the schema - that makes DDL calls to change the schema. Its relatively simple, its effective and it works for me. The advantage is that its repeatable (and can be included in automation), the downside is that its a bit more work to pull create the change scripts. I can then also define acceptable schema version ranges for a revision of the application and refuse to run (or perform schema updates or otherwise take appropriate steps) if they don't match.

In terms of test data... I don't have good answers, you may want a script to populate the database with suitable sample data, said script will have to evolve and grow. Alternatively you can version control a reference copy that you update from time to time.

Fundamentally though, you shouldn't be depending on arbitrary data changes made in another instance to be able to develop your application (I'm not assuming that you are, just making the observation!). If the data changes are required then they probably need to be part of a schema version update.


问:
Syntactic sugar in PHP with static functions
The dilemma I'm facing is: should I use static classes for the components of an application just to get nicer looking API?

Example - the "normal" way:

```<code>// example component
class Cache{
  abstract function get($k);
  abstract function set($k, $v);
}

class APCCache extends Cache{
  ...
}

class application{

  function __construct()
    $this->cache = new APCCache();
  }

  function whatever(){
    $this->cache->add('blabla');
    print $this->cache->get('blablabla');
  }

}
</code>```

Notice how ugly is this->cache->.... But it gets waay uglier when you try to make the application extensible trough plugins, because then you have to pass the application instance to its plugins, and you get $this->application->cache->...

With static functions:

```<code>interface CacheAdapter{
  abstract function get($k);
  abstract function set($k, $v);
}

class Cache{

  public static
    $ad;

  public function setAdapter(CacheAdapter $a){
    static::$ad = $ad;
  }

  public static function get($k){
    return static::$ad->get($k);
  }

  ...

}

class APCCache implements CacheAdapter{
  ...
}

class application{

  function __construct(){
    cache::setAdapter(new APCCache);
  }

  function whatever()
    cache::add('blabla', 5);
    print cache::get('blabla');
  }

}
</code>```

Here it looks nicer because you just call cache::get() everywhere. The disadvantage is that I loose the possibility to extend this class easily. But I've added a setAdapter method to make the class extensible to some point. I'm relying on the fact that I won't need to rewrite to replace the cache wrapper, ever, and that I won't need to run multiple application instances simultaneously (it's basically a site - and nobody works with two sites at the same time)

So, am doing it wrong?

答:
Well it depends on how your class will be used and in what context.

With the risk of being downvoted by some, I recommend you take a look at 2 design patterns that may help you:

Singleton - http://en.wikipedia.org/wiki/Singleton_pattern

Monostate - http://c2.com/cgi/wiki?MonostatePattern

ContentLicense: CC BY-SA 3.0


问:
How to learn Cloud Computing and Big Data at home?
I want to learn Cloud Computing and Big Data at home.

Is it possible to learn these technologies on home PC?

Which technologies to learn in Cloud Computing?

Which technologies to learn Big Data (Hadoop)?

答:
Www.coursera.org offers free online courses. There are courses for Big Data and Cloud for health Servies available.

To answer the Op questions:

Yes you can learn it from your home PC. You simply need a PC with a web browser for consuming the learning materials. Depending on the course itself other software for installation may e required.

As for 2 and 3 I think to get started with the technologies like Cloud or "Big Data" it's good to have a nice example domain where you can alloy those. And I think medical and healthcare are a very rapidly growing branch in need of those.


问:
Native mobile app development - how do I structure my user stories?
I'm about to start on a project which will involve developing prototype native mobile apps (iOS and Android initially) as well as a web-based admin interface and an API for these apps to communicate with.  We've got a list of stories already drafted up, however a lot of them are in the format:

```<code>As a mobile user I want to be able to view a login screen so that I can sign into the app
</code>```

If this were targeted for a single platform, I wouldn't see a problem.  However, since we're targeting multiple platforms, I'm not sure whether these should now be duplicated eg "As an Android user" or similar.  This seems like duplication, but it's work that will need to be completed separately for each platform.

This is the first mobile project we've gone native on - previously it was Phonegap and we lumped all stories in under "As a mobile user".  Since essentially this was a web-based app wrapped in native code, this didn't present too much of an issue, but I'm conscious that wholly-native apps are a different ballgame!

答:
I don't see why you don't want to make separate user stories for each mobile application. Even though the stories sound similar, they have huge differences both from developers' and users' point of view.

If you're using a system like Jira, you could even create a separate project for each application. This approach is better especially if all applications are completely independent in terms of resources _ different developer(s), different computer resources, etc. It would be easier to make estimations for each of the tasks.

If you still don't want to make separate user stories, you could create tasks for each application under the same story. But this would be convenient if you develop all the applications simultaneously, so that every story would be completed almost at the same time.


问:
Which order to define getters and setters in?
Is there a best practice for the order to define getters and setters in? There seems to be two practices:

getter/setter pairs

first getters, then setters (or the other way around)

To illuminate the difference here is a Java example of getter/setter pairs:

public class Foo {
    private int var1,
    var2,
    var3;

    public int getVar1() {
    return var1;
    }

    public void setVar1(int var1) {
    this.var1 = var1;
    }

    public int getVar2() {
    return var2;
    }

    public void setVar2(int var2) {
    this.var2 = var2;
    }

    public int getVar3() {
    return var3;
    }

    public void setVar3(int var3) {
    this.var3 = var3;
    }
}
```

<p>And here is a Java example of first getters, then setters:</p>

<pre class="lang-java prettyprint-override"><code>public class Foo {
    private int var1,
    var2,
    var3;

    public int getVar1() {
    return var1;
    }

    public int getVar2() {
    return var2;
    }

    public int getVar3() {
    return var3;
    }

    public void setVar1(int var1) {
    this.var1 = var1;
    }

    public void setVar2(int var2) {
    this.var2 = var2;
    }

    public void setVar3(int var3) {
    this.var3 = var3;
    }
}
</code>```

I think the latter type of ordering is clearer both in code and in class diagrams but I do not know if that is enough to rule out the other type of ordering.

答: If you are on a team, do what they usually do. Otherwise just pick the one you like more. On the scale of important design choices this is probably somewhere near "which thumb should I use to hit the space bar?"</p>


答:
As far as I know, there's no single convention. The Oracle Java Code Conventions section on file organization doesn't explicitly mention the placement of getters and setters, but it does say:

These methods should be grouped by functionality rather than by scope or accessibility.

This doesn't provide any guidance - I could argue that either placement meets this criteria.

Something to consider is that modern IDEs allow you to have more abstract views of the structure of your files than as the textual code component. This, coupled with powerful searching tools, should make it easy to navigate files and find the appropriate methods within even large files.

As an example, Eclipse provides an Outline view that let's you sort and filter methods and fields in different ways, and navigate right to where they are in files. NetBeans had similar functionality, and I'd suspect that most other IDEs do as well.

The only time this might matter is if you are reading the code outside of your IDE. An example might be using an external code review tool or viewing deltas from your version control system.

The best solution would be to simply be consistent across files in a project. Find a standard, document it, and stick to it.

Title: Which order to define getters and setters in?

Body:
Is there a best practice for the order to define getters and setters in? There seems to be two practices:

getter/setter pairs

first getters, then setters (or the other way around)

To illuminate the difference here is a Java example of getter/setter pairs:

public class Foo {
    private int var1,
    var2,
    var3;

    public int getVar1() {
    return var1;
    }

    public void setVar1(int var1) {
    this.var1 = var1;
    }

    public int getVar2() {
    return var2;
    }

    public void setVar2(int var2) {
    this.var2 = var2;
    }

    public int getVar3() {
    return var3;
    }

    public void setVar3(int var3) {
    this.var3 = var3;
    }
}
```

<p>And here is a Java example of first getters, then setters:</p>

<pre class="lang-java prettyprint-override"><code>public class Foo {
    private int var1,
    var2,
    var3;

    public int getVar1() {
    return var1;
    }

    public int getVar2() {
    return var2;
    }

    public int getVar3() {
    return var3;
    }

    public void setVar1(int var1) {
    this.var1 = var1;
    }

    public void setVar2(int var2) {
    this.var2 = var2;
    }

    public void setVar3(int var3) {
    this.var3 = var3;
    }
}
</code>```

I think the latter type of ordering is clearer both in code and in class diagrams but I do not know if that is enough to rule out the other type of ordering.


问:
Why SQL is not so widespread in large desktop applications?
As a software developer, I've worked on projects ranging from tiny home-made apps to medium-size enterprise applications. In nearly every project I used a database or regretted choosing not to use it from the beginning.

Now, I am wondering a few things about the databases and their usage in general applications:

Why Windows itself doesn't use any "central" SQL database? For example:

Errors Reporting data is stored in a bunch of files,

Windows Update stores everything in flat files,

Icons cache is stored in a very strange single file which doesn't seem to be accessed through SQL, etc.

Why so many large applications avoid using databases? For example, wouldn't Microsoft Outlook gain by using a real database instead of reinventing the wheel by having its own format for .pst files and storing some data in registry?

If database adds an additional layer of an overall complexity and a tiny performance loss, it is a price of a huge advantage of making the code simpler in most circumstances, especially when it comes to the storage of small organized chunks of data instead of large binary streams. So why so few products are actually using databases? Probably the only application I know which actually uses Sqlite database is Firefox, and maybe Microsoft Exchange (but the last one is not a desktop application)?

Also, wouldn't a set of applications, like Microsoft Office or Microsoft Expression, benefit from having an unified SQL database, making it easier to deploy the applications, to update/upgrade the data, to share data between those applications, to make backups, etc.?

答:
Why Windows itself doesn't use any "central" SQL database?

Actually, this idea has been in development at Microsoft for some time. It is called WinFS. It is an intriguing technology, and it is available to MSDN subscribers. Some days soon, I'm going to install it on a VM and play around with it.

ContentLicense: CC BY-SA 2.5


问:
How can I implement an EPUB reader in JavaScript?
I'm wondering if I can create an EPUB (free and open e-book standard) reader in JavaScript. The basic requirements would be:

Server parts of the EPUB reader from a server API.

Read the EPUB data in JavaScript.

Render it on page.

Provide some extra functionality, like text highlights or page notes.

I have no information about how I could do this. I'm willing to try a prototype project. What are the steps that I could take towards implementing such a thing?

答:
From your comments, it seems like you are at a very early conceptual stage, and want general guidance... well, that's going to be very difficult to give, since the entire topic is quite large.  But in general, what you want to do is:

Read in and parse an epub file using javascript.

Generate HTML which represents the contents (and inline images / SVG / etc).

Well, that's at a very high level, and doesn't help us much.  You can break down step 1 by reading up on the epub format itself (e.g.: wikipedia article and  general info).  Pretty quickly, you should notice that the format uses OCF to package together multiple files, so your first problem will be to create an OCF reader, which also means that you will need to be able to unzip the data in javascript (Florian Margaine's links should give you an idea of how others have solved this problem).  At this point, I'd start looking for existing implementations in javascript, because you probably don't want to be implementing all of this from the ground up.  This is all before we're even touching the actual contents of the epub file.  Once you are past this point, you should be able to read in the actual contents, and attempt to translate them into HTML.

Regarding step 2, I'd start by looking at the various features provided by epub - text, CSS styling, embedded images, etc - and start attacking those one at a time, starting with whatever gives the most return for my time (probably text...).


答: Ever Java IDE can generate getters and setters for you. Just use that functionality and leave the order of those methods like the IDE created it. This is generated code, don't touch it unnecessarily.</p>


答:
I think your intentions are good, but perhaps not the method.  First, let's consider the obvious:

I'm relying on the fact that I won't need to rewrite to replace the cache wrapper, ever, and that I won't need to run multiple application instances simultaneously (it's basically a site - and nobody works with two sites at the same time)

These are assumptions.  Sometimes assumptions are valid, sometimes they're not, and when they're not, they hurt.  In general, removing flexibility is not a particularly great idea.  Many large projects start out as "just give me a page where I can capture X", so don't be so hasty to predict the future.

More importantly, you may be going against standard practices.  There's a lot to be said for conventions and standards.  I'm far from a PHP expert, but from what I've seen, "$this->" is the kind of boilerplate that developers learn to ignore after a bit of practice.  Is it really worthwhile going out of your way to shorten it by a little bit?  If we take that bit for granted, only the plugin comment remains with "$this->application->cache".  Is there any reason why a cache variable cannot be set up in this case to shorten it to "$this->cache"?

The above is just some general guidance, but actually what we should really be talking about here is dependency injection.  Your various classes shouldn't be aware of what cache they are using, only that they have a cache and it can be accessed via $this->cache.  By referring to a static implementation, you are breaking this rule, and just on that, it's a bad thing.

To summarise, I would say - try to shorten the code to $this->cache whereever you can, but no more.  I believe that syntax is fairly idiomatic in PHP, and going beyond it is unnecessary.

Edit:  I should add "don't sweat the small stuff" - I really think that you're over-thinking this problem (even if I've indulged you and added my rationale).  This is a relatively trivial problem to be worrying about, and I'm sure there's better ways for you to spend your energy :)

Title: Syntactic sugar in PHP with static functions

Body:
The dilemma I'm facing is: should I use static classes for the components of an application just to get nicer looking API?

Example - the "normal" way:

```<code>// example component
class Cache{
  abstract function get($k);
  abstract function set($k, $v);
}

class APCCache extends Cache{
  ...
}

class application{

  function __construct()
    $this->cache = new APCCache();
  }

  function whatever(){
    $this->cache->add('blabla');
    print $this->cache->get('blablabla');
  }

}
</code>```

Notice how ugly is this->cache->.... But it gets waay uglier when you try to make the application extensible trough plugins, because then you have to pass the application instance to its plugins, and you get $this->application->cache->...

With static functions:

```<code>interface CacheAdapter{
  abstract function get($k);
  abstract function set($k, $v);
}

class Cache{

  public static
    $ad;

  public function setAdapter(CacheAdapter $a){
    static::$ad = $ad;
  }

  public static function get($k){
    return static::$ad->get($k);
  }

  ...

}

class APCCache implements CacheAdapter{
  ...
}

class application{

  function __construct(){
    cache::setAdapter(new APCCache);
  }

  function whatever()
    cache::add('blabla', 5);
    print cache::get('blabla');
  }

}
</code>```

Here it looks nicer because you just call cache::get() everywhere. The disadvantage is that I loose the possibility to extend this class easily. But I've added a setAdapter method to make the class extensible to some point. I'm relying on the fact that I won't need to rewrite to replace the cache wrapper, ever, and that I won't need to run multiple application instances simultaneously (it's basically a site - and nobody works with two sites at the same time)

So, am doing it wrong?


问:
What is the term for a 'decoy' feature or intentional bug?
I have forgotten a slang programming term. This thing is an intentional bug or a decoy feature used as a distraction. An example usage, "Hey Bob, QA is doing a review today. Put a $THING into the module so they actually have a problem to find".

This can be used negatively, to have a very obvious intentional flaw to discover as a distraction from a real problem.

This can also be used positively. Its like how you always let rescue dogs 'find' a victim when searching a disaster area. It can also be used to verify that a QA process is actually catching flaws.

What is the term I am looking for?

答:
A Duck

From http://www.codinghorror.com/blog/2012/07/new-programming-jargon.html:

A feature added for no other reason than to draw management attention and be removed, thus avoiding unnecessary changes in other aspects of the product.


答: It can also depend on the language.  In Java there's no real advantage to either order, but in C#, for example, you have the concept of "properties", which group the getter and setter together, so it kind of enforces that ordering.  In a language like C++, where you might want different visibility on getters vs. setters (e.g. private setter, public getter), you'd probably do the opposite, since the visibility modifier is given once for multiple methods, rather than individually for each.</p>


问:
Should I be looking for developers with specific skill sets or generalists that need to learn?
Thanks to the great help of this site and SO, I've been able to make a prototype of a software I want to sell but unfortunately although the prototype works I think my code quality is very low. I didn't use much OOP or design patterns so although my code is understandable to me, I think a normal developer would faint if they had to read it.

So I wanted to hire a developer to make it a bit more better quality and improve some of my implementations of API's that I may have not done correctly.   I'm having problems hiring a developer though.

I have met 2 developers and had them read my software specs.The problem is, they lacked my business's domain knowledge(which is completely understandable and no biggie) but they also lacked knowledge of the underlying tech systems I used such as Hadoop, Hbase, Cuda, etc..I spent alot of time explaining map/reduce, bigtables and other technologies I used. I thought it was common knowledge because of my interactions with people on this site but the people I met with mentioned they never had to deal with these things so they didn't know it.

My question is, for software projects that are hiring contractor developers is it a danger if the developer does not have experience with the underlying technologies? or can a general developer who is accomplished in another area realistically pick up new technologies?  I did a very very quick back of envelope calculation and I think the upfront costs would be similar if I hire a student or developer with no experience in my technologies who will work many hours versus hiring a highly experienced developer who charges double but finishes in half the time but what other risks should I be considering or worried about?  Also, should if I do hire a generalist, should I be paying for the time it takes them to learn hadoop or cuda if they are contractors(seems to make business sense but not sure how fair it is to them if they do not use the skill again).

I'm a bit confused so any suggestions would be great.

答:
I guess if a novice can do the exact same things for half the price in twice the time, it all works out. Realistically, there are going to be problems your novice won't solve and pitfalls they can't avoid. I don't think you'll get similar code. You're going to end up lowering your expectations. </p>

<p>This is more likely to be the case when it comes to design. Pay the extra fee for the experienced developer to work on the design. You can use the novice to help with the coding volume if you think that's cost effective. </p>

Body:
I guess if a novice can do the exact same things for half the price in twice the time, it all works out. Realistically, there are going to be problems your novice won't solve and pitfalls they can't avoid. I don't think you'll get similar code. You're going to end up lowering your expectations.

This is more likely to be the case when it comes to design. Pay the extra fee for the experienced developer to work on the design. You can use the novice to help with the coding volume if you think that's cost effective.


问:
Is it ever ok to have an empty catch statement?
I thought about it and could not come up with an example. Why would somebody want to catch an exception and do nothing about it? Can you give an example? Maybe it is just something that should never be done.</p>

答:
I do it all the time with things like conversion errors in D:

```<code>import std.conv, std.stdio, std.exception;

void main(string[] args) {
    enforce(args.length > 1, "Usage:  foo.exe filename");

    double[] nums;

    // Process a text file with one number per line into an array of doubles,
    // ignoring any malformed lines.
    foreach(line; File(args[1]).byLine()) {
        try {
            nums ~= to!double(line);
        } catch(ConvError) {
            // Ignore malformed lines.
        }
    }

    // Do stuff with nums.
}
</code>```

That said, I think that all catch blocks should have something in them, even if that something is just a comment explaining why you are ignoring the exception.

Edit:  I also want to emphasize that, if you're going to do something like this, you should be careful to only catch the specific exception you want to ignore.  Doing a plain old catch {} is almost always a bad thing.

Body:
I do it all the time with things like conversion errors in D:

import std.conv, std.stdio, std.exception;

void main(string[] args) {
    enforce(args.length > 1, "Usage:  foo.exe filename");

    double[] nums;

    // Process a text file with one number per line into an array of doubles,
    // ignoring any malformed lines.
    foreach(line; File(args[1]).byLine()) {
        try {
            nums ~= to!double(line);
        } catch(ConvError) {
            // Ignore malformed lines.
        }
    }

    // Do stuff with nums.
}

That said, I think that all catch blocks should have something in them, even if that something is just a comment explaining why you are ignoring the exception.

Edit:  I also want to emphasize that, if you're going to do something like this, you should be careful to only catch the specific exception you want to ignore.  Doing a plain old catch {} is almost always a bad thing.


答:
The first way. If it's possible always group together or keep close by related functions that operate on the same members.

If you arrange your code in this way it makes it clearer and easier to refactor, since if one class can be factored out of another that is doing too much, the factorisable piece usually revolves around a specific member variable.

In general it is easier to debug, understand and manipulate code when you can see all on the same page the entire lifecycle of an object/variable. I'd go so far as to say that Code layout based primarily on superficialities like scope and alphabetical order will actually mean you miss opportunities to refactor because you cannot see them.


答:
Group the getter and setter for a single field together, in pairs.

Grouping all the getters together and all the setters together makes it hard to tell which fields have just getters or just setters.

When I am reading code or looking for specific functionality I envision a class as having fields, with each field having a getter and a setter. It doesn't make sense to me for a class to have a getters group and a setters group, each having fields.


问:
I seem to be missing a few important concepts with PhoneGap
I'm planning on developing an app on multiple platforms and I'm thinking that PhoneGap might be perfect for me. I had been reading that it's one codebase for all platforms but looking at the PhoneGap guide it seems there are separate instructions for each platform. So if i want to develop for iOS, Android, BB and WP7 I need to write 4 different sets of code? I'm sure i'm missing something fundamental here.

Aside from that, how do people usually approach a PhoneGap build? You obviously / probably want the finished app to look like a native app - is it more common than not to use jQuery Mobile together with PhoneGap?

Is there a preferred IDE? I see, in the guide, for iOS they seem to suggest Xcode. I'm fine using Xcode but it seems a bit overkill for HTML & CSS. Do I need to develop in Xcode and if not how do i approach it? Use a different IDE / Text Editor and then copy paste into Xcode for building and testing?

I know this question is long-winded and fundamental but it something which i don't think is properly addressed in the guides.

Thanks.

答:
Phonegap only provides the framework for shared code on different platforms. In order to build the app for each platform you have to use the native toolsets so; Visual Studio for WinPhone, XCode for iOS, Eclipse w/ Android SDK for Android, etc.

You can reuse all your PhoneGap code but you need to create projects on each platform to build and submit the apps to the appropriate mobile stores.


答:
Actually in manufacturing (and quality assurance) there is something called a Red Rabbit Test (aka Red Herring) that refers to putting a known bad part into the machine or process and making sure it's detected.

Red Rabbit Test

used to check how long it takes to identify a defect. In this test, a red part is added to the mix and the time until it is discovered is identified.

Some automated machines have automatic cycles (typically once per shift) where it prompts the operator to load the "red rabbit" part and then it runs the cycle checking that the error detection and rejection logic work correctly.

Title: What is the term for a 'decoy' feature or intentional bug?

Body:
I have forgotten a slang programming term. This thing is an intentional bug or a decoy feature used as a distraction. An example usage, "Hey Bob, QA is doing a review today. Put a $THING into the module so they actually have a problem to find".

This can be used negatively, to have a very obvious intentional flaw to discover as a distraction from a real problem.

This can also be used positively. Its like how you always let rescue dogs 'find' a victim when searching a disaster area. It can also be used to verify that a QA process is actually catching flaws.

What is the term I am looking for?


问:
How/where to run the algorithm on large dataset?
I would like to run the PageRank algorithm on graph with 4 000 000 nodes and around 45 000 000 edges.

Currently I use neo4j graph databse and classic relational database (postgres) and for software projects I mostly use C# and Java.

Does anyone know what would be the best way to perform a PageRank computation on such graph? Is there any way to modify the PageRank algorithm in order to run it at home computer or server (48GB RAM) or is there any useful cloud service to push the data along the algorithm and retrieve the results?

At this stage the project is at the research stage so in case of using cloud service if possible, would like to use such provider that doesn't require much administration and service setup, but instead focus just on running the algorith once and get the results without much overhead administration work.

答: For such a big project, it will be very costly to utilize cloud based service. As you are using Java, I would recommend that you have a look at Hadoop Using more then home computer/server you will be able to get the results. </p>


答: It will depend on how much data you are actually working with (how big is a node?), but typically code like this really benefits from running as close to the data as possible.  It should certainly be possible to run this on a high-end home computer (something with lots of RAM and some SSDs), or you could potentially set up a small cluster (say 3-4 machines) with a gigabit switch.  Sorry, I don't know enough about the actual PageRank algorithm to give any specifics, but I have run Hadoop jobs on my home machine with a quad-core CPU and 8G of RAM (not an uncommon class of machines these days).</p>

Title: How/where to run the algorithm on large dataset?

Body:
I would like to run the PageRank algorithm on graph with 4 000 000 nodes and around 45 000 000 edges.

Currently I use neo4j graph databse and classic relational database (postgres) and for software projects I mostly use C# and Java.

Does anyone know what would be the best way to perform a PageRank computation on such graph? Is there any way to modify the PageRank algorithm in order to run it at home computer or server (48GB RAM) or is there any useful cloud service to push the data along the algorithm and retrieve the results?

At this stage the project is at the research stage so in case of using cloud service if possible, would like to use such provider that doesn't require much administration and service setup, but instead focus just on running the algorith once and get the results without much overhead administration work.


问:
Lua & Javascript documentation generation
I am in the beginning phase of create a mobile MMO with my team. The server software will be written in JavaScript using NodeJS, and the client software in Lua using Corona. We need a tool to auto-generate documentation for both the server-side and client-side code.

Are there any tools which can generate documentation for both Lua and Javascript? And as a bonus: we are hosting our project on Bitbucket and the Bitbucket Wiki uses the Creole markup language. So if it's possible I want the tool to export to Creole.

Edit: I know about tools for generating documentation for one of both languages. However, I don't want 2 different styles for documentation in one project. Therefore one tool which can generate documentation for both languages would be great.

答:
Sphinx currently only does Javascript but it includes a modular system to add new languages. Maybe not the simpler solution but with some work it would be usable with the two languages.

As a reference, Erlang extension file is written in ~400 LOC.

python-creole allow conversion between Creole and reStructuredText (via HTML).


问:
What can be done to decrease the number of live issues with applications?
First off I have seen this post which is slightly similar to my question. :

What can you do to decrease the number of deployment bugs of a live website?

Let me layout the situation for you.  The team of programmers that I belong to have metrics associated with our code.  Over the last several months our errors in our live system have increased by a large amount.  We require that our updates to applications be tested by at least one other programmer prior to going live.  I personally am completely against this as I think that applications should be tested by end users as end users are much better testers than programmers, I am not against programmers testing, obviously programmers need to test code, but they are most of the times too close to the code.  The reason I specify that I think end users should test in our scenario is due to the fact that we don't have business analysts, we just have programmers.  I come from a background where BAs took care of all the testing once programmers checked off it was ready to go live.

We do have a staging environment in place that is a clone of the live environment that we use to ensure that we don't have issues between development and live environments this does catch some bugs.

We don't do end user testing really at all, I should say we don't really have anyone testing our code except programmers, which I think gets us into this mess (Ideally, we would have BAs or QA or professional testers test).  We don't have a QA team or anything of that nature.  We don't have test cases for our projects that are fully laid out.

Ok, I am just a peon programmer at the bottom of the rung, but I am probably more tired of these issues than the managers complaining about them.  So, I don't have the ability to tell them you are doing it all wrong.....I have tried gentle pushes in the correct direction.

Any advice or suggestions on how to alleviate this issue ?

答:
There are a lot of issues here.

I personally am completely against this as I think that applications should be tested by end users and not programmers as end users are much better testers than programmers.

This is exactly the wrong attitude. You programmers are the first line of defense against garbage leaking out. Your end users are the last ones you want doing your testing. For one thing, it's too late. Those bugs should have been detected and fixed long before the product went out the door. For another, your company is risking having those end users becoming ex-users when they finally get so sick of having a buggy product that they go elsewhere.

We don't do end user testing really at all. We don't have a QA team or anything of that nature. We don't have test cases for our projects that are fully laid out.

You may not need a QA team, but that doesn't mean you can forgo quality. All of you need to act like you are members of the QA team. You need to do end-to-end testing. Unit testing isn't enough. You need to take on the attitude that bugs shouldn't creep in. Nip them in the bud.

Ok, I am just a peon programmer at the bottom of the rung, but I am probably more tired of these issues than the managers complaining about them. So, I don't have the ability to tell them you are doing it all wrong.....I have tried gentle pushes in the correct direction.

There apparently is a problem with management here, but you are pushing exactly in the wrong direction. I suspect your management has a "get 'er done" kind of mindset is only paying lip service to quality. This needs to change. Your competition is going to steal your customers away from you with a better and cheaper product if it doesn't.


答:
As a general rule, no. You either want to throw the exception up the stack, or log what happened.

However, I often do this when I'm parsing strings and converting to numbers  (especially in mapping projects that are of the use-once and throw away variety).

```<code>boolean isNonZeroNumber = false;

try {
   if(StringUtils.isNotBlank(s) && new BigDecimal(s).compareTo(BigDecimal.ZERO) != 0) {
     b = true;
   }
} catch(NumberFormatException e) {
//swallow this exception; b stays false.
}

return b;
</code>```

Title: Is it ever ok to have an empty catch statement?

Body: I thought about it and could not come up with an example. Why would somebody want to catch an exception and do nothing about it? Can you give an example? Maybe it is just something that should never be done.</p>

Body:
As a general rule, no. You either want to throw the exception up the stack, or log what happened.

However, I often do this when I'm parsing strings and converting to numbers  (especially in mapping projects that are of the use-once and throw away variety).

boolean isNonZeroNumber = false;

try {
   if(StringUtils.isNotBlank(s) && new BigDecimal(s).compareTo(BigDecimal.ZERO) != 0) {
     b = true;
   }
} catch(NumberFormatException e) {
//swallow this exception; b stays false.
}

return b;


答:
Seems like my professors called it bebugging or fault seeding.  The idea is that if you wanted to estimate the population of something like fish in a lake, you could catch some, tag and release them, give them time to assimilate randomly with the other fish, then estimate the population based on how many tagged fish you catch later.

This search link finds a page in a book by the late great Watts Humphrey where he talks about this technique.


答:
If you think a primary language feature is ugly, you are going to end up writing very poor code trying to avoid it.  Please just get over it or switch to another language that suits your style more.

Anything else only hurts us all.


问:
what is the purpose of arrows?
I am learning functionnal programming with Haskell, and I try to grab concepts by first understanding why do I need them.

I would like to know the goal of arrows in functional programming languages. What problem do they solve? I checked http://en.wikibooks.org/wiki/Haskell/Understanding_arrows and http://www.cse.chalmers.se/~rjmh/afp-arrows.pdf. All I understand is that they are used to describe graphs for computations, and that they allow easier point free style coding.

The article assume that point free style is generally easier to understand and to write. This seems quite subjective to me. In another article (http://en.wikibooks.org/wiki/Haskell/StephensArrowTutorial#Hangman:_Main_program), a hangman game is implemented, but I cannot see how arrows makes this implementation natural.

I could find a lot of papers describing the concept, but nothing about the motivation.

What I am missing?

答:
Just an addition to the other answers: Personally it helps me a lot to understand what such a concept is (mathematically) and how it relates to other concepts I know.

In the case of arrows, I found the following paper helpful - it compares monads, applicative functors (idioms) and arrows: Idioms are oblivious, arrows are meticulous, monads are promiscuous by Sam Lindley, Philip Wadler and Jeremy Yallop.

Also I believe nobody mentioned this link which may provide you some ideas and literature on the subject.

Title: what is the purpose of arrows?


问:
Should you promise to deliver a feature that you aren't sure if its implementable?
In an article from HN, I came across the following advice:

Always tell your customer/user "yes", even if you're not sure. 90% of
  the time, you'll find a way to do it. 10% of the time, you'll go back
  and apologize. Small price to pay for major personal growth

But I've always thought that one should do a feasibility analysis before making any kind of promises to a customer/user, so that they aren't misled at any point. At what circumstances, then, should the above advice applicable?

答:
This question has been studied formally and is addressed by the jointly produced IEEE Computer Society / ACM Code of Ethics.

2.01. Provide service in their areas of competence, being honest and forthright about any limitations of their experience and education.

3.04. Ensure that they are qualified for any project on which they work or propose to work by an appropriate combination of education and training, and experience.

3.09. Ensure realistic quantitative estimates of cost, scheduling, personnel, quality and outcomes on any project on which they work or propose to work and provide an uncertainty assessment of these estimates.

5.05. Ensure realistic quantitative estimates of cost, scheduling, personnel, quality and outcomes on any project on which they work or propose to work, and provide an uncertainty assessment of these estimates.

There are certainly business and legal implications about promising something that you can't deliver.  Usually these come from the customer going elsewhere, refusing to pay, or suing your company.  If you are in a partnership with others, they may sue for damages if your part is not delivered.  Lawsuits can even come from competitors.

There is a story from the early days of supercomputers where Seymour Cray and a team at Control Data Corporation were close to launching a product, and another very large computer company told its customers that it also was close to launch.  The lie cost CDC a lot of business and turned into a lawsuit where the big company could not show any credible evidence for their claims.  The result was what was at the time a big settlement worth $80 million dollars 1970 (about $223 million in 2012, adjusted for inflation).  You can read about it here:

http://en.wikipedia.org/wiki/Control_Data_Corporation#CDC_6600:_defining_supercomputing


答:
We require that our updates to applications be tested by at least one
  other programmer prior to going live.

That's a start, but you are writing here because you have proven this to be insufficient.

Applications should be tested by end users

We used to joke that we'd let end-users test our code.  The point of testing is to find bugs before the end-users do.  That way, end-users have a good experience, and recommend, or buy more of the software.

not [tested by] programmers

What's wrong with programmers testing?  I think it's an important part of being a good programmer.  Some schools of thought recommend that programmers write tests before even writing code!  I think the problem that you are getting at is only having programmers do testing.

staging environment in place that is a clone of the live environment

This is very good.  But if it is truly a clone, then the learning you gain from installing from development to staging is not getting transferred from staging to production.  One way or another, you aren't getting the full benefit of this system.  Do you do your testing in the staging environment?

We don't do end user testing really at all.

End user testing is usually about acceptance of new features, ease of use, and meeting the users needs.  Not about finding bugs.  End-users finding bugs = lost customers.

We don't have a QA team or anything of that nature. We don't have test
  cases for our projects that are fully laid out.

Eek!  This is the root cause of your problems.  A QA team would be fantastic, but even one eager and capable full-time tester would be an improvement.  You could get a short-term contractor, but having someone on-board long-term who can weave testing into your whole development cycle would be much better.

I work in a small company and we have a written regression test that we go through for every release.  It is not fun, but it catches bugs.  We take turns and just do it.

Maybe you mean something different when you talk about end-users finding bugs.  If so, you need to find a different way of expressing it, because that's a losing proposition if I've ever heard one.  Specifically, it sounds like it loses customers.  Advocate instead for:

A professional tester

A written regression test

Test-driven development

Establishing a culture of Quality.

Each of those is a time-honored industry-standard solution to a real issue you are experiencing that is affecting your bottom line.  If you keep metrics, then you should be able to estimate a dollar figure to the number of users who leave because of bugs, and the negative advertising the bugs generate.  There is also an opportunity cost, where customers who don't find bugs are happier and more likely to recommend your product.  If 80% of the total cost of the bugs to the company is enough to hire a tester, that's your whole business case right there.  A slam-dunk really.  Good luck!

Title: What can be done to decrease the number of live issues with applications?

Body:
First off I have seen this post which is slightly similar to my question. :

What can you do to decrease the number of deployment bugs of a live website?

Let me layout the situation for you.  The team of programmers that I belong to have metrics associated with our code.  Over the last several months our errors in our live system have increased by a large amount.  We require that our updates to applications be tested by at least one other programmer prior to going live.  I personally am completely against this as I think that applications should be tested by end users as end users are much better testers than programmers, I am not against programmers testing, obviously programmers need to test code, but they are most of the times too close to the code.  The reason I specify that I think end users should test in our scenario is due to the fact that we don't have business analysts, we just have programmers.  I come from a background where BAs took care of all the testing once programmers checked off it was ready to go live.

We do have a staging environment in place that is a clone of the live environment that we use to ensure that we don't have issues between development and live environments this does catch some bugs.

We don't do end user testing really at all, I should say we don't really have anyone testing our code except programmers, which I think gets us into this mess (Ideally, we would have BAs or QA or professional testers test).  We don't have a QA team or anything of that nature.  We don't have test cases for our projects that are fully laid out.

Ok, I am just a peon programmer at the bottom of the rung, but I am probably more tired of these issues than the managers complaining about them.  So, I don't have the ability to tell them you are doing it all wrong.....I have tried gentle pushes in the correct direction.

Any advice or suggestions on how to alleviate this issue ?


答:
The nice thing about the PageRank algorithm is that it can be solved iteratively in a distributed way, within the MapReduce framework.  However, the working data for Pagerank on ~5M nodes and ~50M edges should fit perfectly well in 4GB ram, never mind 48GB....

Specifically, you don't need to store all data for each web page in memory -- instead, you should digest your input database so that the working data for the PageRank solver refers to nodes by index.  Even with no particular effort at optimization, each node should take no more than 32 bytes, and each edge no more than 16 bytes, for in-memory space of less than 1GB.

A demonstration example for this kind of datastructure, in C++/STL:

```<code>std::vector<float> old_rank, new_rank;  // rankings for each node
std::vector<int> end_edge;  // index after final edge for each node
std::vector<int> edge_dest;  // destination node index for each edge
std::vector<float> edge_weight;  // fractional weight for each edge

...

void pagerank_iteration(float base_value, float scale_value) {
    new_rank.fill(0.0);
    int edge = 0;  // loop variable:  current edge index
    for(int node=0; node<first_edge.size(); ++node) {  // loop over nodes
        while(edge < end_edge[node]) { // loop over edges of current node
            int dest_node = edge_dest[edge];
            new_rank[dest_node] += edge_weight[edge] * old_rank[node];
            ++edge;
        }
    }
    assert(edge == edge_dest.size());

    for(int node=0; node<new_rank.size(); ++node) {  // add scale/offset
        new_rank[node] = base_value + scale_value * new_rank[node];
    }
}
</code>```

Running on a single PC is easier than running it on a cloud service, because you don't need to use a network-capable framework (although it might be a good idea to keep that possibility in mind).  The relatively small sizes you are describing can be solved easily with an ad-hoc single-threaded algorithm, and you can either use Hadoop locally or roll your own MapReduce using threads or inter-process communication if you want more cores.

Body:
The nice thing about the PageRank algorithm is that it can be solved iteratively in a distributed way, within the MapReduce framework.  However, the working data for Pagerank on ~5M nodes and ~50M edges should fit perfectly well in 4GB ram, never mind 48GB....

Specifically, you don't need to store all data for each web page in memory -- instead, you should digest your input database so that the working data for the PageRank solver refers to nodes by index.  Even with no particular effort at optimization, each node should take no more than 32 bytes, and each edge no more than 16 bytes, for in-memory space of less than 1GB.

A demonstration example for this kind of datastructure, in C++/STL:

std::vector<float> old_rank, new_rank;  // rankings for each node
std::vector<int> end_edge;  // index after final edge for each node
std::vector<int> edge_dest;  // destination node index for each edge
std::vector<float> edge_weight;  // fractional weight for each edge

...

void pagerank_iteration(float base_value, float scale_value) {
    new_rank.fill(0.0);
    int edge = 0;  // loop variable:  current edge index
    for(int node=0; node<first_edge.size(); ++node) {  // loop over nodes
        while(edge < end_edge[node]) { // loop over edges of current node
            int dest_node = edge_dest[edge];
            new_rank[dest_node] += edge_weight[edge] * old_rank[node];
            ++edge;
        }
    }
    assert(edge == edge_dest.size());

    for(int node=0; node<new_rank.size(); ++node) {  // add scale/offset
        new_rank[node] = base_value + scale_value * new_rank[node];
    }
}

Running on a single PC is easier than running it on a cloud service, because you don't need to use a network-capable framework (although it might be a good idea to keep that possibility in mind).  The relatively small sizes you are describing can be solved easily with an ad-hoc single-threaded algorithm, and you can either use Hadoop locally or roll your own MapReduce using threads or inter-process communication if you want more cores.


答:
In my humble experience, rarely is this good thing. You mileage may vary though.

Nearly every time I've seen this in our code base, it's been because I've tracked down a bug that the eaten exception has hidden. To put another way, by not providing any code, the application has no way of indicating an error, or performing another action.

Sometimes, at API layers for example, you might not want or be able to let exceptions past, so in that case, I tend to try and catch the most generic, then log those. Once again, to at least give a debug/diagnosis session a chance.

Typically, if it must be empty, the least I do is put an assertion of some kind, so at least something happens during a debug session. That said, if I can't handle it, I tend to omit them completely.


问:
How should compound words be handled when coding? Is there a definitive list of compound words?
QUESTION:

How should you handle compound words when programming?

Are there any good lists available online for developers of generally accepted technology-related compound words?

I can see how this is highly ambiguous, so should I just use common-sense?

EXAMPLE:

I would be inclined to do this:

filename NOT FileName

or

login NOT LogIn

However, the microsoft documentation indicates that filename is not compound. So I wonder, is there a more definitive source? See also, this english.stackexchange discussion
 on filename.

Under the section "Capitalization Rules for Compound Words and Common Terms" located here: Microsoft .NET Capitalization Conventions only offers a limited introduction into the topic, and leaves it up to the developer to use their intuition with the rest.

答:
I search in an english dictionary and both filename and login are single word terms. So in programming they should be treated as a single word, not compound words.

I guess an english dictionary should be a good source of reference.


答:
In this case, it's more important to set your own standard and follow it consistently. A lot of this is debatable between developers, so you should pick a method and use if consistently for each word. A dictionary is a good place to check to see if something is a valid single word.

As an aside, login is a noun (the login page) and log in (or LogIn) is a verb (log in the user). Here the distinction can be made by writing logIn vs. login

Title: How should compound words be handled when coding? Is there a definitive list of compound words?

Body:
QUESTION:

How should you handle compound words when programming?

Are there any good lists available online for developers of generally accepted technology-related compound words?

I can see how this is highly ambiguous, so should I just use common-sense?

EXAMPLE:

I would be inclined to do this:

filename NOT FileName

or

login NOT LogIn

However, the microsoft documentation indicates that filename is not compound. So I wonder, is there a more definitive source? See also, this english.stackexchange discussion
 on filename.

Under the section "Capitalization Rules for Compound Words and Common Terms" located here: Microsoft .NET Capitalization Conventions only offers a limited introduction into the topic, and leaves it up to the developer to use their intuition with the rest.


问:
GPLv2 - Multiple AI chess engines to bypass GPL
I have gone through a number of GPL-related questions, the most recent being this one:

https://stackoverflow.com/questions/3248823/legal-question-about-the-gpl-license-net-dlls/3249001#3249001

I'm trying to see how this would work, so bear with me. I have a simple GUI interface for a game of Chess. It essentially can send/receive commands to/from an external chess engine (ie: Tong, Fruit, etc). The application/GUI is similar in nature to XBoard ( http://www.gnu.org/software/xboard/ ), but was independently designed.

After going through a number of threads on this topic, it seems that the FSF considers dynamically linking against a GPLv2 library as a derivative work, and that by doing so, the GPLv2 extends to my proprietary code, and I must release the source to my entire project. Other legal precedents indicate the opposite, and that dynamic linking doesn't cause the "viral" effect of the GPL to propagate to my proprietary code.

Since there is no official consensus that can give a "hard-and-fast" answer to the dynamic linking question, would this be an acceptable alternative:

I build my chess GUI so that it sends/receives the chess engine AI logic as text commands from an external interface library that I write

The interface library I wrote itself is then released under the GPL

The interface library is only used to communicate via a generic text pipe to external command-line chess engines

The chess engine itself would be built as a command-line utility rather than as a library of any sort, and just sends strings in the Universal Chess Interface of Chess Engine Communication Protocol ( http://en.wikipedia.org/wiki/Chess_Engine_Communication_Protocol ) format.

The one "gotcha" is that the interface library should not be specific to one single GPL'ed chess engine, otherwise the entire GUI would be "entirely dependent" on it. So, I just make my interface library so that it is able to connect to any command-line chess engine that uses a specific format, rather than just one unique engine. I could then include pre-built command-line-app versions of any of the chess engines I'm using.

Would that sort of approach allow me to do the following:

NOT release the source for my UI

Release the source of the interface library I built (if necessary)

Use one or more chess engines and bundle them as external command-line utilities that ship with a binary version of my UI

Thank you.

Edit: For what it's worth, this is so I can keep my own code private, as I may want to re-use some of my rendering code in other independent projects. This is not a commercial attempt to just write a cheap UI to effectively "wrap" someone else's engine and profit from their hard work. In the end, I wrote my own simple chess engine (little more than a legal move validator, really) instead of using a GPL'ed component.

答:
Take a look at this.

By contrast, pipes, sockets and command-line arguments are communication mechanisms normally used between two separate programs. So when they are used for communication, the modules normally are separate programs. But if the semantics of the communication are intimate enough, exchanging complex internal data structures, that too could be a basis to consider the two parts as combined into a larger program.

According to that, GNU does not consider communicating through a pipe to be a derivative work, most of the time anyway.

OwnerDisplayName: Dogbert


答:
I'm highly annoyed by inconsistent naming.  I suggest these actions:

Create a project-wide dictionary for naming that resolves all the common cases, like "filename" and "login".  If you are going to allow any abbreviations, they should be standardized too, and if used at all, I suggest using them all the time.

Define a process to follow to resolve new questions about word breaks.  For example, you could just defer to dictionary.com or another online dictionary.

Have code reviews to catch naming errors.

Publicly flog repeated scofflaws.


答:
No, I don't think it's ethical to incorporate GPL software into your close-sourced project. Any action that begins with an attempt to "bypass" the GPL is probably violating the spirit of the GPL. I don't find it an acceptable solution.

If your software runs GPL code, then your software should be GPL. That's the sort of give and take relationship that the FSF is trying to foster.

But to tone down the rhetoric, proprietary projects can indeed make use of GPL'd software as long as they're "at arms length". Your code can run on GPL'd operating systems, your code can ask for webpages served by a GPL'd server, and your proprietary user interface can even call on a chess program to pick the next move. But if you include the GPL'd chess engine, you MUST include the license and make the chess engine source code available. And you can change the chess engine, but if you make it specifically so only your UI can use it, you are violating the GPL.

And even then, if you're profiting from GPL'd code... Come on dude, contribute back to the community.

Title: GPLv2 - Multiple AI chess engines to bypass GPL

Body:
I have gone through a number of GPL-related questions, the most recent being this one:

https://stackoverflow.com/questions/3248823/legal-question-about-the-gpl-license-net-dlls/3249001#3249001

I'm trying to see how this would work, so bear with me. I have a simple GUI interface for a game of Chess. It essentially can send/receive commands to/from an external chess engine (ie: Tong, Fruit, etc). The application/GUI is similar in nature to XBoard ( http://www.gnu.org/software/xboard/ ), but was independently designed.

After going through a number of threads on this topic, it seems that the FSF considers dynamically linking against a GPLv2 library as a derivative work, and that by doing so, the GPLv2 extends to my proprietary code, and I must release the source to my entire project. Other legal precedents indicate the opposite, and that dynamic linking doesn't cause the "viral" effect of the GPL to propagate to my proprietary code.

Since there is no official consensus that can give a "hard-and-fast" answer to the dynamic linking question, would this be an acceptable alternative:

I build my chess GUI so that it sends/receives the chess engine AI logic as text commands from an external interface library that I write

The interface library I wrote itself is then released under the GPL

The interface library is only used to communicate via a generic text pipe to external command-line chess engines

The chess engine itself would be built as a command-line utility rather than as a library of any sort, and just sends strings in the Universal Chess Interface of Chess Engine Communication Protocol ( http://en.wikipedia.org/wiki/Chess_Engine_Communication_Protocol ) format.

The one "gotcha" is that the interface library should not be specific to one single GPL'ed chess engine, otherwise the entire GUI would be "entirely dependent" on it. So, I just make my interface library so that it is able to connect to any command-line chess engine that uses a specific format, rather than just one unique engine. I could then include pre-built command-line-app versions of any of the chess engines I'm using.

Would that sort of approach allow me to do the following:

NOT release the source for my UI

Release the source of the interface library I built (if necessary)

Use one or more chess engines and bundle them as external command-line utilities that ship with a binary version of my UI

Thank you.

Edit: For what it's worth, this is so I can keep my own code private, as I may want to re-use some of my rendering code in other independent projects. This is not a commercial attempt to just write a cheap UI to effectively "wrap" someone else's engine and profit from their hard work. In the end, I wrote my own simple chess engine (little more than a legal move validator, really) instead of using a GPL'ed component.

ContentLicense: CC BY-SA 4.0


问:
Under which circumstances (if any) does it make sense to work for a startup, for free?
I've been bumping around the startup world for a while, and most startups I've seen seem to have (amongst other things) two things in common:

A lack of money

An inability to, reliably, hire good quality developers

This means that, for startups, the ideal hire is someone who is free - where they can wait until they've both raised money and found out that the hire is worth his price tag.

When (if ever) is this a win win situation? For you, as a programmer or software developer, when would this make sense?

答:
Yes, I would do that if

I could live by other means.

Would give me some experience that I could cash it out later (internship mode).

Could not find any other employment.

most important: Got equity.

If you cannot be paid, or compensated, then the startup founders should give you equity. Also in order for this to be meaningful (because first employees can make or break a company), you have to be fully aligned with their vision and strategy.


答:
"When (if ever) is this a win win situation?"

Never. Never, ever, ever, ever, ever.

Your time and skills are worth cold, hard cash. Odds are, you and your coworkers will spend way too many hours writing a bunch of crap code "just to get it out the door".

Once it's out the door, the company is in make it or break it mode.

Once its in that mode, it'll most likely break.

If it breaks, you're SOL for payment.

If it makes, you could still be SOL for payment.

Title: Under which circumstances (if any) does it make sense to work for a startup, for free?

Body:
I've been bumping around the startup world for a while, and most startups I've seen seem to have (amongst other things) two things in common:

A lack of money

An inability to, reliably, hire good quality developers

This means that, for startups, the ideal hire is someone who is free - where they can wait until they've both raised money and found out that the hire is worth his price tag.

When (if ever) is this a win win situation? For you, as a programmer or software developer, when would this make sense?


问:
Does (should?) changing the URI scheme name change the semantics?
If we take:

```<code>http://example.com/foo
</code>```

is it fair to say that:

```<code>ftp://example.com/foo
</code>```

.. points to the same resource, just using a different mechanism for resolving it (and of course possibly a different representation, but perhaps not)?

This came to light in a discussion we were having surrounding some internal tooling with Git. We have to process some Git repositories, and they come to use as "git@{authority}/{path}" , however the library we're using to interface with them doesn't support the git protocol. I suggested that we should make the service robust in of that it tries to use HTTP or SSH, in essence, discovering what protocols/schemes are supported for resolving the repository at {path} under each {authority}.

This was met with some criticism: "We don't know if that's the same repository".

My response was: "It had better be!"

Looking at RFC 3986, I see this excerpt:

URI "resolution" is the process of    determining an access
  mechanism and the appropriate parameters    necessary to dereference a
  URI; this resolution may require several    iterations.  To use that
  access mechanism to perform an action on the    URI's resource is to
  "dereference" the URI.

Which makes me think that the resolution process is permitted to try different protocols, because:

Although many URI schemes are named after protocols, this does not
  imply that use of these URIs will result in access to the resource via the named protocol.

The only concern I have, I guess, is that I only see reference to the notion of changing protocols when it comes to traversing relationships:

it is possible for a single set of hypertext documents to be
  simultaneously accessible and traversable via each of the "file",
  "http", and "ftp" schemes if the documents refer to each other with
  relative references.

I'm inclined to think I'm wrong in my initial beliefs, because the Normalization and Comparison section of said RFC doesn't mention any way of treating two URIs as equivalent if they use different schemes. It seems like schemes named/based on IP protocols ought to have this notion, at least?

答: It's common for static pages to be mapped by ftp also be available by http, but you should not assume this is the case.  Anything else is almost certainly NOT the case.  Many pages accessed by HTTP have some form of active processing, and for other protocols, GIT included, any resemblance between what you "git" and what FTP might see is purely coincidental.</p>


答:
Of course, this is very subjective, each of us will have a different opinion. This is mine. The only situation I find that you will be in a win win situation is when you feel the project as yours too, and this means that you like the idea, you like the company, you like its values, but also you participate on decisions, on defining the company, its strategies etc. At last, that means that you are a partner, and that you probably own part of the company. At last, you are not working for free, because you are paid with shares of that company, that if it is succeful, might be worthwhile.

If you work for free, just to get the opportunity to get a job in the future, I don't think that is fair to you, even if you just want to build portfolio.


问:
I have a library and several small programs that use it: how should I structure my git repositories?
I have some code that uses a library that I and others frequently modify (usually only by adding functions and methods). We each keep a local fork of the library for our own use.

I also have a lot of small "driver" programs (~100 lines) that use the library and are used exclusively by me. Currently, I have both the driver programs and the library in the same repository, because I frequently make changes to both that are logically connected (adding a function to the library and then calling it).

I'd like to merge my fork of the library with my co-workers' forks, but I don't want the driver programs to be part of the merged library.

What's the best way to organize the git repositories for a large, shared library that needs to be merged frequently and a number of small programs that have changes that are connected to changes in the library?

答:
You could make the library be one repository per developer, so each developer maintains their own fork but can pull from each other.

You could make the library be one shared repository such that commits that go to master are not expected to cause uncommunicated issues for the other developers.

Both of those have a slight complication in that given a version of a driver program it may be difficult to get back to the version of the library; you'd need to decide that's not a problem or start tracking what version your driver programs need.

The other main solution is to do nothing, but as you've seen git isn't well-suited to treating part of a repository as a whole, unlike its centralised slightly cumbersome cousin Subversion.

More specific answers might depend on knowing what language the library and client programs are written in.


问:
Native mobile app development - how do I structure my user stories?
I'm about to start on a project which will involve developing prototype native mobile apps (iOS and Android initially) as well as a web-based admin interface and an API for these apps to communicate with.  We've got a list of stories already drafted up, however a lot of them are in the format:

```<code>As a mobile user I want to be able to view a login screen so that I can sign into the app
</code>```

If this were targeted for a single platform, I wouldn't see a problem.  However, since we're targeting multiple platforms, I'm not sure whether these should now be duplicated eg "As an Android user" or similar.  This seems like duplication, but it's work that will need to be completed separately for each platform.

This is the first mobile project we've gone native on - previously it was Phonegap and we lumped all stories in under "As a mobile user".  Since essentially this was a web-based app wrapped in native code, this didn't present too much of an issue, but I'm conscious that wholly-native apps are a different ballgame!

答:
(I asume you use scrum). If the product owner knows upfront that he/she will always prioritize the different mobile platforms equally. (Eg. because it is a company policy)

And if your user stories are small enough, so that your team can do at least four or five of them in a sprint.

Only then you should not split your mobile stories into a story per platform. Use the definition of done to state all expected platforms.

In all other cases: split the mobile stories per platform. There is absolutely nothing wrong with that.


答:
When (if ever) is this a win win situation?

About the only time when it would make sense is when all of the following is true:

You are a co-owner with a double-digit percentage stake in the equity of the company

You have other means to sustain yourself and your family for at least a couple of years

You love the idea behind the start-up, and you see a clear path to its profitability

In all other cases, reading a good book is a better way to spend your time.


答:
The only reason to do that is if you are one of the founders (or are getting as much out of the deal as a founder).

You are taking the same risk you need to be in a position to get compensated appropriately for that risk high risk high reward.

Your ability to live off oatmeal may affect your ability to do this effectively though :-)


答: Sounds like a good fit for git submodules - move the library into it's own, public repository, then add it as a git submodule to the repository where you keep your driver programs. If you haven't used git submodules, it might take some getting used to; understanding how it works requires some knowledge of git's internals. Here's a tutorial that I found useful.</p>

Title: I have a library and several small programs that use it: how should I structure my git repositories?

Body:
I have some code that uses a library that I and others frequently modify (usually only by adding functions and methods). We each keep a local fork of the library for our own use.

I also have a lot of small "driver" programs (~100 lines) that use the library and are used exclusively by me. Currently, I have both the driver programs and the library in the same repository, because I frequently make changes to both that are logically connected (adding a function to the library and then calling it).

I'd like to merge my fork of the library with my co-workers' forks, but I don't want the driver programs to be part of the merged library.

What's the best way to organize the git repositories for a large, shared library that needs to be merged frequently and a number of small programs that have changes that are connected to changes in the library?


问:
What is a good way to learn about multicore programming at the kernel level in Linux?
I am interested in multicore programming at the kernel level.  I expect this affects many areas and is probably different for each architecture.  What are some must read sections of the kernel?  If I wanted to compare and contrast code for an Intel I7 and an ARM Cortex-A9 MPCore where would I find the differences?</p>

答:
All programming in the kernel is multi-core programming (in the sense that it has to be capable of running on multiple cores). So there's nothing specific to that which you don't already do for general kernel coding.

Areas of kernel programming relevant to multi-core systems are locking, scheduling, and memory access (NUMA if you're on that type of machine).

Here's a few good places to start:

KenrelNewbies - Kernel Hacking

Getting Started with Kernel Development

Assorted free books/docs


答:
Working for free is OK if the purpose is for charity.

If the purpose to is to make someone else wealthy then it's never OK.

If you are being paid with ownership of the company, then I don't consider that working for free. Despite the high chance you won't make any money.


答:
When you are accepted, treated and empowered in a comparable way to one of the original founders.

I'd probably expect an ownership share of no less than half of the largest shareholder.


答:
Manual testing by developers beyond 'yep, the app starts' etc., is a thorough waste of time.  Automatic testing is worth doing, as is examining the causes of failures to see if you can reasonably prevent them happening again either in the same code or in other code.

It's ok to have end users test if you have nobody else.  Ideally have that structured so that end users can choose to test or to use a more stable version, and make sure you have a good way of getting information back in the event of a failure.

End users might be the only people who could possibly think of, say, testing what happens when you're in a locale where converting "I" to lowercase doesn't give "i" (Turkish, and this bit me), or running the application from a DVD drive, or without any network connected.  The trick is to involve them, actually respond to what they report and make them feel like they're contributing instead of being victimised.

Also, in certain environments you might pick a 'friendly' end user to test certain features/fixes.  Especially if you can watch them use the program, you can learn a lot that way.


答:
One example where I think is OK to just swallow exception without doing anything, even logging the exception, is inside logging code itself.

If you tried to log something and got exception there is not much you can do about it:

you can not log it of course;

you might be able to fall back to a reserve logging mechanism, but most applications are not that sophisticated, and for those that are sophisticated enough the same design problem will arise with the reserve logging mechanism;

fast fail - will be too radical a solution for most applications;

throwing exception up will do little good as it will end up in a catch statement up the stack that will almost certain try to log it...

That leaves you with the "least of the evil" option of quietly swallowing it, allowing the application to keep performing its main job, but compromising the ability to troubleshoot it.


答:
I'd take total lack of familiarity with what Hadoop/MapReduce even are as a warning sign that the developer might not be making any attempts to keep up to date.

That said, that's just a sign, not a no-hire.  Give them FizzBuzz or something of that nature, and if they get past that show them your code and ask for a critique.  Perhaps choose something with a bug deliberately, but also something you think is ok, as that discussion will be more interesting.

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

Body:
Thanks to the great help of this site and SO, I've been able to make a prototype of a software I want to sell but unfortunately although the prototype works I think my code quality is very low. I didn't use much OOP or design patterns so although my code is understandable to me, I think a normal developer would faint if they had to read it.

So I wanted to hire a developer to make it a bit more better quality and improve some of my implementations of API's that I may have not done correctly.   I'm having problems hiring a developer though.

I have met 2 developers and had them read my software specs.The problem is, they lacked my business's domain knowledge(which is completely understandable and no biggie) but they also lacked knowledge of the underlying tech systems I used such as Hadoop, Hbase, Cuda, etc..I spent alot of time explaining map/reduce, bigtables and other technologies I used. I thought it was common knowledge because of my interactions with people on this site but the people I met with mentioned they never had to deal with these things so they didn't know it.

My question is, for software projects that are hiring contractor developers is it a danger if the developer does not have experience with the underlying technologies? or can a general developer who is accomplished in another area realistically pick up new technologies?  I did a very very quick back of envelope calculation and I think the upfront costs would be similar if I hire a student or developer with no experience in my technologies who will work many hours versus hiring a highly experienced developer who charges double but finishes in half the time but what other risks should I be considering or worried about?  Also, should if I do hire a generalist, should I be paying for the time it takes them to learn hadoop or cuda if they are contractors(seems to make business sense but not sure how fair it is to them if they do not use the skill again).

I'm a bit confused so any suggestions would be great.


答: This turned out to be a problem with how I was removing the HTTP headers from the file. Once I fixed that, this worked perfectly fine.</p>

Title: Reconstruct a file from a TCP stream

Body:
I have a client and a server and a third box which sees all packets from the server to the client (but not the other way around). Now when the client requests a file from the server (over HTTP), the third box sees the response. I am trying to reconstruct the file there. I am using libpcap to capture TCP datagrams and trying to reconstruct the file there. Here is what I did

Listen for packets on an interface

Group all packets which have the same ACK number

Sort the group based on SEQ number

Extract data from each packet and combine them and write to the disk

The problem is, the file thus generated is not exactly the same as the original file. Their sizes are the same each, but when I open the images in an image viewer, they look different. time Does everything sound correct here?

EDIT

Hexdump of first 512 bytes of the recovered file

```<code>0000000 009a 0095 0090 008b 0086 0081 007c 0077
0000010 0072 006d 0068 0063 005e 0059 0054 004f
0000020 004a 0045 0040 003b 0037 0032 002d 0028
0000030 0023 001e 0019 0014 000f 000a 0005 0000
0000040 0400 0000 0000 0000 7276 6375 5420 4352
0000050 0000 0000 6720 7369 0000 0000 0000 0000
0000060 0000 0000 0002 0000 028f 0000 0000 0000
0000070 0001 0000 0000 0000 6173 6d65 1fe7 0057
0000080 0000 0050 0956 004c 0000 0000 5a20 5859
0000090 0001 0000 5c9e 0003 130b 0004 edcc 0003
00000a0 cf14 0010 5f2e 0014 a4fe 0013 0000 0000
00000b0 6577 7669 0000 0000 0000 0000 0000 0000
00000c0 0000 0000 0000 0000 0000 0000 2e31 2d32
00000d0 3636 3139 4336 4945 6e20 2069 6f6e 7469
00000e0 6469 6f6e 2043 6e67 7769 6965 2056 6365
00000f0 656e 6572 6566 2c52 0000 0000 0000 0000
0000100 0000 3100 322e 362d 3936 3631 4543 2049
0000110 696e 6e20 696f 6974 6e64 436f 6720 696e
0000120 6577 5669 6520 6e63 7265 6665 5265 002c
0000130 0000 0000 0000 7363 6465 0000 0000 0000
0000140 0000 0000 0000 0000 0000 0000 0000 0000
0000150 4742 7352 2d20 6520 6163 7370 7220 6f75
0000160 6f6c 2063 4742 2052 6c74 6175 6566 2044
0000170 2e31 2d32 3636 3139 2036 4543 2e49 0000
0000180 0000 0000 0000 0000 4200 5247 2073 202d
0000190 6365 7061 2073 7572 6c6f 636f 4220 5247
00001a0 7420 756c 6661 4465 3120 322e 362d 3936
00001b0 3631 4320 4945 002e 0000 0000 0000 7363
00001c0 6465 0000 0000 0000 0000 0000 0000 0000
00001d0 0000 0000 0000 0000 0000 0000 0000 0000
*
00001f0 6368 632e 6965 772e 7777 2f2f 703a 7474
0000200
</code>```

Hexdump of first 512 bytes of the original file:

```<code>0000000 d8ff e0ff 1000 464a 4649 0100 0101 2c01
0000010 2c01 0000 e2ff 6d1c 4349 5f43 5250 464f
0000020 4c49 0045 0101 0000 5d1c 694c 6f6e 1002
0000030 0000 6e6d 7274 4752 2042 5958 205a ce07
0000040 0200 0900 0600 3100 0000 6361 7073 534d
0000050 5446 0000 0000 4549 2043 5273 4247 0000
0000060 0000 0000 0000 0000 0000 0000 d6f6 0100
0000070 0000 0000 2dd3 5048 2020 0000 0000 0000
0000080 0000 0000 0000 0000 0000 0000 0000 0000
*
00000a0 0000 0000 0000 0000 1100 7063 7472 0000
00000b0 5001 0000 3300 6564 6373 0000 8301 0000
00000c0 6c00 7477 7470 0000 ef01 0000 1400 6b62
00000d0 7470 0000 0302 0000 1400 5872 5a59 0000
00000e0 1702 0000 1400 5867 5a59 0000 2b02 0000
00000f0 1400 5862 5a59 0000 3f02 0000 1400 6d64
0000100 646e 0000 5302 0000 7000 6d64 6464 0000
0000110 c302 0000 8800 7576 6465 0000 4b03 0000
0000120 8600 6976 7765 0000 d103 0000 2400 756c
0000130 696d 0000 f503 0000 1400 656d 7361 0000
0000140 0904 0000 2400 6574 6863 0000 2d04 0000
0000150 0c00 5472 4352 0000 3904 0000 0c08 5467
0000160 4352 0000 450c 0000 0c08 5462 4352 0000
0000170 5114 0000 0c08 6574 7478 0000 0000 6f43
0000180 7970 6972 6867 2074 6328 2029 3931 3839
0000190 4820 7765 656c 7474 502d 6361 616b 6472
00001a0 4320 6d6f 6170 796e 6400 7365 0063 0000
00001b0 0000 0000 7312 4752 2042 4549 3643 3931
00001c0 3636 322d 312e 0000 0000 0000 0000 0000
00001d0 1200 5273 4247 4920 4345 3136 3639 2d36
00001e0 2e32 0031 0000 0000 0000 0000 0000 0000
00001f0 0000 0000 0000 0000 0000 0000 0000 0000
0000200
</code>```

Some more details:

I am using C++

The packet data is being stored as std::vector<char>

I did change the byte order while reading the ack number and seq number from the packet using ntohl

I am not sure if I need to change the byte order for the data as well. I tried to reverse the data from each packet before combining them, even that did not work.

Is there something I am missing?

EDIT

Original file:

Recovered file:


答:
Never work for free.

As previously mentioned, make sure you get equity - real equity, not options.

My conditions for working for equity only:

I can support my lifestyle without cash from this job

Will I be learning anything that will be useful to me later in my career (not just technical skills, but soft skills too)?

Do I believe in the founders?  Make sure you fully check-out their backgrounds.  Meet them at least three times before committing.  I've met plenty of these dreamers who can talk a good game up front, but generally within three meetings I've been able to tell the ones who are legit from the talkers.

Do I believe in the product?


问:
Call a script over the network
I have a Python script on a box that I want to call from a Java server, over the network. I know that I can start a server on the Python side and then connect to it from the Java site, but I am trying to see if there is a way to avoid the overhead of running a server on the Python side. Is there any other way of doing it?</p>

答: We used to run scripts on various boxes by having a chron job (or Scheduled Task on Windows) that checks the date on a file in a shared folder every minute.  If the date changed, run the script.  Otherwise, just exit and be run again in a minute.  Really low-tech.</p>

Title: Call a script over the network


答:
Developers should be doing real unit and integration testing that can be automated. Ideally after every check in/commit (or at least nightly) all of those tests should be run and pass before the code is released.  There are a number of continuous integration tools out there can do this for you (e.g. http://jenkins-ci.org/).

When defining the tasks for your project, make sure your time estimates include developer time for building these tests.  NOTE: Usually you will spend more time writing tests than you will writing the actual application code.

Whenever a bug is reported, start by adding a test that reproduces it.  Then fix to the test.  This will prevent the same bug from coming back.

As for changing management's outlook you can try the following:
* Track every hour that is spent resolving bugs
* Highlight the bugs that have come back repeatedly
* Show them how much time is being wasted fixing bugs rather than improving and adding new features
* If you have some downtime start setting up these processes yourself, so at least you know your code is good
If you can show them in numbers the cost to the company it may change their outlook.


答:
You are really asking for a code review and/or training.  Especially for code review, a group of seasoned programmers with diverse backgrounds is best.  When they all agree, do what they tell you.  When they all have a different opinion, you are doing just the right thing.  :-)

If you use mapReduce, CUDA, and Hadoop and want a single reviewer, hire the expert.  My first choice would be to look for someone with experience in addition to school.  Also consider training yourself, joining user groups, etc.  You may be able to take a few key individual questions and show them to friends if you have that kind of friend.

Does Programmers.StackExchange let people post code for critique?  If so, I'd pick no more than a page.  Pick something you know is wrong, but don't know why.

What programming language are you using?


答: Run lighttpd and put a hook on there to create a file. Have a cron job check if that file exists every interval. If it does, do action(s), then delete it.</p>

Title: Call a script over the network

Body: I have a Python script on a box that I want to call from a Java server, over the network. I know that I can start a server on the Python side and then connect to it from the Java site, but I am trying to see if there is a way to avoid the overhead of running a server on the Python side. Is there any other way of doing it?</p>


答:
I personally am completely against this as I think that applications should be tested by end users and not programmers as end users are much better testers than programmers.

This is not a good practice. Your application functionality should be tested by programmer before handling it to the testing stage. QA should be responsible for testing of functionality as well as related modules in your application. After it past QA, your client users (not end-users) should have a UAT (user acceptance testing). Once it passes UAT then you deploy it to production.

However, if your programmers perform testing through writing unit tests, then this is is a great practice to follow.


问:
What did Linus Torvalds mean by his quotation about portability?
In a debate with Andrew Tanenbaum over microkernel vs. monolithic operating system architecture, Linus Torvalds said,

Portability is for people who cannot write new programs.

What did he mean by that?

答:
If you're want to write portable code, you have to write portable code.

What do I mean by that?

The design must reflect the purpose. If the language is C, for instance, design it so that the minimum number of lines of code need to change in order for it to work. This would often mean separating the display from the computation, which is a good design philosophy anyway (MVC). Most C code can be compiled anywhere, provided you have access to a good compiler. Leverage that and write as much as you can to be generic.

BTW, this answer will only apply for applications. OS and embedded are another animal entirely.


答:
When (if ever) is this a win win situation?

I would like to add-up to already suggested reasons when it is reasonable to work for start-up:

It would make sense to work on a start-up only if you have clear understanding of business model and want to gain experience how to run such start-up.

In another words, learning for free while being partially engaged with this project is also something that you would only gain.

However, this advice is only for a relatively newbie developer and may not work for everyone.


答:
Running a small server (develop it yourself) written in Java on the python box shouldn't have too much overhead, if you don't want to do this at all then there is no real native way in Java to do it.

Some options though:

If you have a web server running on the box already, create a CGI script that runs the desired program. When the java box makes a HTTP connection to the URL, the python script is run.

Use a remote shell and connect to it, e.g. System.exec("rsh remotebox progname");

Use a secure shell (like above) e.g. System.exec("ssh remotebox progname");

Title: Call a script over the network


问:
Is there any kind of established architecture for browser based games?
I am beginning the development of a broser based game in which players take certain actions at any point in time.
Big parts of gameplay will be happening in real life and just have to be entered into the system.

I believe a good kind of comparison might be a platform for managing fantasy football, although I have virtually no experience playing that, so please correct me if I am mistaken here.

The point is that some events happen in the program (i.e. on the server, out of reach for the players) like pulling new results from some datasource, starting of a new round by a game master and such.

Other events happen in real life (two players closing a deal on the transfer of some team member or whatnot - again: have never played fantasy football) and have to be entered into the system.

The first part is pretty easy since the game masters will be "staff" and thus can be trusted to a certain degree to not mess with the system. But the second part bothers me quite a lot, especially since the actions may involve multiple steps and interactions with different players, like registering a deal with the system that then has to be approved by the other party or denied and passed on to a game master to decide.

I would of course like to separate the game logic as far as possible from the presentation and basic form validation but am unsure how to do this in a clean fashion.

Of course I could (and will) put some effort into making my own architectural decisions and prototype different ideas. But I am bound to make some stupid mistakes at some point, so I would like to avoid some of that by getting a little "book smart" beforehand.

So the question is:

Is there any kind of architectural works that I can read up on?

Papers, blogs, maybe design documents or even source code?
Writing this down this seems more like a business application with business rules, workflows and such... Any good entry points for that?

EDIT:

After reading the first answers I am under the impression of having made a mistake when including the "MMO" part into the title.
The game will not be all fancy (i.e. 3D or such) on the client side and the logic will completely exist on the server. That is, apart from basic form validation for the user which will also be mirrored on the server side.
So the target toolset will be HTML5, JavaScript, probably JQuery(UI).
My question is more related to the software architecture/design of a system that enforces certain rules.

Separation of ruleset and presentation

One problem I am having is that I want to separate the game rules from the presentation.

The first step would be to make an own module for the game "engine" that only exposes an interface that allows all actions to be taken in a clean way.

If an action fails with regard to some pre/post condition, the engine throws an exception which is then presented to the user like "you cannot sell something you do not own" or "after that you would end up in a situation which is not a valid game state."

The problem here is that I would like to be able to not even present invalid action in the first place or grey out the corresponding UI elements.

Changing and tweaking the ruleset

Another big thing is the ruleset.
It will probably evolve over time and most definitely must be tweaked.
What's more, it should be possible (to a certain extent) to build a ruleset that fits a specific game round, i.e. choosing different kinds of behaviours in different aspects of the game. This would do something like "we play it with extension A today but we throw out extension B."

For me, this screams "Architectural/Design pattern" but I have no idea on who might have published on something like this, not even what to google for.

答:
I would start by gaining a really deep understanding of the scope that javascript is capable of delivering to a browser based project. Start with node.js and also refresh yourself on AJAX. Look through the jQuery library starting with codeacademy's tutorial . </p>

<p>Eventually you'll need to master WebGL and understand how to integrate the backend of your program with the js frontend. I'd recommend taking this class for some clarity. However, if you are planning an MMO, then stackless python or java would be probably a better choice for a backend. </p>

Body:
I would start by gaining a really deep understanding of the scope that javascript is capable of delivering to a browser based project. Start with node.js and also refresh yourself on AJAX. Look through the jQuery library starting with codeacademy's tutorial .

Eventually you'll need to master WebGL and understand how to integrate the backend of your program with the js frontend. I'd recommend taking this class for some clarity. However, if you are planning an MMO, then stackless python or java would be probably a better choice for a backend.


问:
Is there any way to get faster app reviews?
I am trying to build a business around an iPhone app. The app will be our main sales channel, and being able to adapt the sales channel faster than the 9-10 days delay cause by the app review times is crucial. Therefore, I was wondering whether there is anything I can do to improve the speed of reviews. I am thinking that the publishers of Angry Birds, surely would not have to wait in line for reviews on the same terms as some obscure free app. So what can I do? Some things I am considering:

Would Apple prioritize apps that they earn money on?

Could I in some way pay Apple directly?

I already know of the possibility of requesting an expedite review, but it seems like one can get punished for supplying a non-technical reason.

答:
Would Apple prioritize apps that they earn money on?

There is no short way. Some advises that you may pick up here might not work as well, because there is no guaranteed solution.

However, if you contact App Store for recommendation and ask openly your problem, you would definitely get the best answer or guidelines to follow. Thus, cutting corners when dealing with vendor are very high risk, that i would advice not to take.