Skip to content

Instantly share code, notes, and snippets.

View AkshayAgarwal007's full-sized avatar

Akshay Agarwal AkshayAgarwal007

  • Kolkata
View GitHub Profile
@AkshayAgarwal007
AkshayAgarwal007 / 14-05-2017
Last active May 14, 2017 15:36
GSoC Work Progress <Resolving Style Formatting Issue in BTimeUnitFormat>
As discussed with PulkoMandy previously on IRC, BTimeUnitFormat does not
incorporate style formatting. It does take style as an argument
https://github.com/haiku/haiku/blob/master/src/kits/
locale/TimeUnitFormat.cpp#L90
but the style element is not used anywhere. So B_TIME_UNIT_ABBREVIATED
won't work currently.
I was trying to fix the same. My changes here:
https://diffy.org/diff/c4de3i96k5y5aa5m1z5dlmzpvi
@AkshayAgarwal007
AkshayAgarwal007 / 13-05-2017
Last active May 12, 2017 21:19
GSoC Discussions Log <Adding vector icons to BToolBar | BBitmaps are expensive>
<•Me>
I'm trying to add HVIF icons to BToolBar buttons.
I'm taking one of the icons from here. : http://zumi.xoom.it/myhaiku/btoolbar/index.html
Opened it in Icon-O-Matic and exported it as HVIF Rdef, Copied the hex representation into the .rdef file. Loaded the vector icon to a BBitmap object and passed it as a parameter to the BToolBar->AddAction().
But when I'm taking one of the icons directly from here http://zumi.xoom.it/myhaiku/btoolbar/index.html it's not getting aligned properly. Getting aligned to the left:http://pasteboard.co/5mSHCE5kW.png
But taking the same icon(hex representation) from the BePDF source makes it aligned properly. http://pasteboard.co/5mTqr4E2o.png
Seems like there's some extra data appended at the end (in the one from the BePDF source).
Commit containing the code for the same.
@AkshayAgarwal007
AkshayAgarwal007 / LinkedInUrlScrapper.py
Last active November 26, 2016 00:06
Queries Google for Jeff Weiner's LinkedIn profile and then scraps the results and finds the best matching profile URL using Selenium.
from selenium import webdriver
import json
from difflib import get_close_matches
def urlMatch(titles_urls, name):
links = []
titles= []
for item in titles_urls:
if "linkedin.com/in/" in item[1]:
titles.append(item[0].split('|')[0].strip())
@AkshayAgarwal007
AkshayAgarwal007 / wordDensity.py
Last active August 16, 2016 23:15
Calculating term densities in a piece of text. Filter methods used : stopword removal, conversion to lower case, non-alphanumeric char removal, no stemming.
#!/usr/bin/env python
"""
Created on Wed Aug 17 03:39:14 2016
Calculating term densities in a piece of text
@author: Akshay Agarwal <agarwal.akshay.akshay8@gmail.com>
"""
import re