Search Results

Search found 24 results on 1 pages for 'ittayd'.

Page 1/1 | 1 

  • PowerShell: can't modify environment variables

    - by IttayD
    I have an environment variable set via "system properties - advanced - Environment Variables". I modified the variable's value. In cmd, I see the new value. In PowerShell, the value is still the old value. Trying to set it with [Environment]::SetEnvironmentVariable doesn't have any effect.

    Read the article

  • how is the windows kill process works?

    - by IttayD
    I'm unfamiliar with how processes are killed in Windows. In Linux, a "warm" kill sends a signal (15) and the process can handle by instantiating a signal handler it and a cold kill sends signal (9) which the OS handles killing the process by force. What is the procedure in Windows? How can I send a "kill" to a process? How does the process handle it? Is there a cross-platform way of responding to a kill/close request?

    Read the article

  • excel autocomplete combo-box with on-selection event

    - by IttayD
    Hi, I have an excel sheet for groceries. One column is the name, another is whether to buy it or not (checkbox) and another is the amount. I'd like to have a widget in the top row so that I start typing an item's name and it shows a list of matching items that I can select from, or if I continue to type and there's only one item, completes its name. When the last item is selected, other widgets show the amount, which I can edit and clicking 'check' will check the item in the list. I know this is kind of very specific, but am hoping someone can at least get me started. Thank you, Ittay

    Read the article

  • excel autocomplete combo-box with on-selection event

    - by IttayD
    I have an excel sheet for groceries. One column is the name, another is whether to buy it or not (checkbox) and another is the amount. I'd like to have a widget in the top row so that I start typing an item's name and it shows a list of matching items that I can select from, or if I continue to type and there's only one item, completes its name. When the last item is selected, other widgets show the amount, which I can edit and clicking 'check' will check the item in the list. I know this is kind of very specific, but am hoping someone can at least get me started. Thank you, Ittay

    Read the article

  • cast across classloader?

    - by IttayD
    How can I do this: class Foo { public static Foo get() throws Exception { ClassLoader cl = new URLClassLoader(new URL[]{"foo.jar"}, null); // Foo.class is in foo.jar return (Foo)cl.loadClass("Foo").newInstance(); // fails on class cast } } What I need is for the JVM to consider the Foo instance from cl as if it is an instance of Foo from the classloader of the executing code. I have seen these approaches, none of them good for me (the above example is a toy example): Load the class (or a separate interface) by a class loader that is a parent of both the calling code and created classloader Serialize and deserialize the object.

    Read the article

  • using pom for test scope dependencies

    - by IttayD
    Hi, Is it possible to create a pom file so it can be used inside another pom to add test scope dependencies? So in module E's pom.xml I have: <dependencies> <dependency> <groupId>com.example</artifactId> <artifactId>D</artifactId> <type>pom</type> <scope>test</scope> </dependency> </dependencies> So that if D's pom.xml contains dependencies on artifacts A, B, C, then these artifacts are in the compilation and execution classpath of E's tests. NOTE: the reason I want such a pom, and not rely on regular dependency resolution is that I have created a tests jar using maven-jar-plugin:test-jar and using that jar as a dependency causes maven to not use its transitive dependencies. (see http://jira.codehaus.org/browse/MNG-1378) UPDATE: this does not work for me (maybe because I'm trying to use it for the test scope): http://www.sonatype.com/books/mvnref-book/reference/pom-relationships-sect-pom-best-practice.html

    Read the article

  • logging in scala

    - by IttayD
    In Java, the standard idiom for logging is to create a static variable for a logger object and use that in the various methods. In Scala, it looks like the idiom is to create a Logging trait with a logger member and mixin the trait in concrete classes. This means that each time an object is created it calls the logging framework to get a logger and also the object is bigger due to the additional reference. Is there an alternative that allows the ease of use of "with Logging" while still using a per-class logger instance? EDIT: My question is not about how one can write a logging framework in Scala, but rather how to use an existing one (log4j) without incurring an overhead of performance (getting a reference for each instance) or code complexity. Also, yes, I want to use log4j, simply because I'll use 3rd party libraries written in Java that are likely to use log4j.

    Read the article

  • URLClassLoader does not find folders in jar if not ending with '/'?

    - by IttayD
    A 3rd party library (jersey) is trying to find Java packages by ClassLoader#findResource passing in the package name as file name (replacing dots with slashes). What I see is that if I pass a package name as 'a.b.c' (converted to 'a/b/c') it is not found, but if I pass 'a.b.c.' it is found. This translated directly to URL#inputStream that uses ZipFile which doesn't find the entry a/b/c, but finds the entry a/b/c/ I'm trying to find if this is the intended behavior or is there something wrong with my packaging (maven) or the URLs passed to the classloader (which look like jar:file://C:/.../foo.jar!/)

    Read the article

  • splat operator in groovy?

    - by IttayD
    def foo(map, name) { println(map) } foo("bar", hi: "bye") will print [hi:bye] Now I have a previous map that I wish to pass along to foo. In pseudo code, something like: def otherMap = [hi: "world"] foo("bar", hi: "bye", otherMap*) So that it prints [hi:world] This doesn't work of course. Also, trying to pass just the map mixes the order of arguments: def otherMap = [hi: "world"] foo("bar", otherMap) will print bar How can I fix this?

    Read the article

  • how to define a structural type that refers to itself?

    - by IttayD
    I want to create a method sum that I can call on different types, specifically sum(1,2). def sum[A](a1: A, a2: A) = a1 + a2 This fails because the compiler can't tell if A has a method '+' I tried to define a structural type: type Addable = {def +(a: Addable)} This fails because of an illegal cyclic reference How can I achieve this in a type safe way without requiring A to extend a specific trait?

    Read the article

  • Scala: how to specify varargs as type?

    - by IttayD
    Instead of def foo(configuration: (String, String)*) I'd like to be able to write: type Configuration = (String, String)* def foo(configuration: Configuration) The main use case is to provide an easy method signature when overriding in subclasses

    Read the article

  • nicer way of handling dom than DOMCategory?

    - by IttayD
    I'm trying to create a DSL that can easily use a dom node. Using DOMCategory is nice, but adds the noise of 'use(DOMCategory)'. Is there a way to avoid that? I tried wrapping the script call inside a call to 'use', but this doesn't seem to work in closures.

    Read the article

  • Scala: can't write setter without getter?

    - by IttayD
    This works: class ButtonCountObserver { private var cnt = 0 // private field def count = cnt // reader method def count_=(newCount: Int) = cnt = newCount // writer method // ... } val b = new ButtonCountObserver b.count = 0 But this doesn't class ButtonCountObserver { private var cnt = 0 // private field def count_=(newCount: Int) = cnt = newCount // writer method // ... } val b = new ButtonCountObserver b.count = 0 I get: error: value count is not a member of ButtonCountObserver Is it possible to create a setter (with the syntactic sugar) without a getter?

    Read the article

  • why am i getting StackOverflowError?

    - by IttayD
    In groovyConsole I have this: import groovy.util.* import org.codehaus.groovy.runtime.* def gse = new GroovyScriptEngine("c:\\temp") def script = gse.loadScriptByName("say.groovy") this.metaClass.mixin script say("bye") say.groovy contains def say(String msg) { println(msg) }

    Read the article

  • execute external command / application from java

    - by IttayD
    I'm looking for a package to support reliably executing external processes from Java. My criteria: Abstract over OS. So if I want to run 'foo', it will look for 'foo.bat', 'foo.exe' under windows and 'foo' under other OSs (or, have a way of passing a map of os-command) Being able to execute Java classes by simply giving the class name and arguments (so the package locates the java command, copies jvm flags and then executes) Process stdout and stderr properly Watchdog / Monitoring capabilities I've looked at commons-exec but it looks like it answers only 3 & 4. Ant has support for execution but looks like an overkill to use it for this purpose only.

    Read the article

  • capture types of varargs parameters

    - by IttayD
    Hi, I'd like to define a method accepting varargs, so that I get the types with which it was called even in the case of nulls. def foo(args: Any*) = .... val s: String = null foo(1, s) // i'd like to be able to tell in foo that args(0) is Int, args(1) is String

    Read the article

  • creating proxy object in groovy

    - by IttayD
    Hi, I am looking for how to write a method that accepts some value and returns a proxy to that value where the underlying value can be retrieved with an accessor: def p = toProxy(1) assert p == 1 assert p * 2 == 2 assert p.underlying == 1 def p2 = toProxy(objWithMethodFoo) p2.foo() p2.underlying.foo() I want to do this per object instance (not for all objects of some class) and without the need to use special 'use' constructs.

    Read the article

  • best scala idiom for find & return

    - by IttayD
    This is something I encounter frequently, but I don't know the elegant way of doing. I have a collection of Foo objects. Foo has a method bar() that may return null or a Bar object. I want to scan the collection, calling each object's bar() method and stop on the first one returning an actual reference and return that reference from the scan. Obviously: foos.find(_.bar != null).bar does the trick, but calls #bar twice.

    Read the article

1