Saturday, 11 June 2016

Packing similar small rectangles into a larger rectangle of given dimension

I was facing a similar issue and finally got the answer to my problem on my own. 
Assuming length is greater than the breadth for both the rectangles 
(smaller and larger ones), following cases will occur while you try to pack 
smaller rectangles on the larger one. Let the length of larger rectangle be L,
 its breadth be B and length and breadth of smaller rectangles be l and b 
respectively. Case 1. Pack the smaller rectangles such that their lengths 
are parallel to the breadth of the larger rectangle until you fall short of space.
 Then try the other way round (Length of larger rectangle parallel to Lengths of 
smaller one) on the available space. Case 2: Pack the smaller rectangles such
 that their lengths are parallel to the length of the larger rectangle until you 
fall short of space. Then try the other way round (Length of larger rectangle 
parallel to breadths of smaller one) on the available space. Take the maximum 
of case 1 and case 2 to get the maximum no of smaller rectangles that can be 
packed on a larger one. Find the python 3 code of the implementation below: 

import math
Length_of_larger_rectangle = 1200
Length_of_smaller_rectangle= 520
Breadth_of_larger_rectangle = 1000
Breadth_of_smaller_rectangle= 343
def pack(Length_of_larger_rectangle,Breadth_of_larger_rectangle,Length_of_smaller_rectangle,Breadth_of_smaller_rectangle ):
    if Length_of_larger_rectangle<Breadth_of_larger_rectangle:
        temp=Breadth_of_larger_rectangle
        Breadth_of_larger_rectangle=Length_of_larger_rectangle
        Length_of_larger_rectangle=temp
    if(Length_of_smaller_rectangle<Breadth_of_smaller_rectangle):
        temp2=Breadth_of_smaller_rectangle
        Breadth_of_smaller_rectangle = Length_of_smaller_rectangle
        Length_of_smaller_rectangle=temp2

    Case1= math.floor(Length_of_larger_rectangle/Length_of_smaller_rectangle )*math.floor(Breadth_of_larger_rectangle/Breadth_of_smaller_rectangle)
    left_length1  =  Length_of_larger_rectangle-Length_of_smaller_rectangle*math.floor(Length_of_larger_rectangle/Length_of_smaller_rectangle )
    if (left_length1>Breadth_of_smaller_rectangle):
        Case1a=math.floor(Breadth_of_smaller_rectangle/left_length1)*math.floor(left_length1/Breadth_of_smaller_rectangle)
        Case1=Case1+Case1a

Case2=math.floor(Breadth_of_larger_rectangle/Breadth_of_smaller_rectangle)*math.floor(Length_of_larger_rectangle/Length_of_smaller_rectangle )

Case3=math.floor(Length_of_larger_rectangle/Breadth_of_smaller_rectangle )*math.floor(Breadth_of_larger_rectangle/Length_of_smaller_rectangle)
    left_breadth2=Breadth_of_larger_rectangle-Length_of_smaller_rectangle*math.floor(Breadth_of_larger_rectangle/Length_of_smaller_rectangle)
    if(left_breadth2>Breadth_of_smaller_rectangle):
        Case3=Case3+math.floor(Length_of_larger_rectangle/Length_of_smaller_rectangle)*math.floor(left_breadth2/Breadth_of_smaller_rectangle)
    Case4=math.floor(Breadth_of_larger_rectangle/ Length_of_smaller_rectangle)*math.floor(Length_of_larger_rectangle/Breadth_of_smaller_rectangle)

    No_of_cfcs=max(Case1,Case2,Case3,Case4)
    return No_of_cfcs

a=pack(Length_of_larger_rectangle,Breadth_of_larger_rectangle,Length_of_smaller_rectangle,Breadth_of_smaller_rectangle )
print(a)

Friday, 6 November 2015

How to autotune your voice and be an awesome singer!

So you want to be the next big thing!
You want you to sing in front of a cheering crowd and get fame ..bahahahahahaa!!
Not an issue...Not an issue... its normal :)
Today I'll be teaching you how to autotune your voice for free using audacity.
In order to autotune your voice using audacity you need to downlod  audacity (obviously) and Gsnap.
Lemme guide you ahead with the exact steps!

STEP1: Download audacity (its a software to edit audio).
You can download it from here: http://audacityteam.org/

STEP2: Once you are done with settin up Audacity, download Gsnap.GSnap is an auto-tune effect. It can be used subtly to correct the pitch of a vocal, or, with more extreme settings, to create a robot-voice effect. It requires a monophonic input signal to operate.Gsnap can be opened by going to effects an Gvst: gsnap.
GSnap user interface
You can download it from here: http://www.gvst.co.uk/
The GSnap settings you will need:
MIN. FREQ: 40 Hz
MAX. FREQ: 2000 Hz
GATE: -80 dB
SPEED: 1

THRESH: 100 cents
AMOUNT: 100%
ATTACK: 1 ms
RELEASE: 1 ms

P.BEND: 0 cents
VIBRATO: 0 cents
VIB. SPEED: 0.1 Hz
CALIBRATE: 430 Hz

and thats it ... Gimme your autograph now!

Monday, 22 June 2015

How to type very fast using your 10 fingers - the art of touch typing

Hello guys, this is Geekzone and today I will tell you - How to type very fast using your 10 fingers - the art of touch typing. Touch typing, or the art of typing with your 10 fingers, can do wonders to your efficiency and the way of writing. Most technologically literate people know a bit of typing but if you can type without looking at the computer keyboard, you can get work done faster and gain an edge.Also, it looks more professional. Touch typing is a useful skill to have for mobile and tablet users because when you perfectly know where the keys are, you can tap them faster.
gif
So the million dollar question is that where and how can you learn to type without looking at the keyboard. In order to learn touch typing, you need to first know the exact position of your fingers on the keyboard and then make it your habit to place them there whenever you type.
There are many online websites which provide free practice for the same. Some of them are:-
https://www.typingclub.com/
www.typingstudy.com/
www.keybr.com/
www.ratatype.com/learn/

So grab the one you are most comfortable with and get started!
All the best and don't forget to drop a comment below.









How to download videos from Facebook without any hassle!

Hello guyz this is Geekzone and today, I will tell you the best way to download facebook videos.
You must have seen some video on facebook and at the same time realized that the video deserves to be in your hard disk. But so far there is no option to download videos to your hard disk on facebook.
What is the solution?

Well you can easily download a facebook video by following the simple steps below.
Step 1- Go to the page containing that video.
Step 2-Replace the www.facebook to m.facebook in the URL bar of your browser.
Step 3- The mobile version of the website opens and the video is seen as in the mobile phone.
Play the video.
Step 4- Right click on the pause/play button and click save video as.
Step 5- Choose the destination where you want the video to be saved.
Boom ! the video starts downloading.
If it works for you share this post and let others know the method as well.
If you have any doubt, don't hesitate to post it in the comments section below.
I'll create some more videos explaining this stuff in details soon.
If you want to stay tuned, subscribe my Youtube channel https://www.youtube.com/channel/UCwfnW0t5OG-D61MLEGJ0-CA .
Facebook Page- https://www.facebook.com/geekzo

Friday, 29 May 2015

5 Quick tips to make yourself look more beautiful in your profile picture...


Hello guys, this is Geekzone and today I will tell you - How to add some more color to your beauty in your pics. Since you have come to my blog I will not let you go barehanded. You will get something! I Promise :)
So without wasting much of your time I will start with my quick tips on how to make yourself look like a celebrity on Facebook, Whatsapp, or whatever social media you use ...
I know you are excited so let's begin.



#Tip no 1
This one is for those who look fat. Open your image using a picture editor. It could be any...
 change the resolution of your photo so as to decrease its width a bit..but listen..Don't make it as thin as a stick..It will clearly reveal that you have used such techniques.
some of the recommended pic editors are Adobe Photoshop, Nero, Picasa and online pic editor like Picmonkey.
If you have never used them don't look at them like that ..just google them!


#Tip no 2
Do you have a dark complexion?
Then this one is for you..
Go to a pic editor like Picmonkey (online ) or Adobe Photoshop.
I will not talk about something you could have trouble with like - go to this then this then this and so on..
I will rather suggest you to adjust the brightness and contrast.
you can also try some other options like gamma, RGB,hue,saturation etc.
Just edit it so that it looks good, at least better than before!
Try random combinations. Undo button will always be there in case you do something wrong.
Don't end up making you look like Michael Jackson (LOL!)... :P


#Tip no 3
And this one is a general tip which will work for anyone..
There are many software products and android apps available in the app markets (chillax for free!) that can help you add some shine to your pictures.
I will mention a few of them
1. Beauty plus - You can get it here at- https://play.google.com/store/apps/details?id=com.commsource.beautyplus&hl=en
2. Adobe Photoshop- Google it for downloading it or send me a pm on fb for help. I will help you in getting it. I promise :)


#Tip no 4
This is the simplest of all the tips I have discussed.
Go to fb.com and visit all the photos of good looking handsome people.I mean the people who look awesome on Facebook but are actually not..You can easily find such people in your friend list or near you. Just have a look at their picture and see what they are doing..
In case you have any doubt, I am always there for help :)

#Tip no 5
This tip is for those who edit their page very much and frequently..
Dear friend,
why do u edit your pic if u know that the person looking at it will know that you have done so??
I mean you can .....its your wish ...but its ... against my theory and my tip no 5.
The best thing I feel after editing a pic is that I edited my pic without making anyone notice it!
People say you look good, you look smart, you have become fair, you have lost weight, you have gained muscles etc etc..

I will keep it short so as to save your time. I know its really precious. You have to do other things as well.If you have any doubt regarding this post,
let me know them in the comments section below.
I'll create some more videos explaining this stuff in detail soon.
If you want to stay tuned subscribe to my Youtube channel
https://www.youtube.com/channel/UCwfnW0t5OG-D61MLEGJ0-CA .
+1 it or tell me why don't you like it in the comments section below.
each and every question in the comment will be answered!
Like my Facebook page at https://www.facebook.com/geekzo