Posts

Simplest way to get a polygon from Illustrator to Java? -

what's simplest way polygon (doesn't need curves etc, array of points) illustrator (or other vector graphics program, matter) java polygon object? i'm not eager implement heavy svg class, app needs light-weight possible. i know it's wide question, may answers be. in advance, guys. you might want try "fxg converter (webstart)" (http://idisk.mac.com/han.solo-public/fxgconverter.jnlp) http://harmoniccode.blogspot.com/ .

NextGen gallary for WordPress not displaying correcting in chrome -

the nextgen gallery isn't displaying in chrome, works fine in firefox. has found fix problem? even sample page gallery display isn't displaying correctly. http://nextgen-gallery.com/gallery-tags/ when open image view it, after moving second image, image moves down bit , after few images sitting below website, not near top or in middle. making unusable. thank you better yet: <style type="text/css"> #shdisplay { top:15%!important;. } </style> worked me, , not have absolute value, better different sized monitors!!

c++ - C++11: std::thread inside a class executing a function member with thread initialisation in the constructor -

i'm trying use std::thread c++11. couldn't find anywhere if possible have std::thread inside class executing 1 of function members. consider example below... in try (below), function run(). i compile gcc-4.4 -std=c++0x flag. #ifndef runnable_h #define runnable_h #include <thread> class runnable { public: runnable() : m_stop(false) {m_thread = std::thread(runnable::run,this); } virtual ~runnable() { stop(); } void stop() { m_stop = false; m_thread.join(); } protected: virtual void run() = 0; bool m_stop; private: std::thread m_thread; }; class mythread : public runnable{ protected: void run() { while(!m_stop){ /* something... */ }; } }; #endif // runnable_h i'm getting error , others: (same error , without $this) runnable.h|9|error: no matching function call ‘std::thread::thread(<unresolved overloaded function type>, runnable* const)’| when passing pointer. runnable.h|9|error: is...

Resources for learning how to design good API wrappers in ruby -

i'd learn how design api wrappers in ruby. i'm looking for: blog articles tutorials best code , library learn code directly (well commented , designed) books ... , also, what of favorite api wrappers , makes them special? any source welcome in advance update jun 29 2011 building platform api on rails update: 13/06/2011 have @ great post on how develop an api wrapper/interface client: - http://www.arailsdemo.com/posts/56 chapter 2 of ruby best practices might helpful. you can read free here .

vb.net - WCF 'sub main' not found -

i must losing mind... after getting test wcf hosted in windows service, i'm trying 1 (practice, practice, practice). i created wcf service library, added 1 function. created windows service, , added wcf project. did rest of stuff located here (http://joefreeman.co.uk/blog/2010/03/creating-a-setup-project-for-a-windows-wcf-service-with-visual-studio/) now i'm getting "sub mian not found in [wcf app]" error when try build solution. i didn't think wcf projects required sub main services , not applications. doing wrong? didn't have sub main in last project. ideas? the wcf service doesn't need sub main, windows service does. compare against built, working windows service. edit: using c#, when create new project using windows service template, following initial code in program.cs file ( static void main sub main ). i'd very surprised if don't have in windows service. static class program { /// <summary> /// mai...

java - load resource from Jar file at runtime -

i trying load resource jar file added in @ runtime , not getting far. here code (groovy): url url = new url("jar:file:/out/resource.jar!/test.resource") def urllist = [] << url url[] urls = urllist.toarray() urlclassloader classloader = new urlclassloader(urls, this.class.getclassloader()) inputstream stream = url.openstream() i error: java.util.zip.zipexception: error in opening zip file @ java.util.zip.zipfile.open(native method) questions: 1) need put "test.resource" in url? 2) relationship between urlclassloader , current class's classloader? 3) proper way stream in resource (obviously have doesn't work)? thanks if want add jar file current thread's classloader you'd create new urlclassloader, use current class's classloader parent , add new jar urls. may not put test.resource in url. don't forget assign new classloader current thread. see example below: url url = new url("file:/out/resource.ja...

Detecting mime-type of a MySQL BLOB in Java -

yes know shouldn't store images on database , thanks. that said, there way detect in java mime type of blob stored in mysql? it images (.gif, .png, .jpeg, etc.) don't need common purpose tool. thanks lot guys bonus points if proposed solution not involve 3rd party libs :) i imagine can take @ headers. need read data byte array , examine bytes see if match headers different file-types. for example, gif, first 3 bytes "gif" (47 16 49 16 46 16 ) followed either "87a" (38 16 37 16 61 16 ) or "89a" (38 16 39 16 61 16 ). so should work (uses fileinputstream demonstration purposes, can binary data blob using resultset#getbinarystream(int) or resultset#getbinarystream(string) ): import java.io.fileinputstream; import java.io.fileoutputstream; import java.io.ioexception; import java.util.arrays; public class identifyimage { public static void main(string[] args) throws ioexception { fileinputstream in ...