Posts

Showing posts from February, 2011

spring mvc - Thymeleaf: how to include page specific javascript using layouts? -

using thymeleaf there way decorate layout w/ page specific javascript , javascript includes? <!--my layout --> <!doctype html> <html> <head> </head> <body> <div th:replace="fragments/header :: header"> </div> <div class="container"> <div layout:fragment="content"> </div> </div> </body> </html> <!--my page --> <!doctype html> <html layout:decorator="layout"> <head> </head> <body> <div layout:fragment="content"> hello world </div> <script src="pagespecific1.js"></script> <script src="pagespecific2.js"></script> <script> alert("hello world") </script> </body> </html> in layout template, put fragment script. <html xmlns="http://www.w3.org/1999/xhtml" xmlns:th="http://www.thym

opencv - save an image in a complete path -

i using opencv library , visual studio 2013. save result image in complete path. it's ok same path c:\\... doesn't work. tried use both forward \ , / , result looked same. here code: #include<iostream> #include<opencv2/imgproc/imgproc.hpp> #include<opencv2/highgui/highgui.hpp> using namespace std; using namespace cv; int main() { mat src, dst; float sum; /// load image src = imread("lena.jpg", cv_load_image_grayscale); if (!src.data) { return -1; } // define kernel float kernel[3][3] = { { 1 / 9.0, 1 / 9.0, 1 / 9.0 }, { 1 / 9.0, 1 / 9.0, 1 / 9.0 }, { 1 / 9.0, 1 / 9.0, 1 / 9.0 } }; dst = src.clone(); (int y = 0; y < src.rows; y++) (int x = 0; x < src.cols; x++) dst.at<uchar>(y, x) = 0.0; //convolution operation (int y = 1; y < src.rows - 1; y++){ (int x = 1; x < src.cols - 1; x++){ sum = 0.0; (int k = -1; k <= 1; k++){ (int j = -1; j <= 1; j++){ s

sql - Display data from database to textbox -

i trying show data database textbox , write in textbox. last code got. here data showing in datagrid. instead of datagrid how data textboxes. public sub selectitem(byval itemcode string) try sql.opendbconnection() dim strsql string = "select itemcode 'item code',itemname 'item name' " & _ " tblitemmaster itemcode= @itemcode" dim cmd new sqlcommand(strsql, sql.sqlconn) dim ds new dataset cmd.parameters.addwithvalue("itemcode", itemcode) dim da new sqldataadapter(cmd) da.fill(ds, "tblitemmaster") dgvpurchaseorder.datasource = ds.tables("tblitemmaster") sql.sqlconn.close() catch ex sqlexception msgbox(ex.message, msgboxstyle.critical, "sql error") catch ex exception msgbox(ex.message, msgboxstyle.critical, "general error") end try end sub i have no idea how that. please me if

vb.net - Convert Pdf to Bitmap via code -

i know there's tons of threads "out there" can find bitmap pdf , how add images pdf. i have pdf convert jpeg. i've tried use itextsharp can find info making pdf, not other way araound. ideas or links actual code? imagemagick uses ghostscript handle pdfs if task i'd recommend using ghostscript. there's managed wrapper here , can ghostscript binaries here . come in installer can extract them using 7-zip. see this discussion on need deploy in app. might have play around 32-bit vs 64-bit. also, on ghostscript download page please read "which license right me?" section.

java - JSF- <h:commandButton> does not invoke new window from backing bean -

my issue similar issue having in xhtml , calls backing bean method invoking new window pre constructed url.but problem not opening url. my code in xhtml given below <h:commandbutton style="margin-left:1em;width: auto; height: 20px;font-size:85%" value="webphone" id="lwebpne"rendered="#{bean.editcmdactionflg == true , (bean.selectedsearchsysdetrow.isfeed != '1' or bean.selectedoverviewdetails.webpheflg == false)}"actionlistener="#{bean.webphonesearch}" > <f:param name="lpid" value="lpid" /> </h:commandbutton> , code given in backing bean public void webphonesearch(actionevent event) { logger.info("webphonesearch method enter .."); string param = ""; map<string, string> params = facescontext.getcurrentinstance() .getexternalcontext().getrequestparametermap(); if (params.get("lpid") != nu

windows - cURL POST multiple files with different names (emulate wildcard) -

this little on head, please specific in responses. i have performed https form post using curl. here code, simplified: curl.exe -e cert.pem -k -f file=@"c:\dir\test.txt" "https://www.example.com/ul_file_curl.ashx" here's problem: need make code upload 2 files each day, , names change every day based on several variables, date , time of creation. what want replace test.txt *.txt , curl doesn't seem support wildcards, how can accomplish this? in advance. edit: done in windows environment.

Service not injecting properly into quartz job class With quartz scheduler plugin (v1.0.1) for grails 2.3.6 -

i've implemented own quartz job classes take in service method . however, service doesn't seem injecting job class nullpointer exception when accessing service. how services injected during trigger of job . any suggestion on how invoke method in service job class update 1 : added job code , log messages import org.quartz.job; import org.quartz.jobexecutioncontext; import org.quartz.jobexecutionexception; import org.quartz.jobdatamap; import com.unitrac.app.reportcentre.report.reportservice; // logging import org.apache.commons.logging.logfactory; class reportjob implements job { def reportservice; def grailsapplication; // logging private static final log = logfactory.getlog(this); void execute(jobexecutioncontext context) throws jobexecutionexception { // execute job jobdatamap jobmapdata = context.getmergedjobdatamap(); try { log.debug("in report job - executin

c# - Picking data inside a string via reflex -

Image
okay have been trying pick data string reflex(in c#) while, want pick between customer , <\div> dont seem able data: code: string text= "<div> company = fake company </div><div>customer: xxxx</div><div>device: ny-fil05 </div><div>service: device fail:</div> " var groups= regex.match(text, @"customer: (.*\b</\div>\b")).groups; var auxi = groups[1].value; basically need grab xxxx im either grabbing or grabbing nothing string text = "<div> company = fake company </div><div>customer: xxxx</div><div>device: ny-fil05 </div><div>service: device fail:</div>"; match m = regex.match(text, @"(?<=customer: ).*?(?=</div>)"); if (m.success) console.writeline(m.value); explanation: (?<=customer: ).*?(?=</div>) debuggex demo

What is a "RS" in a html(text) file? -

Image
the file opened everedit. want know "rs" is. and notepad++ i got page our school library website. page shows result of query book. books may written more 1 author. authors column there contains 2 authors little space between them. page works fine ie6. on ie11, firefox , chrome space vanished. 2 authors became 1 author long name. opened html file using notepad.exe , found nothing. opened everedit, got "rs" there. it sounds it's non-printable character, can appear differently in different applications. (i ran problem these in sql queries once, colleague using different editor copied/pasted things differently.) it's tough certainty character is, based on this table (or this one separates out non-printable characters) best guess record separator: dec 30 hex 1e oct 036 char rs if can examine character in octal or hexadecimal editor can confirm this. you'd have identify byte examine (probably copying small piece file examin

openldap - Export/import LDAP data using perl script -

i new in openldap , perl. want export /import ldap data with/without schema ldap database. possible using perl script? if yes ,please give me sample code. create new schema using openldap , perl without dns.how that? this many questions in 1 item. please ask 1 question @ time. how read ldap wtih perl: use strict; use warnings; use data::dumper; ### ldap use convert::asn1; use net::ldap; use net::ldap::util qw(ldap_error_name canonical_dn ldap_explode_dn ldap_error_text); use net::ldap::ldif; %parms ( host => 'localhost', port => 389, binddn => 'your dn', passwd => 'password', base => "", filter => "(objectclass=*)", scope => "base", attrs => ['*'], ); $ldif = net::ldap::ldif->new( "out.ldif", "w", onerror => 'die', wrap => 0 ); $ldap= net::ldap->new($parms{'host'}, port => $parms{'port'}); $bind_result

c# - Where to store user input data in WPF application? -

i have wpf application contains few pages user enter data. need store data until user finishes input , need data , print out verification. i know there dictionary able store keys , data, how store data starting page until final page? create class file store data or there other better solution solve problem? it big question more domain model wpf. sounds have collecton of data. collection must ... think have name. e.g. "results", "survey", or "bill of materials". model , model data. now talking wpf stuff, each data entry page "bind" individual "data" model. whatever user using navigate through data bind collection thing. keywords want lookup: binding datacontext observablecollection mvvm start small. have long rich path.

asp.net mvc 4 - HttpContext.Current null when making a function Asynchronous in MVC4 -

i working on mvc4 in vs2010-sp1. made 1 of function in controller class asynchronous. part of made controller class derived asynccontroller , added below 2 methods ( see code section 1 , 2 below). 1 method ending async(see code section 1 ) , method ending completed ( see code section 2 ). problem in model class trying access webservice credentials httpcontext ( see code below 3 ). context going null when making asynchronous call. ie, in new thread httpcontext not available. how pass context main thread new threads created. code section 1 public void sendplotdatanewasync(string fromdate, string todate, string item) { asyncmanager.outstandingoperations.increment(); var highchartmodel = new highchartviewmodel(); task.factory.startnew(() => { asyncmanager.parameters["dataplot"] = highchartmodel.getgraphplotpointsnew(fromdate, todate, item);

c# - How to select the listbox items from View Model -

i want select list box items view model? my xaml is:- <grid x:name="mvvmlistboxuicontainer" grid.row="1" margin="2,0,2,0"> <listbox height="374" itemssource="{binding studentdetails,mode=twoway}" horizontalalignment="left" margin="2,6,0,0" name="listbox1" verticalalignment="top" width="476" borderbrush="#00410d0d"> <i:interaction.triggers> <i:eventtrigger eventname="tap"> <i:invokecommandaction command="{binding eventpagecommand, mode=oneway}"/> </i:eventtrigger> </i:interaction.triggers> <listbox.itemtemplate> <datatemplate> <border borderbrush="gray" padding="5" borderthickness="1"> <stackpanel orientation="horizontal"> <border borderbrush="w

Sorting php array in Redis -

i have array of objects (result of mysql query) array(28) { [0]=> array(2) { ["member_id"]=> string(5) "40105" ["last_login"]=> string(19) "2014-02-18 06:04:06" } [1]=> array(2) { ["member_id"]=> string(5) "51758" ["last_login"]=> string(19) "2014-04-21 09:29:11" } [2]=> array(2) { ["member_id"]=> string(5) "52682" ["last_login"]=> string(19) "2014-04-21 08:27:00" } what best datatype sort in redis ? need search , add object result? shall use set or list ?

locking - SQL Server Delete Lock issue -

i have sql server database deleting rows 3 tables a,b,c in batches conditions through sql script scheduled in sql job. job runs 2 hours tables have large amount of data. while job running, front end application not accessible (giving timeout error) since application inserts , updates data in these same tables a,b,c . is possible front end application run in parallel without issues while sql script running? have checked locks on table , sql server acquiring page locks. can read committed snapshot or snapshot isolation levels or converting page locks row locks here. need advice. split operation in 2 phases. in first phase, collect primary keys of rows delete: create table #templist (id int); insert #templist select id yourtable in second phase, use loop delete rows in small batches: while 1=1 begin delete top (1000) yourtable id in (select id #templist) if @@rowcount = 0 break end the smaller batches allow front end a

html - save input type file state after server validation mvc -

i have html form textbox controls , <input type=file> control uploading file. controls have server validation. imagine next situation: select file uploading , enter data textbox controls(some textboxes leave blank). click submit button , form sended server action. after validation checking in server redirect same form error correction. textboxes save state , have data file control don't have. p.s. when debugging code, see uploaded file in view model. can resend html form? don't write code because think redundant. you can filename (eg. myfile.txt ), not full path (eg. /home/martin/myfile.txt or c:/users/martin/myfile.txt ), can't set value server-side or javascript. reasons of security & privacy. what can instead: validate form javascript or ajax request, if fails, original form (& values) unchanged (i recommend this). save file contents on first try, , if retry fails , user didn't give new file, use saved file contents (this may requ

Update text file with the name and also run an exe using batch file -

i below things every single file the files ext .mtc inside particular directory in loop using batch script. can please help? output name of file in text file in variable run application exe pass file name variable text file (in step 1) batch file can used output same 2nd batch file *basically want retain name of file stored in 1st batch file 2nd batch file i able step 2 of running application each of mtc file not able step 1 , step 3. something : @echo off /f "delims=" %%a in ('dir /b/a-d *.mtc') call:execute "%%a" exit /b :execute echo treating : %1 yourexe.exe call your_second_bat.bat %1 and second batch value of .mtc file in %1 your_second_bat.bat : @echo off echo value received first bat [%~1]

Eclipse - Searching for strings in JRE System Libraries or Referenced Libraries does not work -

i can search files, folders or whole workspace search function, whenever select either 'jre system library' or 'referenced libraries' eclipse returns "'*' - 0 matches in empty scope". checked 'consider derived resources' no avail. i aware these files read-only, why cannot search through them?

javascript - Require.js continues to load uncompressed modules after optimization -

Image
i've run r.js optimizer , seems working properly. trouble i'm having while compressed optimized version loads continues load uncompressed modules. reason why happen? build.js { appdir: '../static', mainconfigfile: '../static/javascript/config.js', dir: '../public', baseurl: 'javascript/libs', usestrict: false, wrap: false, optimizecss: "standard", optimize: "uglify2", generatesourcemaps: false, preservelicensecomments: false, uglify2: { "screw-ie8": true, warnings: false, mangle: true }, throwwhen: { optimize: true }, pragmasonsave: {}, modules: [ { name: '../front', include: ['views/front/main'], exclude: ['../config'] } , { name: '../portal', include: ['views/portal/main'], exclude: ['../config'] } , { name: '../survey', include: ['vi

How to convert Base64 encoded pkcs12 content to java.security.PrivateKey? -

i'm consuming google directory api via service account , received pkcs12 key @ service account creation. google support 2 different ways use taking key java.io.file or java.security.privatekey , poc, have used first way creating googlecredential object using java.io.file , googlecredential credential = new googlecredential.builder() .settransport(httptransport) .setjsonfactory(jsonfactory) .setserviceaccountid(serviceaccountid) .setserviceaccountscopes(arrays.aslist(directoryscopes.admin_directory_user)) .setserviceaccountuser(serviceaccountuser) .setserviceaccountprivatekeyfromp12file(serviceaccountprivatekeyfile) .build(); it's working expected in actual use case cannot rely on filesystem cannot use first method. wanted implement actual use case using second way using java.security.privatekey , following when done. googlecredential cred

html - Responsive design css dom element manipulation -

i have div field including input element , label element. both display: block <div class="cf-full"> <input id="a" > <label class="helptext"</label> </div> so in normal view, input field come first. however, want layout responsive, in mobile label come first. i know dom manipulation can achieved javascript easily. there way achieve reverse dom elements order pure css? this works div { display:table; } input { display:table-footer-group; } label { display:table-header-group; } http://jsfiddle.net/v8xtc/

Store different collection in different files in MongoDB -

i'm going migrate sql server database mongodb. have multiple tables lot of data. know if possible break single mongo db file multiple files 1 each collection in mongo. there no single mongodb data file. mongodb allocate initial file database , add files needed. on mac configured starts 64mb file, next double size (128mb) , doubles next 1 etc till get's 2gb , files after 2gb in size. you can modify various configuration options http://docs.mongodb.org/manual/reference/configuration-options/ keep in mind storage file allocation per database, not collection.

image - Jquery active link change src -

i have paralax effect on site , want make active dot. problem every dot must diffrent on active green orange mint blue and when they`re not active want them white. and important me change src of image not .css here code 1 color active dot: <ul class="paralax"> <li><a href="#intro" title="next section"><img src="https://dl.dropboxusercontent.com/u/64675374/circle2/dot.png" /></a></li> <li><a href="#second" title="next section"><img src="https://dl.dropboxusercontent.com/u/64675374/circle2/dot.png" alt="link" /></a></li> <li><a href="#third" title="next section"><img src="https://dl.dropboxusercontent.com/u/64675374/circle2/dot.png" alt="link" /></a></li> <li><a href="#fif

java - No Main Function -

ok, trying run , tells me there no main (i have tried putting 1 in , termination , syntax error) wrong and/or put main function? here code import javax.swing.*; import java.awt.*; import java.awt.event.*; public class stylelistener extends jpanel { private static final long serialversionuid = 1l; private jcheckbox bold, italic; private jlabel saying; private jsplitpane splitpane; public stylelistener() { splitpane = new jsplitpane(jsplitpane.vertical_split); splitpane.setonetouchexpandable(true); splitpane.setpreferredsize(new dimension(300,200)); splitpane.setbackground(color.green); splitpane.setdividerlocation(100); jpanel subpanel1 = new jpanel(); subpanel1.setpreferredsize(new dimension(300, 100)); subpanel1.setbackground(color.cyan); saying = new jlabel ("say style!"); saying.setfont (new font ("helvetica", font.plain, 36)); subpanel1.add (saying); splitpane.settopcomponent(subpanel1); jpanel subpanel2 =

algorithm - How to do high dimensional range query with fixed range? -

i have 10^4 points in 7 dimensional space. application, need make ~10^6 range queries on input find points lie inside given range. in application, queries use same range size. appropriate data structure problem? kd-tree seems apt, 7 dimensions , small output size linear in time complexity queries. solution range trees, seems complex construct small number of input in application. also, don't see of these structures using fact range constant size advantage. example, if 1d problem, queries asking points lying inside range of size 10 example, @ different places along number line. well, late answer, dont know if s usefull now. can use fixed height fqts (fhfqt or fhqt) [ http://users.dcc.uchile.cl/~rbaeza/ftp/fqtrees.ps.gz] or fixed query arrays (fqa) [ http://www.dcc.uchile.cl/~gnavarro/ps/mtap01.pdf] . these structures work in kind of similarity searching. beside that, need use pivot selection method incremental 1 results. assume using euclidian distance , distances h

Display dialog box before intent activity starts in android -

i'm creating application in i've display dialog box. dialog box having edittext , button. want display dialog box before activity starts. please me. create instance of dialog in oncreate(); , show in onresume();

What is the minimum target CPU architecture for the various versions of Visual Studio? -

what minimum target processor architecture (indicated _m_ix86 predefined macros) supported every version of visual studio 2008, 2010 , 2012? for example, msvs 2012 supports pentium pro , higher. the classic switch /g . available options differed different versions of compiler (with newer versions dropping older options, albeit continuing accept them compatibility reasons). here's got: /g3 built code optimized 386 processors ( _m_ix86 set 300) /g4 486 processor ( _m_ix86 set 400) /g5 built code optimized pentium ( _m_ix86 set 500) /g6 built code optimized pentium pro, ii, , iii ( _m_ix86 set 600) /g7 built code optimized pentium 4 or amd athlon ( _m_ix86 set 700) /gb specified either "blend" mode or lowest common denominator reasonable when version of compiler released. default option if no other specified. and of course, bears explicit mention setting option optimize newer processor architecture did not prevent code running on older

php - Display two td per row -

here code retrieve data , want display them table. specific each row should contain 2 td data. //seelct forklft query $select_part_query = "select distinct part_code, part_desc, part_size, oem, part_image tblpartdetails part_code '%$txtsearch%' or part_desc '%$txtsearch%' or part_size '%$txtsearch%' or oem '%$txtsearch%'"; $result1 = mysqli_query ($mydatabase, $select_part_query); if($result1) { $counter1 = 1; while($info1 = mysqli_fetch_array( $result1 )) { if( $counter1 == 1 ) { echo "<tr>"; } echo '<td style="width:460px; padding:15px;">'; echo "<div style='width:430px; height:210px; padding:10px; background-color:rgba(190, 190

Downloading a file created in server using Java -

i trying download file given url. url not direct file url. when url provided in browser manually, prompt download/save. for example, http://www.my-domain.com/download/type/salary/format/excel i have no issues in url has file name directly in url. in above url, based on format , type, server generates file. in java trying download file using below code. file created, content domain content , not actual excel data. url url = new url("http://www.my-domain.com/download/type/salary/format/excel"); httpurlconnection connection = (httpurlconnection) url.openconnection(); float totaldataread = 0; bufferedinputstream in = new bufferedinputstream(connection.getinputstream()); fileoutputstream fos = new fileoutputstream("c:\\test.xls"); bufferedoutputstream bout = new bufferedoutputstream(fos, 1024); byte[] data = new byte[1024]; int = 0; while ((i = in.read(data, 0, 1024)) >= 0) { totaldataread = totaldataread + i; bout.write(data, 0, i); } bout.clo

ios7 - How to make this kind of effect in iOS, blur effect it is increasing leaner to lower side -

Image
i searched this, didn't found exact solution problem, answer making blur effect shows making blur effect on entire frame want blur effect below image in image blur effect @ bottom to, increasing leaner lower side can 1 know how this, ideas or sample code ... :) use cagradientlayer uicolor *thecolor = [[uicolor alloc] initwithred:146.0/255.0 green:146.0/255.0 blue:146.0/255.0 alpha:1]; cagradientlayer *gradientlayer = [cagradientlayer layer]; cgrect gradientlayerframe = theview.frame; gradientlayerframe.origin.x = 0; gradientlayerframe.origin.y = 0; gradientlayer.frame = gradientlayerframe; //build colors array gradient nsarray *colors = [nsarray arraywithobjects: (id)[thecolor cgcolor], (id)[[thecolor colorwithalphacomponent:0.9f] cgcolor], (id)[[thecolor colorwithalphacomponent:0.6f] cgcolor], (id)[[thecolor colorwithalphacomponent:0.4f] cgcolor], (id)[[thecolor c

How to read method parameters from a method call defined in a .java file? -

Image
i want read parameters passed particular method of java class. here java file: package config; public class abc extends lineavailabilitynew { public abc(message msg) throws messagehandlerexcection { super(msg); } public void domessagedataoverrides() throws messagehandlerexcection { super.domessagedataoverrides(); setworkinglineqty("21"); setstoppedlineqty("10"); setworkinglineexchangegroupcode("gol"); setworkinglinewithserviceid("01014013024", "24", "mpf", "n", "n", "a line in e2e", "", "nte", "gol", "", "standard", ""); setonemoreworkinglinewithserviceid("01014013025", "25", "mpf", "n", "n", "a line in e2e", "", "nte", "gol", "", "standard", ""); setonemoreworkinglinewith

asp.net mvc 4 - Two-Phase commit implementation -

let's say, i've abc system @ abc location , def system @ def location. abc system insert data, @ same time def system update data. how guaranteed entire set of operations completes, or entire set of operations fails, , state of system restored state in before of operations began. i heard about, two-phase commit. info , sample? need technical advice.

ruby - Why doesn't Minitest's assert_raises work as expected in this case? -

i'm trying sort out weird behavior in rails using action controller bug report template . for record, controller in template: class testcontroller < actioncontroller::base include rails.application.routes.url_helpers def index render text: 'home' end end i've added route missing action: routes.draw '/' => 'test#index' '/missing' => 'test#missing' end and i'm trying assert abstractcontroller::actionnotfound raised when following route: class bugtest < minitest::test include rack::test::methods def test_missing assert_raises(abstractcontroller::actionnotfound) { '/missing' } end private def app rails.application end end expected behavior: green test. actual behavior: # running tests: d, [2014-04-24t09:17:41.948985 #4497] debug -- : d, [2014-04-24t09:17:41.949029 #4497] debug -- : i, [2014-04-24t09:17:41.949094 #4497] info -- : started "/missing&

c# - Improve control rendering performance in a TabControl -

my windows forms application has large tabcontrol select view user wants (customer management, other special list management, log list, etc.). each tab page contains nothing special, it's bunch of standard controls, layouted through tablelayoutpanels , flowlayoutpanels. these labels, textboxes, comboboxes, listboxes , on. when switch tab page, can literally watch windows forms painting controls on screen. in first moment, background of controls seems partially painted, other regions, text, , few rendering frames later painted , complete. there no event handler on tabcontrol nothing delay switching. tab switching quick, it's rendering of stock controls doesn't happen in 1 step progressively. user should not see. controls static. don't re-arrange or dynamically create them @ runtime. there doesn't have content. can see on new tab page i've designed , isn't filled data yet. have never seen such partial updates wpf, it's winforms issue. what cause

sql - Get database name from field? -

currently reference multiple databases same query, so databasename.tablename.column i wondering if can reference database name field. reason there hundreds of these references , when creating new instances customers database names vary slightly, these have updated. what looking this: (select databasename configurationtable).tablename.columnname would work @ all? , if can foresee problems? you cannot use syntax in question. what use dynamic sql , build query dynamically based on database name. example: declare @sql nvarchar(max) = (select databasename configurationtable) set @sql = n'select columnname ' + quotename(@sql) + n'..tablename' exec sp_executesql @sql

perfect implementation of database as a service for private cloud -

i going implement database service in our private cloud. purpose looking appropriate dbaas implementation. spent times openstack , dbaas solution called trove. unfortunately lacks documentation , toturial. right looking better solution. question best opensource solution dbaas? regards. i think trove best option. else require customization , glue code level of integration trove has openstack. you'd have document customization , create tutorial it. did try add database service openstack guide? you can learn lot reading through redstack script found in trove-integration repo. if need help, there lot of places go. openstack mailing list #openstack-trove on irc (freenode) ask.openstack.org

Display Classifier's Notes/Properties When Generating RTF in Sparx Enterprise Architect -

Image
i'm using sparx enterprise architect 10. i have instance of component on diagram , display both: the instance's notes; and the classifier's notes when generating rtf documentation. if have package structure this: and have template publishes diagrams package , elements on package's diagram, result looks this: it not there field available classifier's notes -- name of classifier. have custom sql? edit - april 25: is familiar sql or script required this? it looks way add custom field report using fragment. i've found if create template fragment displays field want , use custom query, can return information want. create template fragment create template fragment in enterprise architect. only check custom checkbox in sections tree. right click between custom start , end tags on page , choose insert custom field . type name of custom field (in case, chose use notes ). save, click document options icon. set tem

c++ - How do I use GLTriangleBatch -

i developing real world application render solid white polygons on screen, , change alpha values time passes. trying learn how use gltrianglebatch perform (i know c++ well, not opengl), , have not been able find examples online. far, have found few resources led me put following bit of code, still confused on portions: gltrianglebatch mytriangles; mytriangles.beginmesh(1000000); // include how many vertices have: 1??? mytriangles.addtriangle(...); // add triangle: 2??? // repeat triangles batch mytriangles.end(); // done adding triangles mytriangles.draw(); // draw triangles i have marked portions confused on ???, , questions appear below: question 1: number of vertices have exact, or okay over-estimate , / or underestimate? furthermore, number of vertices represent "batched" vertices, or individual vertices of each triangle (e.g. 2 connected triangles 2 shared vertices require 6 vertices or 4?) question 2: paramaters are: m3dvector3f verts[3]: assume 3

python - How to make Sphinx understand Sage doctests? -

i have package python, , meant used python. there few functions available when module used under sage. problem sage doctests must prefixed sage: rather >>> , , sphinx doesn't pick these when generating documentation. is there way sphinx recognize sage: prefix being equivalent >>> when generating html (or other) docs? well, can use sage's built-in version of sphinx , documentation builder. work in progress sage @ http://trac.sagemath.org/ticket/13679 allows building documentation single python file not in sage's source tree, try that.

git - How to publish to Github Pages from Travis CI? -

we compiling doxygen docs on travis-ci server , want push them onto our gh-pages branch. how handle authorization git push ? have example using encrypted variables in travis-ci? should go https authorization or ssh key? step-by-step example https api token in environment variable others have mentioned it, here goes more detailed procedure. create separate repository website (optional). reduce likelihood overwrite main repository, , keep output files polluting it. get personal access token under https://github.com/settings/tokens only enable "public_repo" access public repositories, "repo" private. save token somewhere can see once. on travis settings repository https://travis-ci.org/<me>/<myrepo>/settings create environment variable: github_api_key=<token> and make sure mark "display value in build log" "off". this safe because authorized pushes see such environment variables, if malicious user t

javascript - Angularjs databinding not working on class attribute -

i trying put grid view using bootstrap's grid system. have slider controls how many columns , rows grid should have, , grid should adjust through databinding. having column part. trying set class based on column selected. if column count 2 want use col-lg-6, or 3 use col-lg-4, , 4 use col-lg-3. minimum count 2, grid should respond changing value , not. not sure if angular problem or doing wrong. here jsfiddle: http://jsfiddle.net/8jbxz/ <body ng-app="gridview" ng-controller="gridviewcontroller"> <div id="slidercontainer"> rows : <input value="2" type="range" min="2" max="4" id="rowcount" step="1" ng-model="rows"/> columns : <input value="2" type="range" min="2" max="4" id="columncount" step="1" ng-model="columns"/> </div> <div>rows : {{rows}}

PHP Function flags as parameters -

can explain how works? lot :) define("flag_a", 1); define("flag_b", 2); define("flag_c", 4); function test_flags($flags=false) { if ($flags & flag_a) echo "a"; if ($flags & flag_b) echo "b"; if ($flags & flag_c) echo "c"; } test_flags(flag_a|flag_b); this done using called bitwise math . specifically, using & (bitwise and) operation check see if value set. sake of argument here, use 4-bit numbers, keep short , simple. the number 7, in 4-bit binary, follows: 0111 each digit has value doubled each time, , of them added make total number of 7. broken down, works so: 0 1 1 1 ^ ^ ^ ^ | | | | 8 4 2 1 so, essentially, is: 0 * 8 + 1 * 4 + 1 * 2 + 1 * 1 = 7 now, bitwise math, bitwise and, can care bits in columns -- basically, bit in each column must 1, or set zero. so, checking '4' inside '7

c++ - xmpp authenticate to face book chat api and always receive a failure -

i use gloox open source api works again several other xmpp servers. use following code jid jid( "userid@chat.facebook.com" ); j = new client( jid, "password" ); j->setserver("chat.facebook.com"); j->setport(5222); j->setsaslmechanisms(gloox::saslmechplain); j->settls(gloox::tlspolicy::tlsrequired); j->registerconnectionlistener( ); j->registermessagesessionhandler( this, 0 ); j->disco()->setversion( "messagetest", gloox_version, "windows" ); j->disco()->setidentity( "client", "bot" ); j->disco()->addfeature( xmlns_chat_states ); stringlist ca; it connects , opens tls socket receives saslnotauthorized facebook. is userid correct? missing facebook? any appreciated. check facebook chat jid here , under "other" link. you no need change server, port, sasl or tls parameters, set jid , password, xmpp library should find other par

Wordpress - qTranslate plugin - how to force redirect to home page when language is switched -

i'm trying set simple multi-language community website. on website, have contents available in multi-languages qtranslate. "language switcher" added @ footer , displayed in pages. what need re-direct users home page when switch language. i've spent hours searching solution in google, in vain. does know how redirect home page when language switched using qtranslate? thank much. just use <?php echo home_url(); ?> , not <?php bloginfo('home'); ?>

java - User input failing if statement and I don't know why -

my program calculating , printing users bmr value, based on age, height, weight, , gender. however, program not working when comes checking gender based on input, , jumping straight else statement. code far, how fix it? import java.util.scanner; public class maintainingweight { public static void main(string[] args) { //instance variables int age, weight, inches; //weight in pounds, height inches double bmr; string gender; //program introduction welcoming user scanner keyboard = new scanner(system.in); system.out.println("hello fellow user, program determine \nyour bmr value , tell amount of chocalate bars need"); system.out.println("in order maintain body weight."); //ask user input age, weight , height system.out.println("please enter age."); age = keyboard.nextint(); system.out.println("next enter weight in pounds"); weig

php - insert an array as an object property (json) -

i expect result [ { "uid": "1", "firstname": "james", "lastname": "bond", "task": [ { "task": "teaching" }, { "task": "tutoring" } ] } ] where result1 , result2 following: $result1 [{"uid":"1","firstname":"james","lastname":"bond"}] $result2 [{"task":"teaching"},{"task":"tutoring"}] i tried $result1[0]['tabs'] = $result2; echo json_encode($result1); but says fatal error: cannot use object of type stdclass array you have this.. $result1='[{"uid":"1","firstname":"james","lastname":"bond"}]'; $result2='[{"task":"teaching"},{&quo

php - Mysql varchar fields with number not sorting well -

i have little knowledge of mysql, importing csv file many numbers in db, developer changed type of fields int varchar , script sort 1 fields numeric descending no longer display number in descending order well, numbers mix up, if use phpmyadmin , click on column. he mentioned me when changed numerical fields value varchar because data getting corrupted otherwise. succeeded in importing data display script not working anymore. i way on head. 'avgsearches` varchar(11) collate utf8_bin default null, engine=innodb default charset=utf8 collate=utf8_bin auto_increment=1406 here sorting order: 9900 90 880 8100 74000 720 70 select distinct keyword , avgsearches traffic status='y' order avgsearches desc one way, make fixed length strings padded left leading zeroes. prevents use of index ordering job done. neater if converted stored function. missing 'trim'. select distinct keyword, avgsearches traffic status='y' order right(conc

python - Enable proxy support of pyLast -

i want enable proxy, found method named enable_proxy , when this: network = pylast.lastfmnetwork(api_key = api_key, api_secret = api_secret, username = username, password_hash = password_hash) network.enable_proxy("http//...", 8080) i network error: [errno 11004] getaddrinfo failed , because call of pylast.lastfmnetwork tries generate network session key. how can enable proxy support of pylast? don't find example. if don't need scrobble, can create network object without session key omitting username/password hash, here: https://github.com/ticklemynausea/mbot-shell/blob/199d65c5841cb7e0f9f2cc5aec677bcb45ffe5b4/lastfm/lastfm.py#l34 https://github.com/devilcius/last2what/blob/8d6b0a87dc25a859c137670fee67643c99e0c78d/last2what.py#l103 like this: network = pylast.lastfmnetwork(api_key, api_secret) if proxy_enabled: network.enable_proxy(host = proxy_host, port = proxy_port) do need scrobble? if so, try after enabling proxy: network.usern

php - CodeIgniter How to access session variables in twig templates -

somebody can me please. i'm new in codeigniter , twig. have declared in controller following: $datasession = array( 'nick' => $sess_nick, 'login_ok' => true ); $this->session->set_userdata($datasession); redirect('app'); //app controller render template view. then, question is: how can variables twig template? tried using: {{ session.userdata.nick }} but shows empty string. thanks advance. to add session variable on twig template, have add following line in twig library or controller. $datasession = array( 'nick' => $sess_nick, 'login_ok' => true ); $this->session->set_userdata($datasession); $this->_twig->addglobal("session", $this->ci->session); then on twig template, can print session this {{ session.userdata.nick }} since in codeigniter, session stored user in userdata array. otherwise, can call session variable , name {{ session.nick }} src: http:/

mysql - PHP mysql_fetch_array doesnt work? -

im trying fetch array out of mysql query result : $result = mysqli_query($con,"select * names"); if (!$result) { echo "wrong"; } var_dump($result); //fetch data in loop while($r=mysql_fetch_array($result, mysql_assoc)){ var_dump($r); } var_dump($result); shows me there in : object(mysqli_result)#2 (5) { ["current_field"]=> int(0) ["field_count"]=> int(6) ["lengths"]=> null ["num_rows"]=> int(2) ["type"]=> int(0) } but why never a: var_dump($r); call you mixing mysql_ functions mysqli_ functions change fetch $r = mysqli_fetch_array()

ajax - Switch rendering according to headers, application-wide -

this question case in hand. let's imagine website page displays filtered products list : if request /products?foo=bar in browser, full page wrapped in layout, layout contains header form allowing change search criterias. if change foo value baz , submit form, reloads dynamically results (with jquery $.load() , example), calling /products?foo=baz in ajax. if enter same criteria iphone app, app requests /products?foo=bar server, replies json object. all 3 calls refer same resource ("the products list", resource intended in rest resource ), need different rendering. in first case, need full html page (with layout) in second case, need partial html page (without layout) in third case, need plain json response this rendering switch can triggered headers x-requested-with (with or without layout) , accept (html/json). in phalcon, given example implemented : class productscontroller extends \phalcon\mvc\controller { public function indexact