Suppose you have a collection called tweets whose documents contain information about thecreated_at time of the tweet and the user’s followers_count at the time they issued the tweet. What can you infer from the following explain output?
In this problem, you will be using an old weather dataset. Download weather_data.csv from the Download Handout link. This is a comma separated value file that you can import into MongoDB as follows:
mongoimport –type csv –headerline weather_data.csv -d weather -c data
You can verify that you’ve imported the data correctly by running the following commands in the mongo shell:
> use weather
> db.data.find().count()
> 2963
Reading clockwise from true north, the wind direction is measured by degrees around the compass up to 360 degrees.
90 is East
180 is South
270 is West
360 is North
Your assignment is to figure out the “State” that recorded the lowest “Temperature” when the wind was coming from the west (“Wind Direction” between 180 and 360). Please enter the name of the state that meets this requirement. Do not include the surrounding quotes in providing your answer.
Answer is:
New Mexico
Write New Mexico and submit.
If you need query then following is the query to retrieve the data
If you had installed Xampp in D:/ folder then follow the following steps, if you have installed in C:/ or another folder then replace D with respective folder name.
Open up the Xampp control panel and stop Apache (Ensure that you don’t have it running as a service.
Navigate to D:/xampp/apache/conf/extra or wherever you installed Xampp
Open up your text editor with administrative privileges and open up httpd-vhosts.conf found in the D:/xampp/apache/conf/extra folder
At the very bottom of the file paste the following (check if it exists there already)
<VirtualHost *:80>
DocumentRoot “D:/xampp/htdocs”
ServerName localhost
</VirtualHost>
Without that line of code, you will lose access to your default htdocs/ For eg: http://localhost/ will be inaccessible.
Now copy and paste the code below: <VirtualHost *:80> DocumentRoot “D:/xampp/htdocs/webocreation” ServerName webocreation.dev ServerAlias www.webocreation.dev <Directory “D:/xampp/htdocs/webocreation”> AllowOverride All Require all Granted </Directory> </VirtualHost>
Now we head over to our Windows Hosts File, to edit the HOSTS. File will be located at C:/Windows/System32/drivers/etc/hosts, where hosts is the file. 127.0.0.1 localhost
Look for the line above and enter your site mimicking the layout 127.0.0.1 localhost 127.0.0.1 webocreation.dev
Change this to the domain name you choose earlier
Change it to reflect the lines above (if you have problems saving it meant you didn’t have your text editor running in admin mode.
Restart Apache and test to make sure it is working.
It is not recommended to change the default files of OpenCart as if you upgrade then all changes will be lost so we have seen one solution to achieve your requirement by changing the header.tpl. Open catalog/view/theme/YOUR_THEME/template/common/header.tpl Find the following lines of code:
For many sub-categories, you can make multiple columns of sub-categories in OpenCart. While inserting the category, in the data tab, insert the “Columns” value to show multiple columns. You can see examples of the “MP3 Players” category and its sub-categories in the default installation.
Products to show without the add to cart button, another Opencart free module “Coming Soon Products module OpenCart version 2.0”. When you enabled this module, you will be able to see the products which available date is greater than today.
The module will look like below:
Admin section will look like:
Download Coming Soon Future Products free module from the link below:
Upload the files in the root folder to your server, no file is overwritten.
Then activate the “Future Products” module.
Activating the “Future Products” module:
After uploading files to servers, it’s time to install the “Future Products” module
We are showing the “Future Products” module at the right column of the Category page (Category Layout) but you can show it wherever you like as this acts as a normal module.
Go to Admin section
Then click on Extensions on the left menu
After that Click Modules and go to “Future Products” in the modules list
Then click the Green button for the “Future Products” to install the module (see the image below)
Then click the blue edit button
After that, you will see the form which has the status field, select “Enabled” and then click the Save button.
Your module is active and is ready to use in the layout.
Setup layout for the sidebar “Future Products” module at the right column of the home page:
From the admin section go to System >> Design >> Layouts.
You will see a list of layouts, from which edit the Home layout.
Then click Blue add the button to add rows at module section which is shown in the image below:
Second, you choose the “Future Products” in the module column and Column right in the Position column and insert the sort order as required.
Then click save button
Your custom home page is ready with the “Future Products” module in the right column. Likewise, you can show in many other layouts and pages.
Codes of “Future Products” modules of the presentation layer’s controller:
Go to catalog/controller/module/futureproducts.php
Please let us know if you have any questions or concerns. Please don’t forget to post your questions or comments so that we can add extra topics and Opencart free module. You can follow us at our twitter account @rupaknpl and subscribe to our YouTube channel for opencart tutorials.
While working as drupal developer in multi language Drupal 7 site you may find EntityFieldQuery class which allows finding entities based on entity properties and keep on getting confused with the propertyCondition and entityCondition for language translation.
Below example of entity field query helps me to find node main language specific featured blog post and
global $language;
$query = new EntityFieldQuery;
$query->entityCondition('entity_type', 'node')
->entityCondition('bundle', $bundletype)
->propertyCondition('status', NODE_PUBLISHED) // in case you need it
->propertyCondition('language', $language->language)
->fieldCondition('field_featured_blog', 'value', '1', "=")
->propertyOrderBy('changed', 'DESC')
->range(0,1);
$query->execute();
Below will find data as per the translated entity based language featured blog.
global $language;
$query = new EntityFieldQuery;
$query->entityCondition('entity_type', 'node')
->entityCondition('bundle', $bundletype)
->propertyCondition('status', NODE_PUBLISHED)
->entityCondition('language', $language->language)
->fieldCondition('field_featured_blog','value', '1', "=")
->propertyOrderBy('created', 'DESC');
$query->execute();
When you do print_r($query), then you will get following:
Full details of EntityFieldQuery at:
https://api.drupal.org/api/drupal/includes%21entity.inc/class/EntityFieldQuery/7.x
The function defaults to either = or IN depending on the value param as an array or string.
https://api.drupal.org/api/drupal/includes%21entity.inc/function/EntityFieldQuery%3A%3ApropertyCondition/7.x
The protocol that use newlines to separate messages, we’ll call this protocol Line Delimited JSON (LDJ). There are no line breaks in JSON messages. Although JSON is whitespace agnostic it ignores whitespace outside of string value.
Serializing Messages with JSON
Let’s develop the message-passing protocol that uses JSON to serialize messages. Each message is a JSON-serialized object, which is a hash of key-value pairs. Here’s an example JSON object with two key-value pairs:
{"key":"value","anotherKey":"anotherValue"}
The net-watcher service we’ve been developing in this chapter sends two kinds of messages that we need to convert to JSON:
When the connection is first established, the client receives the string
Now watching target.txt for changes…
Whenever the target file changes, the client receives a string like this: File “target.txt” changed: Sat Jan 12, 2013, 12:35:52 GMT-0500 (EST)
We’ll encode the first kind of message this way:
{"type":"watching","file":"target.txt"}
The type field indicates that this is a watching message the specified file is now being watched.
The second type of message is encoded this way:
Here the type field announces that the target file has changed. The timestamp field contains an integer value representing the number of milliseconds since midnight, January 1, 1970. This happens to be an easy time format to work within JavaScript. For example, you can get the current time in this format with Date.now().
To relieve the client program from the danger of split JSON messages, we’ll implement Line Delimited JSON (LDJ) buffering client module. Then we’ll incorporate it into the network-watcher client.
First, let’s have a look at how the Node does inheritance. The following code sets up LDJClientto inherit from EventEmitter.
LDJClient is a constructor function, which means other code should call new LDJClient(stream) to get an instance. The stream parameter is an object that emits data events, such as a Socket connection. Inside the constructor function, we call the EventEmitter constructor on this. That line of code is roughly equivalent to calling super() in languages with classical inheritance.
Finally, we call util.inherits() to make LDJClient’s prototypal parent object the EventEmitterprototype. If this sounds cryptic to you, don’t worry. It’s like saying classLDJClientinherits from EventEmitter in languages with a classical inheritance model. It means that if you look for a property on an LDJClientand it’s not there, the EventEmitteris the next place to look
Exporting Functionality in a Module
Let’s pull together the previous code samples and expose LDJClientas a module. Open a text editor and insert the following: /ldj.js
“Account login module for free OpenCart version 2.0” is another opencart free extensions when it is enabled you will be able to see the login form only when the customer is not logged in and if the customer is logged in then the form will be replaced with account links.
When the customer is not logged in you will see a form like this:
When logged in it will be seen the link the image below:
account_login_form_display
Download Account Login Form display free module from the link below:
Upload the files in the root folder to your server, no file is overwritten.
Then activate the “Account Login” module.
Activating the “Account Login” module:
After uploading files to servers, it’s time to install the “Account Login” module
We are showing the “Account Login” module at the right column of the Home page (Home Layout) but you can show it wherever you like as this acts as a normal module.
Go to Admin section
Then click on Extensions on the left menu
After that Click Modules and go to “Account Login” in the modules list
Then click the Green button for the “Account Login” to install the module (see the image below)
Then click the blue edit button
After that, you will see the form which has the status field, select “Enabled” and then click the Save button.
Your module is active and is ready to use in the layout.
Setup layout for the sidebar “Account Login” module at the right column of home page:
From the admin section go to System >> Design >> Layouts.
You will see a list of layouts, from which edit the “Home” layout.
Then click Blue add the button to add rows at the module section which is shown in the image below:
Second, you choose the “Account Login” in the module column and Column right in the Position column and insert the sort order as required.
Then click save button
Your custom home page is ready with the “Account Login” module in the right column. Likewise, you can show in many other layouts and pages.
Codes of “Account Login” modules of the presentation layer’s controller:
Please let us know if you have any questions or concerns. Please don’t forget to post your questions or comments so that we can add extra topics and Opencart free module. You can follow us at our twitter account @rupaknpl and subscribe to our YouTube channel for opencart tutorials.
We have had great experienced working with Limelight CRM. Here are the following things that we have worked:
Campaign management and offer management
Maintain the servers
Sites are all hosted in RackSpace and have load balancing to balance the visitor’s load.
Maintain security: Uses Cloudflare to maintain security and have performed many other tasks to obtain the best security
Maintain page loads
Integrate limelight in more than 50 websites. Uses both the Webform and API form and integrated into the design, sometimes 2-page checkout sometime one-page-checkout
Subscription management of the campaign Have not to design the PSD but can perform image changing and editing as per the necessity of the site.
Bootstrap uses for responsiveness
Upsell management for each offer and campaigns
Payment load balancing management
and many more.
Let us know if you have any questions or suggestions or requirements. You can also find us on Twitter and Facebook.