SQLite -- same DB, different machines -> different results

2009-06-11 Thread Тимофей Даньшин
Hello. I've written the alfa of my first app on the Mac which works in an acceptable manner on my macbook. But when i run it on my iMac, it returns different results for the in seemingly the same conditions. The application is a dictionary. As the user types a word into the searchfield, he

Re: SQLite -- same DB, different machines -> different results

2009-06-12 Thread Тимофей Даньшин
Thank you all for your replies. I really didn't have any "order by" clause. But, unfortunately, I can't test it on my iMac right now. On Jun 11, 2009, at 6:30 PM, Gregory Weston wrote: Timofey wrote: I've written the alfa of my first app on the Mac which works in an acceptable manner on my m

Re: Multiple keyboard shortcuts for the same menu command

2009-07-27 Thread Тимофей Даньшин
Well, you could have two different menu items doing the same thing and having the two shortcuts. On Jul 27, 2009, at 11:38 AM, Oleg Krupnov wrote: I'd like the "Go Back" command in my app to be triggered by both Cmd+[ and Cmd+<- (left arrow) keyboard shortcuts. How do I do that? I am aware of

Re: Hyperlinks in NSAttributedString?

2009-07-30 Thread Тимофей Даньшин
Yes, it is possible. See the docs for NSAttributedString for details. There was also an example of how to make hyperlinks, the link to that sample code, i suppose, must be there, too. Best regards, Timofey On Jul 30, 2009, at 1:53 PM, Rick Mann wrote: I need to render short sentences in my

Spotlight

2009-03-01 Thread Тимофей Даньшин
Hi all! I have a potentially large database with attributedStrings. Is there a way to somehow get the Spotllight find the closest matches to another string, or do i have to write the search engine myself? Thank you. Timofey. ___ Cocoa-dev mailing

setSelectedRange doesn't work properly...

2009-03-01 Thread Тимофей Даньшин
Hello. In my NSDocument-based application I use a number of my own attributes to the NSTextStorage in that document. The funny thing is when i set the cursor to the desired point and begin typing, one of those attributes gets broken, i.e. the range containing the text that i type in doesn't

Exel and PowerPoint

2009-03-02 Thread Тимофей Даньшин
Hello. Are there any abstractions in Cocoa to open and handle Exel and PowerPoint files? Thank you. Timofey. ___ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) Please do not post admin requests or moderator comments to the list. Contact the mode

NSMutableDictionary drives me mad.

2009-03-10 Thread Тимофей Даньшин
Hello. I am writing a method for searching for the longest common substring. The idea is to store the pieces of that LCS in an NSMutableDictionary with TMIntWrappers as keys and NSMutableStrings as values. Now, TMIntWrapper is the class i created for wrapping ints into objects. It stores an

SearchKit quiestion.

2009-03-16 Thread Тимофей Даньшин
Hi all. In my application I have to search for strings closest matching a given string. So, for example, if the "given string" is "Hello. Would you like some oranges", I need to find "Hello. Would you like some lemons" or "Hello. Would you want some oranges" (if they are in the database)

Xcode & GoogleCode.

2009-03-19 Thread Тимофей Даньшин
Hello. Are there any instructions out there for creating new Xcode projects in an existing SVN repository on Google Code from within Xcode? For the only way i could find was to create an empty project in Xcode, then commit it to the repository from a command line and then create a new pro

- (IBAction) executes normally, but then crushes.

2009-03-19 Thread Тимофей Даньшин
Hello. I have got a method that is an IBAction, and it works quite all right, it reaches its final curly bracket, but then the whole application crushes for some reason. But the words [Session started... etc] in the log appear about three lines before the phrase "Finished adding to the DB

Re: - (IBAction) executes normally, but then crushes.

2009-03-19 Thread Тимофей Даньшин
Could you, please, expand on that? Am I using too much memory? Am I not releasing objects correctly? I am really at my wit's end... On Mar 20, 2009, at 12:12 AM, mm w wrote: memory 2009/3/19 Тимофей Даньшин : Hello. I have got a method that is an IBAction, and it works quite all

Re: - (IBAction) executes normally, but then crushes.

2009-03-19 Thread Тимофей Даньшин
1edd697 <+0039> and%esi,%edx 0x91edd699 <+0041> mov(%edi,%edx,4),%eax By the way, are there any manuals on reading these stacktraces? On Mar 20, 2009, at 1:36 AM, Shawn Erickson wrote: 2009/3/19 Тимофей Даньшин : 2009-03-19 23:47:28.204 Untitled[16510:10b] The splitString

Send events to AppleScript

2009-03-20 Thread Тимофей Даньшин
Hello. Is it at all possible to have an application send actions to a particular AppleScript script, or set that script as a delegate of that application or to have an AppleScript as a means of communication between two applications (one of which is mine, and the other isn't)? Thank you in

Re: Send events to AppleScript

2009-03-21 Thread Тимофей Даньшин
On Mar 21, 2009, at 5:38 AM, has wrote: On Mar 21, 2009, at 1:06 AM, Тимофей Даньшин wrote: On Mar 21, 2009, at 3:34 AM, has wrote: Is it at all possible to have an application send actions to a particular AppleScript script, Yes. See NSAppleScript/OSAKit/Carbon OSA APIs. There

Re: Send events to AppleScript

2009-03-21 Thread Тимофей Даньшин
dify those elements. On Mar 21, 2009, at 7:28 PM, has wrote: On Mar 21, 2009, at 12:09 PM, Тимофей Даньшин wrote: Well, I'm writing a "translation memory" application, which is a program that grabs sentence by sentence from a given text (that needs translating), asks the user t

Custom windows -- just curious

2009-03-23 Thread Тимофей Даньшин
Hi. Does anybody know how to make totally custom windows, such as the control window in DVD Player or the minimized iTunes window? As i said in the subject -- I am just curious. Timofey. ___ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) Please

KVC-KVO compliance - noob questions

2009-03-26 Thread Тимофей Даньшин
Hi. I'm new to the field of KVC/KVO, but I want to master it. Are there any standard tests to check whether my objects are KVC/KVO compliant? And are there, perhaps, simpler and less profound explanations of that subject, than the ones on the Apple site? Thank you for your attention and repl

Absolutely Mysterious Compilation Error

2009-03-29 Thread Тимофей Даньшин
Hello. I have a class called "TableMaker". And i import its header in the header of another class. The funny thing is that every once in a while the app fails to build, XCode pointing to the line "TableMaker *tableMaker;" in that other header file as the cause of the failure. If i comment ou

Re: Absolutely Mysterious Compilation Error

2009-03-29 Thread Тимофей Даньшин
Yes, that cleared it. Thank you a lot. Could you, please, tell me, where i can read more about circular includes and what the ways of dealing with them are? It seems rather an odd thing after Java. On Mar 30, 2009, at 3:25 AM, Stephen J. Butler wrote: 2009/3/29 Тимофей Даньшин : It

Double Clicks in an NSTextView.

2009-04-01 Thread Тимофей Даньшин
Hello. I would like to be able to intercept double clicks on the text in an NSTextView even if the text is not a link and is not in an NSTextAttachmentCell. I did try to do this by implementing the textView: willChangeSelectionFromCharacterRange: toCharacterRange and comparing the initial

Cursor Invisible when NSTextView is not editable

2009-04-04 Thread Тимофей Даньшин
Hello. In my application, i need some parts of the text in my NSTextView to be editable and some not. However, the user should be able to navigate through those non-editable parts, but the cursor (the flickering thing showing the insertion point) gets invisible as soon as it gets into a n

SQLite and Unicode

2009-04-06 Thread Тимофей Даньшин
Hello. When I insert non-latin strings into my SQLite3 database, they turn into some weird sets of characters (as I select those strings later in Terminal), and the fields, which contain those strings, become unusable by my application. I googled for it for quite a bit, but everywhere it s

SQLite3 and Unicode Strings - Problem

2009-04-07 Thread Тимофей Даньшин
Hello. In my application, I have the need to store strings with non-latin characters in a SQLite database. But when I insert them, they become corrupt. When i bind the string to the prepared statement, i do make sure it is in UTF-8: sqlite3_bind_text(sentence_insert_statement, 1, [string UTF

Fwd: SQLite and Unicode

2009-04-07 Thread Тимофей Даньшин
is that i am able to add non-latin strings to it by reading sql files from SQLite in Terminal... Best regards, Timofey. On Apr 6, 2009, at 2:31 PM, Тимофей Даньшин wrote: When I insert non-latin strings into my SQLite3 database, they turn into some weird sets of characters (as I select

Re: SQLite and Unicode

2009-04-07 Thread Тимофей Даньшин
here will be problems with non-latin chars. Can that be the issue here? How can i chop off the NULL-char off the cString just to give it a try? On Apr 7, 2009, at 9:12 PM, Keary Suska wrote: On Apr 7, 2009, at 10:39 AM, Тимофей Даньшин wrote: On Apr 7, 2009, at 8:14 PM, Keary Su

Re: SQLite and Unicode

2009-04-07 Thread Тимофей Даньшин
your help. And if you could give me a hint on how to safely get unicode chars at a given position of a string, I'd be even more grateful :) Timofey. On Apr 7, 2009, at 10:23 PM, Greg Guerin wrote: Тимофей Даньшин wrote: To be on the safe side, i make a local copy of the method's inp

static vs non-static. Recommendation needed.

2009-04-13 Thread Тимофей Даньшин
Hello. A foreword: In my application I need to allow the user to create a database. So i display a dialogue panel, collect all the necessary information about the db to be created and create a "DatabaseInfo" object. Then i pass that DatabaseInfo object to the DatabaseCreator to actually crea

Re: static vs non-static. Recommendation needed.

2009-04-13 Thread Тимофей Даньшин
But I might suggest you've omitted a couple of options. Would it be, for example, particularly evil if your DatabaseInfo object include a createDatabase method? Well, not exactly, i suppose. The point is that i create DatabaseInfo either before creating a new database or after opening an ex

Problem: sqlite3 and .sqlite-journal files

2009-04-17 Thread Тимофей Даньшин
Hello. As I wrote earlier, in my application a user can open a database or create a new one, and then perform some tasks, the results of which are stored in the said database. However, a strange thing happens: when the user _creates_ a database, everything is stored as hoped. But when the

It doesn't work without the NSLog()... Why?

2009-04-29 Thread Тимофей Даньшин
Hello. It's a very funny thing. And i do hope i am not bonkers. But the following code works fine until i delete the line with "NSLog()". In the latter case it just returns an empty array. Are there any sane reasons why that can happen? - (NSArray *) selectWordsBeginningWith:(NSString

Re: It doesn't work without the NSLog()... Why?

2009-04-29 Thread Тимофей Даньшин
ause might be. On Apr 29, 2009, at 4:32 PM, Graham Cox wrote: On 29/04/2009, at 10:05 PM, Тимофей Даньшин wrote: NSArray *ret = [mutableRet copy]; // NSLog(@"The number of items to be returned is: %i", [ret count]); [mutableRet release]; return ret;

NSOperation, Sqlite, library routine called out of sequence

2009-04-29 Thread Тимофей Даньшин
Hello again. In short, i get an error calling the same synchronized singleton DatabaseManager from different threads. Here is what I am actually doing. As I was writing earlier, i am writing a dictionary application that is supposed to show translations for words from the database. In the

Re: NSOperation, Sqlite, library routine called out of sequence

2009-04-29 Thread Тимофей Даньшин
: Тимофей Даньшин wrote: In short, i get an error calling the same synchronized singleton DatabaseManager from different threads. Are you sure your database accesses are synchronized (i.e. thread- safe)? I see nothing in the posted code that uses @synchronized or any other locking mechanism

Re: NSOperation, Sqlite, library routine called out of sequence

2009-04-29 Thread Тимофей Даньшин
Hm... That really works! Thanks a lot. Putting the bodies of those methods in @synchronized(self) blocks helped Thanks a lot again. On Apr 29, 2009, at 11:33 PM, Greg Guerin wrote: Тимофей Даньшин wrote: The DatabaseManager is synchronized. If any class is to communicate with the db, it

Re: Problem with the list?

2009-05-04 Thread Тимофей Даньшин
Same here. Didn't receive anything from the first of May till today. They must have been celebrating the international workers' day :). On May 4, 2009, at 6:31 PM, Robert Martin wrote: Hi, I haven't received any posts for several days now, on any of the Apple lists I'm subscribed to...Is thi

NSTableView, 2mln rows, looks bad.

2009-05-04 Thread Тимофей Даньшин
Hello. I need to have a tableView with about 2 million rows, and that figure may actually be bigger. But the table looks awfully bad in that case: you get artifacts when scrolling, the text in the rows does not coincide with the alternate bluish and white stripes, and if you click on a row

Re: How to change the case of letters

2009-05-04 Thread Тимофей Даньшин
It looks like, if you want to change the case of a particular letter (say, all occurrences, letter "a"), you will have to iterate through all the chars in your textView, check if they are "a"s, if they are upper or lower case, and change their case accordingly. That is, if I understood your

NSTextView delegate methods in NSTextView subclass.

2009-05-06 Thread Тимофей Даньшин
Hello. I have subclassed NSTextView and I am using that subclass as a field editor for an NSTextField. On certain events in the field editor, i need to take certain actions again in the field editor, and as of now i have to use delegate methods in the TextField's delegate to call methods i

Dashboard-style window flip.

2009-05-07 Thread Тимофей Даньшин
Hello. This might be a noob question, but I'd like my application to have it's two or three settings to be located "on the back of it's window", like widgets in DashBoard do. I've been googling for it, but all i could find was a desperately slow "Window Flipper" project. Can you recommend m

Win->MacOS porting question.

2009-05-13 Thread Тимофей Даньшин
Hello. I am about to get involved in a project on porting a windows program into MacOS. The original program is written in C++ with limited use of windows-specific libraries, and its owner wants the code that will result from that project to be compilable both under Windows and MacOS (and,

C++ constructors.

2009-05-13 Thread Тимофей Даньшин
Hi there. Here is a C++ constructor that is said to work on Windows (i.e., the guy who wrote it says it works on Win), but doesn't work on Mac. Is there a way to fix it, except by replacing it with a "copy" method? Cbyte1::Cbyte1 (Cbyte1 &val) { m_size = val.m_size; if (m_s

Categories and splitting an app into logical blocks.

2009-05-15 Thread Тимофей Даньшин
Hello. Suppose, I have an app that, for example, works with a database. It can write to the db, it can select things. There is a class that works with the database, a class that controls that class and a class that interacts with the gui. And, of course, there is some testing code in all

Re: IP detection code by country

2009-05-15 Thread Тимофей Даньшин
I once used the "IP-to-country" database for my site. It was a free-to-download-and-use csv consisting of ip ranges and countries, to which they correspond. It can easily be used to create an sqlite database. Check out http://ip-to-country.webhosting.info. But there are no Cocoa libs for th

Re: microsoft file formats in cocoa

2009-05-17 Thread Тимофей Даньшин
TextEdit doesn't render quite a lot of things in doc files, such as footnotes, headers/footers, comments and lots of other things. I've tried to find a library that would do that, but failed. If you do find anything like that (or reinvent it for that matter ;) ), please, let me know as well.

[OT] default boot device

2009-05-26 Thread Тимофей Даньшин
Hello. I installed another version of MacOS X in a separate partition of my hard disc. And now whenever i start the computer, it boots from that partition by default (unless i press option to select the partition to boot from this time). How can i permanently change the primary boot device