Posts

Generate Different Text Languages from one DSL with MPS -

i'm looking way generate code in several different languages, start objc, java android, unity , javascript (cordova), repeated code. i'm writing code manually on , on in each language. i'm looking @ mps , thinking on developing 1 dsl , generate different code each language. my question mps allow create different textgen different languages? yes, mps allows target different languages. surely need distinguish between 2 logical "phases" of generation process in mps - generator, performs model transformations, , textgen, transforms models text. generator typically transforms dsl general-purpose language (still represented ast), while textgen defined general-purpose language transforms code text. several such general-purpose "base" languages exist - java, c, xml , few prototypes. transforming dsl directly text through textgen defined dsl possible, feasible simple dsl only.

Unable to Connect to connect to Oracle 12c with SID But Service Name Works -

i'm trying connect oracle database. database hosted in local virtual machine. i can connect fine with service name: ...@localhost:1521/orcl however sid: ...@localhost:1521:cdb1 not work. currently when try , connect get: ora-01017: invalid username/password; logon denied note: i'm using exact same username , password both login - attempts. i can connect sid system user. your service name orcl - connection works. then try different database, 'cdb1', , same user/password don't work. those different databases, probably. you're in multitenant environment. should use service name when connecting 12c instance. sid in multitenant take container database. pluggables running in container reachable service name.

html - Changing media screen makes div overlay -

Image
i using bootstrap , divs 4-columns each (col-md-4) . based on bootstrap 12-columns means in pc media screen 3 divs @ each row. below 991px it's standard each 4-columns covers whole screen. please see screenshot: however, want 4-columns cover 50% of screen when screen size between 600px , 990px. meaning there 2 divs @ each row. have succeeded in, there issues. when loading page @ mobile portrait (approx < 530px) loads correctly. div not overlay each other. when loading page @ mobile landscape, or ipad portrait (approx > 740px) loads correctly. div not overlay each other. when flipping screen either mobile portrait mobile landscape or opposite it's starting act strange. divs overlaying each other. the effect want has been adding using following css : @media screen , (min-width: 991px) , (max-width: 1200px) { #isotope-list img { height: 100%; } } @media screen , (min-width: 600px) , (max-width: 990px) { #isotope-list .col-md-4 { width: 50%; } #isot...

arrays - Decrease run time of this java program -

i have made program input array, , find product of 3 largest numbers of array such that: the array constitutes of sub-arrays consisting of index increased 1 @ time. that is, array of 10 elements, find product considering first 3 elements, first 4 elements, first 5 elements , on. here's code: import java.io.*; import java.util.arrays; public class monkmulti { public static void main(string args[] ) throws ioexception { bufferedreader br = new bufferedreader(new inputstreamreader(system.in)); int n = integer.parseint(br.readline()); // no. of elements string xs = br.readline(); //accepting elements in string xs=xs+" "; if(n<1||n>100000) //constraint system.exit(0); int i,temp,count=0; for(i=0;i<xs.length();i++) { if(xs.charat(i)==' ') { count++; } } if(count!=n) //checks if no. of elements eq...

html - How can I move my navigation bar to a different place? -

i'm trying make nav bar horizontal , centered. right now, it's smushed right of website. how control bar located? also, why can't have css under #nav (why need #nav ul li, etc?) #nav{ width: 90%; text-align: center; font-size: 35px; text-align: center; } #nav ul li{ display: inline; height: 60px; text-align: center; } #nav ul li a{ padding: 40px; background: #25ccc7; color: white; text-align: center; } <div id="nav"> <ul> <li><a href="/">home</a></li> <li><a href="/about">about</a></li> <li><a href="/contact">contact</a></li> </ul> </div> you need different css selectors because not styles meant applied surrounding container #nav , elements inside it. pure css, not possible nest rules . if nesting aski...

Where do I find the definition of Rf_protect() in R's sources? -

i reading r sources , trying learn heap structure. i'm looking definition of protect(), i've founded: $ grep -rn "#define protect(" * src/include/rinternals.h:642:#define protect(s) rf_protect(s) and then $ grep -rn "rf_protect(" * src/include/rinternals.h:803:sexp rf_protect(sexp); src/include/rinternals.h:1267:sexp rf_protect(sexp); but didn't find rf_protect()'s definition. thanks. the rf_ prefix common idiom giving plain c code resemblance of namespace. want protect(...) instead: /usr/share/r/include/rinternals.h:#define protect rf_protect and given how 'core' this, may start in src/main quick grep -c leads src/main/memory.c . et voila on lines 3075 3081 sexp protect(sexp s) { if (r_ppstacktop >= r_ppstacksize) r_signal_protect_error(); r_ppstack[r_ppstacktop++] = chk(s); return s; } now said, want pay attention of file , not function.

python - SWIG Syntax Error -

i'm trying compile swig bindings wireless communications library ( http://www.yonch.com/wireless ) uses it++ library. using swig version 2.0.11 on ubuntu 14.04. this error getting when trying build: /usr/include/itpp/base/binary.h:162: error: syntax error in input(1) here line 162 binary.h: itpp_export std::ostream &operator<<(std::ostream &output, const bin &inbin); if rest of file needed can found here: http://montecristo.co.it.pt/itpp/binary_8h_source.html this swig command line call being used: /usr/bin/swig -c++ -python -i/home/user/anaconda/include/python2.7 -i../../../include -i/usr/include -i../../../bindings/itpp -i../../../bindings/itpp/.. -dhave_config_h -o base_sparse.cpp ../../../bindings/itpp/base_sparse.i i have no experience swig , can't seem see code causing syntax error. insights appreciated! exports not understood swig i add a #define itpp_export in .i file after inclusion of c/c++ headers , before include...