Pages

Thursday, 28 September 2017

SoundPool, SoundPool.Builder(), Supporting All API in Android


protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.activity_main);

    if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) {

        soundPool = new SoundPool.Builder()
                .setMaxStreams(10)
                .build();

        soundId = soundPool.load(this, R.raw.gun_shot, 1);

    } else {
        soundPool = new SoundPool(10, AudioManager.STREAM_MUSIC, 1);
        soundId = soundPool.load(this, R.raw.gun_shot, 1);
    }

}

public void gunShot(View view) {
    soundPool.play(soundId, 1, 1, 1, 0, 1);
}

Tuesday, 25 April 2017

Trick, Mnemonic to remember OSI model layers

Here is the mnemonic or trick that i used to remember OSI model layers.

All people seem to need data processing.



  • All = Application Layer
  • People = Presentation Layer
  • Seem = Session Layer
  • To Transport Layer
  • Need = Network Layer
  • Data = Data link Layer
  • Processing = Physical Layer

Sunday, 26 March 2017

PHP Pandas 🐼🐼🐼

                                              I wanted to revise PHP ... It's been a long time. This book https://daylerees.com/php-pandas/ looks awesome. Also it's author has provided free version to read this book online.

Monday, 20 March 2017

Installing redis in macOS sierra

             Installing redis in macOS Sierra is easy if you've HomeBrew installed. Just watch this video to install redis in your macOS Sierra.

Wednesday, 15 March 2017

Multer, Nodejs, File uploading without extension. Solved.

                So i faced this problem that files that i was uploading were uploading without extensions in nodejs express server to which i was uploading files using multer. πŸ˜•

Quick workaround i found was on this Github Multer Issue Page πŸ˜„

First of all run this command to install this package mime

npm install --save mime


And this is how i was able to make it work.😎

Monday, 13 March 2017

Image uploading in Nodejs Express app using Multer

                             Follow the instructions shown in the video below to upload image in nodejs express server using multer.


Thursday, 2 February 2017

remote sdk in rubymine vagrant

                                       Just open your terminal and ssh into your vagrant and run this command


This path can be copied and pasted to the remote sdk ruby path and that's it.