The Programmer Blog RSS

The Programmer Blog is here to help you, the programmer. We do our best to provide useful resources that offer explanations to popular programming problems, across a variety of programming languages. If you would like to suggest a blog topic or have a question, please leave us a message.

cheatsheet, Javascript

We have compiled a list of almost all of the JavaScript functions you will ever need! This is a nice guide to keep on hand when digging into web development with Vanilla JavaScript. Check out our Javascript Cheat Sheet below. JavaScript Booleans toSource() valueOf() toString() JavaScript Strings charAt() slice() charCo­deAt() split()  concat() substr() fromCh­arC­ode() substr­ing() indexOf() toLowe­rCase() lastIn­dexOf() toUppe­rCase() length...

Read more

c#, systemoutofmemory

While programming for my web app the other day, my application threw an System.OutOfMemoryException when initializing a list of objects. To me this seemed pretty much impossible because my machine has 4GB RAM. Specifically the error happened when I tried to add an existing collection to a new list. For example: List newShapes = new List(selectedShapes); My original thought was that...

Read more

compare, String

Typically programmers become accustom to using the == operator when comparing strings. While this is certainly valid syntax in Java, there is a catch that you should know about. The Catch == compares object references .equals() compares string values Explained == performs a reference equality check, to determine whether the two objects (strings in this case) refer to the same object in the memory. The equals() method...

Read more

Java, java.lang.OutOfMemoryError, systemoutofmemory

Learn how memory leaks manifest themselves in Java and how to avoid a System Out of Memory Exception. Contrary to what many people think, an application written in Java may rather present memory leak problems, resulting in exceptions of type System Out of Memory (java.lang.OutOfMemoryError). Unfortunately, a large number of Java programmers think that Memory leak is a C /...

Read more

Javascript, JSON, KnockoutJS

When using KnockoutJS and the Knockout Mapping Plugin, you may notice extra properties are being serialized with your viewmodels, ex. "__ko_mapping__" or "copiedProperties" objects. JSON Example: { "MyObject": { "Id": "00000000-0000-0000-0000-000000000000", "Type": 1, "Name": "Default MyObject" }, "__ko_mapping__": { "ignore": [], "include": ["_destroy"], "copy": [], "observe": [], "mappedProperties": { "MyObject.Id": true, "MyObject.Type": true, "MyObject.Name": true }, "copiedProperties": {}, "": {}...

Read more