Saturday, December 12, 2015
Javascript - 1
Tuesday, November 24, 2015
Memory Leak on server side
Monday, October 19, 2015
Why desktop apps are making a comeback
Source: Why desktop apps are making a comeback?
- Standalone, desktop applications have benefits that are almost impossible to replicate within a browser:
- Once they find their place in the Windows Start menu or the Mac OS Dock, they are always visible. In the mobile world, an app that isn't on the home screen is easily forgotten and eventually never opened anymore.If you want your app to become a daily habit in the life of your users, then you cannot take the risk of them not opening it because they don't see it. A web app that isn't pinned to the browser is easily closed and forever forgotten. A desktop app has the power to be always visible, and even always open. Don't miss out on this!
- Desktop apps are "alt-tab accessible". Alt-tab is probably the most used keyboard shortcut in the entire desktop universe. For every time someone with your app open hits alt-tab, you get a free impression of your logo and brand name on their screen! How is that for cheap marketing? In all likelihood, your logo will sit between a very popular browser and a cool music streaming service, so the brand association is not bad either. The goal is always the same: your app must become part of the daily routine of your user. Even if they open it by accident, as they're trying to skip a track in their playlist, it's still one more chance for you to convince them that you have what they need. Take that chance.
- also, desktop apps can support download and preview much better than web apps can. Another small but critical thing is the ability to copy things to the clipboard.
- Another great capability of desktop apps is their easy access to the notification system. Few things get more attention than the bouncing motion of a notified app on the Mac OSX dock.
By frequent activity, I mean that your users are going to spend a sizable amount of time in your app every day. Anything that helps them do their regular work falls within this category. For programmers, it's going to be IDEs. For designers, it's going to be Photoshop & Sketch. Transversal tools like e-mail clients or Evernote also come to mind: you probably don't use them for the most part of your work, but you still need to open them several times a day and spend some time typing in it. You want them to be always open and not have to sift through twelve tabs to get to them.
If your product cannot really be used in an urgent or preponderant way, don't burden yourself with a desktop app. The advantages of web apps cannot be overstated, and many great software companies are better off offering web interfaces. APIs like Stripe's, analytics like Kissmetrics', infrastructure like Heroku's, all provide enormous value, but don't justify the development of desktop applications.
Tuesday, October 13, 2015
Buy vs Build your own Trail Manager
New Relic provides a crazy amount of data about the running of both your servers and your applications. This includes application performance data, errors, low level metrics and even rolled up method or database query performance. $149 per host per month for our 200 hosts gives us $29,800 per month.
Librato Metrics provides a fantastic way of storing arbitrary time series data. We're already storing lots of data in New Relic but Metrics provides us with less opinionated software so we can use it for anything, for instance number of logins or searches or other business level metrics. We'll go for a plan with 200 data sources, 100 metrics each and at 10 second resolution for a cost of $3,860per month.
Pagerduty is all about the alerts side of monitoring. Most of the other SaaS tools we've chosen integrate with it so we can make sure we get actionable emails and SMS messages to the right people at the right time. Our plan costs $18 per person per month, so lets say we have 30 people at a cost of $540 per month.
Papertrail is all about logs. Simple setup your servers with syslog and Papertrail will collect, analyze and store all your log messages. You get a browser based interface, search tools and the ability to setup alerts. We like lots of logs so we'll have a plan for 2 weeks of search, 1 year archive and 100GB month of log traffic. That all costs $575 per month.
Sentry is all about exceptions. We could be simply logging these and sending them to Papertrail but Sentry provides tools for tracking and rolling up occurences. We'll go for a plan with 90 days of history and 200 events per minute at a cost of $199 a month.
Pingdom used to provide a very simple external check service, but now they have added more complex multistage checks as well as real user monitoring to the basic ping. We'll choose the plan with 250 checks, 20 Real User Monitoring sites and 500 SMS alerts for $107 a month.
How much!
In total that all comes to $35,080 (£20,922) per month, or $420,960 (£251,062) per year.
Now the first reaction of lots of people will be that's a lot of money and it is. But remember open source isn't free either. We need to pay for:
- The servers we run our monitoring software on
- The people to operate those servers
- The people to install and configure our monitoring software
- The office space and other costs of employing people (like management and hiring)
I think people with the ability to build software tend to forget they are expensive, whether as a contractor or as a full time member of staff. And people without management experience tend to forget costs like insurance, rent, management overhead, recruitment, etc.
And probably more important than these for some people we need to consider:
- The time taken to build a good open source monitoring system
The time needed to put together a good monitoring stack based on for instance logstash, kibana, riemann, sensu, graphite and collectd isn't small. And don't forget the number of other moving parts like redis, rabbitmq and elasticsearch that need installing configuring and maintaining. That probably means compromising in the short term or shipping later. In a small team how core is building your monitoring stack to what you do as a business?
Fix Command tab on Apple Macbook
- Navigate to System Preferences
- Go to Mission Control
- Uncheck "When switching to an application, switch to a Space with open windows for the application"
Try using the cmd+tab now.
Source: http://apple.stackexchange.com/questions/112350/cmdtab-does-not-work-on-hidden-or-minimized-windows
Sunday, September 13, 2015
quick REST error codes and indempotency
- 1XX - informational
- 2XX - success
- 3XX - redirection
- 4XX - client error
- 5XX - server error
Source: https://spring.io/understanding/REST
An idempotent operation is an operation, action, or request that can be applied multiple times without changing the result, i.e. the state of the system, beyond the initial application.
EXAMPLES (WEB APP CONTEXT):
NULLIPOTENT: If an operation has no side effects, like purely displaying information on a web page without any change in a database (in other words you are only reading the database), we say the operation is NULLIPOTENT. All GETs should be nullipotent. Otherwise, use POST.
IDEMPOTENT: A message in an email messaging system is opened and marked as "opened" in the database. One can open the message many times but this repeated action will only ever result in that message being in the "opened" state. This is an idempotent operation.
NON-IDEMPOTENT: If an operation always causes a change in state, like POSTing the same message to a user over and over, resulting in a new message sent and stored in the database every time, we say that the operation is NON-IDEMPOTENT.
When talking about the state of the system we are obviously ignoring hopefully harmless and inevitable effects like logging and diagnostics
Source: http://stackoverflow.com/questions/1077412/what-is-an-idempotent-operation
Friday, August 21, 2015
Accuracy and Precision
Precision refers to the closeness of two or more measurements to each other. Using the example above, if you weigh a given substance five times, and get 3.2 kg each time, then your measurement is very precise. Precision is independent of accuracy. You can be very precise but inaccurate, as described above. You can also be accurate but imprecise.
For example, if on average, your measurements for a given substance are close to the known value, but the measurements are far from each other, then you have accuracy without precision.
A good analogy for understanding accuracy and precision is to imagine a basketball player shooting baskets. If the player shoots with accuracy, his aim will always take the ball close to or into the basket. If the player shoots with precision, his aim will always take the ball to the same location which may or may not be close to the basket. A good player will be both accurate and precise by shooting the ball the same way each time and each time making it in the basket.
Source: http://www.ncsu.edu/labwrite/Experimental%20Design/accuracyprecision.htm
Monday, August 10, 2015
Thursday, August 6, 2015
Personal Knowledge: Web/App Design from Accessibility Perspective
https://www.youtube.com/watch?v=vK1tlLOavvM
Django MVC explanation
- M, the data-access portion, is handled by Django’s database layer, which is described in this chapter.
- V, the portion that selects which data to display and how to display it, is handled by views and templates.
- C, the portion that delegates to a view depending on user input, is handled by the framework itself by following your URLconf and calling the appropriate Python function for the given URL.
- M stands for “Model,” the data access layer. This layer contains anything and everything about the data: how to access it, how to validate it, which behaviors it has, and the relationships between the data.
- T stands for “Template,” the presentation layer. This layer contains presentation-related decisions: how something should be displayed on a Web page or other type of document.
- V stands for “View,” the business logic layer. This layer contains the logic that access the model and defers to the appropriate template(s). You can think of it as the bridge between models and templates.
Neither interpretation is more “correct” than the other. The important thing is to understand the underlying concepts.
- http://www.djangobook.com/en/2.0/chapter05.html#the-mtv-or-mvc-development-pattern
- http://reinout.vanrees.org/weblog/2011/12/13/django-mvc-explanation.html
- http://stackoverflow.com/questions/6621653/django-vs-model-view-controller
Tuesday, August 4, 2015
Dev Utilities
Starters - Django vs Flask
I'm a Django developer for 5 years but now headed for a marketplace project and that is the only thing I want to develop. I will switch to Flask within a year. I could break Django into parts but that would break current applications, which is also bound to Django version. Yes, I could use well-maintained libraries with Django as well but that wouldn't catch our 'deadlines'. Upgrading Django version with a fresh start is also an option but I don't want to do wide migrations every year.
No regrets using Django up to this point, it really forces you to learn general best practices, and helps you get the funding. I call it a startup framework as it helps you to change your business logic quickly. If you are a starter, go with Django, switching to Flask in future won't be painful once you need it.