EzDevInfo.com

agent

A PHP desktop/mobile user agent parser with support for Laravel, based on Mobiledetect

Clojure differences between Ref, Var, Agent, Atom, with examples

I'm very new to Clojure, Can you guys give me explanation with real world scenarios. I mean, where to use Ref, Var, Agent, Atom. I read book, but, still couldn't understand the real world examples.


Source: (StackOverflow)

Predicate vs Functions in First order logic

I have been so confused lately regarding difference between predicate and function in first order logic.

My understanding so far is,

Predicate is to show a comparison or showing a relation between two objects such as,

President(Obama, America)

Functions are to specify what a particular object is such as,

Human(Obama)

Now am I heading on right track to differentiate these two terms or I am completely wrong and need a brief explanation, I would like to have opinion from expert to clarify my knowledge(or approve my understanding). Thanks in advance

Krio


Source: (StackOverflow)

Advertisements

Any good distributed agent/service models for .NET? [closed]

I'm looking for tools that implement the distributed agent/service model ... I guess we could also call this grid or cloud computing, but I'm not sure the term is exactly analagous. A distributed agent model would be one where developers build agents that are dispatched to a framework and the framework executes the agent somewhere in the distributed environment.

Specifically, I'm looking for a framework that support dynamic distribution across the grid/cloud, but replaces the transient agent with a more persistent service. The goal here is to minimize the amount of time and effort it requires to deploy a service into the grid/cloud container.

FWIW, I think Digipede gets pretty close to this, but I'm interested in what else is out there. I'm under the impression that assembly distribution would have to be considered in order for the solution to be viable.


Source: (StackOverflow)

Design patterns for Agent / Actor based concurrent design

Recently i have been getting into alternative languages that support an actor/agent/shared nothing architecture - ie. scala, clojure etc (clojure also supports shared state).

So far most of the documentation that I have read focus around the intro level. What I am looking for is more advanced documentation along the gang of four but instead shared nothing based.

Why ? It helps to grok the change in design thinking. Simple examples are easy, but in a real world java application (single threaded) you can have object graphs with 1000's of members with complex relationships. But with agent based concurrency development it introduces a whole new set of ideas to comprehend when designing large systems. ie. Agent granularity - how much state should one agent manage - implications on performance etc or are their good patterns for mapping shared state object graphs to agent based system. tips on mapping domain models to design. Discussions not on the technology but more on how to BEST use the technology in design (real world "complex" examples would be great).


Source: (StackOverflow)

Non-resolvable parent POM: Could not find artifact

I have recently looked into Gorilla Logic's open source testing tool and need to make some changes in order to be able to log something to the console. I have checked out the code out of source control for the "Android Agent" and now I am looking to build a new .jar agent file. I need to use the
mvn clean install to build the .jar file. When I try to build it the command line is giving this error
Non-resolvable parent POM: Could not find artifact com.gorillalogic.monkeytalk:monkeytalk:pom:1.0.12-SNAPSHOT and 'parent.relativePath' points at wrong local POM @ line 6, column 10 -> [Help 2]

Can anyone help me with this or let me know what this means? Thanks. :) I don't understand maven and just want to know what it means.

Here is the pom.xml file line 6-10

<parent> 
<groupId>com.gorillalogic.monkeytalk</groupId>
    <artifactId>monkeytalk</artifactId>
    <version>1.0.12-SNAPSHOT</version>
    <relativePath>/Users/henry/Desktop/monkeytalk-agent-android/parent/pom.xml</relativePath>
</parent>

Thanks again. :)


Source: (StackOverflow)

Implementing SNMP agent on embedded system

I am currently developing an embedded uP based appliance which can be remotely controlled via ethernet from a PC using its own SNMP manager software.

I have implemented all the private commands, i.e. using a private community password and under the enterprise tree OID (1.3.6.1.4.1.MY_PEN...etc) So from that point of view the unit is working OK.

What I am not too sure is whether the appliance should also respond to other SNMP OID branch queries (e.g. 1.3.6.1.2.1...or others ) Not for the benefit of my PC software, but for the benefit of other PC managers who may or may not want to know whether my device "exists" on the system.

I am aware this is not an essential requirement (my device doesn't need to be known to others) but perhaps there is an established "polite" requirement for SNMP agents in a network to be visible as such. In which case there may be a minimum subset of OID queries that such agents should at least respond to to any PC manager out there.

I cannot find anything about this on the internet, does such a thing exist?

Any comments (or at least a pointer to the "right" RFC as there are so many of them!

Thanks in advance


Source: (StackOverflow)

Android Generic User Agent (UA)

I am building an Android app to display content feed from a server. The server is a mobile website (like http://m.google.com which tracks the traffic from various mobile clients. To differentiate an Android client, how do I provide a generic string for my app?

Here's why I ask that:

Some of the Android devices I got have UA strings like:

Mozilla/5.0 (Linux; U; Android 2.2.1; en-us; ADR6400L 4G Build/FRG83D) AppleWebKit/533.1 (KHTML, like Gecko) Version/4.0 Mobile Safari/533.1

Mozilla/5.0 (Linux; U; Android 2.1; en-us; Eclair_SPR Build/30201) AppleWebKit/520.17 (KHTML, like Gecko) Version/4.0 Mobile Safari/520.17

I need to append a string to the UserAgent string to identify my app. For eg:

I need to do something like this: Mozilla/5.0 (Linux; U; Android 2.1; en-us; Eclair_SPR Build/30201) AppleWebKit/520.17 (KHTML, like Gecko) Version/4.0 Mobile Safari/520.17 Android_MyFirstApp.

Is this the correct way to do it?


Source: (StackOverflow)

Agents in Haskell or functional languages?

I'm architecturing a Multi Agent System (MAS) framework to describe Beliefs-Desires-Intents (BDI) agents in Haskell (i.e. agents are concurrent, communicating monadic actions).

I searched on the web throughly but I wasn't able to find any reference on similar works, apart from a technical report of an unfinished work, Specifying and Controlling Agents in Haskell.

Do you know about any existing implementation or research paper dealing with BDI agents that can be defined in Haskell or in any other functional language, please? My aim is to find possible related works, everything that could manage a system of concurrent intelligent agents written in a functional language. I don't need anything specific, I just want to find out whether my work has something in common with existing approaches.

edit: I managed to find a reference to Clojure, a lisp dialect that supports a form of agent programming very close to the actor model, but it's not meant to directly support BDI agents (one should implement another layer on top of it to get the BDI part done I guess).


Source: (StackOverflow)

Using agents to synchronize jobs

I am toying with a simulation where I have couple of robots and a controller, controller decided what to do and assign jobs to robots, following is technically an abuse basically I do not care about the agents state, I just care about the fact that it will execute fns sent to it in order and I can wait for them to finish.

Following pretty much demonstrates what I am trying to achieve, controller gets a big job each robots gets a chunk of it,


(def *agents* (reduce
               (fn[h v] (assoc h v (agent true)))
               {:control (agent true)} (range 0 5)))

(defn send-job [id f]
  (send-off (*agents* id)
            (fn [s f]
              (try
                (f)
                (catch Exception e (println e))))
            f))

(defn await-job [id]
  (await (*agents* id)))

(send-job :control
          (fn []

            (send-job 0 (fn []
                          (Thread/sleep 10)
                          (println "0 Done.")))

            (send-job 1 (fn []
                          (Thread/sleep 2)))

            (await-job 1)
            ;; 0 still running.
            ;; do other stuff...
            ))

Well the problem is you can not send-off from within a send-off I get "Can't await in agent action". Is it possible to do this using clojure's concurrency tools or do I have to re implement a agent like structure?


Source: (StackOverflow)

About box with Application is agent (UIElement) set to YES?

Im trying to create a application that should only be visible in the status bar, and not have a window until you press the NSStatusItem menu options. So i have one that should open "about"

[[NSApplication sharedApplication] orderFrontStandardAboutPanel:self];

But nothing shows if I have the Application is agent set to YES. If I change it to NO it works, but I get a application window and all the menu options that i don't want to see.

Any ideas?

Kind regards


Source: (StackOverflow)

Definitive list of GWT user.agent properties and the browsers they correspond to

Does anyone know of a definitive list of GWT's user.agent properties and the targeted browsers? I'll be damned if I can find such a thing anywhere on the web!


Source: (StackOverflow)

What is the best architecture for this simulator?

I have to make a simulator in Java, which will simulate car riding on highway. There should be 3 lanes on highway, in every lane there are cars with constant speed. On this highway, there is one agent, which has to drive through and not crash into any other car. Detailed description can be found in this paper at section 2.5 and picture 5.

This image is from mentioned paper and shows the look of highway:

enter image description here

My goal is to write only a simulator (and GUI), not logic of agent. Now, I would like to design an architecture of this simulator and this is where I need help.

My idea, how the agent's API can look is:

public abstract class BaseAgent {
    public abstract void run()
    public abstract void onCrash();
}

Agent (car) on highway should be a descendant of this class. In every step, simulator call function run() where is the agents logic. In this function, agent can call functions like:

goLeft();
goRight();
getNearestCarInLane(int lane_no);
getMySpeed();

So, in every step, agent can decide if he stay in current lane, or if he turns left or right. And that’s all, what can agent do.

So this is agents API, but I do not know, how to design the rest of simulator. My first attempt to simulator architecture was:

class Agent — descendant of BaseAgent, can ride on highway.
class Highway — stores position of all cars on highway.
class Simulator — creates instance of agent and highway; in every step, call agent’s `run()` and monitors any car crash.

This is not a good architecture. In which class should be methods goLeft(), goRight() and getNearestCarInLane()? Because these methods has to be inside of BaseAgent class, but has to know position of every car on highway. So at the end, I had something like this:

Simulator s = new Simulator();
Highway h = new Highway();
Agent a = new Agent();

s.setAgent(a);
s.setHighway(h);
a.setHighway(h);
h.setAgent(a);

And it is terrible and ugly.

So I need a little help from smarter people here. Can somebody give me a link to book, article, whatever about simulators/architecture? Or explain my what I am doing wrong?

I am not a programmer and this project is part of an optional course at my faculty named Software engineering.


Source: (StackOverflow)

TeamCity - Unmet requirements: DotNetFramework4.5_x86 exists

I am very new to TeamCity and currently have a problem with an incompatible agent:

Unmet requirements: 
DotNetFramework4.5_x86 exists

Does anyone know how to fix this? Do I have to add a reference to .NET 4.5 somewhere?

Any advice appreciated.


Source: (StackOverflow)

Dynamic bytecode instrumentation - issue

I have a problem I am not able to solve. Let's assume we have the following two classes and an inheritance relationship:

public class A {
}

public class B extends A {
    public void foo() {}
}

I want to instrument additional code such that it looks as follows:

public class A {
    public void print() { }
}

public class B extends A {
     public void foo() { print(); }
}

In order to achieve this goal, I based my implementation on the java.lang.instrument package, using an Agent with my own class file transformer. The mechanism is also referred to as dynamic bytecode instrumentation.

Piece of cake so far. Now, my test method does the following:

Code:

B b = new B();
b.foo();

This does not work due to the following restriction in the instrumentation package: when calling new B(), the instrumentation starts with class B and ends up in a compilation error when loading the manipulated class as the super class A has no print() method yet! The question arises if and how I can trigger the instrumentation of class A before class B. The transform() method of my classfiletransformer should be invoked with class A explicitly! So I started reading and bumped into this:

The java.lang.instrument.ClassFileTransformer.transform()'s javadoc says:

The transformer will be called for every new class definition and every class redefinition. The request for a new class definition is made with ClassLoader.defineClass. The request for a class redefinition is made with Instrumentation.redefineClasses or its native equivalents.

The transform method comes along with a class loader instance, so I thought, why not calling the loadClass method (loadClass calls defineClass) myself with class A when the instrumentation of B has started. I expected that the instrument method will be called as a result but sadly this was not the case. Instead the class A was loaded without instrumentation. (The agent does not intercept the load process although it is supposed to)

Any ideas, how to solve this problem? Do you see a reason why it is not possible that an agent that manipulates some bytecode cannot manually load another class that is then hopefully also send through that/any agent?

Note that the following code works properly since A was loaded and instrumented before B is manipulated.

A a =  new A();
B b = new B();
b.foo();

Thanks a lot!


Source: (StackOverflow)

Error while using Attach Api

While using attach API in Eclipse error is thrown in console.

In order to use attach API I went to installed JRE in eclipse and then using edit option included the tools.jar in the external jars option in current JRE.

But it throws the following error when i try to execute a simple program such as

java.lang.UnsatisfiedLinkError: no attach in java.library.path com.sun.tools.attach.AttachNotSupportedException: no providers installed at com.sun.tools.attach.VirtualMachine.attach(VirtualMachine.java:190) at dynamicLoadingTest.VMAttach.main(VMAttach.java:17)

This is the simple program executed. import java.io.IOException;

import com.sun.tools.attach.AttachNotSupportedException;
import com.sun.tools.attach.VirtualMachine;

public class VMAttach {


    public static void main(String[] args) {


        try {
            VirtualMachine vm = VirtualMachine.attach("6832");
        } catch (AttachNotSupportedException e) {
            System.out.println("This error");
            e.printStackTrace();
        } catch (IOException e) {
            e.printStackTrace();
        }
    }
}

The process id mentioned 6832 is of a Java application running on the system

On changing the installed jre to jdk following error is produced

Exception in thread "main" com.sun.tools.attach.AttachNotSupportedException: jvm.dll not loaded by target process
    at sun.tools.attach.WindowsVirtualMachine.<init>(WindowsVirtualMachine.java:46)
    at sun.tools.attach.WindowsAttachProvider.attachVirtualMachine(WindowsAttachProvider.java:52)
    at com.sun.tools.attach.VirtualMachine.attach(VirtualMachine.java:195)
    at dynamicLoadingTest.VMAttach.main(VMAttach.java:17)

Source: (StackOverflow)