Saturday, December 31, 2016
Method to do display inline-block div
Thursday, December 29, 2016
Sunday, December 25, 2016
Saturday, December 24, 2016
Tuesday, December 20, 2016
Get total question consumed
SELECT * FROM
(
Select
d.student_id as d_student_id,
d.gold as d_gold,
d.total_question_consume as d_total_question_consume,
d.total_question_correct as d_total_question_correct
from osem_main.usr_student_data_main d
/*WHERE d.student_id not in (4,5,22,47,49,55,79,84,85,2001,2002,2007,2021) */
) as md
join
(
SELECT c.student_id as c_student_id, count(*) as c_total_consume, sum(c.final_result) as c_total_correct
from osem_content.qst_student_consumption c
/*where c.student_id not in (4,5,22,47,49,55,79,84,85,2001,2002,2007,2021)*/
group by c.student_id
) as cd
ON md.d_student_id = cd.c_student_id
;
update osem_main.usr_student_main set is_reviewer=1 where login_id
in
('syazwi','awieer','quzaimer2016','hanania',
'alisa613','kindaichi',
'nazshahsalim','ainanie19','imran3087','kkkkkkkk','nazuhan87',
'osmanawang','azimazahar3','mustafakamal','aliffhafiy',
'imran3086','dinsiputsedut','ismahadi',
'abubakar','hahahaha','aqib21',
'nazshah','reez26','aqib20','langbuana','imran3088','imran3089',
'aqib21','amalina','reezh26','lalala', 'ajilala','aqib1234', 'ejoy12',
'azimazahar3','sabrina88',
'hanania',
'dinsiputsedut',
'imran3086',
'ainanie19',
'juhari',
'osmanawang',
'imranhamzah','jijiji','susususu',
'Otobot','juhari','joejoejoe','radzeen','jjjjjj','alifdanishazmi');
select group_concat(student_id) from osem_main.usr_student_main m where m.is_reviewer=1;
Thursday, December 15, 2016
MySQL to get total question reviewed per chapter
SELECT s.chapter_id, CASE WHEN s.eduyear_id=1 THEN 'Darjah 1' WHEN s.eduyear_id=2 THEN 'Darjah 2' WHEN s.eduyear_id=3 THEN 'Darjah 3' WHEN s.eduyear_id=4 THEN 'Darjah 4' WHEN s.eduyear_id=5 THEN 'Darjah 5' WHEN s.eduyear_id=6 THEN 'Darjah 6' WHEN s.eduyear_id=7 THEN 'Tingkatan 1' WHEN s.eduyear_id=8 THEN 'Tingkatan 2' WHEN s.eduyear_id=9 THEN 'Tingkatan 3' WHEN s.eduyear_id=10 THEN 'Tingkatan 4' WHEN s.eduyear_id=11 THEN 'Tingkatan 5' ELSE 'lain-lain' END as Tingkatan, s.subject_name, t.topic_no, t.chapter_name, COUNT(s.question_id) AS total_question, SUM(CASE WHEN s.review_by <> '' AND s.chapter_id=t.chapter_id THEN 1 ELSE 0 END) AS total_question_reviewed, SUM(CASE WHEN s.review_by <> '' AND s.published_status = 1 AND s.chapter_id=t.chapter_id THEN 1 ELSE 0 END) AS total_question_reviewed_and_published, SUM(CASE WHEN s.review_by <> '' AND s.published_status = 0 AND s.chapter_id=t.chapter_id AND s.review_status LIKE 'f4%' THEN 1 ELSE 0 END) AS total_question_need_to_review, SUM(CASE WHEN s.review_by <> '' AND s.published_status = 0 AND s.chapter_id=t.chapter_id AND s.review_status LIKE 'up%' THEN 1 ELSE 0 END) AS total_question_rejected FROM qst_master_main s LEFT JOIN edu_subject_chapter t ON t.chapter_id=s.chapter_id WHERE s.eduyear_id < 10 GROUP BY s.chapter_id ORDER BY s.eduyear_id,t.subject_code_id, t.topic_no
Tuesday, December 13, 2016
Saturday, December 10, 2016
Fetch realtime database to blog using firebase
Idea utk Osem
1. Ujian personaliti diri dalam set soalan OSEM.
Thursday, December 8, 2016
Data Entry Review Summary
select 'main_total', A.total FROM ( select s.review_by, count(s.question_id) as total from pencil_content.qst_master_main s where s.review_by <> '') as A UNION ALL select s.review_by, count(s.question_id) as total from pencil_content.qst_master_main s where s.review_by <> '' group by s.review_by order by total DESC;
Wednesday, December 7, 2016
Query Builder in Laravel
Ideas to make mobile apps
ExamCrazy (For the Students, By the Students)
A virtual study room where students can meet other students of their own disciplines and prepare for their exams. Give a pop quiz for your friends, rate them, develop ideas over a concept and much more. Initially i thought this idea for a Facebook App. But now i am thinking this has a website.
Studies show over 65% of FBook users are under the age of 24. Why cant we use Social Networking for the sake of Academics.
Exist removed and added new array in PHP
$exist = [1,2,3];
$update = [1,2,4,5,6];
//Action
//1 - Remove no 3
//Add 4,5 and 6
//Both exist before and after
//1,2
$both_exist = array_intersect($exist,$update);
echo ('Check removed');
$removed = array_diff($exist,$both_exist);
echo '';
print_r($removed);
echo '
';
echo ('Added');
$combined = array_unique(array_merge($exist,$update));
$added = array_diff($combined,$exist);
echo '';
print_r($added);
echo '
';
Monday, December 5, 2016
Mathjax Online Converter
Sunday, December 4, 2016
How to implement Mathjax in Ionic?
1. Mathjax sample
Saturday, December 3, 2016
Update image soruce with new source using XML DOM parsing
//Update image src with new src
function upd_img_src_in_html($html_src='', $new_src='')
{
if($html_src == '' || $new_src == ''):
return '';
endif;
$xml = new DOMDocument();
$xml->loadHTML($html_src, LIBXML_HTML_NOIMPLIED | LIBXML_HTML_NODEFDTD);
$imgNodes = $xml->getElementsByTagName('img');
for ($i = $imgNodes->length - 1; $i >= 0; $i--) {
$imgNode = $imgNodes->item($i);
$image_file_names = pathinfo($imgNode->getAttribute('src'), PATHINFO_BASENAME);
if(!empty($image_file_names)):
$imgNode->setAttribute('src', $new_src.$image_file_names);
// $imgNode->setAttribute('style', 'max-width:90%; margin-left:auto; margin-right:auto;');
endif;
}
return html_entity_decode($xml->saveHTML());
}
Also:
http://php.net/manual/en/domelement.setattribute.php
Friday, December 2, 2016
260+ Ionic Framework Resources
There are many posts and articles on the Ionic Framework but sometimes it is difficult to locate exactly what you need. This list is a an attempt to create a comprehensive list of tutorials that cover as many topics as possible. I will update this list as I discover new posts and as new posts are suggested.
Don’t see what you’re looking for? Feel free to leave a comment and I’ll see if I can find something for you.
Looking for Ionic v2? Check out my Ionic Resources List for version 2.
Ionic Basics
- Hello World: Your First Ionic Framework App
- Hello Backend: Your Second Ionic Framework App
- Hello Modules: Your Third Ionic Framework App
- Hello Master Detail: Your Fourth Ionic Framework App
- Structure of an Ionic App
- Creating Views with Ionic
- Controllers in Ionic/Angular
- Make HTTP Requests In Android And iOS With Ionic Framework
- Ionic: Using Factories and Web Services for Dynamic Data
- SOAP Web Services in Angular and Ionic
- Modules in Ionic/Angular
- Promise-Based Architecture in an Ionic App
- Using The UI-Router To Navigate In Ionic Framework
- Saving Data With Ionic Framework
- Organising Code in an Ionic Application for Beginners
- Validation in Ionic Framework Apps with ngMessages
- Build Your First Mobile App With The Ionic Framework
- How To Organize The Files In Your Ionic Project
- How to Create Complex Layouts in Ionic
- Debugging Ionic Apps using Chrome Developer Tools
- The Definitive Ionic Starter Guide
- Ionic Framework | Using Touch Gestures
- Ionic Framework | Working With Forms And Validation
- Understanding Ionic View LifeCycle
- Monitoring Online and Offline States in an Ionic Application
- How To Animate Your Ionic App With Animate.css And ngAnimate
- AngularJS Form Validation In Your Ionic Framework App
- How to Create Animations with CSS in Ionic
- Discover the Power of Directives: Bringing an Ionic App to Life — Part 2
- Understanding Filters in Ionic
- Validate Forms with Ionic Framework: Step by Step Guide!
Installation and Setup
- Ionic – Setup on OSx
- Ionic – How to setup on Windows
- Installing ngCordova in an Ionic Application
- Install Android, Cordova, and Ionic Framework in Ubuntu
Ionic Components
- Understanding Ionic’s Side Menu
- Understanding Tabs In Ionic Framework
- Understanding the Ionic Framework Action Sheet
- Understanding Ionic’s Infinite Scroll
- Understanding Pull to Refresh
- Make List Items Swipeable In Ionic Framework
- Using Slide Boxes and Tabs in Ionic Framework Apps
- Ionic Framework | Using Grid System
Ionic App Patterns
- Ionic: Master Detail Pattern
- Internationalization of an Ionic App: Multilanguage Support
- Internationalization and Localization with Ionic Framework and Angular Translate
- Add Pull to Refresh with Toast Message in Your Ionic App
- Creating a Feed in Ionic
- Make A Gallery-Like Image Grid Using Ionic Framework
- Making Tinder-Style Swipe Cards With Ionic Framework
- Swipeable Cards with the Ionic Framework
- How to Create a Nested Tab View in Ionic
- Creating an Attractive Login Screen in Ionic with Flexbox
- Build Multi Language App with Ionic Framework
Authentication
- Cookie-based Authentication in AngularJS
- Handle User Sign-In With Ionic Framework
- How To Handle User Authentication With AngularJS Inside Your Ionic App
- Simple login example with ionic and AngularJS
- How To Handle User Authentication With AngularJS Inside Your Ionic App
- Adding Social Login with Firebase
- User Authentication with Ionic and Parse, Part 1: Email Login
- Email Authentication with Ionic and Firebase: Full tutorial
Testing
- Writing Your First Unit Test with the Ionic Framework
- Unit Testing Your Ionic Framework App
- Optimize your Ionic Testing with Wallaby.js, Bard.js, and WebStorm
- End2end Testing Ionic collection-repeat with Protractor
- Ionic Framework & Protractor Tests
- Introduction to Automated Testing & Frameworks
- Unit Tests With Jasmine & Karma
- End-To-End Tests With Jasmine & Protractor
- End-to-end testing an Ionic application with Appium and Protractor
Performance
- How to Make High Performance PhoneGap Apps
- Improving the performance of your Ionic application
- Ultimate AngularJS and Ionic performance cheat sheet
Backend as a Service (Firebase)
- Sign Into Firebase With Facebook Using Ionic Framework
- Syncing Data With Firebase Using Ionic Framework
- Create a Password Management App Using Ionic Framework and Firebase
- Creating a Firebase Powered End to End Ionic Application
- Upload Camera Images To Firebase Using Ionic Framework
- Build a Real Time Hybrid App with Ionic & Firebase
- Email and Facebook Authentication with Ionic and Firebase
- Implementing the Master Detail Pattern in Ionic with Firebase
- Create a Real Time Chat App with Ionic and Firebase
- Building Real-Time, Multi-Platform Mobile Applications: Examples Using Ionic Framework and Firebase
- How to build a shopping app with Ionic Firebase
- How to CRUD data in Firebase using Ionic Framework
Backend as a Service (IBM MobileFirst)
- Working with IBM MobileFirst and the Ionic Framework
- Using MobileFirst HTTP Adapters with an Ionic Application
- Using MobileFirst SQL Adapters with an Ionic Application
- Using Remote Logging with Ionic and IBM MobileFirst
- Working with IBM MobileFirst and Ionic – Bootstrapping
- Developing Ionic Apps with MobileFirst 7.1
- Using Ionic Creator with MobileFirst 7.1
Backend as a Service (other)
- Use Parse Core In Your Ionic Framework Mobile Apps
- Syncing Data With Dropbox Using Ionic Framework
- Build a Hybrid Application with the Ionic Framework and Azure Mobile Services, Part 1: Configuring the Project
- Build a Hybrid Application with the Ionic Framework and Azure Mobile Services, Part 2: Creating the User Interface
- Build a Hybrid Application with the Ionic Framework and Azure Mobile Services, Part 3: Wiring Up The Backend
- Sync Data Using PouchDB In Your Ionic Framework App
- How To Use PouchDB + SQLite For Local Storage In Your Ionic App
- Using Couchbase in Your Ionic Framework Application Part 1
- Build a Hybrid Application with the Ionic Framework and Windows Azure Mobile Services
- Building an Ionic Todo App with Backend and Database using Backand
- Cross-Platform Apps with Ionic and Stamplay
- Send Emails In Ionic Framework Via The Rackspace Mailgun API
- How to use Exis to Create a Chat App in Ionic
Ionic Tooling
- Using the Ionic Framework with Grunt and PhoneGap Build
- Minifying Your App’s Source Code
- Debugging AngularJS Apps from the Console
- Use The Ionic CLI To Integrate Crosswalk Into Your Project
- Ionic adds a new State feature
- Automatically Add JS/CSS Files to Your Ionic Projects
- Ionic – The Ionicbox and How To Use It
- Ionic – Using Android x86 Virtual Machine Instead of Emulator
- Production ready apps with Ionic Framework
- How to Minify an Ionic Application for Production
- Getting Started with the Ionic Command Line Interface (CLI)
- The Difference Between Building with PhoneGap and PhoneGap Build
- How to Minify an Ionic Application using Gulp and Cordova Hooks
- Inspect Your Ionic App With ng-inspector
- Mobile Hybrid Apps with VS Code and Ionic
- How To Debug The White Screen Of Death In Your Ionic App
- Using Visual Studio Code with Ionic
- Debugging Your Apache Cordova iOS App With Safari
- StrongLoop, Ionic, and IBM Bluemix
- Adding localization to your Ionic application with IBM Bluemix
- Continuous Integration with Ionic Framework using Visual Studio Online – From Check In to Device
Ionic Backend Services (ionic.io)
- An early look at Ionic Push
- Push It Real Good with Ionic
- Easy Ionic Push Notifications With Ionic.io In 15 Minutes
- How To Debug The White Screen Of Death In Your Ionic App
- Getting Visual Studio Cordova Tooling Working With The Ionic Framework
- Testing Ionic Push Webhooks with IBM Bluemix
- Ionic View in 4 steps
- Sending Out Android Push Notification with Ionic.io to Your Users
- The Complete Ionic Push Notifications Guide
Ionic Ions
- Ionic showWhen directive
- showWhenState: Conditional Elements In Ionic by State
- Dividing a List Automatically in Ionic Framework
- Preload images in Ionic using $ImageCacheFactory
- Adding Frosted Glass Effect to your Ionic Framework App
- Shrinking Headers Like Facebook With the Ionic Framework
- Must-have plugins for Ionic Framework
ngCordova/Cordova Plugins
- Using Custom URL Schemes In Your Ionic Framework App
- OAuth with Ionic and ngCordova
- Print Data To Paper Or PDF Using Ionic Framework
- Create A Todo List Mobile App Using Ionic Framework
- Get Available Free Disk Space Using Apache Cordova
- Using The Native Device Calendar In Ionic Framework
- Make Your Own Facebook Mobile App With Ionic Framework
- Prompt User To Rate Ionic Framework Mobile App
- Add ‘Rate my App’ in your ionic app to increase the number of ratings in the app store
- Use Native Device Dialogs In Ionic Framework Mobile Apps
- Deploy Ionic Framework App With Pre-Filled SQLite DB
- Access The Native Device Clipboard In Ionic Framework
- Upload Files To A Remote Server Using Ionic Framework
- Open Dynamic Links Using The Cordova InAppBrowser
- Create, Delete, And Search Contacts In Ionic Framework
- Playing Audio In Your Android And iOS Ionic Framework App
- Use SQLite Instead of Local Storage In Ionic Framework
- Find The Application Version In Your Ionic Framework App
- Implement Social Media Sharing With Ionic Framework
- Implement Google Maps Using Ionic Framework
- Displaying the Twitter Feed within Your Ionic App
- Use The Android And iOS Camera With Ionic Framework
- Show Native Toast Notifications Using Ionic Framework
- Implement A Barcode Scanner Using Ionic Framework
- Manage Files In Android And iOS Using Ionic Framework
- Handling Apache Cordova Events With Ionic Framework
- Making iOS In-App Purchases With Ionic Framework
- Making Android In-App Purchases With Ionic Framework
- Create an RSS Reader Using AngularJS and Ionic Framework
- Add A Splash Screen To An Ionic Framework Project
- Polish Your App Launch with Cordova Splashscreen Plugin
- Send Email from Android and iOS with Ionic Framework
- Using An Oauth 2.0 Service With Ionic Framework
- Launch External URLs with Ionic Framework
- Using Google Analytics With IonicFramework
- Using Admob With IonicFramework
- Check Network Connection With Ionic Framework
- Placing Phone Calls In Hybrid Apps
- How To Make A HealthKit App With Ionic and ngCordoa
- Using Local Notifications In Your Ionic Framework App
- Adding Gamecenter Support to your Ionic App
- Making a Signature Drawpad with Ionic
- Making a Lock Pattern Login with Ionic and AngularJS
- Support iOS touchID in your ionic app
- Creating a Realtime Image Sharing App With Ionic and Socket.io
- Store Camera Photos Permanently Using PhoneGap, Ionic & ngCordova
- Chaining multiple Cordova File Transfers with ngCordova
- Selecting multiple images in a PhoneGap/Cordova app
- Create A File Browser Using Ionic Framework
- Whitelist External Resources For Use In Ionic Framework
- Modify The Badge Number Of An Ionic Framework App
- Useful Cordova Plugins For Your Ionic Application & Examples
- Using A Pin Dialog In Your Ionic Framework Mobile App
- Monitor Device Battery Status Using Ionic Framework
- Build an iOS app with Push Notifications using Ionic Framework
- The Complete Guide To Images With Ionic
- Add Touch ID Authentication To Your Ionic Framework App
- Using Cordova File Transfer Plugin With Ionic Framework
- Changing & Locking Screen Orientation In Ionic Application
- Using Google AdMob in Your Android Ionic Application
- Handling Native View Animations With Ionic Framework
- Using Cordova Geoloacation API with Google Maps in Ionic Framework
- Integrating the Calendar into your Ionic App
- Support iBeacons In Your Ionic Framework Mobile App
- How To Add Sound Effects To Your Ionic App With Native Audio
- How To Set Up Quick Actions With 3D Touch For Your Ionic App
- Ionic- Using Local Notifications
- Check network information change with Ionic framework
- Adding AdMob to Ionic framework application step by step
- Speaking with Cordova – Text To Speech and Voice Recognition using the Ionic Framework
Miscellaneous
- Adding Background Images To Ionic Framework Apps
- Create A Complex Calculator App Using Ionic Framework
- Embed Video In Your iOS And Android Ionic Framework App
- Add Pin Code Unlock To Your IonicFramework App
- Trigger Pull To Refresh In Ionic Framework Apps
- Learning the Ionic Framework as a Sencha Touch Developer
- Animations For Your Ionic App with Move.js
- Building an Ionic hybrid mobile app with TypeScript
- Ionic SocketIO Chat
- Switching from native iOS to Ionic: Why Hybrid doesn’t suck (anymore)
- Using the Web Audio API for precision audio in Ionic
- Using Device Grade in Ionic Framework Apps
- Tracking and notifying geolocation status with Ionic
- How To Add A Search Bar In The Header On Ionic
- How To Create An Advanced Ionic Gallery with Image Zooming
- How To Easily Use The Twitter REST Api With AngularJS
- Using the Web Audio API for precision audio in Ionic
- The Best Looking Ionic Framework Themes
- Using Google Maps With Ionic Framework
- A Comprehensive List Of Ionic Starter Apps
- Integrating Google Maps with an Ionic Application
- Using Views Events To Create JavaScript Pure Ionic Splash Screen
- Ionic Framework | Get Page Height & Width
- Material Design for Ionic
- Using Charts In Your Ionic Framework Mobile App
- Ionic Framework | Handling Android Back Button Like a Pro
- Working around Ionic’s cached views
- 15 Great Inspirational UI Theme Designs For Ionic Framework
- Intro to ECMAScript 6 and Angular 2 for Ionic Developers
- Why is The .dot Notation Important in Ionic Framework?
- Building a Simple Spotify Player with Ionic
- Modular AngularJS and Ionic architecture: a first step towards AngularJS 2
- How To Use LokiJS For Local Storage In Your Ionic App
- Use Font Awesome Glyph Icons With Ionic Framework
- 4 Ways to Make Your Ionic App Feel Native
- Build a WhatsApp clone with Meteor and Ionic – Meteor Platform version
- Modifying CSS Library Defaults in Ionic
- How to create a calculator application with Ionic framework by using Ionic Creator for UI
- Bring Your Ionic App to Life: Getting Started with D3.js
- How To Create And Display A PDF File In Your Ionic App
- Create Your First Windows 10 Universal Apps With Ionic Framework (Walkthrough)
- Posting data from Ionic app to a PHP server
- Create a Weather and News Reader App with Ionic and Drupal