In my day work I had to compress the database backup file to an external storage using 7zip. I did this by creating a batch file E.g. Compress.bat and inside it using the 7zip executable to compress the backup file
"C:\Program Files\7-Zip\7z.exe" a -t7Z -m0=LZMA2 -mx9 -mmt10 "E:\backup.7z" "C:\Database\productionbackup.bak"
This assumes that your 7z.exe is installed in C:\Program Files directory. The -t7Z means that you want the destination file to be in 7zip format. The -m0=LZMA2 means that the compression algorithm to be used is LZMA2. The mx9 switch specifies that you want Ultra compression ratio.
The mmt10 switch specifies that you want to use 10 processor core for the compression. PLEASE BE AWARE that you should specify -mmt5 if you want to use 5 out of the 10 cores available to avoid overloading the processor for the batch job.
The next parameter is the destination file name, after that would be the source file name.
With the batch file then you can schedule a scheduled task in Windows server for compression of the backup file automatically. Poor man's implementation but it's been so far so good for me.
Hope this helps.
Friday, January 4, 2013
Tuesday, February 10, 2009
Same problem as us?
nice article on how UK's emphasis on financial wizardry might hurt them in the road to recover.
http://www.guardian.co.uk/commentisfree/2009/feb/08/james-dyson-engineering-britain-railways
Are we on the same track?
http://www.guardian.co.uk/commentisfree/2009/feb/08/james-dyson-engineering-britain-railways
Are we on the same track?
Monday, February 9, 2009
Here is what makes me goes on...
As my last post suggests the earnings are actually going down very rapidly. Therefore had been busy coming up with other apps, when I've decided to take a breather and check out reviews for my current application here is what I saw and it really gives me the motivation to try and come out with other 'innovative' (shameless me) way of doing mobile software.
I am really really happy that my new way of creating flowchart with focus of fast and simple works for the reviewers (UK appstore). It feels great when your creation is being appreciated by the users. Hope I've achieve the aim of showing my friends that we are better than what we/others think. (I still remember my friend's remark on doing a flowchart is too difficult)
Oh how can I forget, if you are interested you can purchase it here
I am really really happy that my new way of creating flowchart with focus of fast and simple works for the reviewers (UK appstore). It feels great when your creation is being appreciated by the users. Hope I've achieve the aim of showing my friends that we are better than what we/others think. (I still remember my friend's remark on doing a flowchart is too difficult)Oh how can I forget, if you are interested you can purchase it here
Sunday, January 25, 2009
Sales figures so far
Hi all,
As promised more posts. Here is the sales figure for 5 days so far.
Total downloads: 100
Commision paid to me: USD $1.4 per sales
Estimated profits: USD $140
Majority of the sales comes from USA. Second most downloaded region is Japan (pretty surprised considering I did no localization). Third coming in is Great Britain.
So no, you can't survive on iPhone apps alone.
iPhone flowchart application
Best regards.
As promised more posts. Here is the sales figure for 5 days so far.
Total downloads: 100
Commision paid to me: USD $1.4 per sales
Estimated profits: USD $140
Majority of the sales comes from USA. Second most downloaded region is Japan (pretty surprised considering I did no localization). Third coming in is Great Britain.
So no, you can't survive on iPhone apps alone.
iPhone flowchart application
Best regards.
Tuesday, January 20, 2009
My first iphone flowchart app up
Yes after all the wait and frustrations finally my first iPhone app is up! Of course there are some gotchas again. Most importantly for your W-8BEN submission the ITIN number is not really required, key in 000000000 also for item 9 select first and second checkbox, leave 10 empty as singapore have no tax treaty with the states. This got me for a while...trying to apply for ITIN from IRS...
you can have a look at my app here. anyway more post to come...oh I'm available for iPhone application consulting jobs in the meantime..(finding inspiration for next app still)
you can have a look at my app here. anyway more post to come...oh I'm available for iPhone application consulting jobs in the meantime..(finding inspiration for next app still)
Saturday, November 22, 2008
Creating Toolbar in iphone sdk
Here is how you can create a toolbar at the bottom of your screen. (with code taken from the UICatalog sample)
UIToolbar *bar = [UIToolbar new];
bar.barStyle = UIBarStyleBlackOpaque;
// size up the toolbar and set its frame
[bar sizeToFit];
CGFloat toolbarHeight = [bar frame].size.height;
CGRect mainViewBounds = self.view.bounds; //view of your viewcontroller
[bar setFrame:CGRectMake(CGRectGetMinX(mainViewBounds),
CGRectGetMinY(mainViewBounds) + CGRectGetHeight(mainViewBounds),
CGRectGetWidth(mainViewBounds),
toolbarHeight)];
//add button
// create a bordered style button with custom image
UIImage *im = [UIImage imageNamed:@"selection.png"];
UIBarButtonItem *selectItem = [[UIBarButtonItem alloc] initWithImage:im
style:UIBarButtonItemStylePlain
target:self
action:@selector(changeSelection:)];
selectItem.width = 50.0f; //you can set the width of the icon
selectItem.title= @"Selection"; //set text below image icon
//note the nil at the end
NSArray *items = [NSArray arrayWithObjects: selectItem,nil];
[bar setItems:items animated:NO];
[self.view addSubView:bar];
[selectItem release];
[bar release];
UIToolbar *bar = [UIToolbar new];
bar.barStyle = UIBarStyleBlackOpaque;
// size up the toolbar and set its frame
[bar sizeToFit];
CGFloat toolbarHeight = [bar frame].size.height;
CGRect mainViewBounds = self.view.bounds; //view of your viewcontroller
[bar setFrame:CGRectMake(CGRectGetMinX(mainViewBounds),
CGRectGetMinY(mainViewBounds) + CGRectGetHeight(mainViewBounds),
CGRectGetWidth(mainViewBounds),
toolbarHeight)];
//add button
// create a bordered style button with custom image
UIImage *im = [UIImage imageNamed:@"selection.png"];
UIBarButtonItem *selectItem = [[UIBarButtonItem alloc] initWithImage:im
style:UIBarButtonItemStylePlain
target:self
action:@selector(changeSelection:)];
selectItem.width = 50.0f; //you can set the width of the icon
selectItem.title= @"Selection"; //set text below image icon
//note the nil at the end
NSArray *items = [NSArray arrayWithObjects: selectItem,nil];
[bar setItems:items animated:NO];
[self.view addSubView:bar];
[selectItem release];
[bar release];
sizing UILabel accordingly to the height of the string
In my app I needed to resize the UILabel size dynamically in runtime as the text would not be determined during compilation time. Luckily this can be done by using the sizeWithFont method of NSString class.
CGSize textSize = [ myText sizeWithFont: font constrainedToSize: CGSizeMake(lineWidth, lineHeight*1000.0f) lineBreakMode: UILineBreakModeTailTruncation ];
UILabel *l = [[UILabel alloc] initWithFrame:CGRectMake(10,10,textSize.width,textSize.height)];
This took me awhile to find out..hope it helps you. Happy coding.
- Call sizeWithFont of the text.
- Get back a CGSize struct and you can now init your UILabel with the struct.
CGSize textSize = [ myText sizeWithFont: font constrainedToSize: CGSizeMake(lineWidth, lineHeight*1000.0f) lineBreakMode: UILineBreakModeTailTruncation ];
UILabel *l = [[UILabel alloc] initWithFrame:CGRectMake(10,10,textSize.width,textSize.height)];
This took me awhile to find out..hope it helps you. Happy coding.
Subscribe to:
Posts (Atom)