dynamic-loading

Loading Objective C code dynamically

帅比萌擦擦* 提交于 2019-12-06 05:53:00
I am looking for a possibility of loading Obj C based source dynamically and show the view in my iOS application. For example: I have a set of code written for showing a view, i want to dynamically load this code and show this view. Some thing like, I'll have a service running in the background of my iOS app. It will get a set of Obj C code from my server in text format This dynamic Obj C code should get executed dynamically and show the respective iOS view From Comments Not released in the appstore.. its for internal Is this possible? Short answer: No Not so short answer: You could—in theory

Can I access to symbols of the host process from a shared object loaded in runtime? Any alternative?

流过昼夜 提交于 2019-12-06 01:39:34
In my scenario I want a plugin, which is a shared object loaded in runtime, to access symbols from the “host application” so I can add any functionality to my application. I have tried but have not found any way to do this and I have no clue on whether this is possible or not. So, can I do this somehow or is there any alternative that applications that use plugins use? I am on Fedora 15, Linux 2.6.4. However, I hope the solution will be cross-platform. There are three main approaches: Pass a structure of function pointers to the DLL from the application, giving access to whatever symbols you

How do I make an Action Script 3 class, used in two SWF files, resolve to the same class when one SWF dynamically loads the other?

房东的猫 提交于 2019-12-05 20:26:44
Background I am developing a highly modular application in pure Action Script 3 (we are using Flex 4 SDK to automate our builds, but all our code must be able to compile directly in Flash CS4 Professional). We have a "framework.swc" file which contains interface definitions which are shared between all our modules, we have a "mainmodule.swf" that loads our other modules, and then we have various .swf files for our other modules. We are using the Loader class, in conjuction with ApplicationDomain::getDefinition() for loading classes dynamically [we use "new LoaderContext(false,ApplicationDomain

Dynamic loading of Haskell abstract syntax expression

五迷三道 提交于 2019-12-05 10:00:18
Can we use GHC API or something else to load not text source modules, but AST expressions, similar to haskell-src-exts Exp type ? This way we could save time for code generation and parsing. I don't think the GHC API exposes an AST interface (could be wrong though), but Template Haskell does. If you build expressions using the Language.Haskell.TH Exp structure, you can create functions/declarations and make use of them by the $(someTHFunction) syntax. A fairly major caveat is that TH only runs at compile time, so you would need to pre-generate everything. If you want to use TH at run-time, I

How to handle “panic: the impossible happened” and continue in Haskell

怎甘沉沦 提交于 2019-12-05 05:01:18
I have the following code that uses the GHC API to load modules and get the type of an expression: typeObjects :: [String] -> [String] -> IO [Type] typeObjects modules objects = do defaultErrorHandler defaultDynFlags $ do runGhc (Just libdir) $ do dflags <- getSessionDynFlags setSessionDynFlags dflags targets <- mapM ((flip guessTarget) Nothing) modules setTargets targets result <- load LoadAllTargets case result of Failed -> error "Compilation failed" Succeeded -> do m <- mapM (((flip findModule) Nothing) . mkModuleName) modules setContext m [] values <- mapM exprType objects return values If

Dynamically loadable and unloadable application modules in Java - how?

你说的曾经没有我的故事 提交于 2019-12-04 14:27:40
问题 I'm writing a server application which makes use of external modules. I would like to make them to be upgradeable without requiring server restart. How do I do that? I've found OSGi but it looks very complicated and big for my task. Simple *.jar files are ok, but once they are loaded, I suppose, I cannot unload them from VM and replace with another version on-the-fly. What approach can you suggest? 回答1: It seems like OSGi is exactly what you're asking for. It can be complex, but there are

Is it bad to enable Dead Code Stripping?

核能气质少年 提交于 2019-12-04 08:15:12
My iOS project uses dlsym to dynamically point to an optional C library. Optional as-in the project can run with our without it, it just adds features. For background info: Detect and use optional external C library at runtime in Objective-C The problem is, XCode cleans up libraries that are "not used". Using dlsym means there are no direct references to my 3rd party library and XCode removes it. I thought I found a solution, in "Other Linker Flags" I added -force_load "$(SRCROOT)/my_external.a" which worked great in the simulator. ( -all_load works fine too but seemed overkill to me). The

Progress of loading external JS file

放肆的年华 提交于 2019-12-04 06:06:41
I'm not sure what this would be called to know what to search for, if this is a duplicate please link me :) Is it possible in JavaScript in a browser, to load an external file (this bit is easy), but given that the external file could be rather large (say 50MB) show a progress indicator of the loading of that file? i.e I, knowing the serverside size of the file, not knowing the gzip size, I want to say X% of file loaded. I've not tried anything, I can't find anything to work from let alone find something that suggests its possible. Problem: Trying to load up a 50MB JavaScript library on demand

Ajax - limit the loading of a list and then load the rest on scroll

痞子三分冷 提交于 2019-12-03 21:23:13
I have a store that shows all products of a category on one page (and this is how the owner likes it so pagination is not an option). To improve load time on some heavy categories, I'm hoping to implement a scrip which will load a number of products <li>s and then on page scroll, load another set. The page is generated with this structure <div id="CategoryContent"> <ul class="ProductList"> <li class="Odd">Product</li> <li class="Even">Product</li> <li class="Odd">Product</li> <li class="Even">Product</li> </ul> Ideally I would like to. Load first 25 <li>Products</li> and when the user scrolls

jQuery getScript() vs document.createElement('script')

半腔热情 提交于 2019-12-03 16:58:24
问题 Assuming that both of these approaches load the script properly, and that I wait the appropriate amount of time before using the script (and/or use a callback), what are the major differences between these approaches. Note: I understand the first uses jQuery (which is a larger download etc.). What I'm really interested in is the after affects of these approaches. Does one place the script in a different scope than the other? Etc. jQuery: function loadScript() { $.getScript('http://www