I would like to know if Kamcord can also be used to share screen snapshots? If yes, how can this be done?
I have not done it yet, but I believe you are looking for what is handled by two functions defined in their headers:
+ (UIImage *)snapshot;
+ (BOOL)snapshotNextFrameWithCompletionHandler:(void(^)(UIImage * image, NSURL * imageURL))handler saveToURL:(NSURL *)destinationURL;
Check out their header for a description of those functions purpose:
https://github.com/kamcord/kamcord-ios-sdk/blob/master/Kamcord.embeddedframework/Kamcord.framework/Headers/Kamcord.h
(This is all as of v1.7.6)
You are going to have to decide when to call that (i.e., when something interesting happens in your app worthy of a single image.)
Send an email over support#kamcord.com to confirm. They are super responsive to questions like this.
Edit: Cleaned up grammatical errors
Related
My react web app is not loading on iOS, especially v15.5.
Only black page is loaded when I access to the website using iPhone or iPad.
Is there a way to solve this problem?
The issue is happening because of regex usage. Looks like Safari doesn't support lookbehind yet (that is, your (?<=/)). One alternative would be to put the / that comes before in a non-captured group, and then extract only the first group (the content after the / and before the #).
/(?:\/)([^#]+)(?=#*)/
Also, (?=#*) is odd - you probably want to lookahead for something (such as # or the end of the string), rather than a * quantifier (zero or more occurrences of #). It might be better to use something like
/(?:\/)([^#]+)(?=#|$)/
or just omit the lookahead entirely (because the ([^#]+) is greedy), depending on your circumstances.
I'm trying to use YouTube Data API to get a list of comments for a video.
The problem is that the field authorProfileImageUrl in the response contains a URL to a tiny thumbnail (28x28 pixels) of the profile image instead of the bigger one (48x48) that can be seen in YouTube's comment section. How can I retrieve the bigger one? Am I missing some magic parameter in the request that selects the size of the profile images in comments?
Here's my request URL:
https://www.googleapis.com/youtube/v3/commentThreads?videoId=VIDEO_ID&part=snippet&fields=pageInfo,items(snippet(topLevelComment(id,snippet(authorDisplayName,authorChannelUrl,authorProfileImageUrl,authorChannelId,textDisplay,likeCount,publishedAt)),totalReplyCount))&maxResults=3&key=API_KEY
Edit:
Here's an example profile pic URL i get:
https://yt3.ggpht.com/-b-fXZSZ0hPw/AAAAAAAAAAI/AAAAAAAAAAA/mq4JpF46xq4/s28-c-k-no-mo-rj-c0xffffff/photo.jpg
^^
I noticed that the marked part seems to select the size, because when I change the 28 to 48, the size of the profile pic changes too.
I could change it "manually" with some fancy regexp, and it will work, but it will also rely on implementation details that are undocumented and that may change in future and render the application broken :P So it really would be better if there was a documented API way to do that.
Seems like nobody knows how to solve this, ho here's my temporary solution.
It works, but it depends on an implementation detail that can change in the future and then the solution will break apart and will have to be corrected :q
I accept my own answer for now, but when someone posts a better one, I'll accept it instead.
The solution:
I made a simple function that searches for the image size in the URL string and replaces it with a bigger size.
function small2big(url)
{
return url.replace(/(\/.*s)28(.*\/photo.jpg)$/,"$1"+"48"+"$2");
}
Oh, and here's my middle finger for you, Google: ,,|,,
It seems that actually removing everything right at the 's28' will display the entire image without specifying a size.
For example, instead of this:
https://yt3.ggpht.com/-b-fXZSZ0hPw/AAAAAAAAAAI/AAAAAAAAAAA/mq4JpF46xq4/s28-c-k-no-mo-rj-c0xffffff/photo.jpg
You can use this: https://yt3.ggpht.com/-b-fXZSZ0hPw/AAAAAAAAAAI/AAAAAAAAAAA/mq4JpF46xq4/
And it will return the full size image.
In my case, using php I simply:
function bigAvatar($url) {
$url = substr($url, 0, strpos($url, 's28'));
return $url;
}
Again, if google decides to change this in the future, this would break. But for now, it works.
I have seen programmers using comments like following format:
/*! This is a sample comment
*/
I have seen such comments for the first time while ios development i.e in objective-c.
What is the significance of '!'(exclamation mark) here?
That's the introductionary tag for HeaderDoc
You usually see it in a comment that is "linked" to a method, function or variable.
e.g.:
/*!
This is a comment about FunctionName.
*/
char *FunctionName(int k);
If you use those comments in Xcode 5.1 you can have those documentation popovers (Option + click on methods) for your own code:
So expect to see those things more frequently in the future. :-)
And if you want to use them yourself, I would recommend to have a look at VVDocumenter, a Xcode plugin that makes the creation of those a bit easier.
I have a table called settings, when I would change or enter data into the form it did not change the data in the table. In addition on form an image upload file is not running, There may be the wrong code below.
(Solved by me)
Maybe someone can help me Related to this.
What you are doing here is tottaly in secure and your data can be hacked / manipulate really fast.
Why dont you use a framework like codeignighter there are about 100 easy frameworks that will help you manage database a lot easyer.
Are you sure that you are updating the wrond ID? where id = 1, seems to be not dynamic.
Please post your error http://www.w3schools.com/php/func_mysql_error.asp
I know it is not so related to your question, but you should see these light frameworks:
http://kohanaframework.org/
https://github.com/ElbertF/Swiftlet
http://ellislab.com/codeigniter
You're not checking the return status of of your query, so if it's not working you wouldn't know. Do this:
mysql_query("UPDATE settings SET site='$name',keywords='$keys',descrp='$desc',email='$email',fbpage='$fbpage',twitter='$twitter',gplus='$gplus',disclaimer='$disclaimer',template='$template' WHERE id=1")
or die(mysql_error());
Note: mysql_*() is deprecated: you shouldn't use it. Use mysqli_*() or PDO instead.
Also: You are susceptible to an SQL Injection attack. You should escape your input variables with mysql_real_escape_string() (or the equivalent if you switch to mysqli), or consider moving to prepared statements.
When I read the section on
NSDataReadingOptions
Options for methods used to read NSData objects.
enum {
NSDataReadingMappedIfSafe = 1UL << 0,
NSDataReadingUncached = 1UL << 1,
NSDataReadingMappedAlways = 1UL << 3,
};
typedef NSUInteger NSDataReadingOptions;
It says that
NSDataReadingUncached
A hint indicating the file should not be stored in the file-system caches.
For data being read once and discarded, this option can improve performance.
Available in OS X v10.6 and later.
Declared in NSData.h.
So I am assuming that by default these URL requests are cached and there is no need to implement NSURLRequest to cache data if I want to use shared global cache ? Is this understanding correct ?
Let me start off by saying that dataWithContentsOfURL:options:error: and its ilk are probably the worst APIs for getting something from network. They are very alluring to developers because they can get a resource from network in a single line of code, but they come with some very pernicious side-effects:
First, they block the thread on which they are called. This means that if you execute this on the main thread (the only thread on which your UI can be updated), then your application will appear frozen to the user. This is a really big 'no no' from a user experience perspective.
Second, you cannot cancel these requests, so even if you put this request on a background thread, it will continue to download even though the data may no longer be useful. For example, if your user arrives on a view controller and you execute this request and the user subsequently decides to hit a back button, that data will continue to download, even though it is no longer relevant.
Bottom line: DO NOT USE THESE APIs.
Please use async networking like NSURLConnection or AFNetworking. These classes were designed to get data efficiently and in a way that doesn't impact the user experience. What's even better is that they handle the specific use case you originally asked: how do I stop it from caching on disk?.
There is no answer to your specific question which refer to the caches managed by the URL loading system.
The reading options in method dataWithContentsOfFile:options:error: refer solely to reading from the file system (please consult to the official documentation of NSDataReadingOptions).
Unfortunately, the documentation gives no hint about the behavior when reading from remote resources. Whether the response is cached in the URL cache is unspecified - that is, we don't know, and the internal behavior and implementation can change with each new OS version.
IMHO, we should generally avoid to use the "convenient methods" to read from remote resources. It appears, these methods work only by "accident" when accessing remote resources. So, I strongly agree with #Wayne Hartman ;)