In VBP its possible to define user defined actions by creating a custom COM component or a custom script.
I need to create an user defined action which is iterative, which means it has to call child steps in an iterative manner like the "process files" built in action does.
I can't figure out how to do this and Google isn't helpful either.
Found the answer myself on the kinook forums:
Its not possible to define an iterative user-defined action, but its possible to use a workaround by defining a conditional build rule in the loop controlling step.
Related
I am developing a simple farming game backend using meteor.
So Server needs to check all players farm data and based on that for example increment
production:0
field each second if player has a farm.
What is the best way to do that ?
Should i use Meteor.setTimeout()
You should use Meteor.setTimeout if you don't manually want to bind fibers to the callback function.
Related issues:
What's going on with Meteor and Fibers/bindEnvironment()?
Meteor wrapAsync or bindEnvironment without standard callback signature
However, you can also use the native JS setTimeout but you will have to manually bind a fiber to the callback (if you aim to use for example Mongo) using Meteor.bindEnvironment or Meteor.wrapAsync.
Another interesting tool is Meteor.defer which is similar to Meteor.setTimeout(func, 0) and allows to execute code in the background. Beware of several layers of callbacks when mixing with Meteor.setTimeout.
Ans yet another tool when executing complex services in a method is this.unblock.
Applying these tools in an appropriate way will make your timer based update possible.
In order to create a simple annotation that logs function calls, I'm trying to grab the following attributes from a function that has said annotation:
Function name
Parameter names
Parameter values
What I have so far uses KCallable as a value, which makes grabbing the name and names from the list of KParameter fairly simple. However, I cannot figure out how to get the values of said parameters to make the log statement more contextual.
Does anyone have ideas on grabbing these parameters values within the annotation? It doesn't need to use KCallable, that just seemed like the most intuitive receiver.
You will need a different approach. Annotations and parameter type are a compile time features while values are a runtime feature.
What you will have to do is use a bytecode processing framework like ASM or google "aspect oriented programming". That allows you to examine the generated bytecode and modify if before the JVM tries to execute it.
The other approach is to write a Kotlin compiler plugin which generates the necessary code (google "Writing Your First Kotlin Compiler Plugin")
This blog post contains an example for Java and Spring using the AOP approach: https://solocoding.dev/blog/eng_spring_centrlize_logging_with_aop
I recommend the compiler plugin because the other approach is much more complicated, brittle and badly documented. Use AOP only if you find a framework which already contains all the features you need.
I'm creating a template for our server-side codegen implementation, but I ran into an issue for a feature request...
The developers who are going to use the generated base want the following pattern (the generator is based on the dotnetcore):
Controllers
v{apiVersion}
{endpoint}ApiController : Controller, I{endpoint}Api
Interfaces
v{apiVersion}
I{endpoint}Api
I{endpoint}DataProvider
DataProviders
-v{apiVersion}
-{endpoint}DataProvider : I{endpoint}DataProvider
Both interfaces are the same, describing the endpoints. The DataProvider implementation will allow us to use DI to hot-swap the actual data provider/business logic layer during runtime.
The generated ApiControllers will refer to the IDataProviders, and use the actual implementation (the currently active one, that is). For that we're going to use dotnetcore's built-in dependency injection system.
However I can't seem to find a way to have the operations generator output to three different folders, based on the template. It will all end up jumbled in a single folder, and I will need to manually move them.
Is there a way to solve these requirements, or should I solve it all the time manually?
I have a plugin made for WP, Drupal, SMF, WP etc and now i want to write unit test for them. So is there any way to write common unit test code for them or , maybe, just the base code, i don't want to write unit test for each plugin separately.
Without knowing what your plugin actually does, the answer might be a little bit meta.
You should use polymorphism:
Create an interface which will contain all the prototypes of the methods used for testing functionality (ie, if your plugin formats a post, you will have a method in that interface called format_post() )
for each of the CRMs, create a class that will implement that interface
in your file which executes the tests, create an instance for each of the CRM testing classes (which implement the interface that defines format_post() ) and call format_post() on them
There is probably no way for this but does anyone know a method of excluding certain functions from a build by use of a meta tag and or compiler option?
I want to expose some functions for testing but not have them bloat the application on production. I could create separate testing classes and test for a complier directive or option and only load them if necessary but I like the idea of having the test function on the actual object (in the class).
Thanks
Ronan
You have to look at conditional compilation for example look to this blog post http://www.pixelate.de/blog/debug-and-release-builds-with-as3-conditional-compilation
You can use conditional compilation for that.