Search Results

Search found 164 results on 7 pages for 'misha zaslavsky'.

Page 1/7 | 1 2 3 4 5 6 7  | Next Page >

  • Vim disables ibus IME -- is this a bug?

    - by misha
    I'm using ibus IME to input Japanese text into GVim. I have the following Vim script that I source when GVim starts up: autocmd InsertLeave * :call bug#onInsertLeave() function! bug#onInsertLeave() python << EOT import vim import ibus bus = ibus.Bus() ic = ibus.InputContext(bus, bus.current_input_contxt()) ic.disable() print "bug#onInsertLeave(): exiting" EOT endfunction The line that constructs the InputContext raises the exception: dbus.exception.DBusException: org.freedesktop.DBus.Error.Failed: no focused input context This happens under the following conditions: I enter insert mode I insert some Japanese text I exit insert mode If I don't enter any Japanese text through the IME, then the exception is not raised. I've also noticed that if I exit insert mode after entering some Japanese text while the IME is still enabled, then IME input is disabled (I can see the icon change in the taskbar). If I exit insert mode without entering any Japanese text, but while the IME is still enabled, then the IME stays enabled (the icon does not change). It seems like GVim is disabling the IME (or the IME is switching off) in some conditions. Could it be related to the exception? My questions are: Is this a bug? If it is, then whose bug is it? Vim, Ibus, or something else? Are there any ways to work around the exception? EDIT My system info: > misha@misha-lmd:~/git/iwait2013/lagos$ apt-cache policy ibus ibus: > Installed: 1.4.1-3ubuntu1 Candidate: 1.4.1-3ubuntu1 Version table: > *** 1.4.1-3ubuntu1 0 > 500 http://jp.archive.ubuntu.com/ubuntu/ precise/main amd64 Packages > 100 /var/lib/dpkg/status misha@misha-lmd:~/git/iwait2013/lagos$ apt-cache policy vim vim: > Installed: 2:7.3.429-2ubuntu2.1 Candidate: 2:7.3.429-2ubuntu2.1 > Version table: *** 2:7.3.429-2ubuntu2.1 0 > 500 http://jp.archive.ubuntu.com/ubuntu/ precise-updates/main amd64 Packages > 100 /var/lib/dpkg/status > 2:7.3.429-2ubuntu2 0 > 500 http://jp.archive.ubuntu.com/ubuntu/ precise/main amd64 Packages Ubuntu 12.04, Fluxbox

    Read the article

  • How does one save cookies in HTTP Builder 0.5.0/HTTPClient

    - by Misha Koshelev
    I am trying per instructions here: http://www.innovation.ch/java/HTTPClient/advanced_info.html However, if I am using HTTP Builder, the following lines System.setProperty("HTTPClient.cookies.save","true") System.setProperty("HTTPClient.cookies.jar","/home/misha/.httpclient_cookies") do not seem to create a file: ~/.httpclient_cookies I will post a solution as always when figure it out. :) Misha

    Read the article

  • gradle runJar task?

    - by Misha Koshelev
    Dear All: I am trying to make a task to run my Jar file in gradle. I have come up with the following: task runJar(dependsOn:[jar]){ ant.java(jar:,fork:true) } However, I am unable to find the path to the jar file. Any help much appreciated. Thank you! Misha EDIT: OK this is rather odd. This task runs before compile, etc.??? EDIT: Fixed. The key is in a doLast { } notation, or, in shorthand task runJar(dependsOn:"jar")<<{ ant.java(jar:"${libsDir}${File.separator}${archivesBaseName}.jar",fork:true) } Misha

    Read the article

  • How do I capture java.util.logging output in TestNG?

    - by Misha Koshelev
    Dear All: I am sorry just wanted to know if this was possible? I have discovered an interesting issue with JUnit and am looking for alternatives. Thank you Misha p.s. Here is JUnit issue: import org.junit.After import org.junit.Before import org.junit.Test import static org.junit.Assert.* class MyTestTest { @Before public void beforeTests() { println "Before" } @Test public void testLogin() { println "Before asdf" asdf println "After asdf" } @After public void logoutOfMyTest() { println "After" blah } } JUnit only reports error related to blah. Whereas TestNG reports both: import org.testng.annotations.* class MyTestTest { @BeforeClass public void beforeTests() { println "Before" } @Test public void testLogin() { println "Before asdf" asdf println "After asdf" } @AfterClass public void logoutOfMyTest() { println "After" blah } } Thank you! Misha

    Read the article

  • Potential issues with multiple home pages

    - by Maxim Zaslavsky
    I have a site where I want to have two different home pages: a general description page for anonymous users, and a dashboard page for logged-in users. I am debating between two implementations: Both pages live at / The page for anonymous users is located at / and the dashboard is at /dashboard, with automatic redirection between them based on whether a given user is logged in (e.g., if you're logged in and navigate to /, you are redirected to /dashboard. Is it cleaner to have both pages use the same URL or separate URLs? Also, I imagine that choices for that question will affect the following: Caching: the anonymous page would be completely cached, while the logged-in page would not be cached at all (except for static resources). This could lead to issues with server caching, request speed, and UX (such as if one version of the page is cached in a user's browser when the other version should be displayed, instead). SEO: how would search engines react to such canonical URLs? Load time (due to redirects or to the server having to always reevaluate which page to display)

    Read the article

  • XmlSlurper/NekoHTML document fragment parsing - No HTML or BODY tags wanted

    - by Misha Koshelev
    Dear All, I am trying to parse the following HTML fragment, and I would like to get the same fragment as output (without HTML and BODY tags). Is this possible? If so, how? Thank you Misha p.s. I am reading here: http://nekohtml.sourceforge.net/faq.html#fragments and I believe I have added the correct options below. However, the output is still incorrect :( Thank you Misha import groovy.xml.MarkupBuilder import groovy.xml.StreamingMarkupBuilder import groovy.util.XmlNodePrinter import groovy.util.slurpersupport.NodeChild def text=""" <div><h2>Test</h2> <div>Hi</div> </div> """ // Parse def config=new org.cyberneko.html.HTMLConfiguration() config.setFeature("http://cyberneko.org/html/features/balance-tags/document-fragment",true) def html=new XmlSlurper(new org.cyberneko.html.parsers.SAXParser()).parseText(text) // Output def printNode(NodeChild node) { def writer = new StringWriter() writer << new StreamingMarkupBuilder().bind { mkp.declareNamespace('':node[0].namespaceURI()) mkp.yield node } new XmlNodePrinter().print(new XmlParser().parseText(writer.toString())) } printNode(html) Output: <HTML> <tag0:HEAD xmlns:tag0="http://www.w3.org/1999/xhtml"/> <BODY> <DIV> <H2> Test </H2> <DIV> Hi </DIV> </DIV> </BODY> </HTML>

    Read the article

  • Install VMWare Tools from VMWare Workstation 7.1.1 build-282343 on Debian squeeze: complaint about gcc path not valid

    - by Misha Koshelev
    Dear All: I am trying to install VMWare tools on Debian Squeeze. My error: Before you can compile modules, you need to have the following installed... make gcc kernel headers of the running kernel Searching for GCC... The path "/usr/bin/gcc" is not valid path to the gcc binary. Would you like to change it? [yes] uname -a: Linux debian 2.6.32-5-686 #1 SMP Sat Sep 18 02:14:45 UTC 2010 i686 GNU/Linux dpkg -l | grep make ii make 3.81-8 An utility for Directing compilation. dpkg -l | grep gcc ii gcc 4:4.4.4-2 The GNU C compiler ii gcc-4.4 4.4.4-8 The GNU C compiler ii gcc-4.4-base 4.4.4-8 The GNU Compiler Collection (base package) ii libgcc1 1:4.4.4-8 GCC support library whereis gcc gcc: /usr/bin/gcc /usr/lib/gcc Thank you Misha

    Read the article

  • Interfacing HTTPBuilder and HTMLUnit... some code

    - by Misha Koshelev
    Ok, this isn't even a question: import com.gargoylesoftware.htmlunit.HttpMethod import com.gargoylesoftware.htmlunit.WebClient import com.gargoylesoftware.htmlunit.WebResponseData import com.gargoylesoftware.htmlunit.WebResponseImpl import com.gargoylesoftware.htmlunit.util.Cookie import com.gargoylesoftware.htmlunit.util.NameValuePair import static groovyx.net.http.ContentType.TEXT import java.io.File import java.util.logging.Logger import org.apache.http.impl.cookie.BasicClientCookie /** * HTTPBuilder class * * Allows Javascript processing using HTMLUnit * * @author Misha Koshelev */ class HTTPBuilder { /** * HTTP Builder - implement this way to avoid underlying logging output */ def httpBuilder /** * Logger */ def logger /** * Directory for storing HTML files, if any */ def saveDirectory=null /** * Index of current HTML file in directory */ def saveIdx=1 /** * Current page text */ def text=null /** * Response for processJavascript (Complex Version) */ def resp=null /** * URI for processJavascript (Complex Version) */ def uri=null /** * HttpMethod for processJavascript (Complex Version) */ def method=null /** * Default constructor */ public HTTPBuilder() { // New HTTPBuilder httpBuilder=new groovyx.net.http.HTTPBuilder() // Logging logger=Logger.getLogger(this.class.name) } /** * Constructor that allows saving output files for testing */ public HTTPBuilder(saveDirectory,saveIdx) { this() this.saveDirectory=saveDirectory this.saveIdx=saveIdx } /** * Save text and return corresponding XmlSlurper object */ public saveText() { if (saveDirectory) { def file=new File(saveDirectory.toString()+File.separator+saveIdx+".html") logger.finest "HTTPBuilder.saveText: file=\""+file.toString()+"\"" file<<text saveIdx++ } new XmlSlurper(new org.cyberneko.html.parsers.SAXParser()).parseText(text) } /** * Wrapper around supertype get method */ public Object get(Map<String,?> args) { logger.finer "HTTPBuilder.get: args=\""+args+"\"" args.contentType=TEXT httpBuilder.get(args) { resp,reader-> text=reader.text this.resp=resp this.uri=args.uri this.method=HttpMethod.GET saveText() } } /** * Wrapper around supertype post method */ public Object post(Map<String,?> args) { logger.finer "HTTPBuilder.post: args=\""+args+"\"" args.contentType=TEXT httpBuilder.post(args) { resp,reader-> text=reader.text this.resp=resp this.uri=args.uri this.method=HttpMethod.POST saveText() } } /** * Load cookies from specified file */ def loadCookies(file) { logger.finer "HTTPBuilder.loadCookies: file=\""+file.toString()+"\"" file.withObjectInputStream { ois-> ois.readObject().each { cookieMap-> def cookie=new BasicClientCookie(cookieMap.name,cookieMap.value) cookieMap.remove("name") cookieMap.remove("value") cookieMap.entrySet().each { entry-> cookie."${entry.key}"=entry.value } httpBuilder.client.cookieStore.addCookie(cookie) } } } /** * Save cookies to specified file */ def saveCookies(file) { logger.finer "HTTPBuilder.saveCookies: file=\""+file.toString()+"\"" def cookieMaps=new ArrayList(new LinkedHashMap()) httpBuilder.client.cookieStore.getCookies().each { cookie-> def cookieMap=[:] cookieMap.version=cookie.version cookieMap.name=cookie.name cookieMap.value=cookie.value cookieMap.domain=cookie.domain cookieMap.path=cookie.path cookieMap.expiryDate=cookie.expiryDate cookieMaps.add(cookieMap) } file.withObjectOutputStream { oos-> oos.writeObject(cookieMaps) } } /** * Process Javascript using HTMLUnit (Simple Version) */ def processJavascript() { logger.finer "HTTPBuilder.processJavascript (Simple)" def webClient=new WebClient() def tempFile=File.createTempFile("HTMLUnit","") tempFile<<text def page=webClient.getPage("file://"+tempFile.toString()) webClient.waitForBackgroundJavaScript(10000) text=page.asXml() webClient.closeAllWindows() tempFile.delete() saveText() } /** * Process Javascript using HTMLUnit (Complex Version) * Closure, if specified, used to determine presence of necessary elements */ def processJavascript(closure) { logger.finer "HTTPBuilder.processJavascript (Complex)" // Convert response headers def headers=new ArrayList() resp.allHeaders.each() { header-> headers.add(new NameValuePair(header.name,header.value)) } def responseData=new WebResponseData(text.bytes,resp.statusLine.statusCode,resp.statusLine.toString(),headers) def response=new WebResponseImpl(responseData,uri.toURL(),method,0) // Transfer cookies def webClient=new WebClient() httpBuilder.client.cookieStore.getCookies().each { cookie-> webClient.cookieManager.addCookie(new Cookie(cookie.domain,cookie.name,cookie.value,cookie.path,cookie.expiryDate,cookie.isSecure())) } def page=webClient.loadWebResponseInto(response,webClient.getCurrentWindow()) // Wait for condition if (closure) { for (i in 1..20) { if (closure(page)) { break; } synchronized(page) { page.wait(500); } } } // Return text text=page.asXml() webClient.closeAllWindows() saveText() } } Allows one to interface HTTPBuilder with HTMLUnit! Enjoy Misha

    Read the article

  • Capture console output in TestNG?

    - by Misha Koshelev
    Dear All: I am using TestNG+ReportNG per wiki instructions in gradle (I fixed on cookbook as default example did not work form me). http://docs.codehaus.org/display/GRADLE/Cookbook#Cookbook-addreporters I would like to somehow capture console output in TestNG. Is this possible? Thank you Misha

    Read the article

  • Strange groovy behavior when dealing with threads

    - by Misha Koshelev
    Dear All: I have an interesting dilemma. If I define my class as: class Browser { def swtException protected Object evaluate(script) throws SWTException { swtException=null display.syncExec() { try { result=swtBrowser.evaluate(script) } catch (SWTException swtException) { Browser.swtException=swtException } } } I get this rather interesting error: Exception in thread "Thread-5" org.eclipse.swt.SWTException: Failed to execute runnable (groovy.lang.MissingPropertyException: No such property: swtException for class : com.mksoft.fbautomate.browser.Browser Possible solutions: swtException) Any ideas??? Thank you! Misha

    Read the article

  • Convert cookies from HTMLUnit to HTTPBuilder?

    - by Misha Koshelev
    Dear All: I am doing this (in Groovy): def cookies=webClient.cookieManager.cookies def http=new HTTPBuilder("myurl") http.request(POST) { def headersCookie='' cookies.eachWithIndex() { cookie,i-> if (i>0) { headersCookie+='; ' } headersCookie+=cookie.getName()+"="+cookie.getValue() } headers.'Cookie'=headersCookie ... } Is there a better/less hacky way? Thank you Misha

    Read the article

  • Robust Javascript parser in Java

    - by Misha Koshelev
    Dear All: I am looking for a robust Javascript parser written in Java - by which I mean a Javascript parser that is able to handle most real world Javascript. I am only interested in parsing Javascript, not in executing it. I have found Rhino: http://groups.google.com/group/mozilla.dev.tech.js-engine.rhino/browse_thread/thread/1eff23a8ee57b991 Am I missing anything? Is this the best solution? Thank you! Misha

    Read the article

  • ivy dependency on external JAR

    - by Misha Koshelev
    Dear All: I am battling with Ivy (I tried maven but had an event more difficult time setting up the JBoss repository for Hibernate). Quick question - I am using this wonderful package: http://ooweb.sourceforge.net/index.html Unfortunately, the JAR is only available through Sourceforge: http://sourceforge.net/projects/ooweb/files/ooweb/0.8.0/ooweb-0.8.0-bin.tar.gz/download Is there a way to get Ivy to download a specific JAR? For that matter, is it possible to do with Maven? Thank you! Misha

    Read the article

  • Simple java syncrhonization question

    - by Misha Koshelev
    Dear All: Was wondering, which is correct: Option One class A { public void methodOne() { synchronized(this) { modifyvalue notifyAll() } } public void methodTwo() { while (valuenotmodified) { synchronized(this) { wait() } } } Option Two class A { public void methodOne() { modifyvalue synchronized(this) { notifyAll() } } public void methodTwo() { while (valuenotmodified) { synchronized(this) { wait() } } } and why? Thank you Misha

    Read the article

  • Groovy pretty print XmlSlurper output from HTML?

    - by Misha Koshelev
    Dear All: I am using several different versions to do this but all seem to result in this error: [Fatal Error] :1:171: The prefix "xmlns" cannot be bound to any namespace explicitly; neither can the namespace for "xmlns" be bound to any prefix explicitly. I load html as: // Load html file def fis=new FileInputStream("2.html") def html=new XmlSlurper(new org.cyberneko.html.parsers.SAXParser()).parseText(fis.text) Versions I've tried: http://johnrellis.blogspot.com/2009/08/hmmm_04.html import groovy.xml.StreamingMarkupBuilder import groovy.xml.XmlUtil def streamingMarkupBuilder=new StreamingMarkupBuilder() println XmlUtil.serialize(streamingMarkupBuilder.bind{mkp.yield html}) http://old.nabble.com/How-to-print-XmlSlurper%27s-NodeChild-with-indentation--td16857110.html // Output import groovy.xml.MarkupBuilder import groovy.xml.StreamingMarkupBuilder import groovy.util.XmlNodePrinter import groovy.util.slurpersupport.NodeChild def printNode(NodeChild node) { def writer = new StringWriter() writer << new StreamingMarkupBuilder().bind { mkp.declareNamespace('':node[0].namespaceURI()) mkp.yield node } new XmlNodePrinter().print(new XmlParser().parseText(writer.toString())) } Any advice? Thank you! Misha

    Read the article

  • Hibernate: @UniqueConstraint with @ManyToOne field???

    - by Misha Koshelev
    Dear All: Using the following code: @Entity @Table(uniqueConstraints=[@UniqueConstraint(columnNames=["account","name"])]) class Friend { @Id @GeneratedValue(strategy=GenerationType.AUTO) public Long id @ManyToOne public Account account public String href public String name } I get the following error: org.hibernate.AnnotationException: Unable to create unique key constraint (account, name) on table Friend: account not found It seems this has to do with the @ManyToOne constraint, which I imagine actually creates a separate UniqueConstraint??? In any case, if I take this out, there is no complaint about the UniqueConstraint, but there is another error which makes me believe it must be left in. org.hibernate.MappingException: Could not determine type for: com.mksoft.fbautomate.domain.Account, at table: Friend, for columns: [org.hibernate.mapping.Column(account)] Any hints how I can create such a desired constraint (i.e., that each combination of account and name occurs only once???) Thank you! Misha

    Read the article

  • HTTP Builder/Groovy - get source text _and_ XmlSlurper output?

    - by Misha Koshelev
    Dear All: I am reading here: http://groovy.codehaus.org/modules/http-builder/doc/get.html I seem to be able to get i) XMLSlurper output as parsed by NekoHTML using: def http = new HTTPBuilder('http://www.google.com') def html = http.get( path : '/search', query : [q:'Groovy'] ) ii) Raw text using: http.get( path : '/search', contentType : TEXT, query : [q:'Groovy'] ) { resp, reader -> println "response status: ${resp.statusLine}" println 'Headers: -----------' resp.headers.each { h -> println " ${h.name} : ${h.value}" } println 'Response data: -----' System.out << reader println '\n--------------------' } I am having some trouble and would like to get BOTH (i) and (ii) to debug my XmlSlurper code on the actual html I am getting. Any suggestions how I might go about doing this? I can easily instantiate an XmlSlurper object with the relevant string using the parseString(string) method or the parse(reader) method, but I cannot seem to get the Neko processing step correct. Any hints? Thank you! Misha

    Read the article

  • Gradle java.util.logging.Logger output in unit tests

    - by Misha Koshelev
    Dear All: Sorry this is probably a very simple question. I am using gradle http://www.gradle.org/ for my development environment. It works quite well! I have written a simple unit test that uses HtmlUnit and my own package. For my own package, I use java.util.Logger. HtmlUnit seems to use commons logging: http://htmlunit.sourceforge.net/logging.html I would like to see console output of my logging messages from java.util.Logger However, it seems that even messages at the info level are not displayed in my Unit Test Results GUI (System.err link), although the HtmlUnit messages are all displayed. Please let me know if you have suggestions. Thank you! Misha

    Read the article

  • org.apache.http.impl.cookie.BasicClientCookie not serializable???

    - by Misha Koshelev
    Dear All: I am quite confused... I am reading here and BasicClientCookie clearly implements Serializable per JavaDoc: http://hc.apache.org/httpcomponents-client/httpclient/apidocs/org/apache/http/impl/cookie/BasicClientCookie.html However, my simple Groovy script: #!/usr/bin/env groovy @Grapes( @Grab(group='org.apache.httpcomponents', module='httpclient', version='4.0.1') ) import org.apache.http.impl.cookie.BasicClientCookie import java.io.File def cookie=new BasicClientCookie("name","value") println cookie instanceof Serializable def f=new File("/tmp/test") f.withObjectOutputStream() { oos-> oos.writeObject(cookie) } outputs: false Caught: java.io.NotSerializableException: org.apache.http.impl.cookie.BasicClientCookie at t$_run_closure1.doCall(t.groovy:12) at t.run(t.groovy:11) I have checked and I have no other versions of HttpClient anywhere in classpath (if I take Grapes statement out it cannot find file). Thank you! Misha Koshelev

    Read the article

1 2 3 4 5 6 7  | Next Page >