Posts

LWJGL 3 change OpenGL context / ContextAttribs alternative -

in lwjgl 2 use older profile of opengl that: pixelformat pixelformat = new pixelformat(); contextattribs contextatrributes = new contextattribs(3, 2) //<-- .withprofilecore(true) .withforwardcompatible(true); display.setdisplaymode(new displaymode(width, height)); display.settitle(window_title); display.create(pixelformat, contextatrributes); in lwjgl 3 there no display class anymore, how can there? use glfwwindowhint contextattribs : glfwwindowhint(glfw_context_version_major, 3); glfwwindowhint(glfw_context_version_minor, 2); glfwwindowhint(glfw_opengl_profile, glfw_opengl_core_profile); glfwwindowhint(glfw_opengl_forward_compat, glfw_true); then glfwcreatewindow(width, height, title, 0, 0) glfwwindowhint can change options found in pixelformat , , defaults different may want to. you need call glfwinit() before of this. more complete guide can found here: http://www.lwjgl.org/guide

How to proxy secure web services (HTTPS SSL/TLS) using Mule's <pattern:web-service-proxy> -

we have cxf web services running locally accessed across https tls/ssl. we'd expose these services externally using mule's <pattern:web-service-proxy>. our question is, can <pattern:web-service-proxy> configured use https? we have proxied these services across http using <pattern:web-service-proxy>. however, when change web-service-proxy's inboundaddress , outboundaddress attributes (below) http urls https urls error: "the required object/property "tls-key-store" null". this works: <pattern:web-service-proxy name="unsecure_ws_proxy" inboundaddress="http://localhost:80/services/service_common_name" outboundaddress="http://localhost:8080/app_name/proxied_service_name" /> this not work (produces "the required object/property "tls-key-store" null "): <pattern:web-service-proxy name="secure_ws_proxy" inboundaddress="https://localhost:443/ser...

C# - How to specify generic type constraints for multiple level of inheritance hierarchy? -

i have following class hierarchy public class entitybase<t> t : entitybase<t> { //nothing interesting here } public class benefit : entitybase<benefit> { //again, nothing interesting here } public class seasonticketloan : benefit { //nothing interesting here } now have got following interface public interface iquery<t> t : entitybase<t> { } when try build following class compilation error public class employeesquery : iquery<seasonticketloan> { } i error saying seasonticketloan class not satisfy constraint. the benefit class should have generic type - parent classes have "ultimate" /sealed type generic type. "ultimate"/sealed types have no generic arguments. the result in parent classes way through root parent class generic argument contains type of "ultimate"/sealed class , no errors arise. public class entitybase<t> t : entitybase<t> { //nothing interesting he...

SML: syntax error: replacing FUN with VAL -

i trying write function in ml works loop (yes know not how language supposed work). here code far: fun (f:int->unit) start_i:int end_i:int = let fun for2 (f:int->unit) start_i:int end_i:int i:int = if i=end_i - 1 f else (f i; for2 f start_i end_i (i + 1)) in for2 f start_i end_i start_i end but sml (and ocaml too) giving me error: test.ml:1.2-1.5 error: syntax error: replacing fun val test.ml:2.6-2.9 error: syntax error: replacing fun val so, there wrong function's signature. can't find is. can me? thanks not sure if compiles in ocaml (is f#) version of interactive not complaining is: let rec for2 (body: int->unit) istart iend = if istart = iend () else body istart; for2 body (istart+1) iend

java - Jena; How to check A subClassOf B without iterating A super classes nor B sub classes -

let's have ontology manipulated jena , 2 ontology classes ( ontclass ), , b. there method check a subclassof b without iterating through super classes , checking if b among them. without iterating b sub classes , checking if among them. mean a.issubclassof(b) the best place check documentation. (actually, using ide has support autocompletion make easy find, too.) in case, documentation ontclass has 2 methods you're asking for. it's not issubclass , rather hassubclass(resource) . there's hassuperclass(resource) . instance, check whether subclass of b, do: ontclass = ...; ontclass b = ...; a.hassuperclass(b); // have b superclass? b.hassubclass(a); // b have subclass?

loopbackjs - Node.js periodic tasks with clustering -

i'm running strongloop's loopback api server in production mode. means master process creates many workers, how many cores cpu has. master process controls workers , never execute code. my purpose execute periodic task once @ time, because runs on 4 workers. is there suggestions, except cron or 'key lock' in redis-like storage? in iojs , node v0.12 possible exclusive socket binding . used form of locking similar filesystem based approach. method same both: attempt exclusive access resource if success: perform task else: not perform task with sockets this: net.createserver().on('error', function(err) { console.log('did not lock', err); }).listen({ port: 4321, exclusive: true }, function() { singleprocesstask(); this.close(); }); note exclusive: true required cluster mode because defaults sharing sockets. similarly fs.open : fs.open('lock.file', 'wx', function(err, fd) { if (err) { console.log...

image processing - Detect corner coordinates of a non-convex polygon in clockwise order MATLAB -

Image
i have images includes both convex non-convex polygons. each image contains 1 polygon. need detect corner coordinates , need sort them in clock-wise or counter-clockwise order. convex polygons, use harris corner detection detecting corners , convexhull sorting points. dont have idea on how sort non-convex polygon. inputs images, think image processing technique might sort them out moving alongside edge of polygon. there way least complexity? example image: i have named corners randomly. expected output: i expect corner coordinates in order 1 3 5 9 4 2 8 7 6 10 or 1 10 6 7 8 2 4 9 5 3 . can start @ point, not 1 edit 1: after rayryeng's solution, works convex polygons non-convex polygon, there non-convex polygons doesn't go algorithm. here example another approach use bwdistgeodesic find order corners distance along edge. should work polygon can detect continuous edge. we start loading in image stack overflow , converting black , white imag...