Posts

Showing posts from June, 2014

c# - Can Poly2Tri triangulate polygons with collinear points? -

i'm trying triangulate following rectangular polygon multiple points on bottom , top edges, poly2tri c# implementation fails triangulate properly. doing wrong? thanks. [0.624999999999412,0.549725]:{3914247097} [0.624999999999412,0.0499749999999999]:{2649576031} [0.697622146677862,0.0499749999999999]:{3234442680} [0.764780181168915,0.0499749999999999]:{779801897} [0.83091206956133,0.0499749999999999]:{3290577852} [0.900187283173112,0.0499749999999999]:{965350020} [0.974812716825783,0.0499749999999999]:{4158962073} [1.04408793043765,0.0499749999999999]:{2500807069} [1.11021981883008,0.0499749999999999]:{1609890243} [1.17737785332108,0.0499749999999999]:{4031413118} [1.25,0.0499749999999999]:{1430088023} [1.25,0.549725]:{133402941} [1.17737785332114,0.549725]:{1740221683} [1.11021981883019,0.549725]:{2812201862} [1.04408793043782,0.549725]:{1792339566} [0.97481271682603,0.549725]:{2861752679} [0.900187283173419,0.549725]:{3438312411} [0.83091206956167,0.549725]:{

Fix Labview Alt-Tab behaviour with Autohotkey -

did try fix way labview interferes normal alt-tab behaviour using autohotkey? alt-tab inside labview puts non-labview windows end of list. so if have alt-tabbed labview window browser takes (2 × number_of_currently_open_labview_projects -1) keystrokes back. great idea. find functionality annoying , there doesn't appear easy fix anywhere on web. here's script. 2 quick notes: i had lot of trouble re-mapping alt-tab. if that's critical can try starting here help. to knowledge it's not possible rid of "screen flicker" because windows requires delay between keystrokes. note: adapt code various windows - "ahk_class" using window spy tool included in autohotkey installer . code #noenv ; recommended performance , compatibility future autohotkey releases. #warn ; enable warnings assist detecting common errors. sendmode input ; recommended new scripts due superior speed , reliability. setworkingdir %a_scriptdir% ; ensur

ruby on rails - Activerecord migration error on postgresql -

i have error without explanation. my error : g::undefinedcolumn: error: column "conjoncture_index_id" referenced in foreign key constraint not exist : alter table "reports" add constraint "fk_rails_c25ad9a112" foreign key ("conjoncture_index_id") references "conjoncture_indices" ("id") my migration : class addcolumntoreports < activerecord::migration def change add_reference :reports, :conjoncture_indice, index: true add_foreign_key :reports, :conjoncture_indices end end my create table migration : class createconjonctureindices < activerecord::migration def change create_table :conjoncture_indices |t| t.date :date t.float :value t.timestamps null: false end end end my model : class conjonctureindice < activerecord::base has_many :reports by_star_field :date end my conjonctureindice shema.rb part : create_table "conjoncture_indices&qu

fiware - Can't access filab instance virtual machine -

i have problem accessing our filab instance virtual machine through ssh. have created keypair pem file, instance, associate ip , create security groups without incidences can't access (always timeout). the filab cloud dashboard status active , running all appears correct can't access. know why? all questions related insfrastructure administration in fiware should sent mail fiware-lab-help@lists.fiware.org.

ecmascript 6 - Import non modular scripts (linq.js) in Aurelia -

i have question importing script define global variables aurelia using import keyword. can simple import modules scripts linq.js define global variable enumerable? possible execute script define namespace? i tried steps this blog post it's defines non static methods. can't example use enumerable.from method. this issue package manager, jspm. when have module exports global, need configure shim in jspm configuration file specify name of exported global(s). in case of linq.js, however, seems use module.exports (i looking @ this source here ), should work out of box. if doesn't, try specifying module format (cjs) in configuration. import this: import enumerable 'linq';

mysql - error with connecting to database using authentication in php -

the errors are: could not connect mysql: access denied user 'zebrahead'@'localhost' (using password: yes) warning: mysql_connect(): access denied user 'zebrahead'@'localhost' (using password: yes) in c:\wamp\www\testsite\authentication.php on line 12 db_user using computer's name. authentication.php <?php $authorized = false; if ((isset($_server['php_auth_user']) , isset($_server['php_auth_pw']))) { define ('db_user','zebrahead'); define ('db_password','password'); define ('db_host','localhost'); define ('db_name','registration'); $dbc = mysql_connect (db_host,db_user,db_password) or die ('could not connect mysql: '.mysql_error()); mysql_select_db (db_name) or die ('could not select database: '.mysql_error()); $query ="select first_name users username='{$_server['php_aut

html - CSS: Position Dynamically Sized div to Bottom of Static Div -

Image
i'm adding chat functionality websocket based web app. in conventional chat windows, eldest message @ top of window , newest @ bottom. my implementation should share typical, top bottom element order. however, in conventional chat windows, eldest message sticks top of frame. implementation should have youngest message sticking bottom of frame. i've seen of son playing it, minecraft has ideal chat interface. in truth, minecraft chat interface appears resemble want implement. how, in css, can make chat messages stick bottom of window? this easy if calc() offered means refer current height of element being applied to, like position: relative; top: calc(240px - [current element height]); where 240px static height of chat window. thanks in advance. first, put position:relative on parent container #container{ position:relative; } then, put position:absolute on chat window #chat{ position:absolute; bottom: 0px; } this should handle dynamic heights.

printf - Simple C program not working because of no obvious reason -

i wanted ask following c code, not working , have no idea why. not enter in if statement, when compile in c++ cin , cout instead of printf/scanf works fine. #include "stdafx.h" #include <conio.h> int sqrt(int x) { if(x < 0) { return printf("no negative numbers"); return 0; } else if(x == 0 || x == 1) { return x; } else { int lowerbound = 1, upperbound = x; int root = lowerbound + (upperbound - lowerbound)/2; while(root > x/root || root+1 <= x/(root+1)) { if(root > x/root) { upperbound = root; } else { lowerbound = root; } root = lowerbound + (upperbound - lowerbound)/2; } if(root*root==x) { return root; } else { return -1; } } } void main() { int

php - Restore a postgresql dump (.sql file) without the command line? -

scenario: i have built php framework uses postgresql database. framework comes shipped .sql file dump of default tables , data framework requires. i want able run sql file client (php), rather command line, in order import data. because have come across server setups accessing command line not possibility, and/or running commands isn't possible (pg_restore may not accessible php user example). i have tried splitting .sql file , running query using pg_sql php extension, because dump file uses copy commands create data, doesn't seem work. seems because copy used, .sql file expects imported using pg_restore command (unless missing something?). question: so question is, how can restore .sql dump, or create .sql dump in way can restored via client (php) rather command line? for example: <?php pg_query(file_get_contents($sqlfile)); ?> rather than: $ pg_restore -d dbname filename example of error: i using pgadmin iii generate .sql dump, using "plai

postgresql - SQL - SELECT by index which is a long hash -

let's assume have long unique hashes (like 250-character long). store them primary key . lookup row slower if primary key based on int ? i've made simple benchmark preparing tables: create table test_int(id integer primary key); create table test_text(id text primary key); insert test_int select * generate_series(1,1000000); insert test_text select md5(random()::text)||md5(random()::text)||md5(random()::text)||md5(random()::text)||md5(random()::text)||md5(random()::text)||md5(random()::text)||md5(random()::text) generate_series(1,1000000); analyze; explain analyze select * test_int id=<somevalue>; index scan using test_int_pkey on test_int (cost=0.42..8.44 rows=1 width=4) (actual time=0.023..0.024 rows=1 loops=1) index cond: (id = 58921) heap fetches: 1 planning time: 0.129 ms execution time: 0.058 ms explain analyze select * test_text id=<somevalue>; index scan using test_text_pkey on test_text (cost=0.68..8.69 rows=1 width=260) (act

html - Where does the list-style-type : disc reflects when margin is set to 0px on li of a ul? -

Image
consider snippet: <ul id= "nav"> <li> <a href = "#"> home</a> </li> <li> <a href = "#"> france</a> </li> <li> <a href = "#"> italy</a> </li> <li> <a href = "#"> spain</a> </li> <li> <a href = "#"> eastern mediterranean</a> </li> <li> <a href = "#"> islands</a> </li> </ul> the css in context: #nav { list-style-type: disc; margin: 20px 0 0 0; padding: 0; } #nav li { margin: 10px; // if set 0, circular di

java - MongoDB BSON codec not being used while encoding object -

i'm attempting store object in mongodb database (using mongodb 3.0.2) , getting codecconfigurationexception when attempting encode object error message can't find codec class java.time.localdate. i have written , included codec localdate objects. details follow. the object, dutyblock , i'm attempting store has these member variables: public class dutyblock { private localdate startdate; private localdate enddate; //inclusive private int blocklength; private double pointvalue; private arraylist<ra> assigned; } i wrote following codec encode dutyblock objects within database: public class dutyblockcodec implements codec<dutyblock> { @override public void encode(bsonwriter writer, dutyblock t, encodercontext ec) { document document = new document(); document.append("startdate", t.getstartdate()); document.append("enddate", t.getenddate()); document.append("bloc

datetime - Date format not show in Excel -

i'm facing problem in excel date's values missing in cells. actual values in database: id date 001 2015-05-18 00:00:00.000 002 2015-05-22 00:00:00.000 003 2015-05-21 00:00:00.000 004 2015-05-18 00:00:00.000 excel view (error): id date 1 00:00.0 2 00:00.0 3 00:00.0 4 00:00.0 excel doesn't recognize "-" valid date seperator. have 2 options: change locale allow "-" date seperator convert "-" local date seperator (usually '.' or "/") when creating / querying data source

tabs - How can remove padding or margin in Tabwidget in android? -

Image
i want create tabbed application. allright when create tab. space between tabs much. want remove padding or margin don't know how can that. suggestion? xml <?xml version="1.0" encoding="utf-8"?> <tabhost xmlns:android="http://schemas.android.com/apk/res/android" android:id="@android:id/tabhost" android:layout_width="fill_parent" android:layout_height="fill_parent"> <linearlayout android:orientation="vertical" android:layout_width="fill_parent" android:layout_height="fill_parent"> <horizontalscrollview android:layout_width="wrap_content" android:layout_height="wrap_content" android:fillviewport="true" android:scrollbars="none" > <tabwidget android:id="@android:id/tabs" android:padding="0px" android:layout_margin="0px&quo

ios - How to effectively use the Levenshtein algorithm for text auto-completion -

i'm using levenshtein distance algorithm filter through text in order determine best matching result purpose of text field auto-completion (and top 5 best results). currently, have array of strings, , apply algorithm each 1 in attempt determine how close of match text typed user. problem i'm not sure how interpret values outputted algorithm rank results expected. for example: (text typed = " nvmb ") result: " game " ; levenshtein distance = 3 (best match) result: " number stars " ; levenshtein distance = 13 (second best match) this technically makes sense; second result needs many more 'edits', because of it's length. problem second result logically , visually closer match first one. it's if should ignore characters longer length of typed text. any ideas on how achieve this? the levenshtein distance corresponds number of single-character insertions, deletions , substitutions in optimal global pairwise align

jquery - Jqgrid search for dates is not working -

jq(function(){ var token = window.location.href .substring(window.location.href .lastindexof('=') + 1); jq("#grid").jqgrid({ url:'/test/umpire/getfixtures', datatype: 'json', mtype: 'get', colnames:['category', 'tournament','date', 'ground','team 1','team 2','umpire 1','umpire2','umpire 3','match refree','match obsrver','scorer 1','scorer 2'], colmodel:[ {name:'categoryname',index:'categoryname', width:100,editable:true, editrules:{required:true}, editoptions:{size:10,readonly: 'readonly'}}, {name:'tournamentname',index:'tournamentname', width:200,editable:true, editrules:{required:true}, editoptions:{size:10}}, {name:'matchfromdate',index:'matchfromdate', width:100,formatter: "d

How does my ajax call know where my json is in rails -

i have javascript file ajax in follows. $.ajax({ type: "get", contenttype: "application/json; charset=utf-8", url: 'data', datatype: 'json', success: function (data) { draw(data); }, error: function (result) { error(); } }); i have created method in controller renders json. class graphcontroller < applicationcontroller def index end def data render :json => user.select('value').map(&:value) end end so question is, how rails know json coming i'm not returning physical file controller. happens if have physical .json file in folder structure? there heirarchy of how view json file (eg physical file>jbuilder file>controller action)? in ajax call.. contenttype: "application/json; charset=utf-8", defines type of request querying rails. what says is, "if client wants html in response action, respond ha

bash - Run Jenkins' Cygwin script as user -

i have jenkins running on windows, , have build works fine under cygwin bash cygwin terminal, want automate it. however, using script: #!c:\cygwin\bin\bash.exe whoami make the system reports me nt authority\system , not ken when using interactive shell. there easy way persuade jenkins or cygwin run me? most running jenkins default installation. have 2 options. first mentioned in comment. change "service account" same yours. second option derived best practices . run jenkins master on system backup etc. configure slave node account credentials. change project configuration build on specific node. (it possible run slave , master on same machine different credentials - in case want try out things)

c# - Is it possible to create a signed email with an opaque signature using MimeKit? -

basically questions states. i have written program sign email using x509certificate2 installed on users machine. done mimekit, makes easy (as shown). var signer = new cmssigner(certificate, key); signer.digestalgorithm = digestalgorithm.sha1; message.body = multipartsigned.create(ctx, signer, messagecontent); i've been asked if possible create signed email using 'opaque' signature instead of detached signature. believe there option in openssl can this(??). anyway, i've been unable find mention of 'opaque' option in relation mimekit. is possible, , if so, how? yes, possible. regards s/mime, when people refer opaque signature, mean want signature in application/pkcs7-mime format. here's how go creating that: var signer = new cmssigner(certificate, key); signer.digestalgorithm = digestalgorithm.sha1; message.body = applicationpkcs7mime.sign(ctx, signer, messagecontent); hope helps! note: in late 2013, microsoft announced

asp.net - How can i use OpenFileDialog in C# mvc -

my code below @ajax.actionlink("choose file", "chooseitemview", new { }, new ajaxoptions { updatetargetid = "replacediv", insertionmode = insertionmode.replace, httpmethod = "get", //onbegin = "startpreloader", onsuccess = "stoppreloader", onfailure = "stoppreloader" }, new { @id=1, @type="file", @class="btn btn-primary offset-top-2", /*@id=item.gethashcode().gethashcode(), * onc

ruby on rails - ActiveRecord::RecordNotFound: Couldn't find Hotel without an ID -

i`ve got these errors while testing ratings_controller. 1) ratingscontroller create action creates rating if validations pass failure/error: post :create, rating: {value: 4, user_id: user, hotel_id: hotel} activerecord::recordnotfound: couldn't find hotel without id # ./app/controllers/ratings_controller.rb:6:in `create' # ./spec/controllers/ratings_controller_spec.rb:12:in `block (4 levels) in <top (required)>' # ./spec/controllers/ratings_controller_spec.rb:11:in `block (3 levels) in <top (required)>' 2) ratingscontroller create action not create rating if validations fail failure/error: post :create, rating: {value: 3} activerecord::recordnotfound: couldn't find hotel without id # ./app/controllers/ratings_controller.rb:6:in `create' # ./spec/controllers/ratings_controller_spec.rb:17:in `block (3 levels) in <top (required)>' 3) ratingscontroller update action updates

angularjs - Testing local methods containing service calls using Jasmine -

i facing issue testing local method in angular js controller. i need test retrieveruledetails method contains service call, not able proceed. please test below code: var retrieveruledetails = function(feeid, ruleid) { $rootscope.triggerloading(true); feesrulesservice.getrule(feeid, ruleid) .then(getrulesuccess) .catch(getrulefail); }; i think best pass feesrulesservice paramter - spy in jasmine , test getrule invoked feesrulesservicemock= { getrule: function(feeid,ruleid) { } }; spyon(feesrulesservicemock, 'getrule'); retrieveruledetails(feeid,ruleid,feesrulesservicemock) it("bla bla",function(){ expect(feesrulesservicemock.getrule).tohavebeencalled(); expect(feesrulesservicemock.getrule).tohavebeencalledwith(feeid,ruleid); });

ios - How to get all the groups from photo library, like native? -

i have create custom photo library native , working fine, not able videos,favorites,panoramas (group), how can same native photo library ? have use alassetsgroupall groups library , show in tableview native. please me how videos,favorites,panoramas (group)? thanks in advance. you should enumerate groups available. i.e alassetslibrarygroupsenumerationresultsblock resultsblock = ^(alassetsgroup *group, bool *stop) { if (group){ } }; alassetslibraryaccessfailureblock failureblock = ^(nserror *error){ }; nsuinteger type = alassetsgrouplibrary | alassetsgroupalbum | alassetsgroupevent | alassetsgroupfaces | alassetsgroupphotostream; [self.assetslibrary enumerategroupswithtypes:type usingblock:resultsblock failureblock:failureblock];

HTML: Button that links to a .html file -

this question has answer here: how create html button acts link? 26 answers i'm trying make button links file (spacerace.html) , don't know how button link file. please tell me should put in button code. <button type="button" onclick="">1 player mode</button> any highly appreciated, <a href = "spacerace.html"><input type = "button" style = "color:red; height:100px;width:125px; font-size:10px;font-family:'comic sans ms' " value = "1 player mode"/></a>

ios - Create NSURL using AssetPath -

using uiimagepickercontroller, i'm able asset path media assets-library://asset/asset.mov?id=2a2ce6c9-c178-4395-977b-e6f159bf6d5e&ext=mov . nsurl *instagramurl = [nsurl urlwithstring:[nsstring stringwithformat:@"instagram://library?assetpath=%@&instagramcaption=%@",[referenceurl absolutestring], strinstagramcaption]]; now, want convert asset path nsurl pass following code block : if ([[uiapplication sharedapplication] canopenurl:instagramurl]) { [[uiapplication sharedapplication] openurl:instagramurl]; } this way how should convert asset path valid nsurl :- nsurl *instagramurl = [nsurl urlwithstring:[[nsstring stringwithformat:@"instagram://library?assetpath=%@&instagramcaption=%@",[asseturl absolutestring],caption]stringbyaddingpercentescapesusingencoding:nsutf8stringencoding]]; if ([[uiapplication sharedapplication] canopenurl:instagramurl]) { [[uiapplication sharedapplication] openurl:instagramurl]; } ref

php - How to create layout in Zend Framework? -

i trying create dashboard in zend framework css , java script not working? create folder in public directory assets. add below code in view file. <?php $this->headlink() ->prependstylesheet($this->baseurl('assets/css/style.css')); $this->headscript() ->prependfile($this->baseurl('assets/js/script.js')) ?> note: change file names file names.

asp.net mvc - ASP Chart Line Theme -

i'm using chart helper on mvc project line chart looks weird or doesn't looks want. i've been searching subject , thing can find charttheme 1 example series. i'm including this, example found series on chart theme. series name="default" template ="all" borderwidth="3" isvalueshownaslabel="true" i want put dot on values instead of numbers. think solution must on "series" because chart helper doesn't has many options can't find other properties series has. have 2 images upload can't because need more reputation, try update if reputation needed.

visual studio - How to set up and maintain directory structure in TFS build server? -

so have pretty huge solution many projects, few of them use dlls other projects in solution, projects copy files other directories after build performed. (as post build events) when build solution locally on machine, great , working, when configure build, , build on build server (we use tfs) goes wrong , error when try load 1 of applications in solution. (the error not give me data on went wrong) so before sit debug of this. know how can smartly manage build actions performed locally , via build server , see deltas? i able build solution same on build server on machine (with directory structure, post build events..etc) thanks lot the accepted way you're after use nuget managing assembly references. can publish dependent assemblies nuget part of continuous delivery process, reference (and update!) dependencies in solutions consume them necessary. this removes ambiguity ("what version of foo.dll project x using?") , reduces runtime errors ("why

Porting C code for an iOS app -

i working on building app needs use c library have.the c code designed linux platform , has linux system calls. firstly, need port c code run on ios. possible so? ios apps allowed use system calls? (i read elsewhere apps using syscall.h not permitted on appstore) secondly, once have ported code can include them directly in swift code? or have create .so files or such thing.

smarty3 - codeigniter HMVC + Smarty: can we call module view routine from template -

just started using hmvc module extension , smarty codeigniter . in hmvc, can call module functions view generate specific view (in case modal dialog login in case user not logged in): <?php echo modules::run('module/controller/method', $param, $...); ?> all seemed work pretty before started using smarty templates. question - is practice call php routines directly templates generate view? are there other alternatives keeping hmvc intact ? one way can create specific templates such login_dialog.tpl , include directly in base templates based on user login status. but, feel defies purpose of hmvc , should use modules generate view , not directly include them. may wrong. please suggest alternatives..

android - How to use TypeFace in DrawerItems? -

i using android studio. wanna use zawgyi font; change "android" text. can't use code, typeface typeface = typeface.createfromasset(getassets(), "fonts/zawgyi.ttf"); mainactivity.java private void adddraweritems() { string[] osarray = { "android", "ios", "windows", "os x", "linux" }; madapter = new arrayadapter<string>(this, android.r.layout.simple_list_item_1, osarray); mdrawerlist.setadapter(madapter); mdrawerlist.setonitemclicklistener(new adapterview.onitemclicklistener() { @override public void onitemclick(adapterview<?> parent, view view, int position, long id) { // toast.maketext(mainactivity.this, "time upgrade!", toast.length_short).show(); } }); } activity_main.xml <android.support.v4.widget.drawerlayout xmlns:android="http://schemas.android.com/apk/res/andr

oauth 2.0 - OAuth2 with Google Cloud Print -

i had written google apps script connected google cloud print automate printing. script auto-run on time interval, search relevant files, , if found sent them printer. code used oauthconfig , working fine , class has been deprecated , after weekend of trial & error , scouring interwebs can't work oauth2 . here's oauthconfig code working fine : function printdoc(docid, doctitle, myprinterid) { var scope = 'https://www.googleapis.com/auth/cloudprint'; var url = 'https://www.google.com/cloudprint/submit'; var payloadofsubmit = { "printerid" : myprinterid, "title" : doctitle, "content" : docid, "contenttype" : "google.kix" }; var fetchargs = googleoauth_('google', scope, payloadofsubmit); fetchargs.method = 'post'; var responseofsubmit = urlfetchapp.fetch(url, fetchargs); var jsonofsubmit = json.parse(responseofsubmit.getcontenttext()); return j

c preprocessor - Pointer to type within a macro, C -

i've run problem when attempting express pointer type within macro. take simple example. #define index_of_data(data, type, index) \ ((type *)data)[index] this works: index_of_data(buffer, float, 3); where fails: index_of_data(buffer, float[2], 3); because cast should (float(*)[2]) . is there way express "the pointer of type " , ...without using typeof ? (which isn't standard c). note, there of course other ways make specific example work. cast char , offset sizeof(type) * index example. interested in way express pointer type in c. doing heavily complicated stuff c types may fun sport, it's extremely confusing in real code. to avoid wrecking heads on complicated pointer expressions much, people use typedef ! if typedef types expect use macro of yours, won't have problems. observe: #include <stdlib.h> #define index_of_data(data, type, index) \ ((type *)data)[index] int main(void) { float (*buffer)[2]

Extracting integers from string of text in Java -

this question has answer here: extract digits string in java 12 answers i have several lines of text such as: "you current have 194764bleh notifications" "you current have 32545444bleh notifications" "you current have 8132bleh notifications" "you current have 93bleh notifications" what's best way integers text ? currently using line.split twice, once "have" , once "bleh". seems inefficient doing integers. are there better ways that? e.g. string str = "you current have 194764bleh notifications"; str = str.replaceall("\\d", ""); // replace non-digits using regex take away non-digits option, not restrict having 'have' & 'bleh' wrap numbers. not entirely sure efficiency compared using split though.

android - How to put a MediaController in a TextureView -

i'm trying put media controller in texture view have error saying e/mediaplayer﹕ should have subtitle controller set here code @override public void oncreate(bundle savedinstancestate) { super.oncreate(savedinstancestate); setcontentview(r.layout.texture_video); textureview = (textureview) findviewbyid(r.id.textureview); listview = (listview) findviewbyid(r.id.list); . . . arrayadapter<string> adapter = new arrayadapter<string>(this, android.r.layout.simple_list_item_1, android.r.id.text1, values); listview.setadapter(adapter); listview.setonitemclicklistener(new adapterview.onitemclicklistener() { @override public void onitemclick(adapterview<?> parent, view view, int position, long id) { if (position == 0) { ondestroy(); file_name = "test1.mp4"; textureview.setsurfacetexturelisten

java - Where the registerModule code should live when using jackson -

this test code. dynabean bean1 = new lazydynabean(); bean1.set("p1", 1); bean1.set("p2", 2); objectmapper mapper = new objectmapper(); try { logger.error(mapper.writevalueasstring(bean1)); } catch (jsonprocessingexception ex) { logger.catching(ex); } simplemodule simplemodule = new simplemodule("simplemodule", new version(1, 0, 0, null, "com.bolan", "oa")); simplemodule.addserializer(dynabean.class, new dynabeanserializer()); mapper.registermodule(simplemodule); dynabean bean2 = new lazydynabean(); bean2.set("p1", 1); bean2.set("p2", 2); try { logger.error(mapper.writevalueasstring(bean2)); } catch (jsonprocessingexception ex) { logger.catching(ex); } this source of dynabeanserializer: public class dynabeanserializer extends jsonserializer<dynabean> { private final static logger logger = logmanager.getlogger(dynabeanserializer.class); @override public void serialize(dyna

libgit2 - How to use libgit's git_repository_open in d -

i trying use libgit2 library in d. segmentation fault upon the program's exit. error not happen before exit, when open , close repository. seem issue garbage collector, manually disabling garbage collector (gc.disable();) seems not effect outcome @ all. freeing (git_repository_free(repo)) seems have no effect. this example code: import std.stdio : writeln; import std.string : tostringz; import core.memory : gc; import deimos.git2.types : git_repository; import deimos.git2.repository : git_repository_open, git_repository_free; void main() { gc.disable(); git_repository *repo; git_repository_open(&repo, ".".tostringz()); git_repository_free(repo); writeln("end"); } output: $ ./gittest end zsh: segmentation fault (core dumped) ./gittest the versions: libgit2-dev: 0.22.1-0ubuntu3 libgit2: ~>0.20.1 dub: 0.9.23-0 dmd-bin: 2.067.1-0 kubuntu: 15.04 what, if anything, doing wrong? , if nothing can culprit of bug ide