Posts

Showing posts from March, 2012

java - JComboBox dynamically updating values -

i trying update items of combo box xml nodes, nodes when run loop, somehow not able add them items of combobox public class xmltoexcelgui extends javax.swing.jframe { public java.io.file file; public xmltoexcelgui() { initcomponents(); } public void setprogressbarvalue(string s){ jprogressbar1.setstring(s); } @suppresswarnings("unchecked") private void initcomponents() { jlabel1 = new javax.swing.jlabel(); jbutton1 = new javax.swing.jbutton(); jlabel2 = new javax.swing.jlabel(); jprogressbar1 = new javax.swing.jprogressbar(); jbutton3 = new javax.swing.jbutton(); jscrollpane1 = new javax.swing.jscrollpane(); jtextpane1 = new javax.swing.jtextpane(); jcombobox1 = new javax.swing.jcombobox(); setdefaultcloseoperation(javax.swing.windowconstants.exit_on_close); jlabel1.settext("xmltoexcel"); jbutton1.settext("choose ...

database - Data compression in RDBMS like Oracle, MySQL etc -

i reading in-memory database incorporates feature data compression. using that, instead of storing first name, last name, father's name etc. values in column (which leads lot of data duplication , waste of disk storage), creates dictionary , attribute vector table each column, unique values stored in dictionary , corresponding attribute vector stored in original table. clear advantage of approach lot of space removing overhead of data duplication. i want know: does rdbms oracle, mysql etc. implicitly follow approach when store data on disk? or when use these rdbms have implement same if want take advantage of same? as know there no free lunch, understand trade-offs if developer implements above explained data compression approach? 1 can think of in order fetch data database, have make join between dictionary table , main table. isn't it? please share thoughts , inputs. this answer based on understanding of query. appears mixing 2 concepts : data normalis...

java - onClick not working in viewpager android -

i have made slideshow using viewpager , disabled default swipe functionality. instead want change slide when clicked on image.so add code in viewpageradapter class when click on image doesnt anything. viewpageradapter class is: package com.dekton.dektonapp; import android.content.context; import android.graphics.typeface; import android.support.v4.view.pageradapter; import android.support.v4.view.viewpager; import android.view.layoutinflater; import android.view.view; import android.view.viewgroup; import android.view.animation.animation; import android.view.animation.animationutils; import android.view.animation.linearinterpolator; import android.view.animation.translateanimation; import android.widget.imageview; import android.widget.relativelayout; import android.widget.textview; public class viewpageradapter extends pageradapter implements animation.animationlistener { //declare variables context context; int[] background; int[] icon; string[] title; string[] title_2; stri...

xaml - Change SelectedIndex without triggering SelectedIndexChanged? -

i'm having problem. want set default value (kind of 'header text') combobox. purely aesthetics purposes , describe user initial purpose of combobox. i have selectedindexchanged combobox opens view. my problem is, change .selectedindex '0' value 'header' selected. when change index, seems cause infinite loop, until .selectedvalue of combobox becomes null , .selectedindex becomes '-1' throws exception. my code below: public myview() { this.initializecomponent(); load += myloadevent(); } private void myloadevent(object sender, routedeventargs e) { mycombobox.selectedindex = 0; } private void mycomboboxselectionchanged(object sender, selectionchangedeventargs e) { // use combobox value , go other view } thank you! you can skip first event adding flag variable. skip first 1 or next event after setting processevent false : public myview() { this.initializecomponent(); load += myloa...

php - Error sonata classificiation bundle -

i have problem. installed sonata classification bundle. but when want create new post have error: neither property "collection" nor 1 of methods "getcollection()", "collection()", "iscollection()", "hascollection()", "__get()" exist , have public access in class "dn\sitebundle\entity\post".* this code in postadmin.php ( src/dn/sitebundle/admin/postadmin.php ) namespace dn\sitebundle\admin; use sonata\adminbundle\admin\admin; use sonata\adminbundle\form\formmapper; use sonata\adminbundle\datagrid\datagridmapper; use sonata\adminbundle\datagrid\listmapper; use sonata\adminbundle\show\showmapper; use sonata\corebundle\validator\errorelement; use knp\menu\iteminterface menuiteminterface; class postadmin extends admin { // fields shown on create/edit forms protected function configureformfields(formmapper $formmapper) { $formmapper ->add('title', 'text', array('label...

javascript - Navigation with different background color when is on top -

i working on little project , have navigation transparent background. need if start scrolling, background change on black. my code: window.onscroll = function f() { if (document.documentelement.scrolltop + document.body.scrolltop > prvni.parentnode.offsettop ) { nav.style.display = "none"; } else { nav.style.display = "block"; } }

Translating Matlab function to R -

i having lot of trouble translating piece of matlab-code r. missing conceptually. matlab in whole is: nobs = 2000; x = cumsum([0;randn(nobs,1)/sqrt(nobs)]); k = 1; n = size(x,1); dx = zeros(n-k,1); % calculate dx - part having trouble = k : n - 1 sumx = 0; j = 0 : k sumx = sumx + (-1)^j*nchoosek(k,j)*x(i-j+1); end dx(i-k+1) = sumx; end i have tried make function, works. function following part of matlab code: for j = 0 : k sumx = sumx + (-1)^j*nchoosek(k,j)*x(i-j+1); end so far, i've done in r, corresponds first part of trouble code: function (n,i,k){ sumx <- 0 (j in 0:k){ term <- ((-1)^j)*choose(k,j)*xsub((i-j)/n) sumx <- sumx + term } return(sumx) } now works, can't sum across i? for (k in 1:2){ (i in k:10){ ????????????????????? } } i don't have matlab here. compare results known sequence, rse=c(1:5)/100 nobs = 2000; rse=rnorm(nobs) #rse=c(1:5)/100 x = cumsum(c(0,rse/sqrt((length(rse))...

javascript - show/hide mulptiple divs using jquery -

im new jquery , understand of hitting me hard. ive looked around answer maybe im trying specific. this jquery code im using : $(document).ready(function(){ $(".slidingdiv").hide(); //hides div $(".show_hide").show(); //click on img show hidden div $('.show_hide').click(function(){ $(".slidingdiv").slidetoggle("slow"); }); heres example of html : <div class"> <img height="300" width="350" src="images/web.png" alt="design 1" class=" show_hide img-responsive center-block wow fadein" href="#"/> <br> </div> when click image , toggles hidden div : <div class="slidingdiv"> <div> <img height="300" width="350" src="images/web.png" alt="design 1" class="img-responsive center-block" /> </div> </di...

Facebook Search Graph For Page using SDK PHP SDK 4 -

i trying search page domain using domain name, getting amy results. code looks this: $session = new facebooksession('fb_access_token'); $session = facebooksession::newappsession(); $request = new facebookrequest( $session, 'get', '/search?q=example.com&type=page'); $response = $request->execute(); $graphobject = $response->getgraphobject(); $pages = $graphobject -> asarray(); should doing else search pages domain? as per doc , can search name: type description 'q' value page search page. name

android - I can't get data from edittext in fragment after I replace fragment -

i have 2 fragment edittext, data first edittext gets after call second fragment can't data edittext in second fragment. logcat said me data second edittext void. this first fragment class package com.example.n; import android.annotation.targetapi; import android.app.fragment; import android.os.build; import android.os.bundle; import android.view.layoutinflater; import android.view.view; import android.view.viewgroup; import android.widget.edittext; @targetapi(build.version_codes.honeycomb) public class fragmentadd extends fragment { edittext et1; @override public view oncreateview(layoutinflater inflater, viewgroup container, bundle savedinstancestate) { view rootview = inflater.inflate(r.layout.frag_add, container, false); et1 = (edittext) rootview.findviewbyid(r.id.edittext); return rootview ; } } this second fragment class package com.example.n; import android...

javascript - PHP Validation from database -

i working on project , stuck on registration page. want verify if: the mobile number exists. the username exists. the email id exists. currently in code have added validation mobile number , working fine. username , email part not understanding how implement it. please me out problem. here code. <?php $msg = ''; if(isset($_post['register'])) { $uname = (!empty($_post['username']))?$_post['username']:null; $pass = (!empty($_post['pass']))?$_post['pass']:null; $cpass = (!empty($_post['cpass']))?$_post['cpass']:null; $fname = (!empty($_post['fname']))?$_post['fname']:null; $lname = (!empty($_post['lname']))?$_post['lname']:null; $email = (!empty($_post['email']))?$_post['email']:null; $mobile = (!empty($_post['mobile']))?$_post['mobile']:null; if($uname == '' || $pass == '' || $cpass == '' ||...

symfony - Error when installing Symfony2 - "no route found" -

i try learn symfony2 personnal project. use linux ubuntu & mac os x yosemite. i installed framework , created new project on 2 os. but when go on project have 404 error message. for more information use app8dev.php , find message: no route found "get /" (from " http://localhost/my_project/web/ ") in app/cache/dev/classes.php @ line 2059 and log show me route error error - uncaught php exception symfony\component\httpkernel\exception\notfoundhttpexception: "no route found "get /" (from " http://localhost/my_project/web/ ")" @ /var/www/html/my_project/app/cache/dev/classes.php line 2059 i have problem on 2 os, can me ? if have created new symfony project need setup controller , routes. see web page simple explanation of setting new controllers: http://symfony.com/doc/current/book/page_creation.html if have setup controller , route not working can view registered routes in a...

javascript - Combine two AJAX without jQuery -

this have , works 80% of time every once in while crash. can combine these better? or @ least check both have returned valid result before displaying. tried setting 2 separate functions , running them in tandem , didn't work either reason. avoid jquery if possible. thanks function doit(str){ var color = document.getelementbyid('button').value; if (str == "") { document.getelementbyid("div1").innerhtml = ""; document.getelementbyid("div2").innerhtml = ""; return; } else { if (window.xmlhttprequest) { ajaxrequest = new xmlhttprequest(); ajaxrequesttwo = new xmlhttprequest(); } else { ajaxrequest = new activexobject("microsoft.xmlhttp"); ajaxrequesttwo = new activexobject("microsoft.xmlhttp"); } ajaxrequest.onreadystatechange = function() { if (ajaxrequest.readystate == 4 && ajaxrequest.status == 200) { ...

rest - What saying good practice about GET resource -

i wonder saying practices create rest api . should or not create uri allow e.g. several specific users? for example mean: /usermanagement/users/{j_goldman,wafik,morder} and uri returns 3 objects users j_goldman, wafik , morder . you can won't restful imho. if need should think remodeling resource selections say, 3 users want belong particular group id 111. can /groups/111 get. if cannot guess should stick restful solution , use 3 api calls users separately.

z3py - Uninterpreted datatype in Z3 -

i'd create uninterpreted datatype in z3 lets call "a". according z3 documentations, can declare using "declaresort" follows: a = declaresort('a') a, b = consts('a b', a) s = solver() s.add(a != b) s.check() however i've seen people using following: a = datatype('event') a.declare('a0') = a.create() a, b = consts('a b', a) my question difference between 2 , 1 correct declare new uninterpreted datatype. not understand a.declare('a0') means in second part. the event datatype contains 1 element called a0, should use first suggestion use declaresort.

oracle - Delphi XE7 TFDTable View RowID error -

i'm converting delphi 5 / bde application delphi xe7 / firedac. 1 of forms has tfdtable component points oracle view containing "group by" clause in create statement. this used work fine in "old" app (bde), firedac i'm getting error: "ora-01446: cannot select rowid from, or sample, view distinct, group by, etc." i understand error i'm getting oracle, i'm not selecting rowid, firedac is! there property on tfdtable component can set prevent adding rowid query? if not, how supposed use view? your appreciated j include fimeta in fetchoptions.items . tfdquery, tfdtable, tfdmemtable, , tfdcommand automatically retrieve unique identifying columns (mkprimarykeyfields) main (first) table in select ... ... statements, when fimeta included in fetchoptions.items. note: mkprimarykeyfields querying may time consuming; application may need explicitly specify unique identifying columns, when firedac fails deter...

html - How would I add a dotted overlay to my background? -

what http://mountaintheme.com/themeforest/mountain/home.html , i'm not sure @ how go this. i've tried methods utilizing css, failed miserably. seems simple fix i'd imagine... this current code, <!doctype html> <html> <head> <meta charset="utf-8"> <title>sound off</title> <meta name="viewport" content="width=device-width, initial-scale=1, user-scalable=no"> <style> body { background-color: rgb(255, 255, 255); color: #000; } { color: #fff; } a:hover { color: #fff; } hr { border-top-color: #fff; } .main { opacity: 0.6; max-width: 640px; margin: 150px auto; padding: 0px 15px; height:2048px; } .page-header { border-bottom: 3px #fff solid; } footer .accr { text-align: right; } @media (max-width: 767px) { .clearfix div { ...

android - Not able to update ADT -

i error while installing previous version. an error occurred while uninstalling session context was:(profile=profile, phase=org.eclipse.equinox.internal.p2.engine.phases.uninstall, operand=[r]org.eclipse.rcp.configuration_root.win32.win32.x86 1.0.0.i20120608-1200 --> null, action=org.eclipse.equinox.internal.p2.touchpoint.natives.actions.cleanupzipaction). backup of file d:\adt\android\adt-bundle-windows-x86-20130219\eclipse\eclipse.exe failed. can not remove : d:\adt\android\adt-bundle-windows-x86-20130219\eclipse\eclipse.exe help-->install new software-->what installed? then, select "android ddms, andoid devlopment tools,android hierarcy viewer, android native development tools, android traceview, tracer opengl es" , click uninstall. after step, try add link ([ https://dl-ssl.google.com/android/eclipse/][1] ) , name adt plugin. link latest adt plugin. in way reinstall adt.

objective c - JSON to NSMutableArray iOS -

as response request json: { "letters": { "a": 0, "b": 1, "c": 2, "d": 3, "e": 4, ... } } that's code acquire json: nsurlrequest *request = [nsurlrequest requestwithurl:[nsurl urlwithstring:url]]; afhttprequestoperation *operation = [[afhttprequestoperation alloc] initwithrequest:request]; operation.responseserializer = [afjsonresponseserializer serializer]; [operation setcompletionblockwithsuccess:^(afhttprequestoperation *operation, id responseobject) { nslog(@"%@", responseobject); } failure:^(afhttprequestoperation *operation, nserror *error) { // handle error }]; i want fill array keys (not values) this: array[0] = "a" array[1] = "b" ...? nsmutablearray *parts = [nsmutablearray new]; nsdictionary *allletters = [responseobject objectforkey:@"letters"]; (nsstring *key in [allletters allkeys]) {...

html - Page Transition with CSS and jQuery -

i need help. creating page transition one: http://goo.gl/74k2rq but following animation own design: http://goo.gl/nvjcz2 so far here's have experimented: https://jsfiddle.net/f7xpe0fo/1/ and doesn't follow design yet. see actual jsfiddle check here: https://jsfiddle.net/8y801eqh/11/ what html contains created 2 divs id's main-page , next-page. first page color red , next page color green. default hide next-page div. check out html: <div id="main-page"> <div> <h1>page transition</h1> <a href="#"> click here</a> </div> </div> <div id="next-page"> <div> <h1>this 2nd page</h1> <a href="#"> click here</a> </div> </div> now css fix design match whole page: #main-page { height: 50vh; width: 100%; position: fixed; left: 0; background-color: #e74c3c; padding: 40px 0 40px 0; } h1{ font-...

Circleci: How to deploy depending on git tag -

is there way restrict circleci deployment on checkings have specific git tag? currently using ... deployment: dockerhub: branch: master commands: - docker login -e $docker_email -u $docker_user -p $docker_pass - docker push abcdef instead of branch: master write tag: /release_.*/ background: set docker tags depending on git tags. example, whenever committed master, new docker images latest tag created , pushed. whenever special git tag set (e.g. release_1.0_2015-06-13 ) new docker image tag 1.0 created , pushed. alternative use different branches according different tags. use tags mark specific release. it looks added since kim answered. normally, pushing tag not run build. if there deployment configuration tag property matches name of tag created, run build , deployment section matches. in below example, pushing tag named release-v1.05 trigger build & deployment. pushing tag qa-9502 not trigger build. deployment: r...

rx java - groupBy operator, items from different groups interleaved -

the following code: observable .just(0, 1, 2, 3, 4, 5, 6, 7, 8, 9) .doonnext(item -> system.out.println("source emitting " + item)) .groupby(item -> { system.out.println("groupby called " + item); return item % 3; }) .subscribe(observable -> { system.out.println("got observable " + observable + " key " + observable.getkey()); observable.subscribe(item -> { system.out.println("key " + observable.getkey() + ", item " + item); }); }); leaves me perplexed. output is: source emitting 0 groupby called 0 got observable rx.observables.groupedobservable@42110406 key 0 key 0, item 0 source emitting 1 groupby called 1 got observable rx.observables.groupedobservable@1698c449 key 1 key 1, item 1 source emittin...

Python subprocess.call STDOUT failing -

i have following python code, no matter combination of options use not log file - keeps logging terminal... log file empty nothing in. going wrong? i've tried number of subprocess functions passing different parameters without luck. import subprocess logfile = open("runlog.txt", "w"); subprocess.call("rm -rf /opt/playlistscraper/downloaded/*.json", stdout=logfile, shell=true); subprocess.call("scrapy crawl radio1 -o/opt/playlistscraper/downloaded/radio1.json", stdout=logfile, shell=true);

business intelligence - QlikView Resources -

i want add qlikview development skill-set. have c# , sql background. there free online resources getting me going @ developer level not end-user? what's best starting place me , level of difficulty involved. i looking resources can me expert level. 1 resource found udemy course , if has done please share review of course content. you can find videos on youtube (like one: https://www.youtube.com/watch?v=ef_bigfxcis ). when install qlikview, have there qlikview tutorial directory. follow pdf file , on pdf. extensive, after can start developing intermediate solutions. pdf covers whole qv official course. after that, go qlikview cookbook site , start exploring more possibilities. find more blogs on qv , subscribe them. qv community amazing. use it! qlikview relatively easy "get" @ first, don't fooled simplicity - whole platform. i've been developing in qv 7 years , still learn new once in while. and have - choice! qv amazing , ...

javascript - AngularJS date filter in range by two inputs -

i want display data in range of date 2 inputs of date . (angularjs date filter in range 2 inputs) here code var app = angular.module('app',[]).controller('ctrl1', function($scope){ $scope.record = [ {uniqueid : 'pp-12', name : 'jim', status : 'approved', date:'05/01/2015' }, {uniqueid : 'pp-11', name : 'jim', status : 'canceled', date:'05/02/2015' }, {uniqueid : 'pp-45', name : 'nick', status : 'pending', date:'05/03/2015' }, {uniqueid : 'pp-32', name : 'thomas', status : 'canceled', date:'05/04/2015' }, {uniqueid : 'pp-01', name : 'thomas', status : 'pending', date:'05/05/2015' }, {uniqueid : 'pp-09', name : 'nick', status : 'approved', date:'05/06/2015' }, ...

rss - Copy Row if Sheet1 A contains part of Sheet2 C -

so i'm trying pull data in row separate sheet (sheet2!), if part of col has the date in sheet1! c1. col ex: "build 251 @ fri jun 12 03:03:49 2015" col c1 ex: "fri jun 12" (changes date every couple days) i've tried these formulas don't work. errors "finished no results"; "error filter has mismatched range sizes"; "there no columna"; "formula parse error" =filter("'github-changelog'!a", ("'github-changelog'!a" = 'x64 rss data'!c2)) =query('github-changelog'!a:f,"select * contains '(transpose(" "&c1:c&" "))'") =filter('github changelog'!a,mmult(search(transpose(" "&'x64 rss data'!c1:c&" ")," "&'github-changelog'!a1:a&" "),sign(row('github-changelog'!a1:a)))) i'm not sure why i'm not getting results, date in a...

javascript - Highlighting an element in the menu by manipulating the opacity -

html: <div id="menu" class="menu"> <ul class="headlines"> <li id="item1" onclick="checklist(this)"> <button onclick="myfunction()">g</button> </li> <li id="item2"> <button onclick="myfunction2()">a </button> </li> <li id="item3">b </li> <li id="item4">c </li> <li id="item5">d </li> <li id="item6">e </li> <li id="item7">f </li> </ul> </div> css: lu, li { list-style-type: none; font-size: 1.5em; height: 40px; width: 150px; text-align: right; border-style: none; } .menu { width: 150px; height: 350px; } .menu li { position: relative; top: 150px; bottom: 0; left: 725px; ...

omnet++ - OMNET ++, How to pass message between two car in VEINS? -

i new in veins. can run sumo simulation in veins don't know hot communicate or pass message between cars. can please help? the demo scenario used in veins tutorial that. can find tutorial on the veins website , application code in tracidemo11p.cc

jquery - How to stay on active tab after refresh on page? -

i’ve designed tab page , followed instruction post: http://alexchizhov.com/pwstabs/ how stay on current tab when refresh page? here code: jquery(document).ready(function ($) { $('.tabset0').pwstabs(); $('.tabset1').pwstabs({ effect: 'scale', defaulttab: 3, containerwidth: '600px' }); $('.tabset2').pwstabs({ effect: 'slideleft', defaulttab: 2, containerwidth: '600px' }); $('.tabset3').pwstabs({ effect: 'slidetop', defaulttab: 3, containerwidth: '600px' }); }); <div class="content"> <div class="tabset0"> <div data-pws-tab="tab1" data-pws-tab-name="first tab"> first tab content </div> <div data-pws-tab="tab2" data-pws-tab-name="second tab"> second tab content </div> ...

ios - Adding constraint crash down the application -

i have custom uiview designing uitableviewcell, every things work perfect it's not resize properly. , when trying add constraint crashed. used below code. - (uitableviewcell *)tableview:(uitableview *)tableview cellforrowatindexpath:(nsindexpath *)indexpath { uitableviewcell *cell = [tableview dequeuereusablecellwithidentifier:@"identifier"]; if(!cell) { cell = [[uitableviewcell alloc] initwithstyle:uitableviewcellstyledefault reuseidentifier:@"identifier"]; uiview *vbackview = [[uiview alloc] initwithframe:aframe]; [[cell contentview] addsubview:vbackview]; [vbackview addconstraint:[nslayoutconstraint constraintwithitem:[cell contentview] attribute:nslayoutattributetop relatedby:nslayoutrelationequal toitem:vbackview ...

memcached - Not able to install php memcache -

when run brew install php56-memcache following error. checking whether enable memcache session handler support... yes checking location of zlib... no checking location of zlib... configure: error: memcache support requires zlib. use --with-zlib-dir=<dir> specify prefix zlib include , library located i have zlib in brew list . autoconf jpeg memcached php56 ruby-build freetype libevent mhash php56-igbinary unixodbc gettext libmemcached mysql php56-memcached vim git libpng node pkg-config zlib icu4c mcrypt openssl rbenv i tried `bbrew install php56-memcache --with-zlib-dir=/usr/local/cellar/zlib/1.2.8' gives same error. i tried manual way, ./configure , make , make install , result same. how can install memcache? i run followings , installed. brew link --force zlib brew install php56-memcache

c++ - OCI Prefetch not working -

we have application using oci, cannot seem make prefetch working. we have select query on table dozen of columns (amongst 1 clob column , 1 mdsys.geometry column). clob column in 99% of cases smaller 4000 bytes , in 50% of cases empty. process follows: we set oci_attr_prefetch_rows 500 we bind columns output buffers, clob bind directly text buffer of 8000 bytes for clob handle, set oci_attr_lobprefetch_size 8000 we use ocistmtexecute iters 1 one row fetched buffer. now if wireshark see network packets never filled (there 1 record per roundtrip). if execute same select query sqldeveloper packets nicely filled, can assume row prefetching should work. what missing here? since ran same problem recently: oci_attr_prefetch_rows , oci_attr_lobprefetch_size don't work together. from oracle docs: prefetching not in effect if long, lob or opaque type columns (such xmltype) part of query. whenever have lobs in result set, can't use implicit pr...

Rails: Eager loading for models three associations away -

i want show table of schedules , associated classes, partners, , locations in table columns. # view <% @schedules.each |schedule| %> <%= schedule.date.strftime("%d %b %y") %> <%= schedule.klass.name %> <%= schedule.partner.company %> <%= schedule.partner.city.name %> <%= schedule.start_time.strftime("%l:%m%p") %> - <%= schedule.end_time.strftime("%l:%m%p") %> <% end %> # models schedule belongs_to :klass belongs_to :partner klass belongs_to :partner partner belongs_to :city has_many :klasses has_many :schedules city none # controller schedules @schedules = schedule.includes(:klass, :partner).order(:date, :start_time, :end_time) unfortunately when page loads runs city queries multiple times. select "schedules".* "schedules" order "schedules"."date" asc, "schedules"."start_time" asc, "schedules"....

haskell - Custom deriving(Read,Show) for enum type -

let's have enumeration type: data tvshow = bobsburgers | mrrobot | batmantas and want define instances read , show following behavior: show bobsburgers = "bob's burgers" show mrrobot = "mr. robot" show batmantas = "batman: animated series" read "bob's burgers" = bobsburgers read "mr. robot" = mrrobot read "batman: animated series" = batmantas there lots of repetition in these definitions, , i'd associate each type constructor string , generate show , read automatically associations. such thing possible? the paper invertible syntax descriptions: unifying parsing , pretty printing describes 1 particularly idiomatic solution. example looks this, using invertible-syntax package based on paper: import prelude hiding (applicative(..), print) import data.maybe (fromjust) import text.syntax import text.syntax.parser.naive import text.syntax.printer.naive data tvshow = bobsburgers | mrrobo...