Tuesday 24 May 2016

Best Programming Languages You Should Learn To Boost Your Salary


Source: http://fossbytes.com/python-go-scala-learn-best-programming-languages-salary-boost/

The 2016 Workforce-Skill Preparedness Report of Pay-scale, a salary tracking site, is out with many interesting trends related to the current tech job scenario. The report outlines that Go, Scala, and Python, along with big data tech provide the highest boost in your paycheck. if you are willing to grab a big bite of salary boost by learning some new technology or programming language, we are here to help you.It’s a no hidden fact that the knowledge of big data skills is the most in-demand in the tech world.

Today, the job market is witnessing a paradigm shift and big data skills like Hadoop and Apache Spark, along with Python, Go, and Scala, are gaining high in highest paid lists.  Using its pay-tracking database, the same trend in IT and other industries has been observed by Pay-scale.

These results have been published recently in its 2016 Workforce-Skills Preparedness Report. Among the highest valued skills that provide the biggest pay boost, all are tech related. Out of such top nine skills, seven are directly related to the deep knowledge of programming languages, frameworks, and operating systems.

The biggest jump is provided by the functional programming language Scala with an average pay jump of 22.2 percent.  Google’s Go programming language followed Scala at the second place with a 20 percent pay boost.  While Python didn’t crack the top positions in this list, it had a prominent presence in Pay Scale's survey. Depending on the job titles, Python was found to provide a pay boost of up to 8-14 percent.

Here’s the list of top 9 technologies that provide the highest salary jump:


Sunday 22 May 2016

Image Scaling as to the Aspect Ratio - Android


Image Scaling will be huge blocker for the android developers, In our modern world applications are never been without the dynamic images.  So the images has be fitted as to the aspect ration into the views and correspondingly it needs to work on multiple devices and its sizes.

The below code snippet will be really helpful for us.

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
public static Bitmap scaleImage(Bitmap view, Context ctx, int size) throws NoSuchElementException {
        Bitmap bitmap = null;
        try {
            bitmap = view;
        } catch (NullPointerException e) {
            throw new NoSuchElementException("No drawable on given view");
        } catch (Exception e) {
   throw new NoSuchElementException("Error: "+e);
        }

        // Get current dimensions AND the desired bounding box
        int width = 0;

        try {
            width = bitmap.getWidth();
        } catch (NullPointerException e) {
            throw new NoSuchElementException("Can't find bitmap on given view/drawable");
        }

        int height = bitmap.getHeight();
        int bounding = dpToPx(size,ctx);
        
        // Determine how much to scale: the dimension requiring less scaling is
        // closer to the its side. This way the image always stays inside your
        // bounding box AND either x/y axis touches it.
        float xScale = ((float) bounding) / width;
        float yScale = ((float) bounding) / height;
        float scale = (xScale <= yScale) ? xScale : yScale;
        Log.i("Test", "xScale = " + Float.toString(xScale));
        Log.i("Test", "yScale = " + Float.toString(yScale));
        Log.i("Test", "scale = " + Float.toString(scale));

        // Create a matrix for the scaling and add the scaling data
        Matrix matrix = new Matrix();
        matrix.postScale(scale, scale);

        // Create a new bitmap and convert it to a format understood by the ImageView
        Bitmap scaledBitmap = Bitmap.createBitmap(bitmap, 0, 0, width, height, matrix, true);
        width = scaledBitmap.getWidth(); // re-use
        height = scaledBitmap.getHeight(); // re-use

        BitmapDrawable result = new BitmapDrawable(scaledBitmap);
        
        // Apply the scaled bitmap
       // view.setImageDrawable(result);
        return scaledBitmap;
    }

1
2
3
4
public static int dpToPx(int dp, Context ctx) {
        float density = ctx.getResources().getDisplayMetrics().density;
        return Math.round((float)dp * density);
    }

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
 Glide.with(context)
                .load(url)
                .asBitmap()
                .centerCrop()
                .skipMemoryCache(true)
                .diskCacheStrategy(DiskCacheStrategy.NONE)
                .error(R.drawable.profile)
                .placeholder(R.drawable.profile)
                .into(new BitmapImageViewTarget(viewHolder.txt_jobseekerImage) {
                    @Override
                    protected void setResource(Bitmap resource) {
                // Do bitmap magic here
                        resource = CommonUtil.scaleImage(resource, context);
                        super.setResource(resource);
                    }
                });