Javascript Functions As Object Constructors

JavaScript is a prototype-based language and doesn’t exactly support actual constructors, but we can sort of simulate constructors with functions. One thing to be weary of in JavaScript is scope management. JavaScript doesn’t support classes; it only has support for functions. So you would be using functions in place of classes as well. Also, scope can be an issue with the ‘this’ keyword because ‘this’ operates different than in object-oriented languages. In JavaScript, the ‘this’ keyword refers to the global scope (window object), whereas in most object-oriented languages ‘this’ refers to the parent object.

Read More

Optimizing Web Assets For Performance

Although most internet users nowadays have very fast connections it is still important to optimize your web application’s assets to ensure optimal performance. This is especially the case for mobile users, which have more constrained resources (data connections and hardware resources). There are a number of things you can do but I’lll highlight just a few that I believe are important to think about.

Read More

What Is Cross Site Scripting Xss And How To Prevent It

Cross-Site Scripting (XSS) isn’t necessarily an actual “cross-site” attack, instead its essentially an insertion of client-side script code placed strategically such that users will execute them. This is possible when output from the website isn’t properly escaped, thereby allowing extra code to be added.

Read More

A Simple Method Of Protecting Against Csrf Attacks

A simple method to protect your web application against CSRF (cross-site request forgery) attacks is to generate and validate a unique token of some sort. This can help to prevent automated CSRF attacks. Basically, you will generate a unique token for the user, place it on the page, and then check the token to verify that its valid. You could implement this in just about any server side language, but here is a PHP example.

Read More

Organizing Javascript Html And Css Code

Many web applications these days contain a ton of HTML, CSS, and JavaScript code. If you don’t have a good plan before starting to code it can get really messy really fast. It’s important to plan and organize your code well. Although we want to separate and organize our code as best as possible, the different types and pieces of code will inevitably need to be linked together in many ways.

Read More

Overview Of The Android Activity Lifecycle

In developing for the Android platform, one of the most important concepts to understand is the Activity Lifecycle. This is important because applications behave much differently on Android when compared to traditional platforms, such as Windows, OS X, or Linux. With Android you have less control over the lifetime of an application.

Read More

How To Fake A Higher Resolution In Windows

If your windows machine is stuck with a low resolution and you wish you had a higher resolution screen you might want to try out this registry hack. This is a way to “fake” a higher resolution in Windows by lowering the DPI. This method is done by modifying values in the registry because by default Windows won’t let you set it this low.

  1. Open the Start Menu and click Run
  2. Type in regedit and press enter
  3. Navigate to: HKEY_CURRENT_CONFIG --> Software --> Fonts
  4. On the right-side from the tree, choose LogPixels and then in the main screen modify it's decimal value to whatever DPI value you'd like, however don't go lower than 85 in most cases (In the Windows Custom DPI settings screen, the default lowest is 96)
  5. Log off and log back on or just restart your machine
Read More

Explanation Of The Net Application Session And View States

Application State The application state’s purpose is primarily to store data for all variables in an ASP.NET application.The class used to store this data is the HttpApplication class, which can be accessed via the ‘Code Behind’ file. The data held within this class is available to all pages in the app and for all entities accessing the app. However, there is a method to lock certain peices of data to only allow certain users access to it.

Read More