Posts

Showing posts from January, 2014

ruby - Convert PPT into Images in Rails -

i using docsplit gem convert ppt images docsplit.extract_images(uploaded.path.to_s, :size => '550x', :format => [:jpg],:output=>"#{rails.root}/public/images") it convert take more time . can convert other way please me. im using docsplit well, , if meant application idling/loading while docsplit converting ppt files should keep in mind that: every process takes time, application "stuck" until job done. therefore, should run heavy job/tasks takes long time - in background / in delayed job if so: users won't stuck! (dont forget should let them know job "in process", won't think there error)

Passing JavaScript Codes via PHP POST -

i have 2 textareas, iframe , submit button. in same page. want that; user code html , javascript codes in first textarea. second 1 hidden pass javascript codes. after user click submit button, s/he see results in iframe. saying w3school's trying page. my submit button is: <input type="submit" value="run codes" name="submit" onclick="sendthem()"> my textarea's are: <textarea id="textareacode1" style="width:100%;height:400px" name="code22" rows="21" wrap="logical" cols="42"><?=$code;?></textarea> //the user's textarea <textarea id="textareacode" style="width:100%;height:400px" name="code" rows="21" wrap="logical" cols="42"><?=$code;?></textarea> //this hidden (style="display:none;") 1 see happens, temporary made visible. and sendthem() function is:

java - classCastException please help me with real concept -

when object of subclass assigned variable of super class,why members accessible defined superclass class { int i=10; void adsip() { system.out.println(i); } } class b extends { int j=20; void bdsip() { system.out.println(i+j); } } class inherit4 { public static void main(string[] x) { a=new a(); b b=new b(); system.out.println("b.i="+b.i+"b.j="+b.j); b.adsip(); b.bdsip(); a=b; system.out.println("a.i="+a.i); a.adsip(); } } above code working fine after adding a.j , a.bdisp(); error generated,as far know & b in above code represent refrence memory allocation of objects of class & b why code not able access a.j , a.bdsip(); in above code. why members accessible defined superclass because, @ runtime, superclass reference may pointing superclass instance or instance of class in subclass hierarchy. sup

Spring batch with task executor does not run in parallel -

i have spring batch config follows: <beans> <bean id="taskexecutor" class="org.springframework.scheduling.concurrent.threadpooltaskexecutor"> <property name="corepoolsize" value="25"/> </bean> <batch:job id="springjobbatch1"> <batch:step id="step1" > <batch:tasklet task-executor="taskexecutor"> <batch:chunk reader="reader1" writer="writer1" commit-interval="1000" /> </batch:tasklet> </batch:step> <batch:listeners> <batch:listener ref="listener1"/> </batch:listeners> </batch:job> <bean id="reader1" class="org.springframework.batch.item.database.jdbcpagingitemreader" scope="step"> <property name="datasource" ref="testd

unable to resolve MongoDB error on Windows 8 -

Image
there quite many threads asking issue, don't see working solution this. i new mongodb, ive basiclly created data,log,mongodb folders , config file while trying run db using 'mongo' command following error: hope me, problem? okay have solved matter in following way: i have deleted entire mongodb folder. created new folder on again , put mongodb inside folder hirarchy now mongodb (root) bin folder data\db opened 2 command lines, 1 first used 'mongod' command (to start server) on second used 'mongo' command (to open connection) thats it

postgresql - How to use PGPASSFILE environment variable? -

i using areca backup program , wrote script in backup postgre database. want password via pgpass.conf file can't give it's path script. how can use pgpassfile ? script (; separator) : -u;postgres;-w;-f;custom;-b;-f;d:\satraautobackup\daily\saturday\postgresql\geomolkbackup;geomolkportal2 you can setting environement variable pgpassfile path of pgpass.conf , removing -w parameter. ps: make sure set pgpass.conf in secure place , locking using ntfs permission exemple. a use case here on wiki page

silverlight - Bind combobox to collection in viewmodel -

i have combo box inside datagrid. datagrid bound item source. want fill combo box collection apart parent collection not working. <data:datagrid x:name="dgtransferstockroomgldetails" autogeneratecolumns="false" columnheaderstyle="{staticresource datagridcolumnheaderstyle}" verticalscrollbarvisibility="visible" itemssource="{binding stockroomtransferdetails, mode=twoway}" canuserresizecolumns="false" verticalalignment="top" rowbackground="white" alternatingrowbackground="white" gridlinesvisibility="all" height="400"> <data:datagrid.columns> <data:datagridtemplatecolumn header="from stockroom" width="200" canuserreorder="true" canusersort="true" isreadonly="false"> <data:d

java - Map a Stream<T> to a Map<T, Long> that is counting? -

i have stream<t> , possible generate map<t, long> increases count 1 every element? i'd if reverse t, long long, t , before storing in map , example input/output: example contents of stream<string> : kgj def dgh wanted output first question: (kgj, 1) (def, 2) (dgh, 3) wanted output in end: (1, kgj) (2, def) (3, dgh) what have far, stream<vertexdata> : primitives.stream() .flatmap(primitive -> primitive.getvertexdata().stream()) .distinct() .collect(collectors.groupingby(i -> i, collectors.counting())) .foreach((k, v) -> system.out.println("k = " + k + " / v = " + v)); this turns stream<primitive> stream<vertexdata> distinct elements, , map<vertexdata, long> counts occurences , not want, want keep on counting @ every element passes . is there way ask? what can write own collector counting on elements encountered. following

web services - Failover strategies for stateful servers -

in our project, have stateful server. server runs rule engine (drools) , exposes functionality using rest service. monitoring system , critical have uptime or more less 100%. therefore need strategies shut down server maintainance , have strategies able continue monitoring of agent when 1 server offline. the first might put message queue or service bus in front of drools servers keep messages have not been processed , have mechanisms backup state of server database or storage. makes possible shut down server few minutes deploy new version. question is, when 1 server goes offline unexpectedly. there failover strategies stateful servers, experience? , advice welcome. there's no 'correct' way can think of. rather depends on things like: sensitivity changes on time windows. how application needs brought up. impact if events missed. impact if events monitoring not second. how application raises events outside world. some ideas enabling fail-over: sta

json - jQuery Datatables: display empty table message -

i use jquery datatables display data. works perfect in case server provides no data, plugin gives following warning: "datatables warning (table id = 'notes'): datatables warning: json data server not parsed. caused json formatting error." why not display empty table message. have response server display message "there no entrys ..." thank you i found solution problem the server-response have empty object looks this: {"data":[]} u have set property-name (is case "data") in datatables init-code like: var otable_notes = $("#notes").datatable({ ... "sajaxdataprop": "data", ... }); then, if "data" empty shows "semptytable" - message ... you should return json server appropriate format, example: { "secho": 1, "itotalrecords": 0, "itotaldisplayrecords": 0, "aadata":[ ] }

What tool chain should I use to build a vagrant base box automatically? -

are there tools can use automatically build vagrant base boxes on remote linux server. it'll better if extendable , version control friendly. thanks. first question on so. try out veewee: https://github.com/jedi4ever/veewee i'm not sure "extendable" mean. veewee should job. supports debian preseed file , other configurations can checked version control.

Android : Upgrading user database using SQLiteAssetHelper -

i cant seem understand how upgrade database after reading docs @ https://github.com/jgilfelt/android-sqlite-asset-helper i want keep users data in 1 table only. don't need alter tables. upgrade pretty adding new rows in table. so flow (i'm guessing) : onupgrade : 1) arraylist of user defined data table 1 2) update database 3) put user data table 1 am thinking wrong? tips appreciated. i misunderstood point of update script. when app updated not install new database. keeps old 1 , runs update script bring old 1 speed. so if dont need change user data not lost. run sql in script. if need alter user data table can use temporary table change. eg : -- add fullnames column employees alter table "employees" rename 'employees_me_tmp'; create table "employees" ( "employeeid" int not null, "lastname" varchar(20) not null, "firstname" varchar(10) not null, "fullname&q

Running selenium standalone jar file automatically through code? -

while running scripts in remote machine need run selenium stand alone server jar file in remote machine manually. there way integrate code in script jar file run automatically in remote machine? if have done scenario can share code how this? thanks, sudhansu powershell may perfect solution issue. follow link configure powershell in machine remote machine. http://www.howtogeek.com/117192/how-to-run-powershell-commands-on-remote-computers/ after this, add script run jar file on remote machine. java can do- process proc = runtime.getruntime().exec("cmd /c start powershell.exe invoke-command -computername "remote-computer-name" -scriptblock { java -jar \path\to\selenium-standalone.jar } -credential username-of-remote"); it prompt password of remote machine. give , jar file run on remote machine. hope you.

Formula to reflect changes made in "Sheet B, Sheet C, Sheet D on "SheetA" Excel 2013 -

i have spreadsheet containing sheets "main navigation", "drop down", "drop down sub menu" , main sheet "all pages". i want able see changes made in first 3 sheets mentioned on main sheet "all pages". have system using asses pages of website @ in terms of development. this consistent feature on of sheets. question is.. how reflect change in "main navigation" or others on "all pages" sheet? sheet "all pages" has described pages of site listed. other sheets have specific pages come under description. there no overlap of cells, have been split. an example of looking if cell d2 in "main navigation" has "x" inside, cell d2 on sheet pages should have "x" inside, or if cell d6 in "drop down" has "x" inside cell relevant in sheet "all pages" should have "x"! sorry if has confused anyone! thank in advance!!! if don't want

console - How to call CMD to create GnuPG-Keypair from Java -

i'm trying execute gpg-command in java create new keypair, i'm not getting answer console. code works if try execute gpg-command version gpg --version or retrieve keylist gpg --list-key . i'm using code stackoverflow-question : public void getkeylist(){ try { process gpgprocess = runtime.getruntime().exec("gpg --gen-key"); bufferedreader gpgoutput = new bufferedreader(new inputstreamreader(gpgprocess.getinputstream())); bufferedwriter gpginput = new bufferedwriter(new outputstreamwriter(gpgprocess.getoutputstream())); bufferedreader gpgerroroutput = new bufferedreader(new inputstreamreader(gpgprocess.geterrorstream())); boolean executing = true; while(executing){ try { int exitvalue = gpgprocess.exitvalue(); if (gpgerroroutput.ready()){ string error = getstreamtext(gpgerroroutput); system.err.println(error);

internet explorer - While JAWS is running, Ctrl+f of browser does not work -

i getting issue while using global shortcuts in internet explorer. when pressed ctrl + f in browser, should open browser’s find, instead of opens jaws find dialog. how can disable jaws 'find' dialog on press of ctrl + f ? if absolutely need (i don't know for, though), can press insert+3 pass keystroke through application 1 time. if need disable jaws find permanently: while in internet explorer, press insert+8 go jaws keyboard manager. you'll land in list of applications. press tab go list of scripts. locate iefind script name ctrl+f. press del remove keystroke. confirm removal, save changes , exit keyboard manager.

mysql - ExpressJS Timestamp Timezone -

i have 2 applications running on same machine, inserting same database. the other in php, set timezone. not machine time. the nodejs express application inserting database, inserting current time of machine, want change php application. but how do express? note: using bookshelfjs orm. you can specify timezone in environment: process.env.tz="est"

php - Stric Standard error with WordPress nav walker function -

the themeforest support tell me have 2 errors in wordpress theme: this , this . this wp_nav_menu walker function: class description_walker extends walker_nav_menu { function start_el(&$output, $item, $depth, $args ) { global $wp_query; $indent = ( $depth ) ? str_repeat( "\t", $depth ) : ''; $class_names = $value = ''; $classes = empty( $item->classes ) ? array() : (array) $item->classes; $class_names = join( ' ', apply_filters( 'nav_menu_css_class', array_filter( $classes ), $item ) ); $class_names = ' class="'. esc_attr( $class_names ) . '"'; $output .= $indent . '<li id="menu-item-'. $item->id . '"' . $value . $class_names .'>'; $attributes = ! empty( $item->attr_title ) ? ' title="' . esc_attr( $item->attr_title ) .'"' : ''; $attributes .= !

menu click not working using selenium webdriver through java -

my code below, having problems 'production plan', need able click production plan link doesn't work. list<webelement> ddopts = driver.findelements(by.xpath("html/body/div[4]")); arraylist<string> links = new arraylist<string>(); for(webelement : ddopts) { //system.out.println(we.gettext()); links.add(we.gettext()); system.out.println(links); if(we.gettext().contains("production plan")) { we.sendkeys("production plan"); we.click(); } your webelements in ddopts list aren't anchor tags divs. don't know how page look, seems might thought xpath. like: list<webelement> ddopts = driver.findelements(by.xpath("html/body/div/a[4]")); or list<webelement> ddopts = driver.findelements(by.xpath("html/body/div[4]/a")); or maybe if select option, use select object select myselect = new select(driver.findelements(by.xpath("h

osx - How to use a local domain socket in Objective-C -

objective-c makes easy use network sockets streams doing this: // setup comms server, assumed running on local host nshost* host = [nshost hostwithaddress:@"127.0.0.1"]; nsinputstream *istream; nsoutputstream *ostream; [nsstream getstreamstohost:host port:_port inputstream: &istream outputstream: &ostream]; however, possible create , or connect local domain socket way, or objective-c provide other classes this? if can still use nsstream , getstreamstohost, how specify file , put port number? my research on this, far, shows many examples working tcp/ip or udp, not local domain sockets. you can’t use -getstreamstohost:port:inputstream:outputstream: unix domain socket, no. can, however, create own nsinputstream , nsoutputstream instances; easiest way take advantage of toll-free bridging between cf(read|write)stream , ns(input|output)stream ; instance: struct sockaddr_un sun; sun.sun_family = af_unix; strcpy (sun.sun_path, "/path/to/my

java - What is the time complexity of Arrays.parallelSetAll()? -

i read : everything java 8 that, java 8 adds arrays.parallelsetall() int[] array = new int[8]; atomicinteger i= new atomicinteger(); arrays.parallelsetall(array, operand -> i.incrementandget()); [edited] o(1) or constant time complexity on same machine same no.of elements in array ? sort of performance improvement indicated method name? to start off, can never o(1), more clarification following: i using n = array.length , in case 8 , not matter big number. now observe do: for (int = 0; < n; i++) { array[i] = i.incrementandget(); } this java 8 easier: arrays.setall(array, v -> i.incrementandget()); observe both take o(n) time. now take account execute code parallel, there no guarantees how executes it, not know number of parallellizations under hood, if @ such low number. therefore still takes o(n) time, because cannot prove parallellize on n threads. edit , extra, have observed seem think parallellizing action means o(k) converge o(1),

performance - Best solution to host a crawler? -

i have crawler crawl few different domains new posts/content. total amount of content hundred of thousands of pages, , there lot of new content added each day. able crawl through content, need crawler crawling 24/7. currently host crawler script on same server site crawler adding content to, , i'm able run cronjob run script during nighttime, because when do, website stops working because load of script. in other words, pretty crappy solution. so wonder best option kind of solution? is possible keep running crawler same host, somehow balancing load script doesnt kill website? what kind of host/server looking host crawler? there other specifications need normal web host? the crawler saves images crawls. if host crawler on secondary server, how save images on server of site? guess dont want chmod 777 on uploads-folder , allow put files on server. i decided choose amazon web services host crawler both have sqs queues auto scalable instances. have s3 can store im

javascript - How can I add a background circle to a sunburst plot? -

Image
how add background circle sunburst plot in d3? i'm using standard zoomable sunburst example: i want full circle of specified color, highlight 'jaggy-ness' of particular display. all need append circle svg first thing after creating it: svg.append("circle").attr("r", radius).style("fill", "pink"); complete example here .

database - Can I trust MariaDB Galera cluster unique key -

consider following table structure in mariadb galera cluster: create table test ( `name` varchar(100) not null, `master` tinyint(1) default null, primary key (`name`), unique key `master` (`master`) ) engine=innodb; if running on cluster several nodes, , in parallell do: insert test (name, master) values('node1', 1); and on node insert test (name, master) values('node2', 1); can trust 1 query not replace other? if both queries ran @ same time, 1 of them still return error? if query not return error, can trust no other insert can replace row name? the unique constraint enforced. galera uses optimistic locking , i'm not sure if query gets cluster second return normal duplicate entry error or different error transaction conflict 1 inserted.

sql - Get id of max value in group -

i have table , gather id of items each group max value on column have problem. select group_id, max(time) mytable group group_id this way correct rows need id: select id,group_id,max(time) mytable group id,group_id this way got rows. how achieve id of max value row time each group? sample data id = 1, group_id = 1, time = 2014.01.03 id = 2, group_id = 1, time = 2014.01.04 id = 3, group_id = 2, time = 2014.01.04 id = 4, group_id = 2, time = 2014.01.02 id = 5, group_id = 3, time = 2014.01.01 and should id: 2,3,5 thanks! use working query sub-query, this: select `id` `mytable` (`group_id`, `time`) in ( select `group_id`, max(`time`) `time` `mytable` group `group_id` )

logging - Make rsyslog ignore missing log file -

i rsyslog print exact logs 2 different files. 1 /var/log/messages done default rhel rule: *.info;mail.none;authpriv.none;cron.none /var/log/messages and second $hostname_messages.log stored on shared mountpoint between 2 nodes of veritas cluster storage cluster. done by: $template percmdnode,"/foo/bar/system/%hostname%_messages.log" *.info;mail.none;authpriv.none;cron.none -?percmdnode all working fine untill stop cluster service , shared mount point become unavailable rsyslog. in such situation rsyslog exits upon signal 15 , stops logging not shared log file (which pretty obvious) log files. my question if make rsyslog ignore missing log file , carry on logging when file comes online? you may able redirect when shared logfile "suspended" http://www.rsyslog.com/action-execonlywhenpreviousissuspended-preciseness/ $template percmdnode,"/foo/bar/system/%hostname%_messages.log" *.info;mail.none;authpriv.n

xml - How to add attribute on element level in xsd -

i want genearte kind of xml using xsd <unassignedsecurityroleusers> <username errorcode= "1" errormessage="">?</username> <username errorcode= "1" errormessage="">?</username> .... .... </unassignedsecurityroleusers> i tried first <xsd:element name="unassignedsecurityroleusers" type="unassignedsecurityroleusers"/> <xsd:complextype name="unassignedsecurityroleusers"> <xsd:sequence> <xsd:element name="unassignedusers" type="unassignedusers" minoccurs="1" maxoccurs="unbounded" /> </xsd:sequence> </xsd:complextype> <xsd:element name="unassignedusers" type="unassignedusers"/> <xsd:complextype name="unassignedusers"> <xsd:sequence> <xsd:element name="username" type="xsd:string"

Conversion a web-app to mobile-apps -

there several such services on internet can cinvert given web-page mobile application (android, wp, bb, ios). those services looks attactive reducing development time point of view in same time looks suspicious me. does have experience converting web-application mobile? result consistent? there frameworks can build mobile applications html, css & javascript. famous phonegap , there others ratchet. can provide set of javascript apis connect device’s native functions such camera, compass, contacts, , geolocation. example phonegap can build applications ios, android, blackberry, webos, symbian , windows mobile. mentioned in wikipedia: it enables software programmers build applications mobile devices using javascript, html5, , css3, instead of relying on platform-specific apis in ios, windows phone, or android. enables wrapping of html, css , javascript code depending upon platform of device. you can here list of frameworks : http://www.hongkiat.com/blog/mobile

asp.net mvc - A dependency injection Exception with Postal and Unity -

in asp.net web mvc controller (v5.1), wanted switch using iemailservice on postal (v0.9.1), did following on controller: public class homecontroller : controller { private readonly iemailservice _emailservice; public homecontroller(iemailservice emailservice) { if (emailservice == null) throw new argumentnullexception("emailservice"); _emailservice = emailservice; } } my unity (v3.0) container setup: container.registertype<iemailservice, emailservice>(); container.registertype<iemailviewrenderer, emailviewrenderer>(); container.registertype<iemailparser, emailparser>(); but exception, can't make sense out of. unity trying tell me? the type ilist`1 not have accessible constructor. stack trace: [invalidoperationexception: type ilist`1 not have accessible constructor.] microsoft.practices.objectbuilder2.dynamicmethodconstructorstrategy.throwfornullexistingobject(ibuildercontext context) +239 lambda_method(cl

Embed Vaadin 7 Application on another domain/site (Cross-Site) -

i'm evaluating vaadin internal web application , 1 requirement have embed web application (hosted on mydomain:8080) site (hosted on mydomain:80). for vaadin 6, xs add-on let me ease vaadin 7 way can cross-site embedding iframe (which not option me). has been able embed vaadin 7 web application on domain/port? if how? note; - control web servers hosting mydomain:8080 (tomcat 7.0.51) , mydomain:80 (apache httpd 2.2) can change config if helps. - tried cors on tomcat side. didn't help. - tried using vaadin-xs vaadin 7. didn't work. you have 2 things: 1.- enable cors in server side, either using filter or customising vaadin servlet. 2.- change bootstrap script set these parameters: "serviceurl": "http://mydomain:8080", "browserdetailsurl": "http://mydomain:8080",

Find Last Row in DataSet Excel VBA -

i'm trying data import find last row of dataset , paste row of data sql server blank row @ end of data set. this code have, when running code import data on last row, not next blank row after last row sub runimport() on error goto err: cnnstr = "provider=sqloledb; " & _ "data source=myserver; " & _ "initial catalog=mydb;" & _ "user id=user;" & _ "password=pwd;" & _ "trusted_connection=no" set cnn = new adodb.connection application.screenupdating = false cnn.open cnnstr set rs = new adodb.recordset sqry = "select * mytable" rs.cursorlocation = aduseclient rs.open sqry, cnn, adopendynamic, adlockoptimistic, adcmdtext application.screenupdating = false sheet1.range("b5").select range(selection, selection.end(xldown)).select activecell.offset(1, 0).copyfromrecordset rs rs.close set rs = nothing cnn.close set cnn = nothin

asp.net mvc - Update operation Issue in NopCommerce? -

i using nopcommerce. have created new table named "productviewdetails". have tried insert/update record in table. when tried insert new record in table,new record inserted successfully. when tried update operation ,method "updatedata" executed record did not update. code : public void incremementviews(int productid) { productviewdetails productdetails = new productviewdetails(); productdetails.id = 5; productdetails.productid = 1; productdetails.numberofviews = 10; updatedata(productdetails); } public void updatedata(productviewdetails productdetails) { _productviewdetails.update(productdetails); } update method code : public partial class efrepository<t> : irepository<t> t : baseentity { private readonly idbcontext _context; private idbset<t> _entities; public void update(t entity) { try { if (entity == null)

optimizing a table's performance using temporary table in sql server 2008 r2 -

good day, i'm quite newbie in optimizing database queries...actually it's first time... i've done research , found out using temporary tables me improve queries performance.. aside other solutions using index though lot of blogs haven't yet find detailed tutorial it... hoping if kindly help. given sample table... table schemas:: studentinfo: studentid lastname firstname yearcode sectioncode teacherinfo: sectioncode teacherid teachername gradeinfo: studentid averagegrade cashierrecord: studentid enrolleddate modeofpayment amountdue query have tried... select s.studentid, s.firstname, s.lastname, t.teacher, g.averagegrade, c.enrolleddate studentinfo s left join teacherinfo t on s.studentid= t.studentid left join gradeinfo g on s.studentid= g.studentid left join graderecords c on s.studentid= c.studentid if given quer

css - Twitter Bootstrap Stacking Hierarchy using jQuery -

this layout in desktop | content | | sidebar | and wanted acheive in responsive mobile | sidebar | | content | i using hubspot create website , dont have prevelidge write pull-right , pull-left classes on span, can guyz let me know in jquery or javascript not master in javascript you should able jquery .before()... https://api.jquery.com/before/ $(window).on('resize', function () { if ($(window).width() < 768) { $( "#content" ).before( $( "#sidebar" ) ); } }); $(window).trigger('resize'); you .prependto()... https://api.jquery.com/prependto/ $(window).on('resize', function () { if ($(window).width() < 768) { $('.blog-sidebar').prependto( $('.blog-sidebar').parent() ); } else { $('.blog-sidebar').appendto( $('.blog-sidebar').parent() ); } }); $(window).trigger('resize'); in situation, you'd better usin

php - How to check if text has 6 numbers -

i have jobs site , , visitors able add jobs on front end of , need check job details see if has phone number within or not using php code example of 6 digit numbers 123456 , 533434 , no other format, if there 6 digit numbers error message show make visitors remove details section i need : if (strpos($_post[details],'######') !== false) { echo 'remove phone number job details'; } if (preg_match('/[1-9]\d{5}/',$_post[details])) { echo 'remove phone number job details'; }

configuration - Set TCAdefaults in TYPO3 Page TS config for a specific page type only -

i can disable fields in page ts config depending on selected content type. example: tceform.tt_content.header.types.gridelements_pi1.disabled = 1 when try set default value specific content type not work: tcadefaults.tt_content.header_layout.types.gridelements_pi1 = 100 does know how achive, settings default value specific page type? it seems not possible set default value specific content element. pagets reference doesn't mention such option. it possible manipulate options array extent: see here possible actions: http://docs.typo3.org/typo3/tsconfigreference/pagetsconfig/tceform/index.html#pagetceformconfobj you experiment option itemsprocfunc have no idea if it's useful.

symfony - Operation of whether there is form field or there is no form field in Symfony2 -

formtype class articletype extends abstracttype { public function buildform(formbuilderinterface $builder, array $options) { $builder->add('name', 'text'); $builder->add('status', 'choice', array( 'choices' => array( 'a' => 'a', 'b' => 'b', 'c' => 'c', ), 'required' => true )); // ... } // ... } view : no problem. {{ form_widget(form.status) }} {{ form_widget(form.name) }} <input type="submit" value="submit" /> view : problem case. {% if is_granted("is_authenticated_remembered") %} {{ form_widget(form.status) }} {% endif %} {{ form_widget(form.name) }} <input type="submit" value="submit" /> it has register blank status value if not login. intention no change

wso2 - How to handle Error code 50000 in wso2esb -

i using wso2esb4.7.0 , wso2dss3.0.0 . getting error times not every time if tried multiple user successful 1 or 2 user other returning 50000 error code. mentioned property in every sequence <property name="force_error_on_soap_fault" value="true"/> so user unable process there data continue sly why getting error behind this? error coming this [2014-03-06 18:10:01,473] warn - endpointcontext endpoint : endpoint_5c5f8a43ba64941b19b81abcebf92924c90a25e29775053c marked suspended failed [2014-03-06 18:10:01,473] warn - endpointcontext suspending endpoint : endpoint_5c5f8a43ba64941b19b81abcebf92924c90a25e29775053c - current suspend duration : 30000ms - next retry after : thu mar 06 18:10:31 ist 2014 [2014-03-06 18:10:01,475] info - logmediator to: http://www.w3.org/2005/08/addressing/anonymous, wsaction: , soapaction: , messageid: urn:uuid:60fea14f-daa6-413e-82b8-8dbb640492c6, direction: response, message = executing default 'fault' sequence, e

iOS UICollectionView: How to become notified once animation stops if cell is selected through code? -

uicollectionview, being descendent of uiscrollview, sends uiscrollview delegate scrollviewdidenddecelerating which convenient notified when scrolling motion, initiated swipe user interaction, stops. however, if selection of cell invoked through code call to selectitematindexpath then scrollviewdidenddecelerating not called. how can notified selection animation having stopped if select cell through code?

html ajax / jquery get JSON data from remote server using JSONP/JSON -

i use jqchart plugin display charts on mobile devices, html file resides on mobile device. the server takes in 2 parameters this http://somedomain:15025/service1.svc/storewise_sales_qty_asp/{param1},{param2} and displays json response. here part of html code <script lang="javascript" type="text/javascript"> $(document).ready(function () { $('#jqchart').jqchart({ title: { text: 'binding remote data' }, animation: { duration: 1 }, shadows: { enabled: true }, datasource: { ajax: { type: "post", url: "http://somedomain:15025/service1.svc/storewise_sales_qty_asp/26670,26770", contenttype:"application/json", datatype: 'jsonp', crossdomain:true,

c# - Get number inside of a string and do a loop -

i want number of string, , separate string , number, , then, loop , call method number of times string says. string has have structure: "abj3" (only 1 number accepted , 3 characters before it) this code, repeat hundred of times, don't know why int veces = 0; (int = 0; < m.length; i++) { if (char.isdigit(m[i])) veces = convert.toint32(m[i]); } if (m.length == 4) { (int = 0; <= veces; i++) { m = m.substring(0, 3); operaciones(m, u, t); thread.sleep(100); } } operaciones(m,u,t); if (u.length >= 14) { u = u.substring(0, 15); } some please? you have convert m[i] tostring() right sending char value convert.toint32 , higher value (9 = 57 example) char t = '9

c# - Threadsafe buffer wrapping Stream -

i'm using sslstream on top of tcpclient . unfortunately `sslstream`` not support writing or reading multiple threads @ same time. that's why i've wrote own wrapper around it: private concurrentqueue<byte> sendqueue; private volatile bool osending; private readonly object writelock; public async void write(byte[] buffer, int offset, int count) { if (osending) { lock (writelock) { foreach (var b in buffer) { sendqueue.enqueue(b); } } } else { osending = true; await stream.writeasync(buffer, offset, count); osending = false; lock (writelock) { if (sendqueue.count > 0) { write(sendqueue.toarray(), 0, sendqueue.count); sendqueue = new concurrentqueue<byte>(); } } } } the intention behind following: if stream free, write stream. if stream busy, write buffer. if stream returns sending, check if there data in queue , send recursively. i

sharepoint - How do I use HideCustomAction to remove the "Site Contents" link from Quick Launch in SP2013? -

i've created feature should (according numerous articles) remove "site contents" link quick launch. one problem: doesn't happen. here's in elements.xml: <?xml version="1.0" encoding="utf-8"?> <elements xmlns="http://schemas.microsoft.com/sharepoint/"> <hidecustomaction id="hidesitecontents" groupid="siteactions" hideactionid="menuitem_viewallsitecontents" location="microsoft.sharepoint.standardmenu"> </hidecustomaction> <customaction id="siteactionstoolbar" groupid="siteactions" location="microsoft.sharepoint.standardmenu" sequence="1000" title="added test button"> <urlaction url="javascript:alert('button added , working');" /> </customaction> </elements> the test button added site settings menu (showing file read , working) can't remo

java - to pass filepath in url -

i want hit url , pass filepath in : here sample url: localhost:8080/coreengine/addrecording/obd_msisdn_pankaj/9958557426/9999620647/{d:\islamic\first} last 1 filepath. i receiving @ controller : @requestmapping(value="/addrecording/{tablename}/{aparty}/{bparty}/{filename}") public @responsebody string addrecord(@pathvariable("tablename") string tablename, @pathvariable("aparty") string aparty, @pathvariable("bparty") string bparty , @pathvariable("filename") string filename) { return "done"; } it works url : http://127.0.0.1:8080/coreengine/addrecording/thispank/356783956/67456/gdshhfdsg but if hit url : http://127.0.0.1:8080/coreengine/addrecording/thispank/356783956/67456/e:\out_of_ofc\songs\spirit.mp3 it not work filepath , gives following error @ browser : it gives error : vedio playback aborted due network error if hit url 127.0.0.1:8080/coreengine/addrecording/obd_msisdn_pankaj

c# - How to perform a web service call in Windows Phone -

i developping in windows phone 7.1, have web services calls json string, use following code (that class): public void getregions() { if (!_wc.isbusy) { _wc.downloadstringasync(new uri("http://lapiazzashopping.it/test/mobile/getregions.php")); _wc.downloadstringcompleted += new downloadstringcompletedeventhandler(wc_downloadstringcompleted_regions); } } private void wc_downloadstringcompleted_regions(object sender, downloadstringcompletedeventargs e) { debug.writeline("web service says: " + e.result); regions = jsonconvert.deserializeobject<ilist<regions>>(e.result); } now after call want change page show result json. if start call button , button same page change compiler changes page call not yet completed because cannot manage methode "wc_downloadstringcompleted_regions" methode calle authomatically comp

php - Class Not Exist when loading entity Symfony 2 -

Image
i create bundle , entity inside bundle. when try entity or repository in controller using entity manager give error class not exist. i try debug using php app/console doctrine:mapping:info it prompts every thing correct. output found 4 mapped entities: [ok] bitcoin\mybundle\entity\productcategory [ok] bitcoin\mybundle\entity\adminuser [ok] bitcoin\mybundle\entity\product [ok] bitcoin\mybundle\entity\user my controller code follows <?php namespace bitcoin\mybundle\controller; use symfony\component\httpfoundation\request; use symfony\component\security\core\securitycontext; use symfony\bundle\frameworkbundle\controller\controller; use sensio\bundle\frameworkextrabundle\configuration\route; use sensio\bundle\frameworkextrabundle\configuration\template; use sensio\bundle\frameworkextrabundle\configuration\security; use bitcoin\adminbundle\form\login; use bitcoin\adminbundle\form\loginvalidate; class logincontroller extends controller { public function login

jenkins - Maven Release Plugin throws svn : '' is not a working copy -

i have mavenized project , when try release, below error: [error] failed execute goal org.apache.maven.plugins:maven-release-plugin:2.4 .2:prepare (default-cli) on project simpleweb: unable check local modific ations [error] provider message: [error] svn status failed. [error] command output: [error] svn: '' not working copy i have below questions: how scm configuration given in pom file if communication scm should happen through https, how can configure certificate on client side the release should happen branch or trunk my scm configuration follows: <scm> <connection>scm:svn:https://domain.com/svn/new_fw/ci_poc/simpleweb/trunk</connection> <developerconnection>scm:svn:https://domain.com/svn/new_fw/ci_poc/simpleweb/trunk</developerconnection> <url>https://domain.com/svn/new_fw/ci_poc/simpleweb/trunk</url> </scm> my maven release plugin configuration follows: <plugin> <groupid>or

amazon web services - Unable to start Rails server on EC2 boot nginx+passenger. (Linux CentOs) -

i have set nginx+ passenger on ec2 box (amazon linux) i need start rails server each time ec2 instance boots ( boot mean, stop , start ) i can start sever going app directory , doing passenger start -e p -p 80 but i'm not able start every time boots. i tried put in /etc/rc.local looks like: cd /home/ec2-user/myapp rvmsudo passenger start -e p -p 80 but doesn't work. tried writing bash script , putting in /etc/init.d/ . did chmod +x on it. still doesn't work. if run script manually bash start_script.sh . works fine. also if put mkdir tempfolder works. why isn't rails server not starting? nginx.conf server { listen 80; server_name localhost; #charset koi8-r; #access_log logs/host.access.log main; location / { root /home/ec2-user/myapp/public; passenger_enabled on; } #error_page 404 /404.html; # redirect server error

c# - WCF Service Discovery has stopped working via WCF Test Client and via Visual Studio -

having spent around 3 days , losing of hair i'm calling out the wonderful stackoverflow community! we've got bunch of wcf web services on dedicated windows server 2008 r2 running iis7.5. xamlx, svc, asmx. we've been running these services fair few years no problem. of sudden we're finding of our apps (web / console etc) failing call them. if explicitly reference wsdl (appending ?wsdl call example http://server:8000/app/app.svc?wsdl ) we're sorted , works again. problem doesn't explain happened on server caused of our services stop working. when try call services using wcftestclient error: cannot obtain metadata http://server:8081/app/app.svc if windows (r) communication foundation service have access, please check have enabled metadata publishing @ specified address. enabling metadata publishing, please refer msdn documentation @ http://go.microsoft.com/fwlink/?linkid=65455.ws-metadata exchange error uri: http://server:8081/app/app.svc