Posts

string - How to print @ symbol in Ocaml -

i print symbol @ in ocaml omitted content. can body guide me solution this? thanks! i assume you're using printf or similar. "@" character has special meaning in format strings. literal "@" in string, use %@ .

c++ - opengl dynamic bezier curve has gaps - glEvalCoord1f(); -

Image
i have program can pick ten points , bezier curve calculated points. seems work pretty perfect, shown curve has gaps. used gl_line_strip how possible points not connected? i figured out, small u in glevalcoord1f(u); makes gaps smaller. how u depending on controlpoints , window propperties in glevalcoord1f(u); ? [edit] added screen thicker lines: #include <iostream> #include <stdlib.h> #include <string> #include <fstream> #include <math.h> #include <time.h> #include <gl/glut.h> //added gl prefix ubuntu compatibility #define maxp 10 glint nnumpoints = 0; glfloat ctrlpoints[10][3]; gldouble mouseogl[3] = {0.0,0.0,0.0}; glint mousex, mousey; bool mousepressed = false; void getoglpos(int x, int y); void init(void) { glclearcolor(1.0, 1.0, 1.0, 0.0); glshademodel(gl_flat); // enable evaluator glenable(gl_map1_vertex_3); glenable(gl_depth); } void display(void) { int i; glclear(gl_color_buffer_bit | gl_de...

oracle sqldeveloper - How do you read data like tables from SQL Developer using Grails? -

i have fair amount of knowledge of grails cannot find way how read data table sql developers using grails. how can this? by default when use run-app , database in-memory (the url "jdbc:h2:mem:devdb"), there's no way connect outside jvm. if change "real" database can connect both grails , client. to h2, 1 option start standalone server. requires find h2 jar - under $home/.m2/repository or $home/.grails/ivy-cache. example on machine command start on port 9092 (the default) is java -cp /home/burt/.m2/repository/com/h2database/h2/1.3.170/h2-1.3.170.jar org.h2.tools.server -tcp -tcpport 9092 then change url in grails-app/conf/datasource to url = 'jdbc:h2:tcp://localhost:9092/dbname' where "dbname" arbitrary - h2 supports creating multiple databases per server. can start grails , connect server, , can connect client too. a simpler way use h2's auto-server mode, e.g. url url = 'jdbc:h2:./dbname;auto_server=true;auto...

Summing regions of a matrix that do not over lap in matlab -

i trying sum vector in groups of twenty length of vector e.g. 7628. can't figure out way output vector sums of sets of twenty or ans = [sum(a(1:20) sum(a(21:30)....]. since 7600 evenly divisible 20, can reshape , sum: a = rand(7600,1); sum(reshape(a,20,7600/20)) edit addressing comment non evenly divisible lengths b = 20; sz = size(a); % last elements exclude excl = mod(sz(1),b); % sum reshape , sum excluded separately [sum(reshape(a(1:end-excl), b, fix(sz(1)/b))), sum(a(end-excl+1:end))]

apache - Problems importing .htaccess into IIS URL Rewrite Web.Config -

i'm trying import .htaccess file url rewrite rule in iis 7. the current file in symfony 2 fails importing iis. need of knows syntax translate file usable iis, appealing fact work future user of symfony 2 in iis. i apologize not know syntax in iis. , append original file /web/.htaccess , excluding comments convenience. thanks in advance directoryindex app.php <ifmodule mod_rewrite.c> rewriteengine on rewritecond %{request_uri}::$1 ^(/.+)/(.*)::\2$ rewriterule ^(.*) - [e=base:%1] rewritecond %{env:redirect_status} ^$ rewriterule ^app\.php(/(.*)|$) %{env:base}/$2 [r=301,l] rewritecond %{request_filename} -f rewriterule .? - [l] rewriterule .? %{env:base}/app.php [l] </ifmodule> <ifmodule !mod_rewrite.c> <ifmodule mod_alias.c> redirectmatch 302 ^/$ /app.php/ </ifmodule> </ifmodule> the current error output this: <rewrite> <rules> <!--the rule cannot converted ...

php - How do I test contact form in Windows XP using XAMPP through localhost? -

i have coded web site scratch xhtml, using windows xp pro, , includes contact form in php. web site in xampp folder on c drive , being run under localhost on computer @ home. i want test form sending email test message live email address. have tried changing smtp = localhost in php .ini file isp server address, activating line, sendmail_path = "\"c:\xampp\sendmail\sendmail.exe\" -t" and adding semicolon beginning of line below, sendmail_path = "c:\xampp\mailtodisk\mailtodisk.exe" i have placed live email address in contact form code so: <?php //send email if(mail('my@emailaddress.net','contact form',$msg, 'from:postmaster@localhost')) { ?> then tried way placing email address under if(post) function instead: <?php if($_post) { $fname = $_post['fname']; $femail = $_post['femail']; $fcomments = $_post['fcomments']; $fcaptcha = $_post['fcaptcha']; $...

java - log4j warning after `homebrew install zookeeper` -

i'm running mac os x 10. did brew install zookeeper . then created /usr/local/etc/zookeeper/zoo.cfg based on /usr/local/etc/zookeeper/zoo_sample.cfg . then zkserver start works fine. but, when trying connect zookeeper clojure, uses zookeeper java client, error: log4j:warn no appenders found logger (org.apache.zookeeper.zookeeper). log4j:warn please initialize log4j system properly. log4j:warn see http://logging.apache.org/log4j/1.2/faq.html#noconfig more info. my log4j.properties file: log4j.rootcategory=warn, zklog log4j.appender.zklog = org.apache.log4j.fileappender log4j.appender.zklog.file = /usr/local/var/log/zookeeper/zookeeper.log log4j.appender.zklog.append = true log4j.appender.zklog.layout = org.apache.log4j.patternlayout log4j.appender.zklog.layout.conversionpattern = %d{yyyy-mm-dd hh:mm:ss} %c{1} [%p] %m%n so, questions are: what reasonable log4j configuration situation? what homebrew do, out of box, prevent warning happening? to clear...