Olie

Santa Cruz Mountains, CA

Apr
29
comment Need to generate HMAC SHA256 hash in Objective C as in Java
The problem I'm having is that my particular data (I'm using the same hMac routines you guys are), when I do const char *cData = [data cStringUsingEncoding: NSASCIIStringEncoding];, returns cData = NULL. Now I just have to figure out why. (I have a very narrow "this data worked, now this slightly modified data doesn't" test case, I just need to diff them and figure it out.)
Apr
28
comment AppStore In-App-Purchase: How to get the currency a user will pay in?
Getting the local price is simple enough using this answer, but I'm curious if there's a way to get the USD price, regardless of the user's current store. (I wish to alter the thank-you message based on how many 99¢-s were spent.) Can you update your answer to show how to always get the USD price? Thanks!
Apr
28
comment Get ios app store price in correct currency for price tier and location
Old answer/question, but the downvote (not mine) might have been because, as a general rule, we try to put answers directly into SO, rather than just saying "see the documentation [here:link]". Links go stale, and it's just another step for the questioner. That's my guess, anyway. If you spruce-up your answer with some example code of your own (perhaps based on the docs), I'd happily up-vote it. :)
Apr
27
comment Interview Question: What is a hashmap?
Older dictionaries had cut-outs on the page-edges showing where each letter began. So you could quickly turn to the "Z" section. That's the "hash" function in a real-world (old school) dictionary. Once you get to the Z (or E or whatever) section, you've got a sorted list rather than a linked-list of entries but, when explaining to a 5 yr old, that's "close enough". If the question was really "explain to a non-technical adult" (ex: management), you might have done it differently. Say, with puppets. ;)
Apr
13
revised AVAudioPlayer doesn't play audio in once in 15 times
clarified English a bit.
Apr
11
comment How to investigate iOS crash with error NSOSStatusErrorDomain Code=-50 "query missing class name"
Can you give a bit more info? There's very little out there about this error, and I'd like to have a better understanding. How does marking framework as required, vice optional, cause a runtime crash (after hours of app running) ? Thanks!
Apr
6
awarded xcode
Mar
23
awarded Supporter
Mar
23
comment How should I rewire a miswired 3-way switch?
Our house has a lot of weird electrical things, including oddly/wrongly colored wires. Once we found the HOT wire (per instructions above), we did this to ID the travelers at the other switch: TURN OFF CIRCUIT BREAKER. At the HOT-switch end, temporarily twist or tape the 2 travelers (not the hot wire) together. At the other switch end, use resistance/continuity meter to determine which 2 wires have 0 Ω resistance (continuity). Those are your travelers.
Mar
22
comment Finding empty directories UNIX
On MacOS-X, for almost empty directories, run find test -name ".DS_Store" -delete first, then the -empty delete command. Also note, like to pushd to the parent directory, so that find test becomes find ., but the rest of the commands are the same.
Mar
16
awarded Notable Question
Mar
14
answered UIScrollView won't scroll!
Mar
14
comment UIScrollView won't scroll!
Just to clarify this a bit: the UIScrollView should be the size of what you want shown on the screen, and that scrollview's contentSize property should be set to the size of the area that will be scrolling (the contents). The scrollview won't scroll if its contentSize is smaller or equal to its frame size.
Mar
14
awarded Yearling
Mar
14
awarded Nice Question
Mar
7
answered NSDateFormatter dateFromString Always Returns nil
Mar
7
comment NSDateFormatter dateFromString Always Returns nil
Heh, thanks. I had just discovered that and was coming back to answer my own Q when I saw your comment. If there's no objection, I'm going to make another "official" answer, too.
Mar
6
comment NSDateFormatter dateFromString Always Returns nil
Hmmm, I had so much hope for this! My date string is 2016-03-14 13:41:47, my dateFormat is yyyy-MM-dd hh:mm:ss, my time zone & locale are set, but still dateFromString: returns nil. :(
Feb
26
comment PHP Counting Number of Rows
The question was about how to get the count of rows. If that's the goal, then using count(*) is preferred for performance reason. YCS's bank analogy is correct. If, on the other hand, you're going to actually use the data (along with the count), then by all means, fetch the data and use mysqli_num_rows. The "the only right way" comment is referring to the actual question asked, which was about just counting the rows, with an implied discarding the data, after.
Feb
18
comment PHP - detect mysql update/insertion failure due to violated unique constraint
Doing the select first isn't thread-safe. There are race conditions where user1 does the select, finds it nonexistent; user2 does the select, finds it nonexistent; user1 does the insert; user2 does the insert. Hence, the unique constraint and handling the returned error.
1 2 3 4 5