Posts

php - smarty not display text with double quotes -

i using smarty template. fetching 1 issue rendering. have 1 variable value of variable this text" data but when print value in tpl file prints this text except this text" data why happening? please in advance in smarty can escape data using {$variable|escape:'format'} in case format of html should trick {$variable|escape:html} ref: http://smarty.net/docsv2/en/language.modifier.escape.tpl

How to get ProcessStartInfo with arguments from a java process By using C#? -

i trying java process object using c#. thing have several java processes running on computer. following way chose processes: process[] processes = process.getprocessesbyname("java"); foreach(process proc in processes){ //i need filter here correct process. } the java process controlled c# program below: processstartinfo startinfo = new processstartinfo(); startinfo.filename = javahome + "\\bin\\java.exe"; startinfo.arguments = "-jar example.jar port=88888"; startinfo.workingdirectory = "\\testfolder"; startinfo.useshellexecute = false; startinfo.createnowindow = true; process proc = new process(); proc.startinfo = startinfo; proc.start(); what want go through array of process check 1 has same arguments process object started in program. problem when did this: console.writeline(proc.startinfo.arguments); i found there nothing in it, know process started in program. confused me lot. does know issue? you ca...

java - session replication and clustering in tomcat? -

i have configured httpserver2.2 achieve load balancing , clustering for java application. but load balancing works fine , clustering(session replication) not works . my worker.properties in httpserver , workers.java_home=c:/program files/java/jdk1.6.0_25 #worker.list=worker1,worker2 worker.list=balancer worker.worker1.port=8009 worker.worker1.host=localhost worker.worker1.type=ajp13 worker.worker1.lbfactor=1 worker.worker2.port=8019 worker.worker2.host=192.168.100.84 worker.worker2.type=ajp13 worker.worker2.lbfactor=1 worker.balancer.type=lb worker.balancer.balance_workers=worker1,worker2 worker.balancer.method=b # specifies whether requests session id's # should routed same #tomcat worker. worker.balancer.sticky_session =true and httpd.conf be, <ifmodule jk_module> jkworkersfile conf/workers.properties jklogfile logs/mod_jk.log jkloglevel info jkmount /customerchat_v1.02.00 balancer jkmount /customerchat_v1.02.00/* balance </ifmodule> in ...

BizTalk ESB 2.1 - Right message, wrong message type -

i have request/response itinerary made of orchestration extenders. works fine including message sent web service. in receive port there outbound map never gets fired. have tracked down fact message, although correct, has wrong message type context. infact has context of message few steps in itinerary. why , how can solve issue? btw have tried changing context in pipeline component followed esb transform component no avail. not particularly satisfactory solution in end took maps out of receive port. colleague had suggested best practice have layer of abstraction in fact relevant 'classic' biztalk. the issue in particular case appears have 2 identical schemas different namespaces. reason being if external schema changed map internal in port without changing else. again useful classic biztalk negates changes orchestration not relevant esb.

JSON File Parse Python -

[{"cat1":136803,"cat2":"1.4545","cat3":"0.0885","cat4":"112969"}, {"cat1":1564654,"cat2":"2.5448","cat3":"0.0568","cat4":"5468489"}, {"cat1":5484654,"cat2":"1.8948","cat3":"0.0478","cat4":"898489"}] i have json structure looks 1 above. my code: import json pprint import pprint open('file/path') data_file: data = json.load(data_file) data["cat1"] give me error list indicies must integers not, str how can parse return want, "cat1"? my goal parse out want json file , write csv file. your json structure list of dictionary. so, have write: data[0]["cat1"]

iphone - Testing class method using OCMock release 2.1.1 -

i trying check if class method getting invoked using ocmock. have gathered ocmock website , other answers on new ocmock release (2.1) adds support stubbing class methods. i trying same: detailviewcontroller: +(bool)getboolval { return yes; } test case: -(void) testclassmethod { id detailmock = [ocmockobject mockforclass:[detailviewcontroller class]]; [[[detailmock stub] andreturnvalue:ocmock_value((bool){yes})] getboolval:nil]; } the test running , succeeding succeeds if return no instead of yes getboolval method in detailviewcontroller. on keeping breakpoint on method, test execution not stop indicating method not called. how check class method then? please help. edit just looked more closely @ latest version of ocmock , think you're correct in interpreting way mock class method you're directly testing, issue you're calling wrong signature? the answer below general case (so useful when method under test calls out class method). original ...

php - Is Cron the only method to run scheduled tasks? -

is cron(or derivatives) method run scheduled programming tasks? example: charge clients' credit card @ 3 days before x send e-mail 6 hours time x execute xyz command every hour is there resource/books teach how implement these features in clean way(python, ruby(or ror), python)? my current dirty method have wrapper script in crontab running every minute check if tasks should run. don't this. prefer method can programatically implement scheduled tasks. for python can use celery for example executing command every hour this: from celery.task.schedules import crontab celery.decorators import periodic_task @periodic_task(run_every=crontab(hour=3)) def every_three_hour(): print("this runs every 3 hour") and execting 3 hours look: from datetime import datetime yourtask.apply_async(args=[some, args, here], eta=datetime.now()+datetime.timedelta(hours=3))