bensangeorge.com

Archive for the ‘software’ Category

eBook readers and the publishing industry

without comments

A sector of technology that has been growing lately has been the eBook market. With Amazon on their third iteration of the Kindle and the B&N Nook selling out faster than it can ship into stores, the publishing industry is being forced to re-think their strategy of how to get titles into the hands of their faithful readers. The following two videos show how Sports Illustrated and Bonnier Corporation [ no bias of course :-) ] have in mind. Although the demos look pie-in-the-sky right now, it is still exciting to watch them to see how the concept of a magazine might change in the next five years.

Mag+ from Bonnier on Vimeo.

Written by bensan

December 23rd, 2009 at 12:32 am

Drupal bits: Migrating remote files in Drupal

with 3 comments

Recently I had to import a set of remote image files from another server but was not absolutely clear on how to get this done the Drupal way. I found the really came up with a solution of my own with drupal_http_request() which accepts an incoming URL and then executes a HTTP client request. The function returns the data and the response code.

[code lang="php"]$binary_image = drupal_http_request($url);[/code]

After checking the response code to make sure it was successful, use the Drupal function file_save_data() to physically store the file into whatever directory you want to store the image file in.

[code lang="php"]
if ($binary_image->code == 200) {
$filepath = file_save_data($binary_image->data, $save_to, FILE_EXISTS_RENAME);
if ($filepath !== 0) {
// attach other relevant information as well
$fileinfo['filepath'] = $filepath;
$fileinfo['filesize'] = filesize($save_to);
$fileinfo = array_merge($fileinfo, getimagesize($save_to));
return $fileinfo;
}
[/code]

The physical file should be saved but just because you’ve saved the file in the directory does not mean that Drupal is aware of the file. In order for that to happen, you also need the mime type, the file size, and the filepath and manually insert into a node. Once you’ve got those, you can create a node and insert those values along with the rest into it.

[code lang="php"]

// create a node
// add the file's information into the node
$node['field_thumbnail'] = array(
array(
'list' => 1,
'data' => array(
'alt' => '',
'title' => '',
),
'fid' => $fid,
'uid' => $user->uid,
'filename' => $resource['logo_file'],
'filepath' => 'files/_thumbnails/'.$resource['logo_file'],
'filemime' => $info['mime'],
'filesize' => $info['filesize'],
'status' => 1,
'timestamp' => time(),
'alt' => '',
'title' => '',
'upload' => '',
),
[/code]

This will make Drupal recognize your files. Everything should be gravy. Hope this works for you.

By the way, for all of you already on Drupal 7(lucky you), file_save_data() saves the data and automatically updates the database with the file information.

Written by bensan

June 27th, 2009 at 10:45 pm

Book Review of “The Passionate Programmer”

without comments

For developers that are really interested in steering their IT career instead of having their career steered for them, “The Passionate Programmer” is a must have. This book is a revision of My Job went to India. While some of it is relevant information on how to compete in a global development market, it is also talks about how to really make yourself a valuable asset to your organization. One of the more interesting ideas in the book is to not count on your technical skillsets to make yourself valuable but to start knowing your business. In other words, your business does not care if you are love working with Python or PHP but rather can you get the job done and do you know enough about your business domain. Seems extremely trite but for techies, it takes a while to get used to the idea. You can get this book at pragprog.com. Hope it raises your level of thinking about your tech career as it did mine.

Written by bensan

May 20th, 2009 at 2:06 pm

The future of Drupal (as envisioned by Lullabot!)

without comments

Fascinating glimpse into an alternate view of the enriched UI experienced spearheaded by Lullabot. This is a separate project than the “offical” Drupal 7UX project. I am excited at the prospect of Drupal having a very friendly user experience. Enjoy!

project buzzr

Written by bensan

April 14th, 2009 at 1:36 am

Posted in software

Tagged with

dumping mysql and importing mysql

with one comment

One thing that a developer has to do during the course of a project is to export a mysql database so that he can set up a new development environment, transfer data, etc.

In mysql, the mysqldump command works great for this:
mysqldump –verbose -user -h [hostname] -p[password] [database_name] > file.sql

When importing a sql file, just go the other way:

mysql -u [username] –verbose -p[password] -h [hostname] [database_name] < file.sql

This two commands will make importing and exporting databases a snap.

Written by bensan

March 30th, 2009 at 2:13 pm

Launching Running Expo 2.0

without comments

running expo screenshot

Do you love to run or jog? Training for a marathon or 5K? Running Expo allows you to connect with the Facebook user community and create your own digital running route information using Google Maps. Users can search on nearby routes that other people have saved against their profiles as well. For security purposes, we made sure that all routes have access levels. Each route can be made viewable by everyone that is using the Facebook application [public], seen only by your Facebook friends [shared], or be viewable only by you[private].

The future of this project looks bright. A big shout-out to the lead developer of the app, Seth Cardoza for having the vision and bringing me on board. For now, one of the main responsibilities that I will have is to make sure that the word gets out about Running Expo and getting other people to realize it’s value in the Facebook app-space. Without giving away too much, the primary focus of the next iteration will be to hook integrate much deeper with the Facebook platform. So stay tuned.

Please look around and let me know what you think. I would love to hear some feedback. Hope you like the app as much as I enjoyed making it!

Written by bensan

February 26th, 2009 at 5:11 am

Keeping an engineering notebook

with 4 comments

If you took a lab in college like I did, you’d probably know how much your professors forced students to keep an engineering notebook. Well, it turns out that keeping an engineering notebook really pays off significantly. There’s a lot to gain by keeping a documented account of your work.

It helps you record your solutions and store it in one centralized location. How many times have you come across the same problem when working and not recall that pivotal eureka moment that let you arrive at your solution? Even if your solution is not made explicity in your notebook, even retracing  the steps taken to achieve your answer will help you jog your memory faster than anything else can.

Engineering notebooks can help you to reveal previous trends. The items that wasn’t so obvious when you are in the thick of it. Things such as individual workflow habits and the effort spent on each task.ruled-moleskine-pic

Documents a history of work as evidence Working in a creative role, it is sometimes hard to quantify your level of effort against a certain task or group of tasks. When it comes to software development, it seems there are always items that have not been taken into account of in the official project plan. We’ve all been there. There’s always “that one other thing” you have to do before you get into the main task at hand. Before you know it , the level of effort it takes to accomplish the periphery tasks snowball out of control. Next thing you know, your boss is hovering over your desk demanding to know why a task that was slated for half a day has been unresolved for a week. An engineering notebook can help you persuade them by showing them exactly how much effort is going into finding a solution. (Of course, it’s your job to estimate tasks responsibly but that’s another topic altogether).

Read the rest of this entry »

Written by bensan

February 13th, 2009 at 5:02 am

Keeping the team informed

with 2 comments

One of the most important responsibilities that any project manager has to undertake is to track and keep on top of the status of each project. That is part of the job. If you are working on a project that involves multiple teams, make it a priority to know where everyone is on their tasks. Do it in a way that doesn’t continually interrupt their train of thought.

One way of keeping track of tasks is to display the progress of each task (hours remaining till task is complete) in a location that everyone involved in the project has easy access to them. This could be anything from a poster sheet to a whiteboard or even a persistent online message board – as long as it is big enough and persistent to contain all the important tasks that require tracking. Also, make sure that each member of the team understands the purpose behind these information broadcasting tools and encourage them to update it on a regular basis. A good time to update the whiteboard may be every time code is checked in to your source management system(svn / cvs / git).

In the long run if the boards are respected and honored for their purpose both the project management and development teams can spend less time on “figuring out where we are” and more time trying to figure out the next steps to take towards a successful launch date.

Written by bensan

December 23rd, 2008 at 7:04 am

The difference between good and bad project managers

with 4 comments

Throughout my career working in the web development industry, one of the most interesting aspects is the dynamic between the project manager and the development team members.

Developers can tell when they have a good project manager on board with them . They look forward to the chance of working with them. You are:

  • comfortable and conversant with technology. Ideally you ought to have some technical experience behind you.
  • you exercise courage and patience when interfacing with the business and technical personnel. You can handle whiny programmers, unrelenting clients, and the crushing weight of looming deadlines and you make it look easy.
  • you are constantly looking for and communicating solutions to decrease the burden of the programming team. We understand that you’re not on the same level as the dev team technically. Get involved anyway. You’ll only sound stupid the first few times but you may be able to catch a glimpse of how hard the problem truly is. This also takes a bit of courage.
  • you act as a buffer for the development team. Great project managers are resilient and don’t fold under pressure.

Read the rest of this entry »

Written by bensan

December 20th, 2008 at 3:22 am

Using TextMate as a web developer tool

with 4 comments

It has taken several months of work on my Macbook Pro to realize that TextMate is my favorite text editor!

Here are some ways that you can use Textmate to help you with web development. Please note that all of these tips (and more) can be found in the most excellent book, Pragmatic TextMate: Power Editing for the Mac

Closing opening tags – One really important command in this bundle to open and close a tag. You can open and close a tag by typing ^+Shift+< when there is nothing to the left of your cursor. You will see a open tag and close tag appear. Type in whatever you want for your open tag and watch the close tag automatically mirror it for you. After you are done typing in the tag hit Tab and you’ll be able to place your cursor in between the open and close tag. This is great when creating pages full of HTML code. This works with XML documents as well.

Inserting a doctype – For anybody who cannot remember the syntax differences between the XHTML 1.0 Transitional and XHTML 1.0 Strict doctype element, type in the word doctype and hit Tab. This will bring up an option menu from where you can select the exact doctype that you want. It’s saved me an extra 30 seconds. Maybe it will for you too.

Validating your markup with the W3C – Every web developer is concerned with web standards. It helps ensure that all of their web pages work across multiple platforms and stays well formed so that it does not break tomorrow either. Now you can do this within Textmate by typing in ^+Shift+V.

Inserting color codes in CSS stylesheets – When you are creating your CSS stylesheets and you want to double-check the color of a particular hex value, type in Shift+Cmd+C. This will bring up Textmate’s color chooser and allow you make a choice. The color you selected will be transformed to a six digit hexadecimal value with a leading number sign.

When you start using these Textmate shortcuts to do your web development work, you are going to notice that your time to turn around web projects are going to be shorter. Combined with shortcuts, snippets, and command-line integration into Textmate, you are going to start wondering if you ever need to use any other tool for creating textual content.

Written by bensan

November 27th, 2008 at 9:00 pm