Obtain last substring of string
May 12, 2008 at 10:30 am | In Uncategorized | No Comments#ifdef STRRSTR_MISSING
#ifndef NULL
#define NULL 0
#endif NULL
#ifdef ANSI
char *strrstr(char *s1,char *s2) {
#else
char *strrstr(s1, s2)
char *s1;
char *s2;
{
#endif
char *sc1, *sc2, *psc1, *ps1;
if (*s2 == ”)
return((char *)s1);
ps1 = s1 + strlen(s1);
while(ps1 != s1) {
–ps1;
for (psc1 = ps1, sc2 = s2; ; )
if (*(psc1++) != *(sc2++))
break;
else if (*sc2 == ”)
return ((char *)ps1);
}
return ((char *)NULL);
}
#endif
Rebuilding LaunchServices database
May 9, 2008 at 10:23 am | In COCOA | No CommentsTags: Finder "Open With" menu, LaunchServices, LaunchServices.framework
If your "Open With" menu shows applications that are no longer installed, or shows some of them as duplicates, you can use the following Terminal command to rebuild your LaunchServices database: /System/Library/Frameworks/ApplicationServices.framework/\ Frameworks/LaunchServices.framework/Support/lsregister \ -kill -r -domain local -domain system -domain user
Adding an Application entry to the loginwindow.plist
May 8, 2008 at 9:04 am | In COCOA | 1 CommentTags: COCOA, loginwindow, osascript, System Events
Adding an Application entry to the loginwindow.plist
/usr/bin/osascript -e “tell application \”System Events\” to make new login item with properties { path: applicationPath, hidden:false } at end”
Blog at WordPress.com. | Theme: Pool by Borja Fernandez.
Entries and comments feeds.