Posts

Showing posts from May, 2012

javascript - Three.js Why renderer with viewport & scissor and I have a complete black canvas -

i have typical ui - 2 vertical windows. left canvas & renderer, right ui. inside ui have special viewers, example simple top view window. i have used viewports && scissors approach. works fine. the question miss special parameter avoid complete canvas black-filled covers have (my ui) behind. expected viewport & scissors going let me have 'clean' areas (not filled) inside canvas. not.... the alpha approach ( renderer = new three.webglrenderer( { alpha: true } ); ) fix don't know if best solution (what performance) or there way program (enhancement) related viewport & scissors. if i'm going use viewports there no sense fill black. (also main question ... if have viewport & scissor, why , fill canvas black ?) it totally okay use this: var renderer = new three.webglrenderer({ alpha: true }); it common approach can read here in answer you can change color this: renderer.setclearcolor( 0xffffff );

php - Copy file without creating target file -

i want copy file 1 place without knowing target file exists or not. i'm using: <?php $source = 'user/temp/details.txt'; //this file exists. $target = 'user/'.$user_name.'/details.txt'; //this file don't exists. copy($source, $target); ?> but saying: warning: copy() [function.copy]: filename cannot empty in c:\apache2.2\htdocs\account.php on line 3

java - adding second level data in properties file -

what have properties file below. welcome.properties admin = admin welcomeadmin = welcome admin editadmin = edit admin as have repeated admin word, want use below. admin = admin welcomeadmin = welcome #{admin} editadmin = edit #{admin} so if change @ 1 place i.e. @ admin = admin , places reflect. any idea/ suggestion how done appreciated. as per today, classic resourcebundle class doesn't support named parameters , substitution, rather supports simple placeholders of {0} type in key-value pairs of bundles, substituted using messageformat#format . in light if replace welcome #{admin} welcome {0} you'd able achieve functionality seek using 1 of following: jsf's <h:outputformat> : <h:outputformat value="#{msg.welcomeadmin}"> <f:param value="#{msg.admin}" /> </h:outputformat> jstl's <fmt:message> : <fmt:message key="msg.welcomeadmin"> <fmt:param value="#...

templates - Razor Engine not working in ASP.net 5 MVC 6 -

i trying migrate existing code mvc5 mvc6 , having difficulty particular code: engine.razor.runcompile(file.readalltext(emailtemplatepath), "emailtemplatekey", typeof (emailviewmodel), emailviewmodel); i receiving following runtime error: missingmethodexception: method not found: "void microsoft.aspnet.razor.codegenerators.generatedclasscontext.set_resolveurlmethodname(system.string)". in razorengine.compilation.compilerservicebase.createhost(type templatetype, type modeltype, string classname) the original code using in mvc5 taken here . if there no way of converting above code work mvc6 elegant way of doing email templates? apparently there has been change in generatedclasscontext class - property resolveurlmethodname not exist anymore, hence missingmethodexception . looks parsercontext class has changed too, since accessing onerror event handler throws same exception. in fact setter of missing property missing (pardon expression!), whic...

php - password issue with database change -

i changing database add "sex" column , after, can't log site. get_passwd() function, , see $passwd = $row[5] causing problem. i fixed it, there better way function, if adding column database? function get_passwd($link, $login) { $sql = "select * user email='$login'"; $result = mysql_query($sql, $link); $row = mysql_fetch_array($result); $passwd = $row[6];//this problem! //echo $passwd; return $passwd; }; you're mysql functions deprecated. should afraid of mysql injections . ... here way make world of mysql safer ... pdo - http://php.net/manual/de/book.pdo.php example: $db = new pdo("mysql:host=$db_host;dbname=$db_name;charset=utf8", "$db_user", "$db_pass"); $query = $db->prepare("select username, password user email = ? limit 1"); // should know columns selecting // limit make sure don't select 2 rows. $query->execute(array($login)); $row = $q...

Spark: Convert String to spark.sql.types object in scala -

i have array of string {"stringtype", integertype, "longtype", "stringtype"} in scala. , need covert each string spark.sql.types object while iterating for example: stringtype = spark.sql.types.stringtype integertype = spark.sql.types.integertype longtype = spark.sql.types.longtype. one solution create 1 1 hashmap of string , spark.sql.types , use while iterating array. there other cleaner way this? i use scala pattern matching. like: import org.apache.spark.sql.types._ val typelist = inputarray.map(s => { s match { case "stringtype" => stringtype case "integertype" => integertype etc... case _ => throw new runtimeexception("unknown type") } })

Decrement index in a loop after Swift C-style loops deprecated -

how express decrementing indexed loop in swift 3.0, syntax below not valid more? for var index = 10 ; index > 0; index-=1{ print(index) } // 10 9 8 7 6 5 4 3 2 1 here easier (and more swifty) approach. for in (0 ..< 5).reversed() { print(i) // 4,3,2,1,0 } let array = ["a", "b", "c", "d", "e"] element in array.reversed() { print(element) // e,d,c,b,a } array.reversed().foreach { print($0) } // e,d,c,b,a print(array(array.reversed())) // e,d,c,b,a

json - angularjs call to an external url with $http.get -

i have problem angular , calls external json, fact local works perfectly, when make call full url gives me 404, leave code in case see missing, thanks: // javascript document var angulartodo = angular.module('lostsysapp', []); function maincontroller($scope, $http) { $scope.names = []; $http.get('http://www.viudadesoubrier.com/angular/model.php') .success(function(data) { $scope.names = eval(data); console.log(data) }) .error(function(data) { alert(data); console.log('error: ' + data); }); $scope.addnom = function() { $http.post('http://www.viudadesoubrier.com/angular/model.php', { op: 'append', nom: $scope.nom, telefon: $scope.telefon } ) .success(function(data) { $scope.names = eval(data); console.log(data) }) .error(function(data) { console.log('erro...

python - Pip behind a proxy with a custom certificate file -

proxy settings pip can specified via --proxy command line option or in global configuration file (that $home/.config/pip/pip.conf in unix, $home/library/application support/pip/pip.conf in os x, %appdata%\pip\pip.ini in windows). [global] proxy = [proxy server url] however, while custom root certificate file can passed --cert command line option, there not seem way specify custom root certificate in configuration file. specifying cert = [path cert file] in above global configuration not seem taken account, unlike command line option. how can globally set pip use certificate file? we're behind proxy , need cert too. make sure cert file in place cmd , pip (windows) have access to. cert called b.pem i created folder (which didn't exist already) called: c:\users\<username>\appdata\roaming\pip and added file pip.ini folder. in pip.ini [global] cert = c:\users\<username>\b.pem i tested adding the pip.ini file to: c:\users\<userna...

html - Have to double click li to open my link -

i'm having trouble search box has dropdown. in dropdown there links open links have double click them. here link jsfiddle of https://jsfiddle.net/ag7l02u0/ . have solution? html: <form class="search" method="post" action="" > <input type="text" name="inputsearch" id="inputsearch" placeholder="search username" autocomplete="off" /> <ul class="search-ac" id="user-result"> <li><a href="#">search result #2<br /><span>description...</span></a></li> <li><a href="#">search result #3<br /><span>description...</span></a></li> <li><a href="#">search result #4</a></li> </ul> <input type="submit"...

c# - xceed datatgrid export to excel Xceed.Wpf.DataGrid.Export.ExcelExporter class is not found -

Image
i trying export datagrid's data excel. tried using xceed document (see code below). but there, not able find xceed.wpf.datagrid.export.excelexporter public static void exporttoexcel(xceed.wpf.datagrid.datagridcontrol dg, string file_name) { try { xceed.wpf.datagrid.export.excelexporter exporter = new excelexporter(dg); // details exporter.detaildepth = int.maxvalue; // use current system list separator exporter.formatsettings.separator = cultureinfo.currentculture.textinfo.listseparator[0]; exporter.export("d:\\orders.csv"); messagebox.show("excel file has been saved"); } catch (exception ex) { messagebox.show(ex.message); } }

java - Jackson. Deserialize missing properties as empty Optional -

let's have class this: public static class test { private optional<string> something; public optional<string> getsomething() { return something; } public void setsomething(optional<string> something) { this.something = something; } } if deserialize json, empty optional: {"something":null} but if property missing(in case empty json), null instead of optional. initialize fields myself of course, think better have 1 mechanism null , missing properties. there way make jackson deserialize missing properties empty optional? optional not meant used field more return value. why not have: public static class test { private string something; public optional<string> getsomething() { return optional.ofnullable(something); } public void setsomething(string something) { this.something = something; } }

css - change the position of an overlay using custom data attributes -

i have problem assignment know have mixed many things , not work @ all. please me? task the overlay has opened @ specified left , top positions. these positions should specified in link used open overlay, using custom data attributes data-x , data-y show overlay if neither of 2 data attributes or 1 of them provided, default values css should used missing values. also, make sure values data-x , data-y not outside window area. can access inner width , inner height of current browser window window.innerwidth , window.innerheight, respectively. <script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script> <!doctype html> <html> <head> <title>output</title> <style> /* overlay: */ .overlay { /* general properties: */ /* - hidden when page first displayed */ display: none; /* - displayed on top of other page elements */ z-index: 10000; /* - fixed position */...

selenium - How to get value between parent and child node using xpath? -

i want extract vale between parent , child node using xpath. how achieve that? **<div class="shareaccess"> value extract <a href="javascript:shareaccessvalue()" id="sharekey"> key </a> <span></span> </div>** how text value output ' value extract '? should not ' value extract key '. ' key ' should ignored. you can remove child text result java syntax string alltext = driver.findelement(by.classname("shareaccess")).gettext(); string childtext = driver.findelement(by.id("sharekey")).gettext(); string parenttext = alltext.replace(childtext, ""); parenttext "value extract"

javascript - object doesn't support this property or method document.querySelector -

i'm testing 1 line code on ie7 it's giving me following error: object doesn't support property or method , refers to here's problem line in question: var checked = document.queryselector('[name="answer1"]:checked'); this whole code question1 : did training? <input name="q4" value="yes" type="radio"> yes <input name="q4" value="no" type="radio"> no <br> <button id="getval">cick here</button> <script type="text/javascript"> document.getelementbyid('getval').onclick = function() { var checked = document.queryselector('[name="q4"]:checked'); alert(checked ? checked.value : 'not selected'); } </script> is there anyway fix that? queryselector only available in ie8+ . query selector in ie7 you'll need sizzle , standalone version of css query-by-selector code th...

ruby on rails - QR code gone empty while printing -

i generated qr code using command in ruby on rails. <%= raw qr_code.as_html %> my controller qr_code = rqrcode::qrcode.new(device_id) it renders qr code successfully. but, while printing page, qr code disappear. there other way display it?

mysql - Get values by comparing comma seperated string -

i have table this. languages table id languages 1 english 2 spanish 3 hindi 4 portuguese users table userid languages 1421 1,3 1422 2,3,4 i want output this userid languages_names 1421 english,hindi 1422 spanish,hindi,portuguese thanks in advance.

html - Hover button change css of other class -

in following html .pricing-item has border appears when hovered ( .pricing-item:hover::after ). trying set when button ( pricing-button btn-primary ) hovered, css .pricing-item border set '0px;'. <div class="pricing-item"> <div class="pricing-icon"></div> <h3 class="pricing-title">title</h3> <div class="pricing-price"><span class="pricing-currency">$</span>200<span class="pricing-period">/ year</span></div> <ul class="pricing-feature-list"> <li class="pricing-feature">feature</li> <li class="pricing-feature">feature</li> <li class="pricing-feature">feature</li> <li class="pricing-feature">feature</li> ...

plsql - Replace the value -

we have column 'a' in 'x' , 'y' table. if value of column 'a' not null need consider in 'x' table otherwise need consider in 'y' table. based on requirement how achieve it? thanks in advance sounds you're asking nvl function. based on limited information go on work you... create table x(id int, varchar(255)); insert x(id, a) values(1, 'one'); insert x(id, a) values(2, null); insert x(id, a) values(3, 'three'); create table y(id int, varchar(255)); insert y(id, a) values(1, 'one'); insert y(id, a) values(2, 'two'); insert y(id, a) values(3, 'three'); select x.id, nvl(x.a,y.a) x, y x.id = y.id; results in... id ========== 1 1 2 2 3 3

c - How to add openssl lib in android studio with experimental gradle plugin (NDK)? -

i'm trying add openssl library project in android studio 2.0 preview 7 experimental gradle plugin . dependencies { classpath 'com.android.tools.build:gradle-experimental:0.4.0' } what did downloaded openssl library , put jni folder. , have .c file uses library. have included files need , there no errors in code. .c file name hello-jni.c , declared build.gradle (module: app) this: android.ndk { modulename = "hello-jni" } and loaded library in mainactivity this: static { system.loadlibrary("hello-jni"); } but when try build project, error shows this: error:(51) undefined reference `rsa_generate_key' error:error: ld returned 1 exit status error:execution failed task ':app:linkarm64-v8adebughello- jnisharedlibrary'. > build operation failed. linker failed while linking libhello-jni.so. my hello-jni.c source code: #include <jni.h> #include <sys/types.h> #include <unistd.h> #include ...

ios - Swift Cocoa Touch Framework containing another Framework -

i'm trying build framework implements rest api want reuse , share. handle network access, want use alamofire inside api framework. works far except test app, uses api framework, won't build because alamofire missing. in app's target can set "embedded binaries" include api framework. if include alamofire there, works. now wonder if there way put alamofire framework api framework app has include 1 framework. api framework's target->general settings don't have section "embedded binaries". maybe can done in way. or not approach @ all? thanks help! --- update --- of course possible add source files of alamofire framework in api framework. way app has import api framework. still wonder if it's possible include alamofire framework in api framework. half year later learned not meant work way in xcode ios frameworks. if framework depends on other 3rd party frameworks, need import frameworks own target. i'm using xcode 8 b...

Ruby: Is there any way to move versions in JIRA via Ruby rest-client -

recently tried rewrite old legacy python program our production ruby environment. main goal of script is: get version jira project test get parent version create new version after parent jira-ruby gem creating things, there no "move" method, tried use rest library. but can't figure how move newly created version after parent one. https://developer.atlassian.com/static/rest/jira/6.1.html#d2e137 how should sent rest query move version 22015 after 22010 via post method? require 'rubygems' require 'json' require 'restclient' def jira_request project_key="test" jira_login = "bot" jira_pass = "password" jira_url = "http://#{jira_login}:#{jira_pass}@jira.local:16011/rest/api/2/version/22105/move" @move = restclient.post "#{jira_url}", { 'after' => "http://jira.local:16011/rest/api/2/version/22106" }.to_json, :content_type => :json, :acc...

Connection strings not available from App.Config in Unit Tests run on TFS 2015 -

i'v db facing unit tests take connection string app.config file. i'm grabbing strings thru configurationmanager class. var constring = configurationmanager.connectionstrings["db"].connectionstring; the tests run fine on dev machine not on tfs. there null refernce error. if jsut replace connection string in unit test hard coded string - identical in app.config - test works. oh yeah, , i've made sure app.config set "copy output folder". is there known issue tfs , configurationmanager? pom i ran same problem tfs 2015 (on premises update 2). have multiple test projects access connection string app.config file 1 particular project failed access connection string caused our build fail. i altered .csproj file match other working test projects didn't provide success, instead following worked me: copied contents of app.config notepad deleted app.config file project added new application configuration file (app.config) project pa...

android - Implement 2D rotation using multi touch -

in code implemented: zooming (with double tap , touble touch event) scrolling coordinate transformation pixel utm using class matrix , proportions. in way coordinates correct. i add rotation image, don't know how it. me? this image activity: public class mapactivity extends activity { public void oncreate(bundle savedinstancestate) { super.oncreate(savedinstancestate); touchimageview img = new touchimageview(this); img.setimageresource(r.drawable.planimetria); img.setmaxzoom(10f); setcontentview(img); } this java file class: http://pastebin.com/afukpgyz thank help.

javascript - Shorten saved JSON object in browser URL -

currently i'm saving json object in url, once stringified , escaped escapedit get's extremly long: example: "%7b%22glossary%22%3a%7b%22title%22%3a%22example%20glossary%22%2c%22glossdiv%22%3a%7b%22title%22%3a%22s%22%2c%22glosslist%22%3a%7b%22glossentry%22%3a%7b%22id%22%3a%22sgml%22%2c%22sortas%22%3a%22sgml%22%2c%22glossterm%22%3a%22standard%20generalized%20markup%20language%22%2c%22acronym%22%3a%22sgml%22%2c%22abbrev%22%3a%22iso%208879%3a1986%22%2c%22glossdef%22%3a%7b%22para%22%3a%22a%20meta-markup%20language%2c%20used%20to%20create%20markup%20languages%20such%20as%20docbook.%22%2c%22glossseealso%22%3a%5b%22gml%22%2c%22xml%22%5d%7d%2c%22glosssee%22%3a%22markup%22%7d%7d%7d%7d%7d" (object http://json.org/example.html ) code: var stringifeid = json.stringify({ "glossary": { "title": "example glossary", "glossdiv": { "title": "s", "glosslist": { ...

atmel studio start new project page is empty -

Image
i installed atmel studio 7 , can't make new project, tried use example project, gives error project creation failed here's whenever try make new project i dunno if relevant or not, have visualstudio 2015 installed before of this. also, think atmel studio 7 comes it's own compiler, there no need install winavr. what should ? found solution mess, guess atmel studio 7 installs visual studio shell conflicts visual studio 2015 installed, did : uninstall atmel studio 7 uninstall visual studio restart pc install atmel studio install visual studio(be careful, see note in edit) sometimes might find hard step 2, if can't try restore windows using restore point before installing atmel. , try again. edit: wanted add if vs , both installed, no matter order of installation, vs work fine, , won't work.

xml - base64Binary datatype is equivalent to base64? -

"the base64binary datatype represents base64-encoded arbitrary binary data. in other words, data encoded using base64 content-tranfer-encoding defined in section..." xml schema essentials so, understand if decode value, obtain binary data. true? can have base64string, base64float? totally different if have base64 , basebinary? maybe, obvious confuses me when in second line "the data encoded using base64 content-tranfer-encoding " , didn't specify "binary data". regards base64binary used encode sequence of bytes transfer on textual medium. content considered bytes. in answer question, there no need base64string, base64float etc because defined formats. base64binary can used transfer either string or float if transform construct byte sequence , encode base64. decoding , transform in opposite direction on receiving side.

railstutorial.org - Errors encountered in 10.3.3 of Michael Hartl's Rails Tutorial -

i ran following errors when running rspec tests: failures: 1) authentication authorization wrong user visiting users#edit page failure/error: before { visit edit_user_path(wrong_user) } actionview::template::error: undefined local variable or method `feed_item' #<#<class:0x007f89628593f8>:0x007f895fcdcd38> # ./app/views/shared/_feed.html.erb:1:in `_app_views_shared__feed_html_erb___2268788413810348528_70113969385200' # ./app/views/static_pages/home.html.erb:13:in `_app_views_static_pages_home_html_erb__501962788019734978_70114020097480' # ./spec/requests/authentication_pages_spec.rb:108:in `block (5 levels) in <top (required)>' 2) micropost pages micropost creation invalid information should not create micropost failure/error: before { visit root_path } actionview::template::error: undefined local variable or method `feed_item' #<#<class:0x007f89628593f8>:0x007f895ff8c3a8> # ./app/views/shared/_feed.html.erb:1:in...

jquery - using $('html, body') vs $('html') || $('body') for animating page scroll -

does make difference, in terms of performance, animate html , body (for browser compatibility) vs sniffing out browser , using html or body. i assume using html , body cause twice many dom traversals. if so, minimal wouldn't matter?

String removed after constructor initialize on if statement on C++ -

i'm experiencing extrange behaviour on c++ (mvs 2010) when initializing on constructor class called managerenderlistenercommand. implemented command design patter, managerenderlistenercommand command 1 of concrete commands. the place call managerenderlistenercommand void mediator::change(negotiator* negotiator, negotiatorevent& negotiatorevent){ icommand* command = null; if(negotiatorevent.matchevent("addtoviewport")){ command = static_cast<icommand*> (&addtoviewportcommand(mcameramanager, mscenecreator, mengine)); }else if (negotiatorevent.matchevent("managerenderlistener")){ command = static_cast<icommand*> (&managerenderlistenercommand(mobserverregistry, mengine, negotiatorevent.getmessage())); } //execute created command if (command) command->execute(); } as can see in code, managerenderlistener receives string, in case string contains word add contained on negotiatorevent class ( ...

C# Socket Receive to String -

following this guide wrote following function: public string connecttohost(string ip, int port) { socket socket = new socket(sockettype.stream, protocoltype.tcp); ipaddress host = ipaddress.parse(ip); ipendpoint ipep = new ipendpoint(host, port); socket.connect(ipep); byte[] msg = encoding.unicode.getbytes("<client quit>"); int msgsend = socket.send(msg); byte[] bytes; int byterecieve; string msgrecieved = encoding.unicode.getstring(bytes, 0, byterecieve); while (socket.available > 0) { byterecieve = socket.receive(bytes); msgrecieved += encoding.unicode.getstring(bytes, 0, byterecieve); } socket.shutdown(socketshutdown.both); socket.close(); return msgrecieved; } but error use of unassigned local variable 'bytes' , use of unassigned local variable 'byterecieve' on lie of code string msgrecieved = encoding.unicode.getstring(bytes, 0, byterecieve); r...

c# - ASP.NET MVC Web Site & WCF Web Service - Sharing functionalities -

i have following situation: have create website , web service share part of functionalities . this why not want write code twice. i have thought of following architecture: myapp.businesslogic --> here save datamodels database myapp.dataaccess -> datamodels & entity & mapping myapp.ui.models -> viewmodels myapp.ui.servicelayer -> acceses business logic, creates ui viewmodels website, , transforms viewmodels datamodels saving of businesslogic layer myapp.website myapp.ws.models - >ws models, these objects passed between client , ws myapp.ws.servicelayer -> accesses business logic, creates ws models web service, , transfoms ws.models datamodels saving of businesslogic layer myapp.webservice is architecture overkill ? problems encounter ? have problems controllers in asp.net mvc website ? when design applications this. issue dull copying of models view models. best way overcome use automapper. i though create unitt...

sql server - I am inserting excel sheet bulk data into a sql database table, now i need to split the table into multiple tables by using stored procedure -

select [myaccount_firstname] , [myaccount_lastname] , [myaccount_email] , [myaccount_mobile_no] , [myaccount_workphone] , [myaccount_street_1] , [myaccount_street_2] , [myaccount_city] , [myaccount_state] , [myaccount_zipcode] , [myaccount_country] , [business_setup_business_name] , [business_setup_fein_reg_id] , [business_setup_duns] , [business_setup_street_1] , [business_setup_street_2] , [business_setup_city] , [business_setup_state] , [business_setup_zipcode] , [business_setup_country] , [business_setup_businessphone] , [business_setup_businessfax] , [business_setup_emailid] , [business_setup_website] , [business_setup_primary_firstname] , [business_setup_primary_lastname] , [business_setup_primary_email] , [business_setup_primary_mobile] , [business_setup...

replace - OpenOffice Writer macro remove apostrophe from String -

i writing macro in openoffice writer. i read text .xml file , put string. string this: "hello" (so apostrophe part of string) so clear string looks this(example): string removeapostrophe = " "hello" ". i know weird it's written in .xml file way. what need function can put string in , removes apostrophe only: hello come out. something tried not possible replace function: replace(" "hello" ", " " ", "") function call: removeapostrophe = replace(removeapostrophe, chr(34), "") this function used: function replace(removeapostrophe string, search string, newpart string) dim result string dim startposition long dim currentposition long result = "" startposition = 1 currentposition = 1 if search = "" result = removeapostrophe else while currentposition <> 0 currentposition = instr(startposition, removeapostrophe, search) ...

html - Angular ng-pattern: textarea format regex -

Image
i want control form of user input in textarea on page. input has this: that means 3 values in 1 row , semicolon between first , second , between second , third value. by using regex validate it: ^((([^;]+);([^;]*);([^;]+))\n?)*$ it not work 100%, because validates input value1;value2;value3 value1 as valid. problem new line , beginning of next value1. seems until first semicolon written after value1, value1 still appended end of value3 in previous line. how should change regex disable , mark every new incomplete line invalid? i created js fiddle demonstrate: https://jsfiddle.net/tw2y5omc/3/ following regex: ^((?:[^;]+;){2}(?:[^;\n\r]+))$ # captures group # matches except semicolon, followed semicolon 2 times # afterwards except semicolon or newlines being bound end of string if want allow empty values, use star instead: ^((?:[^;]*;){2}(?:[^;\n\r]*))$ demo on regex101.com

xdocreport - How can I generate table in docx with freemarker? -

Image
i'm using xdocreports freemarker template engine generate documents based on template. want generate table java list. code looks this: try { // 1) load docx file filling freemarker template engine , cache // registry inputstream in = reportwriter.class.getresourceasstream("/template/teszt_jegyzokonyv_template.docx"); ixdocreport report = xdocreportregistry.getregistry().loadreport(in, templateenginekind.freemarker); fieldsmetadata metadata = report.createfieldsmetadata(); metadata.load( "testcasegroups", testcasegroup.class, true ); metadata.load( "testcases", testcase.class, true ); // 2) create context java model icontext context = report.createcontext(); testcasegroup testcasegroup1 = new testcasegroup("testcasegroup1", lists.newarraylist(new testcase("description1"), new testcase("description3"))); testcasegroup testca...

Jasper Parameter values -

added more info for me json datasource. we receive json hitting rest api. rest api may need few parameters pass. now parameters api needs , jasper parameters configured in jrxml. in below example reporttypelist, reporttype,dateparam, sheduledate params configured in jrxml.sheduledate filter parameter query json. reporttype , dateparam used hit api json data source. now if observe below reporttypelist have mentioned defaultvalueexpression in trying keep set of values. need read set java , and populate these values in combobox on ui dynamically. for parameter reporttype need default value if user have not selected ui need consider default value. for example: <parameter name="reporttypelist" class="java.util.list"> <defaultvalueexpression><![cdata[$p{reporttypelist}.set( "daily", "weekly",monthly" )]]></defaultvalueexpression> </parameter> <parameter name="reporttype" class="...

regex - Padding multiple character with space - python -

in perl , can following pad punctuation symbols spaces: s/([،;؛¿!"\])}»›”؟%٪°±©®।॥…])/ $1 /g;` in python , i've tried this: >>> p = u'،;؛¿!"\])}»›”؟%٪°±©®।॥…' >>> text = u"this, sentence weird» symbols… appearing everywhere¿" >>> in p: ... text = text.replace(i, ' '+i+' ') ... >>> text u'this, sentence weird \xbb symbols \u2026 appearing everywhere \xbf ' >>> print text this, sentence weird » symbols … appearing everywhere ¿ but there way use sort of placeholder symbol, e.g. $1 in perl can same in python 1 regex? python version of $1 \1 , should use regex substitution instead of simple string replace: import re p = ur'([،;؛¿!"\])}»›”؟%٪°±©®।॥…])' text = u"this, sentence weird» symbols… appearing everywhere¿" print re.sub(p, ur' \1 ', text) outputs: this , sentence weird » symbols … appearing everywhere ¿ ...

javascript - How do you store FB api response? -

i trying following code. want html.concat(name) line work. html string. function getname() { var name = fbname(function(name){ alert(html); //works alert("getname: " + name); //works html.concat(name); //fails? alert(html); // failed: html remains unchanged }); }; function fbname(callback){ fb.api('/' + user_id + '?fields=name', function(response) { callback(response.name); }); ...

Importing CRM Solution carries over the processes but some need to be re written -

Image
whenever export solution working process , business rules imported solution shows error in process section. have rewrite entire process. rare though, other exported processes come across fine. is down guids of email accounts different between databases? this happen when workflow steps contains create/send emails steps. , to, from, cc… records using not exists same guid in environment importing it. no need rewrite whole workflow again. can remove old records selected in send email steps select correspondence record in new environment.

asp.net mvc - angularjs function not invoking mvc controller method -

hi trying access method through angularjs when click button hits function not invoke controller actionresult when manually add url in calls method. here angular code: $http({ method: 'get', url: '/home/getemployeelist?=' + search }). success(function (data, status, headers, config) { $scope.customers = data; }). error(function (data, status, headers, config) { alert('error'); }); } and here controller: public jsonresult getemployeelist(string search) { search = "lourens"; list<quotation> quote = new list<quotation>(); using (specialhireentities sp = new specialhireentities()) { var quotes = sp.quotations.where(x => x.clientname == search).tolist(); return new jsonresult { data = quotes, jsonrequestbehavior = jsonrequestbehavior.allowget }; } } the url in first line of js should $http({ method: 'get',...

erlang - Meaningful auto-generated name for PID for debug purposes? -

there's process started task.supervisor.start_child , if went wrong elixir (erlang) prints error message this: 23:56:06.257 [error] task #pid<0.216.0> started #pid<0.137.0> terminating it's hard understand process crashed. wonder if there's way give meaningful auto-generated names processes? error more descriptive, like: 23:56:06.257 [error] task #pid-request-handler<0.216.0> started #pid-socket-loop<0.137.0> terminating you can name each desired process register/2 function: erlang: register(regname, pidorport) -> true elixir: register(pid | port, atom) :: true then need implementing logger use process_info(pid, registered_name) function registered name of desired process pid , formatting log text name. update: know error_logger event manager ( gen_event ). error, warning, crash, progress , info events sent error logger erlang runtime system , different erlang/otp applications. has default event handlers, sasl ...

ios - Navigation Bar color -

i'm building map app , have label information of route. i've set programmatically color of label , navigation bar same hex. while testing app, i've noticed different bit. can tell me, wrong? screenshot main color in util class; nav bar appearance set in app didfinishlaunchingwithoptions method; label color set in viewwillappear of map vc public static let maincolor = uicolor(fromhexcode: "#335e40") uinavigationbar.appearance().bartintcolor = util.maincolor infolabel.backgroundcolor = util.maincolor did turn off transition? uinavigationbar.appearance().translucent = false

html - Bootstrap navigation: same space between links -

i have website http://sg.nowcommu.myhostpoint.ch/ , can see in navigation space between links different. how can set same space between <li> elements? html: <div class="navbar navbar-fixed-top" data-activeslide="1"> <div class="container"> <button type="button" class="navbar-toggle" data-toggle="collapse" data-target=".navbar-responsive-collapse"> <span class="icon-bar"></span> <span class="icon-bar"></span> <span class="icon-bar"></span> </button> <div class="nav-collapse collapse navbar-responsive-collapse"> <ul class="nav row"> <li data-slide="4" class="col-12 col-sm-2"><a id="menu-link-4" href="#slide-4" title="next section...

insert multiple table rows via a php into mysql -

i inserting multiple line values html table form in sql it's inserting last table form value in database. can't figure out problem is. can me out this? this php: $result = mysql_query("select * ex_marks session='$session' , cl_name='$cl_name' , cl_section='$cl_section' , subject='$subj' , exam='$exam' , date='$date' , roll_no='$rollno' , obtainmarks='$marks'"); if (mysql_num_rows($result) == 0) { mysql_query("insert ex_marks(mid, session, cl_name, cl_section, name, fname, status, date, exam, roll_no, subject, obtainmarks, maxmarks, passmarks) values('', '$session', '$cl_name', '$cl_section', '$name','$fname', '$attendance', '$date', '$exam', '$rollno', '$subj','$marks','$maxmarks','$passmarks')") or die(mysql_error()); echo "<script type='text/javasc...