I have learnt so much still very little productivity.
I need to figure out what I am missing.
Sunday, March 19, 2017
I am missing something
Saturday, March 18, 2017
Political
I went inactive on Facebook few months before 2014 general elections because my known people started posting lots of fake/propaganda statuses on Facebook and I found it annoying. I left Facebook because if I told them the truth many people will take it as personal insult and if they don’t get offended the discussion will waste a lot of my time. Staying silent was not peaceful for me.
The party who was doing most propaganda actually won in that election.
I thought the propaganda will stop after the elections are over and I will return to the old merry Facebook again. Rather the propaganda became more and more aggressive and that is still going on. This made me sad.
I got more active on twitter as not many of my friends are active there thus less chances of loosing friends there.
Doing so I gained some knowledge about politics and I am finding it rather amusing now. Yes sometime annoying too. So decided to write about my political thoughts so I can get some clarity of mind. This is important because politics is so confusing that you don’t realize when you becomes a hypocrite.
If you support a party you start supporting it no matter what. The party or its leader may be doing wrong but as you are their supporter you find a reason to support them while opposite goes with the other parties.
This time around I am choosing a topic that is in news currently and I think is going to explode in coming elections. I am learning about it and making a blog on it.
Lets see how it goes.
Monday, September 12, 2016
Life is too short to..
Life is too short to be shy.
Life is too short to satisfy your ego.
Life is too short to do things other wants.
Life is too short to not to fight for what you want.
Life is too short to give up something you love.
Life is too short to not to be with people you love.
Life is too short to waste in keep saying no.
Life is too short to not to take risks.
Life is too short to not to make mistakes.
Life is too short to not to play with your kids.
Life is too short to miss the memorable moments.
Life is too short to keep procrastinating.
Life is too short to holding yourself back.
Life is too short to stop your heart take control once in a while.
Life is too short to hold your head high.
Life is too short to have that body you always wanted.
Life is too short to not live the life you should.
Life is too short to keep doing chores.
Life is too short to finding your peace.
Life is too short to keep sleeping.
Life is too short to..
Friday, May 13, 2016
To be successful
You will have to do chores.
You can't be special all the time.
Talent is not enough.
Working hard and learning is not enough.
Success lies in doing routine work better.
Sunday, April 24, 2016
Discourse or nodeBB
Serious confusion.
Can't decide between discourse and nodebb. Discourse is perfect, other then its looks and more importantly its initial load size. Whereas nodeBB is around half in size for initial load but its buggy with many things like mod_pagespeed, Cloudflare etc. All this good in discourse but initial load size is big turnoff for me.
I really liked flarum but don't know when will it come out of beta. I am OK with beta if its working decently but developer themselves are advising strongly against using it in production. So its gone.
While evaluating I am not counting the server requirements here. Nodebb works on far lesser resources than discourse, which won't even start on Server below 1GB RAM and recommended is 2GB RAM. They say even with lesser resources nodeBB can serve far more users than discourse.
After the initial load nodebb and discourse are almost on same speed. May be nodebb is a bit snappier.
What I notice is that while nodebb Developers have focused on all the fancy stuff like chat system, theming, UI etc discourse developers have focused on doing basic forum stuff nicely. Discourse looks very well built and everything goes very smoothly. You get lots of finely thought out functions in discourse whereas in nodebb you get those old controls that we are seeing since vBulletin but mixed with fancy stuff.
With what i have written above you can guess i am inclined toward discourse a little bit. But the main problem is i am planning to build an Android forum and i suspect initial load size of discourse is going to cause some troubles on the mobile devices specially the cheaper ones with less RAM. Even one of the lead developer of discourse says JavaScript performance on Android device is a serious problem and you are bound to lose visitors who visit your site from Android devices. And here i am planning to build a forum for Android users.
Gotta think more and decide.
Wednesday, March 2, 2016
Clear mod_pagespeed cache
touch `grep "^ *ModPagespeedFileCachePath" /etc/apache2/mods-enabled/pagespeed.conf | awk ' { print $2; } ' | sed 's/"//g'`/cache.flush
Monday, January 25, 2016
Reading Parse.com docs
I got less time to do my things today. Most of the day went by playing with my son as maid took leave today.
Most part of the remaining time i read parse docs. Learnt a lots of new things about parse and also got some ideas out of it for my app.
When i turned on my system to work I managed to get the comment thing sorted out.
Actually i never mentioned it before here. So here it goes.
In MySQL i was using id for the content that were integers and they were getting incremented automatically on every new row added. I was using this id in the comments table to label which content this comment belongs to. Easy stuff that is.
But here in parse they use NoSQL database that doesn't give auto incrementing integers as id rather they give a alphanumeric objectId. So if i add a new row to content it will not generate same type of integer id so i will have to use objectId in comment table to link comments to newer content.
Now the problem arises how to write the query because old content will not have new objectId in comments and new on will not have the old content id.
To sort this out i needed to add objectId of the content to all the respective comments. I couldn't do it manually because there were 22,000 comments in all.
I needed an automated approach.
I had two options:
1. I use the cloud code facility that parse provide. To use it i needed to write a JavaScript function and run it on the data.
2. I extend my existing android code and update the ids using the app.
First option was little difficult for me as i have never done any of that stuff before. I mean i never used parse cloud code or the tools required to write cloud code. And also i never wrote such a JavaScript function before. But it could have been a nice learning experience.
I chose second option because it required very less time in comparison to first one and also i could track the changes i was introducing with android logcat, so i would not corrupt the data. Although i backed up all data before hand.
I wrote a java method that pulled all the comments attached to old content id and then update each of them by inserting new content objectId in it. I could have done it to all the data at once but i chose to go with one at a time approach. I tapped on the content and all the comment rows related to that content got updated and i tracked it in the parse interface and logcat window.
Took time but finally managed to update all.
Finally i updated the query to use the objectId rather than old content id in the android app to pull the comments. Working nicely.
Yesterday i updated the android app to send objectId for new comments so nothing was required to change in that method.
Reading through the parse documents i learnt about the caching the data in device so i won't have to query it every time i needed more data. Nice function. Would use it. It will make things faster. Tomorrow will try to implement this caching thing.
One thing that went unexpectedly nice as i switched to parse is that when i was using JSON to get and sent data to and from app i was not getting the emoji working. They were changing into question marks. But now i can use all the emoji in content as well as in comments 🙌.
Later.
Sunday, January 24, 2016
Moved to Parse
Yesterday i mostly read few things. Also downloaded and installed the Mac updates. Was tired in the evening so slept early.
Yesterday while reading through Google app engine docs i came across this service called firebase. Its a service built in keeping in mind making it suitable for mobile backend. Looked promising to me and thought of using it rather than going to google app engine. On app engine i will have to write all the code both Android and python app engine app. Will also have to check all the caching and other optimizations. I already wrote earlier that i am no expert in either python or app engine so it will mean i will have to learn much.
While browsing through firebase docs and pricing model i remembered i tried using parse.com before i moved the PHP api to my VPS from appfog. I found it difficult at that time because i was not that fluent in java then. I am more familiar in it now so i compared the pricing model of parse, firebase and google app engine. I found using parse will be much economical and easier to me than using other two.
I am planning to serve images too along with text in my app and parse give more space and bandwidth in free tier than other two and also they have well cooked SDK that will fasten up my development speed. I will also won't have to write the cloud code on my own.
I had already imported the data when i earlier tried parse to i only had to write the android code using parse SDK today. I managed to write it very quickly and found a bug in the parse SDK. I found two workarounds and now my api is up and running on parse.
Will write a post about the bug and how i managed to workaround.
I must confess if i had little patience then when i tried parse earlier i won't have wasted so much time in writing app engine code and all. But then parse SDK has bug that made it impossible for me to make it work with my little knowledge.
Also, parse is not zippy as my app engine code is. But its workable and my development time is significantly reduced by using it.
Now i am reading parse docs so i won't get caught up this time in the bugs and other possible problems.
Later.