rock’n roll

May 25, 2009

iPhoneSpree

Filed under: iPhone, software — dinhviethoa @ 8:08 pm

Similar to MacHeist, which features a bundle of apps by independent Mac developers, iPhoneSpree is giving away bundles of apps — but you don’t have to buy anything to enter. There are 80 levels of winning, with the top 1st-3rd prize winners receiving all 18 apps in the bundle (full list here). You can enter via the website or Twitter.

March 14, 2009

NSURLConnection, Draw a glow, Eliza AI

Filed under: iPhone, software — dinhviethoa @ 4:14 pm

1. NSURLConnection

For those who were wondering about this (and I was).
Really, yes, NSURLConnection knows how to handle cookies and does it by default.
You don’t have to manage it by hand.

2. Draw a glow

If you want to reproduce visually the highlight you can see on a UIToolbar button, you can use the following code sniplet :

void evaluate(void *info,const float *in, float *output) {
	float                x=in[0];
	float                _C0[4]={1,1,1,0};
	float                _C1[4]={1,1,1,1};
	int                  i;
	float factor;

	x = 1 - x;
	float c = 0.3;
	float b = 1;
	factor = exp(-(x - b) * (x - b) / (2 * c * c));
	for(i=0;i<4;i++)
		output[i] = _C0[i]+factor*(_C1[i]-_C0[i]);
}

- (void) drawRect:(CGRect)rect
{
	CGColorSpaceRef space;
	CGFunctionRef function;
	CGShadingRef shading;
	float radius;
	float range[8]={0,1,0,1,0,1,0,1};
	float domain[2]={0,1};
	CGFunctionCallbacks callbacks={0,evaluate,NULL};
	CGPoint center;
	CGRect glowRect;
	CGContextRef context;

	glowRect = [self glowRect];
	context = UIGraphicsGetCurrentContext();

	CGContextSaveGState(context);
	CGContextTranslateCTM (context, CGRectGetMinX(glowRect),
						   CGRectGetMinY(glowRect));
	CGContextScaleCTM (context, glowRect.size.width, glowRect.size.height);

	space = CGColorSpaceCreateDeviceRGB();
	function = CGFunctionCreate(self,1,domain,4,range,&callbacks);

	radius = 0.5;
	center.x = 0.5;
	center.y = 0.5;
	shading = CGShadingCreateRadial(space, center, 0, center, radius, function, NO, YES);
	CGContextDrawShading(context, shading);
	CGShadingRelease(shading);
	CGColorSpaceRelease(space);

	CGContextRestoreGState(context);
}

3. Eliza AI

Do you want emacs doctor back to your iPhone ? You can install our latest app :

Eliza AI

February 14, 2009

Hard construction work in vietnam

Filed under: life — dinhviethoa @ 9:38 pm

How to get additional square meters :

img_00831

French private Joke

Filed under: life — dinhviethoa @ 9:28 pm

To be clean everywhere …

fion1

UINavigationBar and touch events : strange behavior

Filed under: iPhone, software — dinhviethoa @ 7:30 pm

In the iPhone SDK, strange things seems to happen with UINavigationBar.
You have a UINavigationBar at the top of your screen. Then, you can add some widgets (UIView) below the navigation bar.
But it seems that if you try to touch thoses views. UIEvent won’t be forwarded to them if you touch just under the navigation bar.
It seems that in a zone just under the navigation bar, of about 8 pixels height, events won’t be sent to your views but will be forwarded to the navigation bar.

It’s nice since, then, UIButtonBarItem in the navigation bar will be easy to touch because if you miss them and touch under the navigation bar, this will activate them anyway.
It’s also some kind of bug since when you place a view that is 30 pixels, only (let’s say) 22 pixels of the bottom of the view will be touchable and the top part of the view will forward events to the navigation bar and it’s not useful if there are no buttons in the navigation bar.

In the following screenshot : for both button A and B, the the part on top of the red zone is not touchable.

picture-104

In my application, the zone is even larger (about 15 pixels). I did not analyze yet what it could be due to.

February 8, 2009

SmartRSS 2

Filed under: iPhone, software — dinhviethoa @ 10:49 pm

Yet an other RSS reader for iPhone ?

December 25, 2008

gNotes

Filed under: iPhone, software — dinhviethoa @ 2:52 pm

Forget all notes applications! Here comes gNotes

Powered by Google, coded by Hoà at Visuamobile, gNotes is the perfect companion to take notes and sync them easily on the go.

Syncing notes has never been that easy. All you need is a gMail account and you’re done.
You can seamlessly sync notes between your computer (Mac or PC) by using the Google Notebook Web application and your iPhone or iPod Touch without doing any complicated manipulations on the iPhone.

Features:
- Create, edit, delete, re-order notes easily
- Organize notes into folders
- Two way fast syncing between your iPhone and your laptop/desktop (PC or Mac : http://www.google.com/notebook) without any extra software
- Secured note solution: Powered by Google, no privacy issue

A shopping list, one of your brilliant ideas or a classic to do list, from your computer or your iPhone, gNotes takes good care of it and makes sure that your notes are available wherever and whenever you are.

screenshot51 screenshot2-note-detail

You can get it from the iTunes AppStore.

December 16, 2008

UITableView bugs

Filed under: iPhone, software — dinhviethoa @ 1:30 am

1. new company

I’m now at visuamobile.
I’m working on software for iPhone.

2. a word on dequeueReusableCellWithIdentifier:

Did you thought – [UITableView dequeueReusableCellWithIdentifier:] was only for performance issue ?
In fact, this is mandatory when you have to call reloadData at any time.
It has some bug in the following case :
- highlight the cell by touching the cell
- reloadData on the UITableView
- then, touch up to select the cell
The UITableView will try to use the highlighted cell instance (which may have been dealloc’ed) when you touch up instead of using the new created cell.
So that this will crash.

It looks that the workaround is to use the following method of UITableView :
- (UITableViewCell *)dequeueReusableCellWithIdentifier:(NSString *)identifier

3. edit mode and reloadData

Don’t try to call – reloadData on UITableView while it is in edit mode.
This will have a buggy behavior, especially when you call reloadData while the user is touching-dragging the rows to move them.
The workaround is to call reloadData when you are back from edit mode.

4. disable move of rows

– (NSIndexPath *)tableView:(UITableView *)tableView targetIndexPathForMoveFromRowAtIndexPath:(NSIndexPath *)sourceIndexPath toProposedIndexPath:(NSIndexPath *)proposedDestinationIndexPath
if you try to return sourceIndexPath as result, this will have a bad behavior. You tableview will be broken. The dragged cell at the end of drag will be at a strange position in the tableview.

October 12, 2008

Superheroes

Filed under: Uncategorized — dinhviethoa @ 11:02 pm

October 10, 2008

libetpan 0.57

Filed under: mail — dinhviethoa @ 5:51 pm

libetpan 0.57 has been released.
This is for the needs of claws-mail.
Thanks to claws mail, releases of libetpan occur more often :)
I am also thinking about writing an API to produce messages more easily.
This will be based on the work done in etpanX. If you think about an API which is currently hard to use, just tell me.

For hype-ness purpose, I am writing this from my iPhone 3G, with wordpress iPhone application.

Older Posts »

Blog at WordPress.com.