Category: Web Development
PHP | Sorting Complex Multidimensional Array
Suppose we have a complex array like below: $products = array( array( ‘product’ => array(‘id’ => 1, ‘name’ => ‘Jquery tutorial book’), ‘product_details’ => array(‘cost’ => 10, ‘edition’ => ‘first’) ), array( ‘product’ => array(‘id’ => 2, ‘name’ => ‘javascript
iOS | How to get installed app package names
Here is the code to get names of app package installed on iOS devices: include objc/ runtime.h in your viewController.m include <objc/runtime.h> – (void)GetInstalledApps { Class LSApplicationWorkspace_class = objc_getClass(“LSApplicationWorkspace”); NSObject* workspace = [LSApplicationWorkspace_class performSelector:@selector(defaultWorkspace)]; NSArray *array = [workspace performSelector:@selector(allApplications)]; NSMutableString
How to load webpage faster having large number of images
If your webpage has a lot of images it may load really slowly. We can use jQuery method lazyLoad to load the page faster. Lazy Load delays loading of images in long web pages. Images outside of viewport (means part
Moodle/Totara | How to install a new theme
A theme can be installed in Moodle/Totara by two different methods: A) Installing theme via FTP 1. Login to your FTP client server where your Moodle/Totara is installed 2. Go to Moodle “Theme” directory and place the theme folder which
Restrict back button of browser using Struts2
Follow the steps below to restrict back button of the browser: 1. Make a custom filter class as shown below. 2. Implement Filter (in-built interface) 3. Override “doFilter” method present in the Filter interface: public class NoCacheFilter implements Filter {
Toggling a checkbox on/off through Selenium webdriver
Below is the script for on/off the checkbox using webdriver: package mypackage; import org.openqa.selenium.By; import org.openqa.selenium.WebDriver; import org.openqa.selenium.WebElement; import org.openqa.selenium.firefox.FirefoxDriver; public class myclass { public static void main(String[] args) { WebDriver driver = new FirefoxDriver(); String baseUrl = “http://www.facebook.com”; driver.get(baseUrl);
How to create a dynamic div using Javascript
Here is sample code if you want to create a dynamic div using Javascript: <script type=”text/javascript”> divCount =0; function createDiv() { var divTag = document.createElement(“div”); var studList =””; studList += ‘<select id=”BOX_’+divCount+'” name=”BOX_’+divCount+'”>’; studList += ‘<option value=””>— Select —</option>’; for(i=0;i<countStud;i++)
Salesforce | Some Date functions (String to Date and more)
We can convert a string variable into date datatype by using the apex date class function date.parse(String); Syntax: Date var1=date.parse(String); Example: String var=’12/25/2016’; Convert var to date type by: Date var1=date.parse(var); Now var1 contain it as a date type. It
Android | How to get list of all the apps installed on Android device
In one of the mobile app we were required to get the list of all the installed applications on user’s mobile. This was possible but due to security reasons first of all you need to prompt app user to allow