Splitting a JavaScript namespace into multiple files
At the start of each file: if(myNameSpace === undefined) { var myNameSpace = {}; } File 1: myNamespace.foo = function()… File 2: myNamespace.bar = function()…
At the start of each file: if(myNameSpace === undefined) { var myNameSpace = {}; } File 1: myNamespace.foo = function()… File 2: myNamespace.bar = function()…
Speaking in terms of more “classical” DDD, yes domain objects are typically not allowed anywhere outside of the domain. But it is not an absolute rule that domain objects are not used in the presentation layer. For example, Naked Objects represents a school of thought where domain objects are used directly. I myself adhere mostly … Read more
I have just taken a C# solution and did just this (remove any file that had multiple public classes in them) and broke them out to individual files and this has made life much easier. If you have multiple public classes in a file you have a few issues: What do you name the file? … Read more
Just want to add to what was mentioned previously that this: $.each(container.children(), function(j,w) { $(w).unbind().change(function() { … }); }); can be optimized to: container.children().unbind().change(function() { … }); It’s all about chaining, a great way to simplify your code.
I copied a piece from http://wiki.netbeans.org/KeymapProfileFor60. The first option is for Win/Lin and the second for Mac. Command Windows Mac Collapse (hide) a block Ctrl + – ⌘ + – Expand a Collapsed Block (expand-fold) Ctrl + + ⌘ + + Collapse (hide) all code blocks Ctrl + Shift + – ⌘ + Shift + … Read more
There is actually a (subtle) difference between the two. Imagine you have the following code in File1.cs: // File1.cs using System; namespace Outer.Inner { class Foo { static void Bar() { double d = Math.PI; } } } Now imagine that someone adds another file (File2.cs) to the project that looks like this: // File2.cs … Read more
I think you can subscribe Apache Spark, databricks channel on youtube, listen more and know more, especially for the experiences and lessons from others. Apache Spark databricks Spark Technology Center here is some videos recommended: SparkUI Visualization slide SparkUI Visualization Spark in Production: Lessons from 100+ Production Users slide Spark in Production: Lessons from 100+ … Read more
Even though maven projects have single parent, they can import any number of other pom’s like this: <dependencyManagement> <dependencies> <dependency> <groupId>org.example</groupId> <artifactId>my-shared-dependencies</artifactId> <version>0.0.1-SNAPSHOT</version> <type>pom</type> <scope>import</scope> </dependency> </dependencies> </dependencyManagement> This has two important differences compared to a parent: Plugins defined in the imported pom won’t be imported Dependencies defined in the imported pom won’t be added … Read more
The article Eric pointed to is awesome because it covers details of organising large Python code bases. If you’ve landed here from Google and are trying to find out how to split one large source file into multiple, more manageable, files I’ll summarise the process briefly. Assume you currently have everything in a file called … Read more
Used properly, this can be a useful technique. Say you have a complex, performance critical subsystem with a fairly small public interface and a lot of non-reusable implementation code. The code runs to several thousand lines, a hundred or so private functions and quite a bit of private data. If you work with non-trivial embedded … Read more