Can you check available hard disk space with Adobe Air? - air

We have an Adobe Air app that downloads a large amount of images into application storage. I've scanned the docs and found no sign of this, but I thought I'd double check: anyone know if it's possible to see how much available storage space the user has on their HD so we can warn them they don't have enough room?

Found the answer, it is possible:
air.File.applicationStorageDirectory.spaceAvailable
It was in the docs after all. RTFM.
http://help.adobe.com/en_US/AIR/1.1/devappshtml/WS5b3ccc516d4fbf351e63e3d118666ade46-7fe4.html#WSC2FAD3B6-D59A-4e4d-B63F-9846584CF5D5

Related

Google Colab : Local Runtime use

I was currently using google-colab and on the getting started pages, we see:
Local runtime support Colab supports connecting to a Jupyter runtime
on your local machine. For more information, see our documentation.
So, when I saw the documentation I connected my colab notebook to the local runtime, after the installations,etc by using the connected tab.
And when I access the memory info:
!cat /proc/meminfo
The output is as follows:
MemTotal: 3924628 kB
MemFree: 245948 kB
MemAvailable: 1473096 kB
Buffers: 168560 kB
Cached: 1280300 kB
SwapCached: 20736 kB
Active: 2135932 kB
Inactive: 991300 kB
Active(anon): 1397156 kB
Inactive(anon): 560124 kB
Active(file): 738776 kB
Inactive(file): 431176 kB
Unevictable: 528 kB
Mlocked: 528 kB
Which is the memory info for my pc, so certainly the access from the notebook is to my pc? Then how is it any different from my local jupyter-notebook? Now, I can't use the high memory environment of 13 Gigs, nor can I have GPU access.
Would be great if someone can explain!
The main advantages to using Colab with a local backend stem from Drive-based notebook storage: Drive commenting, ACLs, and easy link-based sharing of the finished notebook.
When using Jupyter, sharing notebooks requires sharing files. And, accessing your notebooks from a distinct machine requires installing Jupyter rather than loading a website.
The only benefit is to keep your notebooks in Google Drive.
you can share them easily
you have automatic history/versioning
people can comment on your notebooks
You also have headings with collapsible outline, and probably cleaner UI (if you prefer Colab styling).
TLDR - the short answer is that it's not any different
But, here's an analogy that might help better explain what the point of that is:
Let's pretend Google Colab was something like a video gaming streaming service that enabled users with low-end equipment to play high end graphic demanding video games by hosting the game on their systems. It would make sense if say, we don't have a high end gaming PC or a very strong laptop and we wanted to play a new game that just came out with very high system requirements (which ours barely meets if at all) then naturally we may want to use this streaming service, let's call it Stadia for fun, to play that new game because it lets us play it at 30FPS on 720p resolution for example, whereas maybe using our own computer might give us barely 15 fps at 480p. They would be the people who represent people Like you and I, who want to benefit from the game being run on another system which in this case, would be equivalent to how we want Google Colab to run our iterations on their system. So for us, it wouldn't make sense to have Stadia run locally and use our system resources because there's no benefit in that, even if our saved games were stored locally.
But then there are others, who have high end pc and graphics cards installed, with much better components and resources available to them and let's say they also want to play the same game. Now they could use the same streaming service as us and play at 720p, but since their computer is more powerful and can actually handle let's say the game at 60 FPS on 4k graphics, then they may want to run the game off their own system resources instead of using the streaming service such as Stadia. But that would normally mean, they'd have to get a hardcopy of the game to install it locally on their system and play it that way. And for the sake of the example, let's just pretend it was download only and would require 2 terabytes to install.
So then, if we pretend that stadia had an ability to save them from having download and install the game while still using their systems' resources to provide better graphics while they play, then that would be the case for how or why Colab connecting to a local runtime would serve as a desirable feature for someone. Sharing colab notebooks would be like sharing a game in our theoretical version of stadia, where users wouldn't have to download and install anything so any time there is any update or changes, users would immediately be able to use that new updated version without downloading anything because the actual code (or game install in our metaphor) is run remotely.
Sometimes it's hard to understand things that weren't designed for our use when it contradicts the value which base our decision to use them. Hopefully that helps someone who stumbles across this understand the purpose of it, at least in principle.

get available memory in winrt

I want to plot a larger amount of data within an metro application and I need to buffer this. To find out how far I can buffer it would be great to know how much memory is still available (to my app), this shouldn't inlclude virtual memory.
Is there any way in a metro app to get this Information? I only found GlobalMemoryStatusEx, but that can only be used in desktop apps
Thank you
I just had to deal with this and got hold of the right people at Microsoft to answer this. Unfortunately the answer was : No you can't do that, except use the restricted calls that you found but using those prevents you from getting certified for publication in the store.
How about just trying to allocate a lot of memory in chunks. When it first fails - add up the sizes of the chunks and either release them or use them for your operations.

OCR (reading text from photos) in Cocoa?

Is there any code out there, that I can use in Cocoa, to recognize text from photos? Let's say I snap a photo with my iPhone of a page of a book. I'd like to capture the text in it.
There is the Tesseract OCR toolkit that is an open source OCR engine, currently maintained by Google. "Olipion" created a cross compilation tutorial to get in on the iPhone. I would say that this is a good place to start.
However, there are reasons why you might not want to to OCR on the Phone even if you could. Some of these include:
Even the new iPhone 4's processor is not that fast and since you app can't really run in the background doing the processing, the user experience might not be optimal.
Running OCR on a mobile device would probably be a killer for battery life.
Every time you would want to update the OCR engine everybody who installed your app would have to upgrade.
For an always connected mobile device running the OCR on a server somewhere would be probably better. You could upgrade your OCR software easily, you could run much more powerful algorithms then a mobile device could handle and so on.
I am not so sure that you would be able to get good results from photos taken using a mobile camera -- accuracy of OCR systems goes way down with the kind of poorly lit, noisy, distorted images likely to be captured using a phone camera.
As far as commercial products out there, there is Evernote that gives you a OCR capability if you buy their premium service.
As an alternative to machine OCR, there is always Mechanical Turk, where you could pay people small amount to do the OCR for you. Would probably do better at transcription given the image source.

Apps using Google Wave

I just watched Google Wave Keynote video on Google I/O and I must say I was very impressed with pretty much everything mentioned in the video, the possibilities with Google Wave are enormous.
I'd like to ask if there are any projects using Google Wave already in beta (usable stage) and I would also like to know when is Google Wave supposed to be available for the rest of us who didn't attend Google I/O.
As great as the technology is. It is safe to say it will only be used to find more inventive ways for us to:
Not socialize in real-life
Make communications that would be ill-advised in real-life
Buy things we haven't seen in real life
Unlearn things that are useful in real life (like spelling)
Joking aside, you can signup for the sandbox (as I have) and play around with apps and robots and whatever. You can Sign up here for the developer preview and have a look at what is going on!
You could also run your own wave setup using the information here and experiment with the down-and-dirty!
You can request developer access to the wave sandbox at: https://services.google.com/fb/forms/wavesignupfordev/
It might take a few weeks.

Determine Free Disk Space Allowed By Sandbox On iPhone

I am looking for a way to determine how much free disk space there is available to my application.
I have tried using NSFileManager's fileSystemAttributesAtPath with NSFileSystemFreeSize, but this is giving me the total free space on the iPhone and not what is available to my application by the Sandbox.
I believe applications are limited to using 2 Gig of space, and need to show how much of the 2G is still available.
You can use statfs(2) and check the f_bavail field. This is the amount of space available at the moment to an unprivileged application, so it should give you the modified space that your application is permitted to use.
You can see the iPhone version of the man page here.