Tag Archives: techweekend

TechWeekend Pune: Facebook’s Open Graph API – 1st Oct

There’s a TechWeekend this Saturday (1st Oct, 4pm-7pm, SICSR) to discuss the latest and hottest technology: Facebook’s newly announced OpenGraph API. Join a discussion to see how the recent launch by Facebook can change the way we think about Social Apps and Businesses. Read More: https://developers.facebook.com/docs/beta/

Speakers:

  • Rohan Dighe – Design Experiences and Not Apps using OpenGraph
  • Aman Jain – My Experiences with OpenGraph

About Techweekend

TechWeekend Pune is a volunteer run activity. Each TechWeekend event features a few talks on advanced technical topics. These events are free for all to attend. See PuneTech articles about past techweekends to get an idea of the events.

Join the techweekend mailing list to keep in touch with the latest TechWeekend activities.

Fees and Registration

The event is on the 7th floor, SICSR, (Symbiosis Institute of Computer Studies and Research, near Om Market, Model Colony) on 1st October, Saturday, from 4pm to 7pm.

This event is free and open for anybody to attend. Please register here

TechWeekend – Web Security – August 20

TechWeekend Pune and Microsoft present a technical session web security on Saturday 20th August, 10am, at Sumant Moolgaokar Auditorium, MCCIA Trade Tower, ICC. This session will feature Rohit Srivastwa (of ClubHack) talking about some of the top web vulnerabilities, how they work, and how to prevent them, and Aditee Rele (of Microsoft) talking about the new security features in IE9.

Top Web Vulnerabilities – Rohit Srivastwa

This talk will cover 6 of the top 10 most exploited vulnerabilities on the web as reported by OWASP. Specifically:

  • Cross-Site Scripting
  • Information Leakage
  • SQL Injection
  • Local/Remote File Inclusion
  • Unrestricted uploads
  • Shell Injections

and best coding practices whereever possible.

The speaker Rohit Srivastwa is one of Pune’s most well know security evangelists. He has an expertise in cyber crime investigation and IT infrastructure management. Rohit is actively involved advising several military agencies, law enforcement personnel, media, corporate and Government bodies in these fields.

Rohit Srivastwa is also the founder of ClubHack, a member driven community to spread the security awareness. ClubHack organizes an international hacker convention in Pune every December.

For more see Rohit’s website

Security Features in IE9 – Aditee Rele

The latest version of Microsoft’s browser contains a lot of technologies focused on making the browser very safe from malware and phising attacks on the internet. It uses a new mechanism called layered protection against malware and a bunch of memory and exception handler protections to ensure that the most common ways of exploiting security holes are automatically plugged. To prevent phishing, it uses a SmartScreen filter to block bad URLs, and an application reputation mechanism to detect untrustworthy executables, providing what they claim is 100% social engineering blocking.

The speaker Aditee Rele works in the Developer and Platform Evangelism (DPE) Group at Microsoft Corporation, India. She focuses on addressing architectural challenges in the enterprise and web space and has first-hand exposure to large implementations on various platforms across Microsoft Technology Suite.

Fees and Registration

This event is free and open for anybody to attend. No registration required

The event starts at 10am, in the Sumant Moolgaonkar Auditorium, Ground Floor, Wing A, ICC Trade Center, SB Road. Please come 10 minutes early since security at the venue takes a little time, and we are planning on starting the event on time.

The Basics of Game Development – for programmers

(This is a live-blog of a talk Girish Dhakephalkar of http://ShoonyaGames.com gave at TechWeekend #9 on Game Development.)

This talk is an overview of what exactly is involved in game development – from the point of view of a programmer.

These are the major components of game development.

Game Platform

A game platform is the hardware-software combination on which a game runs. These are the major game platforms:

  • Console (e.g. Xbox 360, Wii, PS2/PS3).
  • Handheld
  • PC (Windows, Mac)
  • Mobile (iPhone, others)
  • Web Browser Based
  • Arcade Machines (i.e. the dedicated game play machines you see in video-games parlours in malls)

The platform makes a big difference to the kind of games you can build. For example, consider the consoles. Here the hardware is fixed. This is good because a game is a very optimized piece of software. So the more you know about the hardware, the more you can optimize, and the better will be your gameplay. (Compare with a PC game where it can be played on PCs with vastly different hardware capabilities. Then you end up programming to the minimum requirements, which is sub-optimal for the higher end PCs.)

Game Development Team

A game development team consists of the following roles:

  • Artists – 2D/3D artists and animators
  • Game Designers – Level designers, Gameplay designers, UI designers
  • Programmers – Graphics, Gameplay, AI engine, Physics, Networking, UI, Tools
  • Audio – Sound effects creators, music composers
  • Testers (Pune has a lot of game testing companies)
  • Special mention: The Crossovers – Technical Artists, Team Leads, Tester-Producer, etc.

Not all kinds of games require all these roles. A “big” game is a huge production, pretty much like a movie, and will hence need all these roles. Smaller games can do with fewer.

Interesting points: The Physics Engine in a game is a piece of software in a game which essentially enforces the laws of physics (as they exist in the game world). When you throw an object, how it flies through space is determined by the physics engine. When you fall, what happens to you, how much you get hurt; if you kick a door, will it break. Such things are determined by the physics engine.

Networking is needed in online games. Specially, an MMORPG (massively multiplayer online role-playing game) has hundreds of thousands of people playing simultaneously, and the various players are interacting with the game system, and with each other. All of this networking has to be managed at the game servers (which are in the cloud) and the game clients (which are installed on the users PC/console).

Game Development

There are two broad phases of game development.

First there is “content creation”. This includes things like creating the characters, animations, levels etc. This happens offline, before the game is “released”. The tools used are Maya/Max, Photoshop, Sound creation tools, and Game design tools. The other big chunk of program in a game software is the “runtime”. This is the server and the engine which interacts with the user and renders each frame of the game, and controls the game play.

The fundamental difference between animation and graphics in games and anywhere else is the “realtime” nature of the rendering. When doing animation/graphics for a movie, everything is computed beforehand, and it is simply displayed/rendered at runtime. However, with a game, this is not true. You need to keep gathering input from the user (for example, the current position of the user), and change the animation appropriately. So, the animation needs to be auto-created at runtime based on the inputs, and this needs to happen at 30+ frames per second.

Going below 30+ frames per second is just not permissible – the game will not feel smooth. Hence, the only thing you can compromise on is the quality/resolution of the graphics. Hence, in terms of pure graphical output, a pre-rendered video is always going to have better possibilities than what is possible in a game.

In any case, in most games, lots and lots of optimization happens to be able to render high quality graphics at 30+ FPS, using the best possible software and hardware combination. Thus, most games will try to use the graphics cards of the hardware to the fullest extent possible. All modern graphics cards are programmable in the sense that common graphics operations (like shaders) can be offloaded to the graphics card. The game engine will have sophisticated software that pushes as much work as possible to the graphics card.

The Game Runtime is broken up into two big parts. First there is the basic engine, which can be thought of as a framework for building games, and has building blocks like rendering, animation, physics, networking, sound. Another major feature of an engine is that it allows easy creation of different kinds of games, characters, levels, and general purpose scripting.

Thus, the idea is that there is a generic game engine which is not necessarily tied to any specific game, and on top of this, various different games can be built by the game designers. Typically, the same game engine will be re-used by a company to build and release many different games.

A game engine will typically come with “game creation tools” which are separate pieces of software which allow you to “author” games. Typical workflow: an artist uses tools like Maya/Photoshop to create the basic content, and the level designer of a game will use the game engine tools to import the basic content into the game. You might create a character in Maya,

Examples of game engines: CryEngine (Crysis, Far Cry, Aion: Tower of Eternity), Unreal Engine (Unreal Tournament, Unreal3, Gears of War. http://udk.com is available free for non-commercial use), Source Engine (Half Life, Counter Strike Source), Unity, Torque (Casual/web-based gaming).

Components of a Game Engine

  • Graphics renderer: all the computer graphics calculations (including ray tracing, lighting, refraction, reflection, etc). Crysis (the game) looks very good because the CryEngine graphics engine is very good.
  • Animation system: Define how your characters move. This includes defining the walk cycle (i.e. one full step of the character walking, which is looped to show a walking character).
  • Scene graph: A level in a game is a huge 3D (or 2D) space, with lots of things – characters, objects, lights. All of these need to be defined and instantiated. These need to be held in memory while the game is playing. Knowing what objects are where, and keeping track of them in memory is the job of a scene graph. The renderer shows you the view of what is currently visible to you, while the scene graph keeps track of everything that is “nearby”, and is the one who calculates what is and is not visible (and should hence be sent to the renderer).
  • Physics: As described earlier, the physics of the game world. When things are thrown, what is their trajectory. If something hits something else, how much doe it bounce. Compute the mass, the force, the acceleration, and apply the Newton’s laws (or another set of laws, if the game world has different physics than our own).
  • Networking: This most programmers should be familiar with.
  • AI: This is what actually defines how different characters (the computer controlled ones) behave and react. Note that you’re not always trying to create reality, or “human” behavior. All you want is a fun experience – not necessarily realistic.
  • Audio: Sound effects, and voice-overs.
  • UI: The interface for the game. Including inputs, options, etc.
  • Scripting: While the basic engine is programmed in C++, for defining what happens in a game, a low-level programming language like C++ or Java is not an ideal language to define the “gameplay.” For this, a scripting language like Lua, or Python is used. Or, like Unreal Engine, the engine might have its own scripting language. Compiling a game takes a long time (more than half an hour for a big game), so you definitely don’t want to write your game logic in a compiled language and require a full compilation every time you make a minor change.

Who would be interested in Game Development

If you want to make a career in game development, these are some things to think about:

  • You need to be interested in games, and should have some knowledge of games. That will make work more interesting
  • You should have played, and analyzed a variety of games – that way you know and understand what are the different possibilities out there
  • You should like working in a team. A game development team can be 100s of people, all working together to produce a single game. And if you’re not really a team player, you will not be able to function properly.
  • Good communication skills. A game development team has people from many different teams, with different backgrounds, and if you’re not good at communication, especially written communication, you might run into problems.

Once you’ve become a game programmer, you’ll find yourself using these skills a lot:

  • Mathematics!!
    • Linear Algebra: matrix operators, vectors, quaternions
    • Co-ordinate systems (remember your geometry?)
    • Trigonometry – basics, like 10th/12th std. level
    • Laws of physics (laws of motion, angular velocity/momentum etc).
  • Programming
    • C/C++. .NET, C# for tools. Scripting languages (python, lua).
    • Object-oriented programming.
    • Writing optimized code

But here is the biggest reason why you should get into game development:

  • Game development is at the cutting edge of technology. All the latest and best technology is used in games first, and only slowly and later does it trickle down into other fields of programming. Game development is the F1-racing of programming.

Links

Lookup these links for some further interesting reading for games.

TechWeekend #9 (#tw9): Game Development

If you like programming, then you cannot miss TechWeekend. This month (actually, 10am tomorrow), we have TechWeekend 9 (#tw9) which will focus on Game Development.

A Programmers’ introduction to Game Development

By Girish Dhakephalkar, http://shoonyagames.com

An introduction to various elements involved in game development with a focus on programming. This talk would explain the structure of a game development team and how the roles fit into the overall plan. It will also explain the basic ideas and concepts related to game programming, including an overview of a game engine and its working. Lastly, it will highlight the kind of skill-sets required by someone who wants to make it as a game programmer.

Game Development using XNA

By Dhaval Faria.

Microsoft XNA is the game development framework (tools and runtime) used for building games for Xbox 360.

Microsoft XNA is a set of tools with a managed runtime environment provided by Microsoft that facilitates computer game development and management. XNA attempts to free game developers from writing “repetitive boilerplate code” and to bring different aspects of game production into a single system.

2-D Game Development for WinPhone7 using Sliverlight

By Mayur Tendulkar.

Mini-Barcamp

We will have about 90 minutes for a session on whatever topics people in the audience feel like talking about. Ideally, we would like you to give a 10 minute lightning talk on a tech topic you’re really interested in (not necessarily game development). It would work best if you’ve prepared beforehand, but that is not a requirement.

About Techweekend

TechWeekend Pune is a volunteer run activity. TechWeekend talks are held on the 3rd Saturday of every month from 10am to 2pm at Sumant Moolgaonkar Auditorium, Ground Floor, ICC Trade Center, SB Road. Each TechWeekend event features 3 or 4 talks on advanced technical topics. These events are free for all to attend. See PuneTech articles about past techweekends to get an idea of the events.

Join the techweekend mailing list to keep in touch with the latest TechWeekend activities.

About the Sponsor – Microsoft

Many thanks to Microsoft for sponsoring the venue for Techweekend. Microsoft wants to get more closely involved with the tech community in Pune, and particularly the open source enthusiasts – with the intention of making everybody aware that their cloud technologies (like Azure) actually play well with open source, and that you can deploy your php applications, your drupal/joomla installs on Azure.

Fees and Registration

TechWeekend #9 happens tomorrow, Saturday 10am-2pm, at Sumant Moolgaokar Auditorium, Ground Floor, Wing A, MCCIA Trade Towers, ICC Complex, SB Road.

This event is free and open for anybody to attend. Please register here

What I like about Rails3 by Gautam Rege

(This article by Gautam Rege is based on a talk he gave at Techweekend #8. It was first published on the Josh Software blog, and is reproduced here with permission.)

This is NOT a post about differences between Rails 2.x and Rails 3 but these are some musings about what I love in Rails. A lot of goodies come ‘in the box’ (I hate saying out-of-the-box) with Rails3 and some of them have been there since early version of Rails but somehow less frequently used or talked about. I spoke about this at Techweekend #8 and the presentation is here.

Bundler

Ever had a production system crash one day – without any code deployment or even anyone logging in. After the initial ‘its not me’ excuses, one system administrator says ‘Hey, I had updated the system libraries’. Having been burnt already before (hopefully), you check on the system and find that some system library has been upgraded and some gems have been upgraded and that is causing incompatibility between other gems etc. We had the case where rack (1.0.1) was upgraded to rack (1.1) causing incompatibility with the Rails gem we were running! The fix is simple — upgrade or downgrade your gems or libraries and you’re on your way. A few days later, another developer needs to deploy a simple sinatra application. He takes the latest version which requires rack > 1.1 and it automatically upgrades the gem. Boom! Your Rails app crashed again.

Did I hear you freeze the gems? Nah – not a good approach, as it causes your application deployment bundle to be huge and ‘frozen’. Every application you use would require to freeze gems and this does not really solve your problem.

Bundler (by Yahuda and Carl) built this awesome gem which is now the de-facto standard for any Rails application. In fact, it was so cool, its not Rails 2.x compatible and very highly recommended. You can now specify your dependencies in a Gemfile and prevent any clashes with any other gem versions and their dependencies. Since the gems are installed in the system default location (not frozen in your app), it means it us re-usable and version friendly!


source "http://rubygems.org"

gem "haml" # the latest version
gem "rack", "~>1.1" # v1.1 or greater
gem "nokogiri", :git => "git://github.com/tenderlove/nokogiri.git"
gem "splat", :path => "~/Code/splat" # local code base

group :test do # only in test environment
gem "rspec", :require => "spec"
end

UJS

Unobtrusive Java Script has been around for ages now but Rails lingered with prototype.js. Now, with the awesome features of JQuery, we can easily use UJS to solve some common and nagging problems:

  • Avoid submit if button clicked twice!
  • Make non-get requests from Hyperlinks!
  • Submit form data via Ajax

Add :remote => true to hyperlink, forms and other elements. This adds the data-remote=true in your html properties. The ‘live’ JQuery function binding kicks in and sets up the events for various elements. Simple and awesome – this is available here.

XSS

Cross site scripting has been a pain to handle for a long time. Rails does this under covers – you dont event need to know too many details:

protect_from_forgery is automatically added during basic rails project creation. This ensures that every form created by the application has an authenticity_token as a hidden data field. During a post request, this is verified and thus ensures that the source of the form creation is the same server – this avoid session stealing where a malicious form is posted to your server using an authenticated user’s session!

While using UJS, you need to add csrf_meta_tag in your layout to avoid silent Ajax errors.

SQL injection is cleanly avoided with new where syntax:

# Wrong
where("user_name = '#{user_name}' AND "password = '#{password}'").first

# Correct
where("user_name = ? AND password = ?", user_name, password).first

# Correct and clean
where(:user_name => user_name, :password => password).first

In Rails3, all html spewed out is HTML SAFE! So, you cannot leave gaps for non-HTML safe code, even by mistake! If indeed you do trust the source, you can use the ‘raw’ method to spew out the HTML as is.

Rails Eager Loading

The N+1 query problem is fairly common and largely ignored until you hit serious performance issues.  Straight out of the Rails guide, consider the case

clients = Client.all.limit(10)

clients.each do |client|
puts client.address.postcode
end

There are 11 queries fired here. Using the :includes construct, Rails does eager loading like this:

clients = Client.includes(:address).limit(10)

clients.each do |client|
puts client.address.postcode
end

Here only 2 queries are fired as Rails includes the address relationship too while fetching the client objects.

Transliteration / Babosa

What happens to your permalinks if a user enters the information in Arabic? We faced exactly this issue and were asked by our client to prevent input which is not English. Woh! ActiveSuppprt in Rails3 addresses a lot of these transliteration issues:

"Jürgen Müller".to_slug.transliterate.to_s #=> "Jurgen Muller"

Performance using Identity Map

The awesomeness of Rails progression – As of this inclusion the Identity Map pattern is now part of Rails 3 caching mechanism. An identity map is a design pattern used to improve performance by providing a in-memory cache to prevent duplicate retrieval of the same object data from the database, in context of the same request or thread.

Optimistic Locking

A really old concept which has been there since REALLY early versions of Rails. This is commonly overlooked but is critically important when it comes to concurrent request processing. By adding a ‘lock_version’ field in the table, Rails automatically kicks into optimistic locking mode and prevents concurrent writes when the data is stale. The StaleObjectError is raised incase the lock_version is not the same as when it was read.

Named Scopes

This is almost cliched now 🙂 Mames scopes were added since Rails 2.1. Its one of the things I love about Rails. The scopes are chained together and the query is fired only when the data is really needed. This is excellent for report filters! Adding new filters is a breeze as its only one of the scopes to be chained. Remember that scopes do not return an Array but an association object like has_many. That is how they can be chained to other scopes.

I’m pretty sure I have missed some things here. Do comment on what features you like best about Rails3! 😉

 

TechWeekend 8: Web Development Frameworks – Rails, Grails, Django

TechWeekend #8 (#tw8) this Saturday will focus on Web Development Frameworks. We have the following talks lined up, and one more is likely to get added in the next day or two

  • Grails, and other web development techniques in Groovy, by Saager Mhatre
  • Interesting new things in Rails3, by Gautam Rege
  • “A Django Case-Study: Use of advanced features of Django in http://wogma.com” by Navin Kabra. This talk will be structured in such a way that people who are not familiar with Python/Django might find the features interesting; while Django developers will be interested in how they were implemented in Django.

TW8 will be this Saturday, 19th March, from 10am to 2pm, at the Sumant Moolgaonkar Auditorium, Ground Floor, A Wing, ICC Trade Center, SB Road.

About Techweekend

TechWeekend Pune is a volunteer run activity. TechWeekend talks are held on the 3rd Saturday of every month from 10am to 2pm at Sumant Moolgaonkar Auditorium, Ground Floor, ICC Trade Center, SB Road. Each TechWeekend event features 3 or 4 talks on advanced technical topics. These events are free for all to attend. See PuneTech articles about past techweekends to get an idea of the events.

Join the techweekend mailing list to keep in touch with the latest TechWeekend activities.

About the Sponsor – Microsoft

Many thanks to Microsoft for sponsoring the venue for Techweekend. Microsoft wants to get more closely involved with the tech community in Pune, and particularly the open source enthusiasts – with the intention of making everybody aware that their cloud technologies (like Azure) actually play well with open source, and that you can deploy your php applications, your drupal/joomla installs on Azure.

When, Where, How much

TechWeekend #8 will be on Saturday, 19th March, from 10am to 2pm, at Sumant Moolgaonkar Auditorium, Ground Floor, Wing A, ICC Trade Center, SB Road.

This event is free and open for anybody to attend. Register here.

Event Report: TechWeekend Pune 7 – Mobile Application Development

TechWeekend Pune 7, on Mobile Application Development was held on Saturday, 19th Feb. These are the live-tweets, collected here for your benefit. Remember, they are live-tweets that were being typed while the event was happening, so they’re not necessarily as coherent and as well-organized as a regular article.

Windows Phone 7 by Mayur Tendulkar

The first talk was by Mayur Tendulkar talking about Windows Phone 7

  • This talk is a basic overview of Windows Phone 7. Important now, because Nokia has now thrown its weight behind it.
  • “If windows is not behaving well, you format your drive and start again. MSFT did same with its Mobile OS. Win Phone 7 is completely new”
  • Mobile phone world suffers from large number of devices of different resolutions that behave differently. This is not true of Win Mobile 7. Windows Phone 7 insists on a standardized hardware & screen configuration. So your Win Phone 7 will always look and behave the same.
    • WinPhone7 screen config: 480×800 or 320×480. No other sizes allowed. S-LCD/AMOLED capacitive touchscreen. 4-point multi-touch
    • WinPhone7 will always have these sensors: A-GPS, proximity sensor, accelerometer, compass, light.
    • All WinPhone7 devices must have these three buttons: Start, Back, Search. (As usual, to shutdown, you press Start 🙂
  • App Development for WinPhone7: regular apps using Silverlight, and game apps using XNA.
    • “Silverlight is just like Flash”. Modern app UI framework. Apparently has 500,000 developers spanning windows, web (and now mobile)
    • Visit the Tata Nano site or the Hard Rock Cafe New York site to see some cool uses of Silverlight
    • The XNA framework for game development is mature and widely accepted – because it was in XBox 360, Windows and Zune.
  • WinPhone7 developers get all the goodness of Visual Studio for developing mobile apps with Visual Studio 2010 Express for WP.
  • Other developer tools: Silverlight Dev Kit. XNA Game Studio 4.0. Expression Blend 4.0. Also VB for WinPhone7.
  • All these development tools for WinPhone7 are free.

This was followed by a walk through of building a WinPhone7 app using Visual Studio 2010 and Silverlight.

Some interesting audience Q&A:

  • Q: What languages are supported for WinPhone7 development? A: At this point, only Visual Basic and C#
  • Q: Does WinPhone7 support multi-tasking. A: No. Some standard system services can run in the background; but apps don’t multitask.

Cross-Platform Mobile Application Development by Rohit Ghatol

Next up: Rohit Ghatol talking about cross-platform mobile app development using phonegap, titanium etc.

  • Two ways of developing cross-platform apps. 1. Develop html5 apps for webkit. 2. Use a translator that translates your app to native code.
  • For now, all major mobile platforms have a webkit based browser (except WinPhone7). So writing an app targeting webkit is “cross-platform”
  • Q: Will a webkit based app work with WinPhone7? A: No. But Mango release of WinPhone7 will support html5, so you should be close.
  • Translating common codebase to different native apps – Titanium. Write in JavaScript, and translate to Native.
  • PhoneGap = HTML5 + CSS3 + JavaScript + special ability to make calls to access phone sensors etc.
    • Note: HTML5/CSS3 development for mobile apps works because all phone browsers are much more advanced on this issue than desktop browsers
    • Features supported by phonegap: accelerometer, camera, compass, contacts, file io, geolocation, audio recording, sound, vibration, storage. Note: not all these features are supported on all mobile phone platforms
    • PhoneGap prerequisites: Need to be a html/javascript expert. Also, it doesn’t help you with UI, you need to be able to develop that
    • So with PhoneGap app development, you’ll probably be doing UIs by using JQueryUI or something like that.
    • Note: PhoneGap ultimately creates a native app that users install. Not just a website that they visit in the browser.
  • At this point, Rohit, showed actual PhoneGap code for a mobile app – to write an app that shows a google map of my current location.
  • Big challenge of PhoneGap is that you need to bring your own UI development framework. This is an advantage also! – PhoneGap allows you to have same UI framework for website as well as your mobile app.
  • Rohit’s suggestions for UI framework – 1. GWT 2. jQueryMobile
  • With Titanium, you write apps in Javascript. This is interpreted by MozillaRhino on Android, and by Webkit JavascriptCore on iOS
    • You have two different directories for images – one for Android, & one for iPhone, because they handle images differently.
    • iPhone requires just one size of images. Android allows different images for different screen sizes/resolutions/orientations.
    • Titanium problem – layout is absolute. For people used to the great layout capabilities of Android, this is a big step down
    • Titanium uses native UI (iPhone and Android), where are PhoneGap uses non-native (html/css) UI. Former gives better experience…
  • PhoneGap/Titanium both use Javascript Interpretation, so both can’t do multi-threaded apps
  • Building your own webkit based cross-platform framework makes sense if you want to overcome limitations of phonegap/titanium.
  • This won’t be as clean as phonegap/titanium, but might be good for your specific case. Steal phonegap/titanium code if required!
  • Comparison of PhoneGap vs Titanium. Titanium more proprietary, limited UI, …
    html5/css3/javascript is the future; but not there yet. Until then, write to webkit specs…

Android Performance Tuning by Anand Hariharan

Next speaker was Anand Hariharan talking about Android Performance tuning.

  • For app performance: first focus on what the user wants, don’t just improve performance for the sake of improving performance. Optimize only after measuring performance, and having specific performance goals. A lot of performance tuning, is really about managing user perception. When doing something that will take time, keep user engaged.
  • Don’t optimize everything for performance – you don’t have the time. Focus on the most important user visible features and fix those. In mobile world – reduce features and use the time saved on fixing performance.
  • Manage user perception better: e.g. Apple’s use of loading a bitmap image of app at beginning to give impression that app has loaded. At app startup time, load a bitmap that looks like your app without the latest data. Gives impression that app load is fast.
  • Performance tips: All platforms have a “recommended best practices” doc. Read that – many developers dont 🙂 e.g. Android best practice: for tasks that take time, use a background service (not an activity).
  • Anand talking about how to avoid an “Application Not Responding” (ANR) dialog for your app
    • An android app is single-threaded. So don’t do io (network or disk) synchronously. Use an async mechanism.
  • Keep activities small. Don’t overload activities. Use different activities to do different things.
  • Use the minimum number of views. Do not use a deeply nested view hierarchy. Your view hierarchy shouldn’t be more than 3 levels deep. If you’re views are getting complicated, consider writing custom views.
  • Track memory allocations. Garbage collection happening during user activity causes slowdowns.
  • Close your cursors. Otherwise garbage collector cannot reclaim memory. Then you get GC cycles, and slowdowns.
  • use onRetainNonConfigurationInstance() to retain large amounts of data between device orientation changes (landscape to portrait)
  • Use SoftReferences to cache data so that the garbage collector can reclaim the memory when required.
  • Avoid database writes as far as possible. Writes take 5ms to 200ms. And full SD card has slower writes.
  • Avoid using data from mutiple tables in a single list (AdapterView). First copy data from multiple tables to a single table and show that. e.g. in Email app, subject and body came from different tables. This really slowed down the inbox view (which shows first line of body).
  • Tools to help with android app optimization: Fix your views using: hierarchyviewer, layoutopt. Check flow & times using: traceview. Use zipalign to optimize your apk (improves app load time).
  • Above all, you must understand what you’re optimizing and why. Measure, measure, measure.

TechWeekend7 (#tw7): Mobile Application Development – 19 Feb

TechWeekend 7 (#tw7) will focus on Mobile Application Development, and we have these talks lined up:

  • Application Development for Windows Phone 7 & Marketplace – by Mayur Tendulkar. With Nokia throwing all its weight behind Windows Phone 7 for all its smartphones, Windows Phone 7 has suddenly become a much more important platform than it was before. Get an overview of what Windows Phone 7 is in this talk. Mayur works on various mobile and location aware technologies at Zevenseas India. Click here for Mayur’s full background
  • Cross-Platform Mobile Application Development – by Rohit Ghatol. With the smartphone market becoming increasingly fragmented, frameworks like PhoneGap and Titanium are becoming popular as means of writing an app just once and deploying it across different mobile platforms. Rohit will talk about his experiences with using PhoneGap/Titanium, and will also touch upon how you could create your own cross-platform framework. Rohit is an associated architect for QuickOffice – the mobile office software suite. Click here for Rohit’s full background
  • Performance Tuning for Android Applications – by Anand Hariharan. Performance is a very critical factor for success of a mobile app, since cellphones are still under-powered as compared to the desktops. This talk will cover Java/Android performance tips, best practices; benchmarking and tracing tools, and what areas to look at in your app for improving performance. Anand is Director of Engineering–Product Development at the India office of Android-based tablet software maker TapNTap. Click here for Anand’s full background
  • Using HTML5/CSS3 for Mobile App development – Arnab Chakraborty. HTML5 is fast becoming an alternative to native apps for mobile app development. This talk will cover the specific features of HTML5 and of CSS3 that make it appropriate for development of mobile apps. Arnab is a senior developer at Thoughtworks. Click here for Arnab’s full profile

This event is free and open for anybody to attend. Please register here

About Techweekend

TechWeekend Pune is a volunteer run activity. TechWeekend talks are held on the 3rd Saturday of every month from 10am to 2pm at Sumant Moolgaonkar Auditorium, Ground Floor, ICC Trade Center, SB Road. Each TechWeekend event features 3 or 4 talks on advanced technical topics. These events are free for all to attend. See PuneTech articles about past techweekends to get an idea of the events.

Join the techweekend mailing list to keep in touch with the latest TechWeekend activities.

About the Sponsor – Microsoft

Many thanks to Microsoft for sponsoring the venue for Techweekend. Microsoft wants to get more closely involved with the tech community in Pune, and particularly the open source enthusiasts – with the intention of making everybody aware that their cloud technologies (like Azure) actually play well with open source, and that you can deploy your php applications, your drupal/joomla installs on Azure.

Register

This event is free and open for anybody to attend. Please register here

TechWeekend LiveBlog: NoSQL + Database in the Cloud #tw6

This is a quick-and-dirty live-blog of TechWeekend 6 on NoSQL and Databases in the Cloud.

First, I (Navin Kabra) gave an overview of NoSQL systems. Since I was talking, I wasn’t able to live-blog it.

When not to use NoSQL

Next, Dhananjay Nene talked about when to not use NoSQL. Main points:

  • People know SQL. They can leverage it much faster, than if they were to use one of these non-standard interfaces of one of these new-fangled systems.
  • When reporting is very important, having SQL is much better. Reporting systems support SQL. Re-doing that with NoSQL will be more difficult.
  • Consistency, and Transactions are often important. Going to NoSQL usually involves giving them up. And unless you are really, really sure you don’t need them, this issue might come and bite you.
  • If you’re considering using NoSQL, you better know what the CAP theorem is; you better really understand what C, A, and P in that mean; don’t even consider NoSQL until you’re very well versed with these concepts
  • RDBMS can really scale quite a lot – especially if you optimize them well. So 90% of the time, it is very likely that the RDBMS is good enough for your situation and you don’t need NoSQL. So don’t go for NoSQL unless you are really sure that your RDBMS wont scale.

MongoDB the Infinitely Scalable

Next up is BG, talking about MongoDB, the Infinitely Scalable. They are using MongoDB in production for http://paisa.com (Infinitely Beta). The main points he made:

  • Based on the idea that JSON is a well understood format for data, and it is possible to build a database based on JSON as the primary data structuring format.
  • The data is stored on disk using BSON, a binary format for storing JSON
  • Obviously, JavaScript is the natural language for working with MongoDB. So you can use JavaScript to query the database, and also for “stored procedures”
  • MongoDB it does not really allow joins; but with proper structuring of your data, you will not need joins
  • You can do very rich querying, deeply nested, in MongoDB
  • MongoDB has native support for ‘sharding’ (i.e. breaking up your data into chunks to be spread across multiple servers). This is really difficult to do.
  • MongoDB is screaming fast.
  • It is free and open source, but it is also backed by a commercial company, so you can get paid support if you want. There are hosting solutions (including free plans) where you can host your MongoDB instances (e.g. http://mongohq.com)
  • You store “documents” in MongoDB. Since you can’t really do joins, the solution is to de-normalize your data. Everything you need should be in the one document, so you don’t need joins to fetch related data. e.g. if you were storing a blog post in MongoDB, you’ll store the post, all its meta-data, and all the comments in a single document.

MongoDB Use Cases:

  • Great for “web stuff”
  • High Speed Logging (because MongoDB has extremely fast writes)
  • Data Warehousing – great because of the schema flexibility
  • Storing binary files via GridFS – which are queryable!

MongoDB is used in production by these popular services:

FourSquare recently had a major unplanned downtime – because they did not understand how to really MongoDB. That underscores the importance of understanding the guarantees given by your NoSQL system – otherwise you could run into major problems including downtime, or even data loss. See this blog post for more on the FourSquare outage

Some stats about use of MongoDB at paisa.com. 54 million documents. 80GB of data. 6GB of indexes. All of this on 2 nodes (master-slave setup).

Redis

Gautam Rege now talking about his experiences with Redis. Main points made:

  • Redis is a key-value database with an attitude. Nothing more.
  • Important feature: in (key, value), the value can be a list, hash, set.
  • 1 million key lookups in 40ms. Because it keeps data in memory.
  • Persistence is lazy – save to disk every x seconds. So you can lose data in case of a crash. So you need to be sure that your app can handle this.
  • Redis is a “main memory database” (which can handle virtual memory – so your database does not really have to fit in memory)
  • All get and set operations on Redis are atomic. A lot of concurrency problems and race conditions disapper because of atomicity.
  • Sets in redis allow union, intersection, difference. Accessed like a hash.
  • Sorted sets combine hashes and arrays. Can lookup by key, but can also scan sequentially.
  • Redis allows real-time publish-subscribe.
  • Redis is simple. Redis is for specific small applications. Not intended for being the general purpose database for your app. Use where it makes sense. For example:
    • Lots of small updates
    • Vote up, vote down
    • Counters
    • Tagging. Implementing a tagging solution is a pain – becomes easy with Redis
    • Cross-referencing small data
  • Don’t use Redis for ORM (object-relational mapping)
  • Don’t use Redis if memory is limited
  • Sites like digg use Redis for tagging

SQL Azure

Saranya Sriram talking about SQL Azure and data in the cloud. SQL Azure is pretty much SQL Server in the cloud, retrofitted for for the cloud:

  • Exposes a RESTful interface
  • Has language bindings for python, rails, java, etc.
  • Gives full SQL / Relational database in the cloud
  • The standard tools used to access SQLServer locally can also be used to access SQL Azure from the cloud
  • For Azure you get a cloud simulation on your local machine to develop and test your application. For SQL Azure, you simply test with your local SQL Server edition. If you don’t have a SQL Server license, you can download SQL Server Express, which is free.
  • You can develop applications in Microsoft Visual Studio. You can incorporate PHP also in this.
  • You can also use Eclipse for developing applications.
  • SQL Azure has a maximum size limit of 50GB. (Started with 1 GB last year)
  • There is no free plan for Azure. You have to play. “Enthusiasts” can use it free for 180 days. If you sign up for the Bizspark program (for small startups, for the first 3 years) it is free. Similarly students can use it for free by signing up for the DreamSpark program. (Actually, the Bizspark and DreamSpark programs give you free access to lots of Microsoft software.)

8 Tech Events in Pune over the next few days

We try to list all the interesting tech events in Pune in the PuneTech Calendar. A few of them are promoted on the PuneTech blog as an article, but we don’t always write an article about all of them. So, if you are not subscribed to the PuneTech calendar (rss, email, sms), then you might not be aware of all of them.

Here is a quick listing of the events happening tomorrow, Saturday, 15 Jan:

  • TechWeekend: Monthly meeting on specific tech topics. This month’s focus is NoSQL and Databases in the Cloud. 10:30am, SICSR.
  • Cutting Edge Water Technologies from across the world. Organized by Venture Center and NCL. 11am, at Venture Center, Pashan Road.
  • SPIN Pune Meet – Next Generation Outsourcing. 5:30pm, Persistent, SB Road.
  • YASHADA: Wikipedia 10th Anniversary Celebration: 5pm-6:30pm. at YASHADA.
  • SICSR: Wikipedia 10th Anniversary Celebration: 6:30pm. at SICSR.
  • Joomla 1.6 Release Party. 6:30pm, Tekdi Web solutions office, Karvenagar.

On Sunday, 16th, IUCAA has a talk on the Chandra X-Ray Observatory, by Dr. Giuseppina Fabbiano. 6pm at IUCAA.

On Tuesday, 18th, eZest and Telerik are conducting a free seminar on implementing your own Agile process. From 9am to 1pm, at MCCIA Trade Tower, SB Road.

All of these events are free, and anybody can attend them. For more details, including registration procedure (if any), and details of the event, see the PuneTech Calendar.