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

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.

September 24, 2008

PaperLess 2.0

Filed under: PaperLess, software — dinhviethoa @ 8:07 am


PaperLess was first a simple document scanner for Mac OS X.
Since it was not that easy to find the produced document and since searching the documents was also a pain, I had to create some kind of library that would contain all the documents. Creating folders for documents is a pain, then, I chose not to let the user do this and rather let him type a name and a comment so that he can search his documents. This is 2.0.

Available for download (Mac OS X).

Note: this is not open-source.

December 14, 2007

at Home, I can now Blog on Software using a Mac

Filed under: life, software — dinhviethoa @ 11:57 pm

1. got a Mac ?
computer
switched my desktop computer/server to an iMac 24″ :
- I still have Unix
- I don’t have to care anymore about the sound driver or getting transparency on X11.
- My scanner now works with my desktop computer (Canoscan LIDE 600 for those who care). Though, the support could be better.
In short, I have a computer that just works. I can spend time working on software.

Though, what still missing is something that would be like apt to install software.
- Macport will build software from source, which will probably fail or at least take some time
- I have to try fink

2. PaperLess
scanner
I worked on <a href=”http://www.etpan.org/paperless“>PaperLess to make it work on Leopard.
ImageCapture framework does not currently work as expected.
I used examples from ImageCapture SDK.
They do not work on Leopard (with my Scanner).
Especially, after transferring the scanned image, next connections to the scanner will fail.
I had to use some workaround to make the scanner works.

3. New blog hosting
write
I got rid of wordpress locally, it’s now hosted at dinhviethoa.wordpress.com.

4. Next home
home
My next home

July 16, 2007

libEtPan, PaperLess, etpanX

Filed under: book, mail, software — dinhviethoa @ 3:38 am

1. libetpan

There is some work available in the CVS :
- libetpan has a new build system for Unix automake is now used. Thanks to Marcus Brinkmann for this work.
Funny that automake will automatically import the GPL licence into your project in a COPYING and also overwrite this file if this contains something else. Use –foreign to avoid this behavior.
- Sebastien Marinier did some work to fix the Windows build.
- a basic RSS/ATOM fetcher/parser has been implemented in libetpan. This was based on rssyl-ng/libfeed implementation. Thanks to Andrej Kacian.

2. PaperLess

A basic scanner application has been implemented for Mac OS X. This is called PaperLess. This will allow you to perform multiple-page document scan and save the document to PDF.

3. etpanX

etpanX is still in progress.

3.1. Account synchronization

synchronization An IMAP synchronization and POP synchronization has been implemented. Still some improvement is needed but user experience is now nearly a local access when reading mails in the IMAP account after the first synchronization with the IMAP server.

3.2. Filter

The implementation of filter is in progress. The plan for filter implementation is :
- Filter will not block the user interface even if it takes some time.
- Only messages from the main mailbox of a given account will be filtered.
- Message that were not yet filtered will be hidden.
- As soon as messages have been process, they will be visible.

4. Reading

Konrad Lorenz – Studies in Animal and Human Behaviour

September 30, 2006

sample – next step

Filed under: software — dinhviethoa @ 3:16 pm

sample now has a user interface. Just pass the output generated by sample (redirected to a file) to gtk-sample (in gtk-ui) and you will get the following :

sample ui

It is available here. It is currently only for linux.

Older Posts »

Blog at WordPress.com.