Posts

Showing posts from 2010

Avoid uploading duplicated files in FTP using MSDOS script

I was uploading files using the script I made in a previous post, and all was working smoothly until I reach a directory full of images used for an address book application, there were about 2,000 files. The current version of the script made no comparison for file existence (actually it deletes the old file in the server before attempting to save the new one) or date comparison. In this case, and assuming those files change don’t change too often, I start thinking in a new process to remove the duplicated files and only upload the non existing files. I made a new FTP script to read the remote files and then delete the existing files from the local PC. This process is a dumb process and only task is to delete all files from the list. It is not aware of date changes or new file versions. Saying these, if you use this script, always work with a backup of your files, never with your original files as they might be deleted. The script usage is: deleteDuplicatedFiles.cmd <Root direc...

FTP Uploading files using MSDOS script

Recently I was working in a static Web Site and at the time I need to upload it to the server, I realize there were several files and directories to upload. As I’ve never been a big fan of FTP programs other than the command line provided in each OS, and, instead of searching if there were already a public solution, I started thinking in an automation script to upload the files. The basic idea of an automation script is to read the contents of a directory, create a commands script for FTP and then execute the generated script. But it also needs to be recursive within internal directories. As I was working with Windows, the script I created is for MS DOS The way to call it is: uploadfiles <Root directory to upload > Where the given root directory is where the desired files to upload are stored. Taking a little walkthrough of the script, it works like these: 1. Set working variables and defaults. set user= < set FTP User> set pass= < FTP Password > set site= < site ...

Daily accomplishments

I was reading “No B.S. Ruthless Management of People and Profits: The Ultimate, No Holds Barred, Kick Butt, Take No Prisoners Guide to Really Getting Rich” by Dan Kennedy. It makes reference to a study made to top executives. According with the referenced study, the executives, by their own account only averages 40 minutes or less of actual accomplishment. In my work as a Project Manager, we found an average developer to be productive for 80% of their time, in an 8 hours shift, it will be about 6:30 hours; plans where made with this in mind. Could that be that when responsibilities are increased and more people need to be managed by us, our own accomplishments decrease?

iPhone's Numeric Pad keyboard with a DOT

Image
I was developing an application for iPhone which handl es numeric fields to register information. To my disappointment, even in iOS 4, there is no default keyboard for a Number pad including a dot “.”; there is a Number pad with numbers from 0 to 9 and the backspace, in the other hand we have the Numbers and punctuations, which includes numbers, dot, parenthesis, and other symbols. T he problem with the former is the absence of a dot and the later is that we can easily switch to the alphabetical keyboard. But what happen with the Number pad including a dot? The Number pad keyboard includes a blank space After a little search a found a couple of examples of including the dot in the kwyboard, using the blank space. First, lets say we have a text field defined and connected to the interface IBOutlet UITextField * textMoney ; And wich keyboard type is the Number Pad self . textMoney . keyboardType = UIKeyboardTypeNumberPad ; In order to include the Dot, we need to stat receiving...

Migrating Contacts over phones

Recently I was helping in a cell phone migration; contacts were the most important thing to migrate, but the devices where not directly compatible as the devices where a Nokia and a Samsung. After a couple of Google’s searches, I got to the idea that there were no application so make my life easier, so I got to the task to investigate what the vendor’s applications were capable of. I install in a Windows PC both suites, Nokia PC Suite and Samsung PC Studio, after I connect and synchronize both devices I got the option of exporting and importing contacts. From the Nokia PC Suite, I exported all contacts; as a result I got a single file including all the 100+ contacts. I then turn to Samsung’s suite and try to import from the file, but it only imports the first one. I don’t know if it has something to do with the vCard standard, but, most of the products I´ve tried do the same when reading multiple cards within a file. So, next thing to do was to create as many files as contacts to impo...

WebServices solution for iPhone - Second Stage

The FileDownloadController class Once I had the FileDownload class, it came to me the problem of using it many times and from many places. I could create as many FileDownload objects as needed, but this will create many variables and lines of code. My solution was to create a controller class ( FileDownloadController ), which I implement with a Singleton Pattern . The concept is: The FileDownloadController class will create and manage all needed FileDownload objects Whenever an object needs to download a file, it should get the FileDownloadController instance and then asks for the download Once the download is complete, or in case of error, a callback will be received by the requesting object In order to maintain certain acceptable performance, because the download process works in the background and consumes resources, there should be a limited number of concurrent downloads, this number is set when the controller is created. In my tests, using an iPhone 3G, an acceptable num...