LLDB regex not recognizing \w+ with image lookup - ios

I'm playing with LLDB with a simple app that has PhotosUI linked. Here's the command I'm running: image lookup -rn '\+\[\w+' PhotosUI. This is not giving me anything.
However, when I use image lookup -rn '\+\[[a-zA-Z0-9_]+' PhotosUI, I got many matches, one of which is
Summary: PhotosUI`__59+[UIViewController(PhotosUI) pu_currentViewControllerStack]_block_invoke
This is just one example that I totally expect '\+\[\w+' to also match. Did I miss something? This is the LLDB version I'm on:
lldb-1103.0.22.10
Apple Swift version 5.2.4 (swiftlang-1103.0.32.9 clang-1103.0.32.53)

Related

raku REPL appears unresponsive on `cygwin` under WIndows 8

I have cygwin under Windows 8 and I've installed and run raku which I understand to be just Perl6.
I wanted to print some strings and numbers but say doesn't do the job (please see the black snippet below) it just do nothing unlike it is described here:
hynek0#hynek /cygdrive/c/Users/hynek0/Desktop/FU
$ raku --version
This is Rakudo version 2020.05.1 built on MoarVM version 2020.05
implementing Raku 6.d.
EDIT 2
EDIT 3
This is probably the same bug as reported with https://github.com/rakudo/rakudo/issues/4378 . It looks like Raku thinks there's nobody behind the keyboard ($*IN.t returning False) and thus switches to slurping the program to execute from STDIN.
At this point, I can only see a workaround: execute you example code with raku -e.

Powerline Expecting ',' delimiter: line 55 column 6 (char 4037) error

I'm using powerline, bash, and iterm2 on mac. I also installed gitstatus, but that didn't work when I installed it two days ago, and powerline worked just fine yesterday without gistatus functioning. Today, when I booted up the terminal, this error showed instead of the prompt.
Any advice? Where can I find the full log of the errors/interpret this message? Alternatively, how can I pinpoint which file has an error on line 55?
There error was in a color config file for the github integration. I was missing a comma at between lines. I believe it was in this file .config/powerline/colorschemes/default.json or another json related to it; see here.
Ultimately, I recommend moving to powerlevel10k. You can configure it to look exactly like powerline, but it a) updates cleanly (compared to powerline where if you update your python it breaks horribly) and b) comes with a really good customization setup and c) lets you use zsh + oh-my-zsh which gives so much additional functionality

Using TensorFlow Audio Recognition Model on iOS

I'm trying to use the TensorFlow audio recognition model (my_frozen_graph.pb, generated here: https://www.tensorflow.org/tutorials/audio_recognition) on iOS.
But the iOS code NSString* network_path = FilePathForResourceName(#"my_frozen_graph", #"pb"); in the TensorFlow Mobile's tf_simple_example project outputs this error message: Could not create TensorFlow Graph: Not found: Op type not registered 'DecodeWav'.
Anyone knows how I can fix this? Thanks!
I believe you are using the pre-build Tensorflow from Cocapods? It probably does not have that op type, so you should build it yourself from latest source.
From documentation:
While Cocapods is the quickest and easiest way of getting started, you
sometimes need more flexibility to determine which parts of TensorFlow
your app should be shipped with. For such cases, you can build the iOS
libraries from the sources. This guide contains detailed instructions
on how to do that.
This might also be helpful: [iOS] Add optional Selective Registration of Ops #14421
Optimization
The build_all_ios.sh script can take optional
command-line arguments to selectively register only for the operators
used in your graph.
tensorflow/contrib/makefile/build_all_ios.sh -a arm64 -g $HOME/graphs/inception/tensorflow_inception_graph.pb
Please note this
is an aggresive optimization of the operators and the resulting
library may not work with other graphs but will reduce the size of the
final library.
After the build is done you can check /tensorflow/tensorflow/core/framework/ops_to_register.h for operations that were registered. (autogenerated during build with -g flag)
Some progress: having realized the unregistered DecodeWav error is similar to the old familiar DecodeJpeg issue (#2883), I ran strip_unused on the pb as follows:
bazel-bin/tensorflow/python/tools/strip_unused \
--input_graph=/tf_files/speech_commands_graph.pb \
--output_graph=/tf_files/stripped_speech_commands_graph.pb \
--input_node_names=wav_data,decoded_sample_data \
--output_node_names=labels_softmax \
--input_binary=true
It does get rid of the DecodeWav op in the resulting graph. But running the new stripped graph on iOS now gives me an Op type not registered 'AudioSpectrogram' error.
Also there's no object file audio*.o generated after build_all_ios.sh is done, although AudioSpectrogramOp is specified in tensorflow/core/framework/ops_to_register.h:
Jeffs-MacBook-Pro:tensorflow-1.4.0 zero2one$ find . -name decode*.o
./tensorflow/contrib/makefile/gen/obj/ios_ARM64/tensorflow/core/kernels/decode_bmp_op.o
./tensorflow/contrib/makefile/gen/obj/ios_ARM64/tensorflow/core/kernels/decode_wav_op.o
./tensorflow/contrib/makefile/gen/obj/ios_ARMV7/tensorflow/core/kernels/decode_bmp_op.o
./tensorflow/contrib/makefile/gen/obj/ios_ARMV7/tensorflow/core/kernels/decode_wav_op.o
./tensorflow/contrib/makefile/gen/obj/ios_ARMV7S/tensorflow/core/kernels/decode_bmp_op.o
./tensorflow/contrib/makefile/gen/obj/ios_ARMV7S/tensorflow/core/kernels/decode_wav_op.o
./tensorflow/contrib/makefile/gen/obj/ios_I386/tensorflow/core/kernels/decode_bmp_op.o
./tensorflow/contrib/makefile/gen/obj/ios_I386/tensorflow/core/kernels/decode_wav_op.o
./tensorflow/contrib/makefile/gen/obj/ios_X86_64/tensorflow/core/kernels/decode_bmp_op.o
./tensorflow/contrib/makefile/gen/obj/ios_X86_64/tensorflow/core/kernels/decode_wav_op.o
Jeffs-MacBook-Pro:tensorflow-1.4.0 zero2one$ find . -name audio*_op.o
Jeffs-MacBook-Pro:tensorflow-1.4.0 zero2one$
Just verified that Pete's fix (https://github.com/tensorflow/tensorflow/issues/15921) is good:
add this line tensorflow/core/ops/audio_ops.cc to the file tensorflow/contrib/makefile/tf_op_files.txt and run tensorflow/contrib/makefile/build_all_ios.sh again (compile_ios_tensorflow.sh "-O3" itself used to work for me after adding a line to the tf_op_files.txt, but not anymore with TF 1.4).
Also, use the original model file, don't use the stripped version. Some note was added in the link above.

iOS: Where to find the full list of OSStatus codes for iOS? [duplicate]

This question already has answers here:
How do you convert an iPhone OSStatus code to something useful?
(19 answers)
Closed 9 years ago.
I can easily find noErr = 0 in the OS X library source code. But it's pretty hard to find a full list of error code for OSStatus on iOS.
On Mac OS X, it's not that hard to find stuff like
kAudioHardwareUnsupportedOperationError
But I can't seem to find useful info for iOS OSStatus codes. It would be nice to have a full list of them or any pointers to the header files that define them.
Thanks!
UPDATE:
I don't think my question is a duplicate of the above question. The op of that "possible duplicate" question wanted to convert the 4-char codes he already knew into human-readable strings. Instead, here is my further spec:
I don't even know what 4-char or typedefed integers to use for iOS.
I'd like to see something like a full list of codes, like you would normally see in many C++ framework/library design, e.g., an enum list, or standard exceptions, or even the OSX k-something codes, which at least can be found in the Xcode docs alone.
My usecases of these codes include:
In my custom functions, e.g., some CoreAudio callbacks that have to return OSStatus, I'd like to return these built-in human-readable codes to indicate the types of runtime errors. Without the list, I don't know what to return, other than noErr.
Apparently, many OSX k-codes are undefined under iOS environment so they can't be used transparently.
UPDATE (CONCLUSION):
I finally found a clue: Search for keyword "Result Codes" in Xcode documentation (Organizer) and we get more or less categorized return codes documentation sections in the "System Guides" result. This is good enough for my original question. –
The best I can do to help is provide the results of using find from the command line:
$ cd /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS6.1.sdk
$ find . -name \*.h -exec fgrep -l OSStatus {} \;
./System/Library/Frameworks/AudioToolbox.framework/Headers/AudioConverter.h
./System/Library/Frameworks/AudioToolbox.framework/Headers/AudioFile.h
./System/Library/Frameworks/AudioToolbox.framework/Headers/AudioFileStream.h
./System/Library/Frameworks/AudioToolbox.framework/Headers/AudioFormat.h
./System/Library/Frameworks/AudioToolbox.framework/Headers/AudioQueue.h
./System/Library/Frameworks/AudioToolbox.framework/Headers/AudioServices.h
./System/Library/Frameworks/AudioToolbox.framework/Headers/AudioSession.h
./System/Library/Frameworks/AudioToolbox.framework/Headers/AudioToolbox.h
./System/Library/Frameworks/AudioToolbox.framework/Headers/AUGraph.h
./System/Library/Frameworks/AudioToolbox.framework/Headers/ExtendedAudioFile.h
./System/Library/Frameworks/AudioToolbox.framework/Headers/MusicPlayer.h
./System/Library/Frameworks/AudioUnit.framework/Headers/AUComponent.h
./System/Library/Frameworks/AudioUnit.framework/Headers/AudioComponent.h
./System/Library/Frameworks/AudioUnit.framework/Headers/AudioOutputUnit.h
./System/Library/Frameworks/AudioUnit.framework/Headers/AudioUnitProperties.h
./System/Library/Frameworks/AudioUnit.framework/Headers/MusicDevice.h
./System/Library/Frameworks/CoreFoundation.framework/Headers/CFBase.h
./System/Library/Frameworks/CoreFoundation.framework/Headers/CFError.h
./System/Library/Frameworks/CoreFoundation.framework/Headers/CFStream.h
./System/Library/Frameworks/CoreMedia.framework/Headers/CMAudioClock.h
./System/Library/Frameworks/CoreMedia.framework/Headers/CMBase.h
./System/Library/Frameworks/CoreMedia.framework/Headers/CMBlockBuffer.h
./System/Library/Frameworks/CoreMedia.framework/Headers/CMBufferQueue.h
./System/Library/Frameworks/CoreMedia.framework/Headers/CMFormatDescription.h
./System/Library/Frameworks/CoreMedia.framework/Headers/CMSampleBuffer.h
./System/Library/Frameworks/CoreMedia.framework/Headers/CMSimpleQueue.h
./System/Library/Frameworks/CoreMedia.framework/Headers/CMSync.h
./System/Library/Frameworks/CoreMIDI.framework/Headers/MIDIDriver.h
./System/Library/Frameworks/CoreMIDI.framework/Headers/MIDIServices.h
./System/Library/Frameworks/CoreMIDI.framework/Headers/MIDISetup.h
./System/Library/Frameworks/CoreMIDI.framework/Headers/MIDIThruConnection.h
./System/Library/Frameworks/Foundation.framework/Headers/NSError.h
./System/Library/Frameworks/MediaToolbox.framework/Headers/MTAudioProcessingTap.h
./System/Library/Frameworks/Security.framework/Headers/SecBase.h
./System/Library/Frameworks/Security.framework/Headers/SecIdentity.h
./System/Library/Frameworks/Security.framework/Headers/SecImportExport.h
./System/Library/Frameworks/Security.framework/Headers/SecItem.h
./System/Library/Frameworks/Security.framework/Headers/SecKey.h
./System/Library/Frameworks/Security.framework/Headers/SecTrust.h
./System/Library/Frameworks/Security.framework/Headers/SecureTransport.h
./usr/include/AssertMacros.h
./usr/include/Endian.h
./usr/include/MacTypes.h

Imagemagick & 3Drotate

I recently had to move my site from one server to another and it appears Fred's 3Drotate script creates files that have Imagemagick settings in them instead of image data. When I first ran the script I received the following error:
expr: warning: unportable BRE: `^[0-9][0-9]*$': using `^' as the first character of the basic regular expression is not portable; it is being ignored
expr: warning: unportable BRE: `^[+-][0-9][0-9]*$': using `^' as the first character of the basic regular expression is not portable; it is being ignored
expr: warning: unportable BRE: `^[0-9]*[\\.][0-9]*$': using `^' as the first character of the basic regular expression is not portable; it is being ignored
expr: warning: unportable BRE: `^[+-][0-9]*[\\.][0-9]*$': using `^' as the first character of the basic regular expression is not portable; it is being ignored
I was able to resolve this by removing each instance of the '^' character. The script runs and it creates a file of a few hundred KB, but the contents appear to be a configuration such as:
id=MagickCache
quantum-depth=16
class=DirectClass colors=0 matte=False
columns=500 rows=500 depth=8
colorspace=sRGB
compression=JPEG quality=75
units=PixelsPerInch
resolution=72x72
page=500x500+0+0
rendering-intent=Perceptual
gamma=0.454545
red-primary=0.64,0.33 green-primary=0.3,0.6 blue-primary=0.15,0.06
white-point=0.3127,0.329
date:create=2012-08-10T20:44:21-07:00
date:modify=2012-08-10T20:44:21-07:00
jpeg:colorspace=2
jpeg:sampling-factor=2x2,1x1,1x1
Any ideas? I'm running imagemagick version 6.7.8-9 which is newer than what was on my original server, however I don't know which version that was.
Update:
I'm on a CentOS box using 3DRotate revised by Fred on 3/11/10. ImageMagick is version 6.7.8-9 whereas my old server, also CentOS was using version 6.7.6-0.
Fred's 3Drotate script still works fine for me. I have no reason to complain.
This is on Mac OS X Lion, with Bash version GNU bash, Version 4.2.37(2)-release....
You are strongly advised to re-download the script and try again. If you want to report a bug, you should give info about your OS, your Bash and your ImageMagick versions...
Oh, and see also this page, which states...
...you need ImageMagick v6.3.5.0 or higher for the script to work,
...gives some hints about troubleshooting and
...tells you the eMail address of the author so you can contact him to discuss your problems.
With recent changes to ImageMagick between IM 6.7.6.7 and IM 6.7.8.3 for colorspace changes and grayscale becoming linear, I have had to go through recently all my scripts and make appropriate changes. I am only part way through my scripts as of this date, but have fixed about 1/3 to 1/2, but 3Drotate did not need any changes since the last one on 11/26/2011. But your version is to old, so you will need to get an update. The problems you seem to have may or may not be related. But appear to be related to the unix utility expr. I would make sure that you have a current version of that installed. The following works perfectly fine for me on both IM 6.7.6.0 and 6.7.8.9 on my Mac OSX Snow Leopard
3Drotate pan=45 tilt=45 auto=zc mandril.jpg mandril_test.jpg
The first question I would ask is what was your exact command line. As you can see the arguments are a bit different from my other scripts as they include equal signs.
If you still have trouble, report them to me or on the ImageMagick Discourse forum at http://www.imagemagick.org/discourse-server/viewforum.php?f=1
Fred

Resources