Problem : Issue when i add user using RestApi include “vendor/autoload.php”; $api = new GidkomOpenFireRestApiOpenFireRestApi; $api->secret = “mySecretKey”; $api->host = “HostName”; $api->port = “9090”; $api->useSSL = false; $api->plugin = “/plugins/restapi/v1″; // plugin For adding user to Roster i am using following code $jid=”xyz@domainname”; //Add to …
Technology
Use closure when doing some heavy operation in app
its better to use closure because its work in background but it stores strong reference of object so whenever operation finish you get data back and also after that you make an operation on data. Example code func retrivingData(completion : (()->())){ // do opearation completion(data) } …
AWS: Useful terminal commands
SSH connection using PEM file $ ssh -l ABC.pem username@53.0.111.225 IMPORT mysql db to AWS from local system $ mysql -u username -h hostname -p dbname < dbfile.sql EXPORT mysql db $ mysqldump -h hostname -u username -p db > dbfile.sql Transfer file via ssh …
UILabel with text of two different colors
Problem: I want to display a string like this in a UILabel: Where the number 5 is red in color and the rest of the string Solution: NSMutableAttributedString *text = [[NSMutableAttributedString alloc] initWithAttributedString: label.attributedText]; [text addAttribute:NSForegroundColorAttributeName value:[UIColor redColor] range:NSMakeRange(10, 1)]; [label setAttributedText: text]; OR NSMutableAttributedString …

Upgrade Vanilla 1.1 to 2.3
Please Follow Following Step:- – Download New Vanilla 2.3 installer – Install Vanilla 2.3 into localhost – copy all folder (everything except conf/, cache/, uploads/, custom themes/and custom plugins/ htaccess) – before paste delete all folder from old vanilla (except conf/, cache/, uploads/, custom themes/and …
Get orientation from video or thumb obtained with AVAssetImageGenerator
Solution: Need to add following line under above method generator.appliesPreferredTrackTransform=true
Quickbook integration with yii1 error
When this issue raised? Quickbook integration with yii1 framework failed because of quickbook SDK’s internally used another 3rd party library which cause the issue. Every time it throws the error like “Failed to open stream: No such file or directory found”. How to solve it? …
Merge Audio with Video
To create app like Dubsmash. <https://itunes.apple.com/in/app/dubsmash/id918820076?mt=8> I have merged audio file of any dialogue or song with captured video. Check method to merge video with audio :- // MARK: – Merge Video func mergeVideoWithAudio() { let mutableComposition = AVMutableComposition() var mutableCompositionVideoTrack …
Swift : Nil Collision Operator ,Save Your iPhone app from random crashes.
Nil-Coalescing Operator: The nil-coalescing operator (a ?? b) unwraps an optional a if it contains a value, or returns a default value b if a is nil. The expression a is always of an optional type. The expression b must match the type that is …
Slow page load
Problem Client was running into an issue where his website pages were taking a really long time to load. Solution The following .htaccess code helped me to solve the issue. #Force non-www: #RewriteEngine On #RewriteCond %{HTTP_HOST} !^www\. #RewriteRule ^(.*)$ http://www.%{HTTP_HOST}/$1 [R=301,L] # REDIRECT TO UNDER CONSTRUCTION …