Scope in AngularJS

One of the most important things in AngularJS is the scope. As you might be familiar with jQuery and Javascript, you know that this keyword can have different values in the same function called from different points in your application – one very clear example would be a delete row function for an already existing grid. Even though the same button(or whatever UI representation you chose) is the same, will delete only the specific row – unless there are bugs in code. Normally, the context will be set to the row, and the row element has the responsibility to provide a unique identifier for that specific record in your business logic. But AngularJS is a different beast, it uses context to partition your already big to huge application. And as with all Javascript frameworks, you will know if you made some mistakes only upon running code. So, although it seems pretty intuitive, I bet you don’t know exactly when, how and to which elements is applied. Am I right? Read the article and convince yourself.

Root scope

Let’s take a look at a minimal web application created with AngularJS:

<!DOCTYPE html>
<html ng-app="MyApp">
    <head>
        <title>My new App</title>
   <script src="//ajax.googleapis.com/ajax/libs/angularjs/1.2.12/angular.min.js"></script>
    </head>
<body>

</body>
</html>

As you can see, the code is plain HTML5.  The only used library is the latest AngularJS library (at writing time). After the page is loaded and the AngularJS script is executed, it searches for ng-app hook, which denote the root DOM element which will be used by module. What I love about it is that it is not strict to this, you may use data-ng-app (this is the correct HTML5 form for attributes – can be used if your website must be 100% compatible).The extra attribute in the tag represents the declaration of a module which will take care of instantiation and initialization of the rest of your code. Think of it as the main declaration of a jQuery script: $( ).ready(handler) only in simpler and more compact.

There is allowed only one application root per page, the first found during client-side parsing will be used; if one wants to have a page which is composed from multiple elements, bind multiple modules at desired element’s level or create custom directives (similar concept to partials in ASP .Net).

[ideabox]Note: By convention, AngularJS uses the dashed name for HTML attributes (a must if you want your website to be standard compliant) and camelCase for the implementation of the corresponding directives (standard casing in Javascript). So when you search for the implementation of ng-app tag, you actually search for ngApp.[/ideabox]

Controller scope

The controller scope is denoted by ng-controller tag which takes as argument the function of the ng-app module that will provide the JSON object used for databindings and callbacks for the buttons’ clicks, for example. But this will happen only in the scope of the controller’s associated root DOM element (including its children) and the scope of the ng-controller function. While one can go out by using simple jQuery searches of the parents of the corresponding root, it is not advisable. Later on, when I will write about unit testing, this will make much more sense; you will test a contained object and it’s inner interaction, instead of complex interactions between different controllers. Not to mention that you might get confused during maintenance of your project, not knowing exactly who modifies your context from outside. The bigger the application, the higher chances are that you’ll run into trouble!

<div ng-controller="OrderController">
	<h1>Your order</h1>
	<div ng-repeat="item in items">
		<span>{{item.product_name}}</span>
		<span>{{item.price | currency}}</span>
		<button ng-click="remove($index);">Remove</button>
	</div>
</div>

Repeater scope

In all application you’ll find at least one grid, a list representation of items which belong to common parent. For example, a list of items of your order you placed on a website. AngularJS provides a templated repeater which will automatically iterate through the collection of JSON objects that you provide as context. While on the root element of the repeater the context is the entire list, using a foreach paradigm, at individual rows, the corresponding element will be provided as its context. So, instead of having only the index and each time retrieve the item from collection, you have access at the specific item, providing you easier ways to create the HTML snippet in which properties of item will be injected:

So, here we have two context, one general at the list’s root and one specific for each item. This way you can work faster!

 

AngularJS – best practices for the MV* pattern usage

During experimentation with AngularJS and using my previous experience with MV* set of patterns and their implementation I found out some interesting facts that may help you a lot in the future development of a loosely coupled web front-end.

[sdropcap]1.[/sdropcap] The KISS principle still applies – please do your self a favour and don’t try to reinvent the wheel. And, as one of my dear Javascript expert and friend would says, don’t create unicorns. Just play nice from the start and you’ll be able to reuse the code without huge modifications upon AngularJS framework updates. And no, a megagon is still not a circle!

[sdropcap]2.[/sdropcap] Since you don’t have a specific templating engine, your HTML is your view. Don’t put more Javascript logic there, try to use for animations and effects the CSS 3 Transitions – they are quite powerful! Use AngularJS’s Directives – they will help you separate the reusable parts of your app and your application will be DRY and easy to mantain. Who doesn’t hate the Friday afternoon bugs which seem to take an eternity to fix? Continue reading AngularJS – best practices for the MV* pattern usage

AngularJS – jump start

Is AngularJS yet another library or it thoroughly has the capability to change the way we develop applications? What’s the difference between AngularJS and other libraries like the mature world wide known jQuery and its plethora of plugins, or Kendo UI /ExtJS? What brings it more in terms of data binding than KnockoutJS? This are the questions I will try to answer in order to decide if I would like to add AngularJS library to my skillset.

Recently I started digging into what I believe to be the future of client-side web design as responsive interface: AngularJS, Javascript library supported and developed by Google. During the initial research, seems that there are quite a few characteristics that sets it apart from other frameworks:

[fdropcap bg=”#333333″ color=”#ffffff”]F[/fdropcap]irst and foremost, it is supported by Google. I have great respect for the company and its products. Not to mention that they ship with extremely care and virtually no bugs, meaning that my task in fixing errors and unexpected behaviors would be easier.

[fdropcap bg=”#333333″ color=”#ffffff”]S[/fdropcap]econdly, provides a feature, called AngularJS Directives, which help you extend the HTML vocabulary, creating entities that can be later-on intercepted by javascript and act upon. For example, one can create his on “customform” tag and replace it during runtime with an actual customized form to be displayed to the user, helping the composition of the view pretty much like ASP .Net partials. The views are HTML, so no more complicated Javascript structures, sometimes including conditional visibility, describing the page like in ExtJS case. This enables clean development and easier support, so no more special templating language to learn! In Kendo UI’s grid, because of its intended flexibility, can be sometimes tricky and prone to errors to write a conditional and complex template at global grid level; not to mention that you can create also one for row, for footer etc.

[fdropcap bg=”#333333″ color=”#ffffff”]T[/fdropcap]he data-binding is natural: any controller and its properties are by default observable and the binding to HTML is by default two-way. Why would this be important? For example in KnockoutJS library one must always be sure that EACH subsequent property or method is created as observable, otherwise it won’t play nice and your beautifully designed HTML5/CSS3 view won’t show what you intend to. Or in Kendo UI, where you need only to specify the initial object as being observable, there are cases in which the “observable” wrapping is lost (during conversion to and from a JSON object). But with AngularJS, all objects are bindable, no mater if they are JSON-cloned.

[fdropcap bg=”#333333″ color=”#ffffff”]H[/fdropcap]uge DRY feeling – no more need for all the duplicated jQuery’s DOM queries in the case of updating rows in a grid – in which you find the element by class, get the desired attribute or property, compare it with the new value and replace it if necessary -in AngularJS’s case you declare the scope (in case of small apps is equal with the controller),  bind desired property in  HTML and run it! If the model gets updated, the binding automatically gets updated and new data is shown without you worrying about it! And the beauty of it is that with the same amount of code (hahaha) you get also the model updated from the HTML view if the property is bounded to a textbox’s value. 

[fdropcap bg=”#333333″ color=”#ffffff”]B[/fdropcap]ecause the separation in Model View Controller, the controller can be easily tested in a controlled environment to find out if it works as intended. This also promotes the definition of a single concern in code, meaning that you’ll test just one feature and not a set of tight-coupled behaviors.

 

 

jQuery – Also experienced devs can make newbie mistakes

Today is a lazy Sunday, so I will be quick. It happened to me. Newbie or not, for sure Saturday has its own way to throw it back to you. jQuery. Me lazy, zipping my coffee. Bad combination.

The code:

onLoad="$('#item_id').trigger('click');"

Nothing works. Why? My mind was lacking more coffee. Go and make some more.

Got coffee, inhaled it. Still no clue. Should work, right? No, it doesn’t! Leave aside IE, try Firefox! Suddenly, it works!

The solution is to move the code AFTER the jQuery was loaded, in a specific file or a script tag on the same page! Don’t forget, AFTER jQuery library was loaded! Otherwise, $ selector will not be available.

$(function() {
       $('#item_id').trigger('click');
});

Conclusion: there’s no life before coffee!

Conclusion 2: better more coffee than less!

 

jQuery – Syncronize two dropdown lists

One of the biggest problems in web UI is to synchronize page elements one upon each other, but by far the hardest is when dealing with multiple dropdowns. A good, clean User Interface is the key to your customer’s heart! This can be achieved in several ways, such as:

  • on the change of the first dropdown, a new page request is issued to the server, with the selected item as current item and the server will figure out which element(s) need to be selected in the subsequent synchronized dropdowns – old style, not so used anymore because it takes time and bandwidth to send and receive the complete page;
  • with AJAX – on the change of the first dropdown, a partial page request is issued to the server, with the selected item as current item; the server will figure out which element(s) need to be selected in the subsequent synchronized dropdowns; it returns just the relevant part of the page ( not a complete one like before); just this new part of the page will be overridden in the current page, creating the user the impression of “real time” action.
  • with jQuery, moving the logic of synchronization to the client side – the advantage is no bandwidth/time consumption, but a huge disadvantage is that the client (the browser) might have Javascript disabled. This concern, although low, might make your page not to work as expected.

jQuery - write less, do more!Today’s choice – jQuery

We’ll explore today the last option, using jQuery. For this we will consider two dropdowns, each one with 3 items. Our target will be simple today, we’ll change the second dropdown to reflect the first one’s selection. Let’s consider that our page contains the following fragment of code with these two dropdown boxes, first one containing the countries and the second their capital. Continue reading jQuery – Syncronize two dropdown lists

Breiny – Master thesis application

Yesterday I did the last step in my Media Informatics master endeavor: I presented my master thesis. After quite a few months of development on the Microsoft Surface, the application that resulted was a good start for a (possible) commercial product.

We started from the idea that a multitouch table device would offer more space, possibilities and opportunities to improve the collaboration and communication in the brainstorming phase of any project. This evolved very much during the development and conceiving the master thesis. It became a tool which not only supported and enhanced collaboration, but also, to name a few:

  • offered clues gathered from Twitter and Flickr images,
  • free drawing and sketching,
  • text input using the virtual keyboard,
  • audio recognition features,
  • save / load of session,
  • integration with a CRM, serving as repository;
  • user-friendly navigation in sessions using also the CRM repository interface.
Come back later or subscribe by e-mail/RSS, there might be other announcements on the availability to try / purchase this application.

 

Master thesis – Conclusions

This article presents an overview of my Master thesis. It summarizes the work by presenting the contributions to the research field and also the future work based on the already created prototype. The Breiny application is meant to support the Brainstorming process by using computers in a modern way – Natural User Interface. After creating the prototype, a User Evaluation was used to prove or disprove the theoretical hypotheses.

In the Related work is presented the relevant work on which my master thesis relyies on and the systems that are the basis for comparison with the developed prototype. It considers several already available collaboration and brainstorming systems and compares their features with the proposed Framework for analysis. As a conclusion of the chapter, none of the considered systems fulfill all the requirements from the proposed Framework. Continue reading Master thesis – Conclusions

ASP .Net MVC – patterns of the Microsoft framework

Read more on RaduPoenaru.com about ASP .Net MVC

These days I decided to dig a little more into ASP .Net MVC. At a first glance, resembles very much with Ruby on Rails – although same idea, I find it more close to my stile. Maybe I am biased towards it because I am already working on Microsoft stack for the last 9 years. The framework is created by Microsoft employees and it is freely available for download, including sources, on Codeplex. That says pretty much about the open source initiative inside Microsoft. Bravo!

Another thing that I liked a lot is the fact that in order to start development, using a freshly installed machine or one without any Microsoft development tools, one needs only to download and install Web Platform Installer, which will continue with the tools download and all the required settings. The developer can grab a cold beer and check his mail or start learning about the Microsoft’s MVC implementation.

Yes, it is the Microsoft supported implementation of a well known pattern by several of its employees, started and continued as an opensource initiative.

The original MVC pattern

The pattern was created at the end of seventies by Trygve Reenskaug, who was part of the research team at Xerox PARC, as part of the Smalltalk system. The pattern is quite simple and separates the key components of a system into 3 distinctive areas (quoted from Wikipedia):

In addition to dividing the application into three kinds of components, the MVC design defines the interactions between them.[8]

  • controller can send commands to its associated view to change the view’s presentation of the model (e.g., by scrolling through a document). It can also send commands to the model to update the model’s state (e.g., editing a document).
  • model notifies its associated views and controllers when there has been a change in its state. This notification allows the views to produce updated output, and the controllers to change the available set of commands. A passive implementation of MVC omits these notifications, because the application does not require them or the software platform does not support them.[9]
  • view requests from the model the information that it needs to generate an output representation.

The Microsoft version – ASP .Net MVC

Among all flavours of MVC and its brothers (Model View ViewModel, Model–view–adapter, Model–view–presenter, Observer pattern, Presentation–abstraction–control, Hierarchical model–view–controller), the Microsoft implementation of the pattern in .Net MVC framework is based on Front Controller pattern and Model 2 patterns [“Programming Microsoft ASP.NET MVC” by Dino Esposito]. Front controller pattern involves a centralized dispatcher that handles all incoming requests towards a component in the pipeline to service that request. Since we’re in patterns area, closely related is the Page Controller. As opposed to Front Controller, the Page controller (implemented in WebForms) manages the incoming requests on URL basis = the reuse of the code is quite limited. Thus, you have to create and maintain several individual pages and their underlying logic as opposed to focus on a central controller and several views which will be used and reused as necessary.

Difference between Page controller and Front controller patterns
See original image and article on http://www.developerfusion.com/article/9450/controller-patterns-for-aspnet/

Overloading methods in ASP .Net MVC

Read more on RaduPoenaru.com about ASP .Net MVC

Today is another ASP .Net MVC day, and as always, I encountered a challenge. Being so used with overloading methods from OOP, I asked myself what if I would do the same with the Controller’s. The sad answer is no, you can’t have two methods with the same name and SAME verb to which they will respond. The rational is simple – routing engine tries to map the request for a controller, and then will try to get the action and the verb. Since there are two methods with the same verb, you run into trouble! Let’s examine a little bit the problem and see several workarounds.

The problem

The compiler will show “Type YourController already defines a member called YourAction with the same parameter types” in the following example:

[HttpPost]
public ActionResult Show()
{
  // implementation
}

[HttpPost]
public ActionResult ListOrders( string userName )
{
  // implementation
}

Solutions – ASP .Net MVC 3

1. Just change for a method the request verb that will map it to a certain route – be careful to change also the calls to this action!

[HttpGet]
public ActionResult ListOrders()
{
   // implementation
}

2. Another alternative would be to keep the name of the method, but decorate it with ActionName. This will map the method (valid both as name and signature for .Net, but invalid for .Net MVC framework) with another name. But be careful at the route, which will not map on the name of method, but rather on the name from the ActionName parameter:

[HttpGet]
public ActionResult ListOrders()
{
   //implementation
}

[HttpGet]
[ActionName("ListOrdersForCustomer")]
public ActionResult ListOrders( string userName )
{
   // implementation
}

3. Create a single action method which will be responsible with both use cases, switching between them on the incoming Request type:

[HttpGet]
public ActionResult ListOrders( string userName = null)
{
   // OPTION 1 - handling by request type
   if (Request.HttpMethod.ToUpperInvariant() == "GET") {
    // do the get handling
   }
   else if (Request.HttpMethod.ToUpperInvariant() == "POST") {
     // do the post handling  
   }

   // OPTION 2 - handling by optional parameter
   if ( !String.IsNullOrEmpty( userName ) ) {
    // do the parameter handling
   }
   else {
     // alternate handling  
   }
}

More about how an method becomes an action you can read in Phil Haack’s blog, one of the main contributors of the ASP .Net MVC frameworks.

Master thesis – User evaluation

Be careful when copying information from this article! The paper is already published and you will be charged with plagiarism!

The Users for the first session were 5 males and 1 female, with age ranging from 27 to 49. For the second, there were 4 males with age ranging from 26 to 52, with significant Brainstorming sessions experience, using Mind-mapping software, whiteboard computer based systems. The room setup consisted from a large space around Surface, with chairs surrounding it. All users were in the Contributor role and they had the opportunity to switch to Session Master any time. The application was started, with no Brainstorming Ideas on the tabletop.

The Evaluation session started with the Prototype presentation. This was targeted only on the User Interfaces, explaining how and which actions can be performed with each area of interest (UserControls and Main SurfaceWindow from Implementation Chapter). The users were encouraged to experience the interface and ask questions during the presentation, in order to understand better the interaction with the prototype.

Following the presentation phase was designed as a game, in order to exercise the prototype’s interface and evaluate the system and its features. The game was built around a imaginary, newly created, travel agency. The participants should create the company’s portfolio in a Brainstorming session, composed from the four phases (scenarios) presented in Typical use cases. They were disclosed one by one, in order to not affect the brainstorming process.


Continue reading Master thesis – User evaluation

  Globals Profiler (2,505.70 ms) SQL (47 queries in 143.29 ms) Errors (26, 1!) Toggle Close
$_GET = array (
  'lang' => 'en',
);

$_POST = array (
);

$_COOKIE = array (
);

$_SESSION = array (
);

$_SERVER = array (
  'SERVER_SOFTWARE' => 'Microsoft-IIS/8.0',
  'REQUEST_URI' => '/?lang=en',
  '_FCGI_X_PIPE_' => '\\\\.\\pipe\\IISFCGI-38018100-0aa2-454b-b9c3-7ee9fc496394',
  'ACTIVEPERL_CONFIG_DISABLE' => '1',
  'ALLUSERSPROFILE' => 'C:\\ProgramData',
  'APPDATA' => 'C:\\Windows\\system32\\config\\systemprofile\\AppData\\Roaming',
  'APP_POOL_CONFIG' => 'C:\\inetpub\\temp\\apppools\\barbarossa.com(domain)(2.0)(pool)\\barbarossa.com(domain)(2.0)(pool).config',
  'APP_POOL_ID' => 'barbarossa.com(domain)(2.0)(pool)',
  'CommonProgramFiles' => 'C:\\Program Files (x86)\\Common Files',
  'CommonProgramFiles(x86)' => 'C:\\Program Files (x86)\\Common Files',
  'CommonProgramW6432' => 'C:\\Program Files\\Common Files',
  'COMPUTERNAME' => 'P3NWVPWEB127',
  'ComSpec' => 'C:\\Windows\\system32\\cmd.exe',
  'FP_NO_HOST_CHECK' => 'NO',
  'itron_dir' => 'C:\\Program Files (x86)\\Installatron',
  'LOCALAPPDATA' => 'C:\\Windows\\system32\\config\\systemprofile\\AppData\\Local',
  'MAILENABLE_PATH' => 'C:\\PROGRA~2\\PARALL~1\\Plesk\\MAILSE~1\\MAILEN~1',
  'NUMBER_OF_PROCESSORS' => '24',
  'OS' => 'Windows_NT',
  'Path' => 'C:\\Program Files (x86)\\Parallels\\Plesk\\Mail Servers\\Mail Enable\\BIN;C:\\PROGRA~2\\PARALL~1\\Plesk\\ADDITI~1\\Perl\\site\\bin;C:\\PROGRA~2\\PARALL~1\\Plesk\\ADDITI~1\\Perl\\bin;C:\\Program Files (x86)\\Parallels\\Plesk\\Additional\\Python\\Scripts;C:\\Program Files (x86)\\Parallels\\Plesk\\Additional\\Python\\;C:\\Windows\\system32;C:\\Windows;C:\\Windows\\System32\\Wbem;C:\\Windows\\System32\\WindowsPowerShell\\v1.0\\;C:\\Program Files\\NetApp\\SnapDrive\\;C:\\Program Files (x86)\\Parallels\\Plesk\\Mail Servers\\Mail Enable\\BIN64;',
  'PATHEXT' => '.COM;.EXE;.BAT;.CMD;.VBS;.VBE;.JS;.JSE;.WSF;.WSH;.MSC;.py;.pyw',
  'plesk_bin' => 'C:\\Program Files (x86)\\Parallels\\Plesk\\admin\\bin',
  'plesk_cli' => 'C:\\Program Files (x86)\\Parallels\\Plesk\\bin',
  'plesk_dir' => 'C:\\Program Files (x86)\\Parallels\\Plesk\\',
  'plesk_vhosts' => 'G:\\PleskVhosts\\',
  'PROCESSOR_ARCHITECTURE' => 'x86',
  'PROCESSOR_ARCHITEW6432' => 'AMD64',
  'PROCESSOR_IDENTIFIER' => 'Intel64 Family 6 Model 45 Stepping 7, GenuineIntel',
  'PROCESSOR_LEVEL' => '6',
  'PROCESSOR_REVISION' => '2d07',
  'ProgramData' => 'C:\\ProgramData',
  'ProgramFiles' => 'C:\\Program Files (x86)',
  'ProgramFiles(x86)' => 'C:\\Program Files (x86)',
  'ProgramW6432' => 'C:\\Program Files',
  'PSModulePath' => 'C:\\Windows\\system32\\WindowsPowerShell\\v1.0\\Modules\\;C:\\automation\\modules',
  'PUBLIC' => 'C:\\Users\\Public',
  'SystemDrive' => 'C:',
  'SystemRoot' => 'C:\\Windows',
  'TEMP' => 'C:\\Windows\\TEMP',
  'TMP' => 'C:\\Windows\\TEMP',
  'UATDATA' => 'C:\\Windows\\CCM\\UATData\\D9F8C395-CAB8-491d-B8AC-179A1FE1BE77',
  'USERDOMAIN' => 'PHX3',
  'USERNAME' => 'P3NWVPWEB127$',
  'USERPROFILE' => 'C:\\Windows\\system32\\config\\systemprofile',
  'windir' => 'C:\\Windows',
  'ORIG_PATH_INFO' => '/index.php',
  'URL' => '/index.php',
  'SERVER_PROTOCOL' => 'HTTP/1.0',
  'SERVER_PORT_SECURE' => '0',
  'SERVER_PORT' => '80',
  'SERVER_NAME' => 'radupoenaru.com',
  'SCRIPT_NAME' => '/index.php',
  'SCRIPT_FILENAME' => 'G:\\PleskVhosts\\barbarossa.com\\httpdocs\\rp\\index.php',
  'REQUEST_METHOD' => 'GET',
  'REMOTE_USER' => '',
  'REMOTE_PORT' => '49234',
  'REMOTE_HOST' => '54.89.36.189',
  'REMOTE_ADDR' => '54.89.36.189',
  'QUERY_STRING' => 'lang=en',
  'PATH_TRANSLATED' => 'G:\\PleskVhosts\\barbarossa.com\\httpdocs\\rp\\index.php',
  'LOGON_USER' => '',
  'LOCAL_ADDR' => '50.62.160.157',
  'INSTANCE_META_PATH' => '/LM/W3SVC/1449',
  'INSTANCE_NAME' => 'RADUPOENARU.COM',
  'INSTANCE_ID' => '1449',
  'HTTPS_SERVER_SUBJECT' => '',
  'HTTPS_SERVER_ISSUER' => '',
  'HTTPS_SECRETKEYSIZE' => '',
  'HTTPS_KEYSIZE' => '',
  'HTTPS' => 'off',
  'GATEWAY_INTERFACE' => 'CGI/1.1',
  'DOCUMENT_ROOT' => 'G:\\PleskVhosts\\barbarossa.com\\httpdocs\\rp',
  'CONTENT_TYPE' => '',
  'CONTENT_LENGTH' => '0',
  'CERT_SUBJECT' => '',
  'CERT_SERIALNUMBER' => '',
  'CERT_ISSUER' => '',
  'CERT_FLAGS' => '',
  'CERT_COOKIE' => '',
  'AUTH_USER' => '',
  'AUTH_PASSWORD' => '',
  'AUTH_TYPE' => '',
  'APPL_PHYSICAL_PATH' => 'G:\\PleskVhosts\\barbarossa.com\\httpdocs\\rp\\',
  'APPL_MD_PATH' => '/LM/W3SVC/1449/ROOT',
  'IIS_UrlRewriteModule' => '7.1.0761.0',
  'WEBSOCKET_VERSION' => '13',
  'HTTP_USER_AGENT' => 'CCBot/2.0 (http://commoncrawl.org/faq/)',
  'HTTP_HOST' => 'radupoenaru.com',
  'HTTP_ACCEPT_LANGUAGE' => 'en-us,en-gb,en;q=0.7,*;q=0.3',
  'HTTP_ACCEPT_ENCODING' => 'x-gzip, gzip, deflate',
  'HTTP_ACCEPT' => 'text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8',
  'HTTP_CONTENT_LENGTH' => '0',
  'FCGI_ROLE' => 'RESPONDER',
  'PHP_SELF' => '/index.php',
  'REQUEST_TIME_FLOAT' => 1427677301.1164179,
  'REQUEST_TIME' => 1427677301,
);

Profiler Initiaded 0.0000 ms 3564 kB
Profiler Noise 0.0379 ms 3565 kB
Profiler Stopped 2,505.7020 ms 6660 kB
3.5431 [ms]
SELECT option_name, option_value FROM wp_options WHERE autoload = 'yes';
0.7601 [ms]
SELECT option_value FROM wp_options WHERE option_name = 'uninstall_plugins' LIMIT 1;
0.7880 [ms]
SELECT option_value FROM wp_options WHERE option_name = 'wordpress_api_key' LIMIT 1;
0.8638 [ms]
SELECT option_value FROM wp_options WHERE option_name = 'revision-control' LIMIT 1;
0.6988 [ms]
SELECT option_value FROM wp_options WHERE option_name = 'shareaholic_has_accepted_tos' LIMIT 1;
0.5929 [ms]
SELECT option_value FROM wp_options WHERE option_name = 'widget_pages' LIMIT 1;
0.5748 [ms]
SELECT option_value FROM wp_options WHERE option_name = 'widget_tag_cloud' LIMIT 1;
0.5820 [ms]
SELECT option_value FROM wp_options WHERE option_name = 'widget_nav_menu' LIMIT 1;
0.5591 [ms]
SELECT option_value FROM wp_options WHERE option_name = 'widget_akismet_widget' LIMIT 1;
0.7370 [ms]
SELECT option_value FROM wp_options WHERE option_name = 'widget_easy-nivo-slider-widget' LIMIT 1;
0.5071 [ms]
SELECT option_value FROM wp_options WHERE option_name = 'widget_easy_nivo_slider' LIMIT 1;
0.4952 [ms]
SELECT option_value FROM wp_options WHERE option_name = 'widget_nivo-slider-for-single-post-widget' LIMIT 1;
0.5641 [ms]
SELECT option_value FROM wp_options WHERE option_name = 'widget_nivo_slider_for_single_post' LIMIT 1;
0.5450 [ms]
SELECT option_value FROM wp_options WHERE option_name = 'widget_polylang' LIMIT 1;
0.5281 [ms]
SELECT option_value FROM wp_options WHERE option_name = 'widget_calendar' LIMIT 1;
0.5569 [ms]
SELECT option_value FROM wp_options WHERE option_name = 'widget_widget_twentyfourteen_ephemera' LIMIT 1;
0.7601 [ms]
SELECT option_value FROM wp_options WHERE option_name = 'akismet_comment_nonce' LIMIT 1;
94.5690 [ms]
SELECT option_value FROM wp_options WHERE option_name = 'liveblogging_enable_twitter' LIMIT 1;
0.9420 [ms]
SELECT option_value FROM wp_options WHERE option_name = 'featured-content' LIMIT 1;
0.8140 [ms]
SELECT option_value FROM wp_options WHERE option_name = 'rewrite_rules' LIMIT 1;
1.3361 [ms]
SELECT t.*, tt.* FROM wp_terms AS t INNER JOIN wp_term_taxonomy AS tt ON t.term_id = tt.term_id WHERE tt.taxonomy = 'language' AND t.slug = 'en' LIMIT
1;
1.1530 [ms]
SELECT * FROM wp_posts WHERE ID = 3016 LIMIT 1;
1.2181 [ms]

					SELECT wp_term_taxonomy.term_taxonomy_id
					FROM wp_term_taxonomy
					INNER JOIN wp_terms USING (term_id)
					WHERE taxonomy = 'language'
					AND wp_terms.slug IN ('en')
				;
2.6579 [ms]
SELECT SQL_CALC_FOUND_ROWS  wp_posts.ID FROM wp_posts  INNER JOIN wp_term_relationships ON (wp_posts.ID = wp_term_relationships.object_id) WHERE 1=1 
AND ( 
  wp_term_relationships.term_taxonomy_id IN (368)
) AND wp_posts.post_type = 'post' AND (wp_posts.post_status = 'publish') GROUP BY wp_posts.ID ORDER BY wp_posts.post_date DESC LIMIT 0, 10;
0.6819 [ms]
SELECT FOUND_ROWS();
3.1450 [ms]
SELECT wp_posts.* FROM wp_posts WHERE ID IN (3163,3148,3131,2421,2407,1919,2149,2389,2356,2057);
1.1361 [ms]
SELECT t.*, tt.*, tr.object_id FROM wp_terms AS t INNER JOIN wp_term_taxonomy AS tt ON tt.term_id = t.term_id INNER JOIN wp_term_relationships AS tr
ON tr.term_taxonomy_id = tt.term_taxonomy_id WHERE tt.taxonomy IN ('category', 'post_tag', 'post_format', 'language', 'post_translations') AND
tr.object_id IN (1919, 2057, 2149, 2356, 2389, 2407, 2421, 3131, 3148, 3163) ORDER BY t.name ASC;
0.7501 [ms]
SELECT t.*, tt.*, tr.object_id FROM wp_terms AS t INNER JOIN wp_term_taxonomy AS tt ON tt.term_id = t.term_id INNER JOIN wp_term_relationships AS tr
ON tr.term_taxonomy_id = tt.term_taxonomy_id WHERE tt.taxonomy IN ('term_language', 'term_translations') AND tr.object_id IN (3, 13, 371, 297, 284, 8,
303, 372, 298, 363, 105, 198, 364, 373, 267, 292, 113, 265, 290, 291, 374, 253, 84, 83, 116, 85, 277) ORDER BY t.name ASC;
0.9181 [ms]
SELECT post_id, meta_key, meta_value FROM wp_postmeta WHERE post_id IN (1919,2057,2149,2356,2389,2407,2421,3131,3148,3163) ORDER BY meta_id ASC;
0.6890 [ms]
SELECT autoload FROM wp_options WHERE option_name = 'shareaholic_deprecations';
0.6380 [ms]
SELECT option_value FROM wp_options WHERE option_name = 'SHRSBvNUM' LIMIT 1;
2.0192 [ms]
SELECT * FROM wp_posts  WHERE (post_type = 'page' AND post_status = 'publish')     ORDER BY menu_order,wp_posts.post_title ASC;
1.1580 [ms]

			SELECT object_id FROM wp_term_relationships WHERE term_taxonomy_id = 368;
0.7038 [ms]
SELECT t.*, tt.*, tr.object_id FROM wp_terms AS t INNER JOIN wp_term_taxonomy AS tt ON tt.term_id = t.term_id INNER JOIN wp_term_relationships AS tr
ON tr.term_taxonomy_id = tt.term_taxonomy_id WHERE tt.taxonomy IN ('language', 'post_translations') AND tr.object_id IN (8, 3011, 708, 3104, 3043, 59,
38) ORDER BY t.name ASC;
0.9449 [ms]
SELECT * FROM wp_users WHERE ID = '1';
0.7150 [ms]
SELECT user_id, meta_key, meta_value FROM wp_usermeta WHERE user_id IN (1) ORDER BY umeta_id ASC;
0.8399 [ms]
SELECT wp_posts.* FROM wp_posts WHERE ID IN (3133,3133,3133,2408,2408,2377,2377);
0.8478 [ms]
SELECT post_id, meta_key, meta_value FROM wp_postmeta WHERE post_id IN (2377,2408,3133) ORDER BY meta_id ASC;
1.0090 [ms]
SELECT   wp_posts.* FROM wp_posts  INNER JOIN wp_term_relationships ON (wp_posts.ID = wp_term_relationships.object_id) WHERE 1=1  AND
wp_posts.post_parent = 2057  AND ( 
  wp_term_relationships.term_taxonomy_id IN (368)
) AND (wp_posts.post_mime_type LIKE 'image/%')  AND wp_posts.post_type = 'attachment' AND ((wp_posts.post_status <> 'trash' AND wp_posts.post_status
<> 'auto-draft')) GROUP BY wp_posts.ID ORDER BY wp_posts.menu_order ASC ;
0.9050 [ms]
SELECT t.*, tt.*, tr.object_id FROM wp_terms AS t INNER JOIN wp_term_taxonomy AS tt ON tt.term_id = t.term_id INNER JOIN wp_term_relationships AS tr
ON tr.term_taxonomy_id = tt.term_taxonomy_id WHERE tt.taxonomy IN ('language', 'post_translations') AND tr.object_id IN (2060, 2061, 2062, 2063, 2064,
2065, 2066, 2067, 2068, 2069, 2070, 2071, 2072, 2073, 2074, 2075, 2076, 2077, 2078, 2079, 2080, 2081, 2082, 2083) ORDER BY t.name ASC;
2.6510 [ms]
SELECT post_id, meta_key, meta_value FROM wp_postmeta WHERE post_id IN
(2060,2061,2062,2063,2064,2065,2066,2067,2068,2069,2070,2071,2072,2073,2074,2075,2076,2077,2078,2079,2080,2081,2082,2083) ORDER BY meta_id ASC;
0.7741 [ms]
SELECT   wp_posts.ID FROM wp_posts  INNER JOIN wp_term_relationships ON (wp_posts.ID = wp_term_relationships.object_id) WHERE 1=1  AND ( 
  wp_term_relationships.term_taxonomy_id IN (368)
) AND wp_posts.post_type = 'post' AND ((wp_posts.post_status = 'publish')) GROUP BY wp_posts.ID ORDER BY wp_posts.post_date DESC LIMIT 0, 5;
2.3971 [ms]
SELECT * FROM wp_comments JOIN wp_posts ON wp_posts.ID = wp_comments.comment_post_ID INNER JOIN wp_term_relationships AS pll_tr ON pll_tr.object_id =
ID WHERE ( comment_approved = '1' ) AND  wp_posts.post_status = 'publish' AND pll_tr.term_taxonomy_id = 368  ORDER BY comment_date_gmt DESC LIMIT 5;
1.7149 [ms]
SELECT wp_posts.* FROM wp_posts WHERE ID IN (2019,1170,2265,1922);
0.7548 [ms]
SELECT YEAR(post_date) AS `year`, MONTH(post_date) AS `month`, count(ID) as posts FROM wp_posts  INNER JOIN wp_term_relationships AS pll_tr ON
pll_tr.object_id = ID WHERE post_type = 'post' AND post_status = 'publish' AND pll_tr.term_taxonomy_id = 368 GROUP BY YEAR(post_date),
MONTH(post_date) ORDER BY post_date DESC ;
0.7730 [ms]
SELECT t.*, tt.* FROM wp_terms AS t INNER JOIN wp_term_taxonomy AS tt ON t.term_id = tt.term_id INNER JOIN wp_term_relationships AS pll_tr ON
pll_tr.object_id = t.term_id WHERE tt.taxonomy IN ('category') AND tt.count > 0 AND pll_tr.term_taxonomy_id = 369 ORDER BY t.name ASC ;
0.7811 [ms]
SELECT t.*, tt.*, tr.object_id FROM wp_terms AS t INNER JOIN wp_term_taxonomy AS tt ON tt.term_id = t.term_id INNER JOIN wp_term_relationships AS tr
ON tr.term_taxonomy_id = tt.term_taxonomy_id WHERE tt.taxonomy IN ('term_language', 'term_translations') AND tr.object_id IN (203, 215, 217, 221, 222,
233, 224, 114, 80, 151, 159, 228, 231) ORDER BY t.name ASC;
Notice Use of undefined constant EASY_NIVO_SLIDER_VERSION - assumed 'EASY_NIVO_SLIDER_VERSION' on line 53 in file G:\PleskVhosts\barbarossa.com\httpdocs\rp\wp-content\plugins\easy-nivo-slider-2.0\easy-nivo-slider.php
Notice Use of undefined constant EASY_NIVO_SLIDER_NIVO_VERSION - assumed 'EASY_NIVO_SLIDER_NIVO_VERSION' on line 55 in file G:\PleskVhosts\barbarossa.com\httpdocs\rp\wp-content\plugins\easy-nivo-slider-2.0\easy-nivo-slider.php
Notice Use of undefined constant EASY_NIVO_SLIDER_CUSTOM_IMAGE_SIZES_VERSION - assumed 'EASY_NIVO_SLIDER_CUSTOM_IMAGE_SIZES_VERSION' on line 57 in file G:\PleskVhosts\barbarossa.com\httpdocs\rp\wp-content\plugins\easy-nivo-slider-2.0\easy-nivo-slider.php
Notice Use of undefined constant EASY_NIVO_SLIDER_NEXTGEN_VERSION - assumed 'EASY_NIVO_SLIDER_NEXTGEN_VERSION' on line 59 in file G:\PleskVhosts\barbarossa.com\httpdocs\rp\wp-content\plugins\easy-nivo-slider-2.0\easy-nivo-slider.php
Notice Use of undefined constant EASY_NIVO_SLIDER_ERROR_NO_IMAGES - assumed 'EASY_NIVO_SLIDER_ERROR_NO_IMAGES' on line 63 in file G:\PleskVhosts\barbarossa.com\httpdocs\rp\wp-content\plugins\easy-nivo-slider-2.0\easy-nivo-slider.php
Notice Undefined offset: 60 on line 315 in file G:\PleskVhosts\barbarossa.com\httpdocs\rp\wp-content\plugins\easy-nivo-slider-2.0\easy-nivo-slider.php
Notice Undefined index: default_lang on line 233 in file G:\PleskVhosts\barbarossa.com\httpdocs\rp\wp-content\plugins\polylang\frontend\frontend-links.php
Warning (68) mkdir(): Permission denied on line 1508 in file G:\PleskVhosts\barbarossa.com\httpdocs\rp\wp-includes\functions.php
Notice Undefined index: category on line 523 in file G:\PleskVhosts\barbarossa.com\httpdocs\rp\wp-content\plugins\easy-nivo-slider-2.0\easy-nivo-slider.php
Notice Undefined index: orderby on line 83 in file G:\PleskVhosts\barbarossa.com\httpdocs\rp\wp-content\plugins\easy-nivo-slider-2.0\misc\list-images-single-post.php
Notice Undefined index: order on line 85 in file G:\PleskVhosts\barbarossa.com\httpdocs\rp\wp-content\plugins\easy-nivo-slider-2.0\misc\list-images-single-post.php
Notice Undefined index: first_css on line 49 in file G:\PleskVhosts\barbarossa.com\httpdocs\rp\wp-content\plugins\easy-nivo-slider-2.0\misc\functions.php
Notice Undefined index: second_css on line 67 in file G:\PleskVhosts\barbarossa.com\httpdocs\rp\wp-content\plugins\easy-nivo-slider-2.0\misc\functions.php
Notice Undefined index: widget_css on line 85 in file G:\PleskVhosts\barbarossa.com\httpdocs\rp\wp-content\plugins\easy-nivo-slider-2.0\misc\functions.php
Notice (3) Undefined index: size on line 227 in file G:\PleskVhosts\barbarossa.com\httpdocs\rp\wp-content\plugins\easy-nivo-slider-2.0\misc\functions.php
Notice Undefined index: effect on line 251 in file G:\PleskVhosts\barbarossa.com\httpdocs\rp\wp-content\plugins\easy-nivo-slider-2.0\misc\functions.php
Notice Undefined index: speed on line 253 in file G:\PleskVhosts\barbarossa.com\httpdocs\rp\wp-content\plugins\easy-nivo-slider-2.0\misc\functions.php
Notice Undefined index: pause on line 255 in file G:\PleskVhosts\barbarossa.com\httpdocs\rp\wp-content\plugins\easy-nivo-slider-2.0\misc\functions.php
Notice Undefined index: pause_on_hover on line 257 in file G:\PleskVhosts\barbarossa.com\httpdocs\rp\wp-content\plugins\easy-nivo-slider-2.0\misc\functions.php
Notice Undefined index: arrows on line 259 in file G:\PleskVhosts\barbarossa.com\httpdocs\rp\wp-content\plugins\easy-nivo-slider-2.0\misc\functions.php
Notice Undefined index: hide_arrows on line 261 in file G:\PleskVhosts\barbarossa.com\httpdocs\rp\wp-content\plugins\easy-nivo-slider-2.0\misc\functions.php
Notice Undefined index: controls_buttons on line 263 in file G:\PleskVhosts\barbarossa.com\httpdocs\rp\wp-content\plugins\easy-nivo-slider-2.0\misc\functions.php
Notice Undefined index: controls_numbers on line 265 in file G:\PleskVhosts\barbarossa.com\httpdocs\rp\wp-content\plugins\easy-nivo-slider-2.0\misc\functions.php
Notice Undefined index: controls_thumbs on line 267 in file G:\PleskVhosts\barbarossa.com\httpdocs\rp\wp-content\plugins\easy-nivo-slider-2.0\misc\functions.php
Notice Undefined index: controls_offset on line 269 in file G:\PleskVhosts\barbarossa.com\httpdocs\rp\wp-content\plugins\easy-nivo-slider-2.0\misc\functions.php
Notice Undefined index: number on line 303 in file G:\PleskVhosts\barbarossa.com\httpdocs\rp\wp-content\plugins\easy-nivo-slider-2.0\misc\functions.php