Powered by Blogger.

The Programming Blog

Hackathons are always awesome !! You build a product, interact with other hackers and overdose yourself off caffeine. And if we get unlimited RedBull, then it's just 10X Awesomeness.

My team was selected into the finals of Smart India Hackathon. We were selected for the Indian Space Research Organisation category.

Problem Statement: Novel Solution for preventing a breach of the confidential file from the organization other than already available methods in networking. The solution should also prevent uploading of data to the internet.

Solution: Our idea for this was a client-side solution: On every employee system, we will partition the system volume into two parts: Public and Confidential. Public Volume contains all the data that can go outside organization without any concern. Confidential Area contains all the confidential data deployed by system admin into this volume.

The Confidential Area will be completely isolated i.e. None of the following can be done on files of this area: Cut, Copy, Send To, Save As, Paste, Delete, Drag and Drop and many more commands. This ensures that none of the files from the confidential area can move to the public area or external drives.

What about uploading to Internet/Mail/Backend Script ?? How can we stop this ??

Our solution to this problem was: When the user wants to open confidential area, the user has to use our File Viewer tool to open the files.
At all other times, all the permission on file of the Confidential area will be revoked. This means that if the user tries to upload a file, it will be corrupt. The user may try bash script, program or any other way, it will not work because file simply does not exist without permissions.

File permissions will only be granted when the user opens the confidential file in File Viewer. Also, during this time (when File Viewer is opened), we are checking that FileViewer is in focus. Because the user can open File Viewer and then take advantage of granted file permissions.

We also handled a lot of other edge cases and were able to develop 60% of our product (Isolation part was done completely using a combination of registry modification, clipboard listeners to clear clipboard when copied data comes in, etc).

The further product development will be carried on after instructions from Indian Space Research Organisation.




Share
Tweet
Pin
Share
No comments
This was my first Hackathon. And I bet, more are coming.

My friend Anirudh called me to join him in the InOut Hackathon, NIT Surat. I wasn't so sure as this would had been my first hackathon. But then, there is always the first time.

Hackthons are awesome. We both interacted with so many developers. It was amazing to hear so many crazy ideas from people. Every interaction ended with a WOW feeling. There were Games, Photo Sessions, Tweet Competitions, Redbulls, and whatnot. It was like we were invited to have fun.

As for our product, it didn't went well. We wasted most of our time brainstorming the idea. The product was not completed on time and we failed miserably in demo. 

But, we realised that hackathon is not a competition. Its fun. That night we didn't sleep. We and group of some other participants played cards, LAN games, and discussed about each others' college culture. We made new friends, from different parts of country.

It was fun but challenging at the same time. I realised the amount of talent out there. It is a good motivation for me and I will participate in more hackathons now.




Share
Tweet
Pin
Share
No comments
Many times Android Studio just wouldn't work. You will see some weird errors while building and stackoverflow will also fail you on this.

Well, this usually always solve my buggy Android Studio -

1. Restart Android Studio.

2. Try Again. If it still fails, go to Build -> Clean Project. Try Again.

3. If it still doesn't work, go to File -> Invalidate Cache and restart. Try Again.

4. If it still fails, close Android Studio. Go to your sdk location -> find a folder called "build-tools". Delete that folder. For a safe side, don't delete it permanently. Try Again.

5. Help yourself. Even God can't help you on this now. 
Share
Tweet
Pin
Share
No comments
Its 4.30 in the night (or just call it morning) and here I am discussing interesting issue I came across in PowerUp Game a couple of days back.

It happened to me for the second time that app crashed with a message "Power Up has stopped working". I didn't had my phone connected when the crash happened. So Bad. Or maybe not. I learned a couple of new things because of this. That's what I love about Open Source.

So,  I thought of applying a trick I found sometime back while going through StackOverflow questions. Here it goes,

1. Open your terminal or Command Prompt and connect your device on which crash happened.

2. Now we need to go to the location of adb. How to find it ?

Go to your Android Studio -> File -> Other Settings ->  Default Project Structure

You can find the location of sdk there.

3. Now we will recover the log cat. Come back to terminal.

cd sdk_location_you_copied
cd platform-tools                            
adb logcat AndroidRuntime:E  *:S 

You will see all the log cats. In case its running infinitely, just press Ctrl + C.

4. Now that you have your logcat, search for your package name in it. I searched "power" and was able to find all the crash that happened in Power Up recently on my device. 

I will be telling about how I handled the issue I found #234 in my next post.
Share
Tweet
Pin
Share
No comments
Winning the 4th Edition of Discover Thinking Contest by CSI

"Best Things Happens Unexpectedly"

- Secured a rank in National 50 in DTC CSI and got invite to 51st Annual Convention of CSI, 2016 , Coimbatore with full cost coverage.

From last few months, most of my days are being spent contributing to Open Source Projects. One such day, I came across Discover Thinking Contest by CSI. It was a while since I did competitive programming and had no mood to participate in this contest.

The contest participation was open for a whole day of 11th Jan, 2017. It was in the night, when I was getting really bored, I decided to give this contest a try. (Better than sitting idle huh !!)

It was a 3 hour contest with 5 questions. The contest was do or die contest. You can't go to next question until you answer the current question. The judge supported most of the programming languages out there, so it was not a problem for anyone.

 The questions were the tricky one with each question a blend of Data Structures, File Handling, and Algorithms. None of the question could have been done if you don't have strong understanding of  File Handling in your respective language.

 The question demanded to read a input.txt file that could be anywhere in the target directory , execute your code on that input in given time complexity and save your output in specified format (was different for every question) in output.txt which should be saved in the same directory as target directory.

To further add to this, the question needed a good understanding of Data Structures. I remember a question in which I had to make my own Data Structure using Java Class, use HashMap, use Queue and a Linked List. The solution got so big that I was sometimes lost in my own code.

Well, I ended up answering all five of them in just time. Given my previous failures in competitive programming I had no hope whatsoever that I will win this out of 11000 participants from all over the country.

But I did !! Coming back from college, I got a mail which congratulated me. I was dumbstruck for few minutes. I convinced myself that it must be a prank but it wasn't. I won it.

The prize was a full cost coverage to attend the 51st Annual Convention of CSI at Coimbatore, Tamil Nadu. 

My First Flight !!
  
Le Meridien Hotel, Coimbatore !!

Awarded by CSI Head !!




It was a 3 day convention with eminent speakers from all over the world. I got to meet several professors from IIT's, Researchers, professionals from top notch industries like Adobe, Microsoft, KPMG, etc. There was so much to learn in just 3 days.

What I loved the most was the cultural diversity. People from different parts of country, from girls to boys,  students to professionals, startups to big IT players, all of them a part of technology. 


Share
Tweet
Pin
Share
No comments
Yesterday, I and my two friends participated in a competitive programming challenge on Hackerearth. It was tiring for us as the place we decided to meet was occupied and we had to change places while the competition was running. Also, we had to rely on mobile internet which unfortunately is not so good.

But we killed it !! We ranked in top 30 teams in India and we are invited for next round which is a Hackathon. Another hackathon !! Can't for it !!

Cont..

It was really sad that one of my friend met with a accident. She is well now. We requested the organisers to allow a replacement and they gave the permission to change team member.

This Hackathon was organised at Naggaro Office Campus and it was amazing. We built a chatbot application using variety of APIs. We also built a Interest Ranker which analyse the Github profile of people to find the most popular technology among them.  

Our demo went really good. We asked the judges to ask question from chatbot and it gave a funny reply. Also, we made of list of Github profiles of all participants of Hackathon. We gave a live demo on this data.

Everyone was impressed. While waiting for results, every team assured us that we would be the winners. And we felt the same. 

But..we didn't won !! It was heartbreaking for us. And it hurts more when everyone was congratulating us before results. 

Anyway, it was good to know the mistakes. Judges told us that our product was not focused on central idea. We should had either focused entirely on chatbot or Interest Ranker. And indeed they were right. Though our demo was good and product was running great, winning team had more central and creative product.

 
Share
Tweet
Pin
Share
No comments
So, now lets see how to know the Big-oh complexity for a given competitive programming questions.So follow this approach -

1.In all the platforms, you will be given a time limit in seconds according to the language you choose.Some platforms may not give you time limit for your programming language directly ,so calculate it as-

a. Codechef - codechef calculation -So,as said in the article multiply your language multiplier given here with the time limit given in the problem.

Ex- If time limit given in the problem is 2 sec ,then for Java  multiplier is 2X,thus

time limit for Java = 4 sec

b. For hackerrank, refer this-Hackerrank Time

Similarly you can see by yourself to get the time limit for your language.We will calculate for C++.Thus for C++,its mostly 2 sec /given in problem  (multiplier is 1 ,s no problem).

2.Now you need to calculate the no. of operations your programming language can compute in 1 sec.
So for C/C++ its usually around 10^8 operations per sec.
Similarly you can see for other languages.

3.Once you have got the time limit for your programming language ,now you need to calculate the total no. of operations for the given problem.For ex-

a.If  n is test case limit and m is input limit then ,worst case no. of operations performed will be-
m*n.

so if m*n =N

So, for a 1sec time limit, (keeping 10^8 operations per sec in mind)

N>10^8: better than O(N), maybe O(nlogn)
N=10^6-10^7 : O(n) solution is required.
N=10^5 : O(nlogn) solution.
N=10^4 : O(n^1.5 or n(logn)^2) solution.
N=10^3 : O(n^2) solution.
N=10^2 :O(n^3) solution.
N=10:O(n!) and O(2^n)  solution.

Above will be valid for java if time limit is 2 sec.But in all platform time limit is given wrt C++.So,just look at the above always.

For ex, let say you want to know above template for java on hackerrank.So,on hackerrank java is 4 sec ,but anyway we will look at C++.For C++, its 2 sec.

which means,template is-
N>2 X 10^8: better than O(N), maybe O(nlogn)
N=2 X 10^6-10^7 : O(n) solution is required.
N=2 X 10^5 : O(nlogn) solution.
N=2 X 10^4 : O(n^1.5 or n(logn)^2) solution.
N=2 X 10^3 : O(n^2) solution.
N=2 X 10^2 :O(n^3) solution.
N=2 X 10:O(n!) and O(2^n)  solution.

Share
Tweet
Pin
Share
No comments
Newer Posts
Older Posts

About me

I am Sachin Aggarwal, Android Developer and Designer pursuing my B.Tech at MAIT, Delhi. I love to explore new things and spend time contributing to Open Source.

Categories

  • Android
  • Competitive Programming
  • Experiences
  • Extras

Blog Archive

  • ▼  2017 (6)
    • ▼  October (1)
      • Android Systrace and Method Tracing
    • ►  April (1)
    • ►  March (2)
    • ►  February (2)
  • ►  2016 (4)
    • ►  September (1)
    • ►  July (1)
    • ►  February (1)
    • ►  January (1)

Created with by ThemeXpose | Distributed By Gooyaabi Templates