Posts

Showing posts from August, 2013

mysql - PHP Best Practice to Update one record and delete another record -

i have 2 tables ( voucher , voucherbalance ). intention first check whether if voucher exist(assuming voucher exists), it'll deleted table , update record in table. following approach im doing. $vouchercode=$_request['vouchercode']; $userid=$_request['userid']; $vouchervalue = $link->query("select vouchervalue voucher vouchercode='$vouchercode';"); $link->query("delete voucher vouchercode='$vouchercode';"); $result = $link->query("update uservoucherbalance set voucherbalance=voucherbalance+'$intvouchervalue' userid='$userid';"); i ask there better approaches ? best practice ?

wpf - Process.Start throwing Class not registered exception in C# -

i have created application in wpf working fine on win7 on win8 shows below exception i'm trying open directory in explorer passing directory path. system.componentmodel.win32exception (0x80004005): class not registered @ system.diagnostics.process.startwithshellexecuteex(processstartinfo startinfo) @ system.diagnostics.process.start() @ system.diagnostics.process.start(processstartinfo startinfo) @ myapp.runfile() i'm getting below error myapp.exe - entry point not found the procedure entry point rangemapfree not located in dynamic link library c:\windows\system32\wer.dll. is there way resolve above? thanks. it might missing wer.dll. i suggest go link , try install dll :) http://www.dll-files.com/dllindex/dll-files.shtml?wer

c++ - compiling log4cpp with custom toolchain -

this question has answer here: make gnu make use different compiler 5 answers i using log4cpp in our project. need support various distributions of linux, have built custom tool chain build our project. since project built custom tool chain, should build log4cpp same tool chain? i can build log4cpp using native compiler using 3 simple commands mentioned in it's web page. ./configure make make install but library not working our custom built binary. new linux, can't figure out file change compiling custom compiler. example our custom tools present in /usr/custom/g++ . can build static library of log4cpp ans use in our project? using ubuntu 14.0 compilation. please help i passed parameter first command following ./configure cxx = /usr/custom/g++ when run make command, automatically picked custom compiler , used it.

c# - Asp.net MCV4 framework issue -

i made web site using vs 2012 , mvc4, work localhost when published , put host doesn't work. iis confiurations same. gives me error lines: this error; configuration error description: error occurred during processing of configuration file required service request. please review specific error details below , modify configuration file appropriately. parser error message: 'targetframework' attribute in <compilation> element of web.config file used target version 4.0 , later of .net framework (for example, '<compilation targetframework="4.0">'). 'targetframework' attribute references version later installed version of .net framework. specify valid target version of .net framework, or install required version of .net framework. source error: line 20: </appsettings> line 21: <system.web> line 22: <compilation targetframework="4.5" /> line 23: <httpruntime targetframework="4.5...

multi tenant - Google app engine: Is it possible to allow users to add their own domain for a Multitenancy app? -

i have been researching on how let users add own domain gae application. the closest things got are: https://cloud.google.com/appengine/docs/python/multitenancy/ https://cloud.google.com/dns/getting-started running google app engine application on multiple customer domains but i'm quite confused. questions are: say app myapp.com , have user myapp.com/?name_space=user1. user1 has domain called user1.com , want forward myapp.com/?name_space=user1 user1.com. is possible use cloud dns modify cname , records let users forward myapp.com/?name_space=user1 user1.com? what options here? i've heard dnsmadeeasy possible solution, i'm not sure if it'd work. because means need api modify record of dnsmadeeasy? can give me directions, tutorials or ideas? grateful. you can add custom domain app engine through google domains. with domain registered through google domains, provide interface point domain particular app engine id using google synthetic rec...

python - Releasing references to deferred: what's the point -

this pattern mentioned in twisted tutorial standard way avoid firing same deferred twice: class a(clientfactory): ... def finished(self, result): if self.deferred not none: d, self.deferred = self.deferred, none d.callback(result) but understand, deferred won't let (i.e., raise exception if do) call same instance twice. why recreate safety mechanism repeating code everywhere? as say, second call deferred.callback raise alreadycallederror . idiomatic write code doesn't trigger exception, though. deferred-using code i've written or read tries reserve alreadycallederror indicate programming errors rather normal runtime conditions can safely ignored. so: def finished(self, result): try: self.deferred.callback(result) except alreadycallederror: pass is not preferred spelling. think because there might other reasons alreadycallederror raised don't stem finished being called more 1 , kind of error handling obscur...

salesforce - SAML Response authentication -

scenario: browser(user) requests resource service provider (sp). sp redirects (with saml request) identity provider (idp). since first login, user gives (idp) his/her valid credentials. idp redirects browser (with saml response includes saml token) sp page. application has link different application. second application needs validate user credentials same idp. user clicks on link , browser opens second application. browser contains same saml response sp. in step 5 how can authenticate user saml response , allow user logged in automatically. do need sp? not able use sp step 1 external application. appreciate help if second application in different administrative domain, should done through own saml sp starting saml request/response exchange idp. if in same domain may able pass intra-domain credential such cookie between first application , second (or rely on full saml well). never reuse same saml response because meant one-time use only.

java - What is the best format for Heapdump file to analyze? Is it hprof? -

i assigned find root cause full gc issue (garbage collector) in our production environment. occurs randomly , believe probable case memory leak present in current application. hope take memory dump our production environment (linux) , analyze using gui tools such eclipse memory analyzer. what best file format heap dump file analyzed? hprof format? going use jmap command obtain heap dump. necessary specify "format=b" option while obtaining memory dump? following sample command going instruct our support team run. (5980 sample pid). if believe in better approach please let me know. jmap -dump:format=b,file=hpdump.hprof 5980 thanks the command seems fine. yes there few other tools available analyze heap dump. please refer this

oracle - Retrieving the first value of the column to a variable in pl sql -

i'll try clear possible. i have these 3 tables customer , link & customer_link . i using following query retrieve customer_no column customer has values not available in customer_no of table customer_link : select c.customer_no customer c left join customer_link cl on c.customer_no = cl.customer_no cl.customer_no null the table customer_link has following columns: id (generated automatically using sequence) customer_no (linked customer table) link_no (linked link table) maker_id what i'm trying is, use above query customer_no customer table not added table customer_link yet (this constraint since customer_link cannot have same customer_no twice in table unique. same goes link_no well) & similar query link_no link table. then use link_no & customer_no respective results & add table customer_link (there function need call values in result). i need use loop here can update results after adding value each table table c...

Google analytics page tracking -

i have question google analytics page tracking. have website , main domain www.tdconnect.nl. want following. pages hanging under tdconnect.nl/cisco/. should separate google analytics. best way this? thank you! using default ga tag job unless want independently track cisco subdirectory. in case 2 separate tags required, , should check outthe following https://developers.google.com/analytics/devguides/collection/gajs/gatrackingsite#singlesubdirectory

grails - About bean of hasErrors -

assuming have following object in controller objcollection = [obj1, obj2, obj3] and in each obj following obj1 = [ input = value, inputa1 = valuea1, inputa2 = valuea2 ] obj2 = [ input = value, inputb2 = valueb2, inputa3 = valuea3 ] obj3 = [ input = value, inputc2 = valuec2, inputa3 = valuea3 ] and gsp looks this <div class="control-group ${haserrors(bean: objcollection.obj, field: 'input', 'error')}"> <g:textfield name='input' value='${objcollection?.obj}'> </div> <div id="subform" class="subcontainer"> <g:each var='obj' in='${objcollection}' status='a'> <div id='obj${a+1}'> <div class='subaccordion'> <div> <g:each var='objinstance' in='${obj}' status="b"> <g:render template="min...

java - No RTP or SIP DTMF with libjitsi -

i'm trying add dtmf audiomediastreamimpl (from libjitsi). can in_band method, that's not optimal because compression problems can arrive. but can't working version of rtp_dtmf or sip_info_dtmf, nothing happens. i have tried use standard method : public void senddtmf(final dtmftone dtmftone) { // same code dtmfmethod.sip_info_dtmf second test. mediastream.startsendingdtmf(dtmftone, dtmfmethod.rtp_dtmf, 100, 101, 100); try { thread.sleep(1000l); } catch (interruptedexception e) { e.printstacktrace(); } mediastream.stopsendingdtmf(dtmfmethod.rtp_dtmf); } i have tried stop rtp flux before, after, not use stopsendingdtmf nothing working. i use libjitsi version 563. if can't solution audiomediastreamimpl, create own sip_info_dtmf, have heard best method dtmf rtp version. i have found how archive objectif. the startsendingdtmf start new thread has task send dtmf. , throw exception because telephone_event not ...

java - Hibernate flush/commit collection owner not associated with session -

in our code have many many relation, relation table contains few additonal fields. for example: have trip resources trip can have multiple equipments , equipment can reused. when equipment not used anymore removed. have following objects: trip equipment (equipment contains list data, i'll call wheels) tripequipmentrelation when replacing equipment on trip first remove relation between equipment , tripequipmentrelation remove relation between trip , tripequipmentrelation remove tripequipmentrelation because equipment not used anymore remove equipment itself. add new equipment trip. add point manual flush on session because need generate id's new objects. far good. when applicationserver tries commit session following error: assertionfail e org.hibernate.assertionfailure <init> assertion failure occured (this may indicate bug in hibernate, more due unsafe use of session) org.hibernate.assertionfailure: collection owner not associated session equipm...

android - Latitude value set to 0 -

i set value mainactivity fragment, value become 0 in fragment. when got log in movetolocation(), value of latitude 0, when got log in setlocation, value of latitude correct passed value. why this? mainactivity mapfragment mapfragment = new mapfragment(); mapfragment.setlocation(111, 222, "abcaddress"); fragment public class mapfragment extends fragment { private googlemap mmap; private double mlatitude; private double mlongitude; private string maddress; @override public void oncreate(bundle savedinstancestate) { super.oncreate(savedinstancestate); try { mapsinitializer.initialize(getactivity()); } catch (googleplayservicesnotavailableexception e) { log.d("", "you must update google maps."); getactivity().finish(); } } @override public void onactivitycreated(bundle savedinstancestate) { super.onactivitycreated(savedinstancestate); ...

java - JSP Page error While inserting data -

Image
im noob programming please following code.while running code gave me nullpointer exception you never call establishconnection in dao class. result of con null. add method establishconnection in constructor of persondao : public persondao(){ establishconnection(); } and try again. furthermore read java code conventions . class name should start uppercase: persondao correct , follows camelcase code conventions.

javascript - antoniogarrote/rdfstore-js reusing blank node -

i using rdfstore in nodejs , cannot figure out how reuse blank nodes. need use blank node more once. here code: graph.add(rdf.createtriple( new rdf.api.blanknode(id); rdf.createnamednode(predicate) rdf.createblanknode() ); id taken entered blanknode "_:30" => "30" i have checked created blank node , correct (with correct id). when db has wrong one. seems using counter give him exact node. edit 1 i have checked created triple , looks want it. problem must somewhere in adding triple graph/storing triple. thanks help, michal. the reason simple: each call rdfstore.store.insert creates sparql insert statement. , each separate sparql statement has own set of unique blank nodes. that said, solution our problem collect triples add in array , add them in 1 go. var triples = []; [...] store.insert(store.rdf.creategraph(triples), graph, function(success, cnt) { if(success) console.log(cnt + ' triples added.')...

php - Access denied for user localhost -

i following tutorial( http://www.wikihow.com/create-a-secure-login-script-in-php-and-mysql ) build login system. it looks it's working fine now, on login page, there error dont quite understand means , how can affect operation. ( ! ) scream: error suppression ignored ( ! ) warning: mysqli::mysqli() [<a href='mysqli.mysqli'>mysqli.mysqli</a>]: (28000/1045): access denied user 'sec_user'@'localhost' (using password: yes) in c:\wamp\www\uncultured\login copy\includes\db_connect.php on line 3 call stack # time memory function location 1 0.0005 370336 {main}( ) ..\login.php:0 2 0.0009 373048 include_once( 'c:\wamp\www\uncultured\login copy\includes\db_connect.php' ) ..\login.php:2 3 0.0012 375688 mysqli->mysqli( ) ..\db_connect.php:3 i grateful if can point me in right direction, much! cheers have added privileges in mysql server user "sec_user" ? something like: gr...

Python large list error -

i did following program generate list of consecutive numbers. however, computations seem fail more 70.000 elements in list. tried using pycharm ide , python console. result same. i'm using python 3.4.1 32-bit version. should ? can cause ? from pylab import * = 100000 # number of elements my_array my_array = [i in range(a)] missing_number = randint(a) print('generate random number: ', missing_number) my_array.remove(missing_number) # remove random generated number my_array print('the number of elements of list is: ', len(my_array)) #length of my_array print('the sum of list :',sum(my_array)) # sum sum02 = (a *(a-1)/2) # sum of consecutive numbers print('the complete sum of consecutive numbers:',int(sum02),'\n') print('and missing number is:', int(sum02) - sum(my_array)) i reproduce result have locally on machine : c:\util\python34\python.exe "find_missing_number_2.py...

DragAndScroll Jquery Javascript -

Image
hello make drag , scroll using jquery or javascript. looking on internet examples couldn't find anything. can give me example of drag , scroll script? (i want use inside of scroll box) kind regards, artur you'd pep. very simple. put demo inside scrolling div you: here's drag-and-scroll demo: drag , scroll simple demo jquery $(function() { $('.container .pep').pep(); }); html <div class="container"> <div class="pep"></div> </div>

shell - Ksh nested substitution -

i have following configuration file: export profile_active=0 export profile_scsadp01[0]="0 84" export profile_scsadp04[0]="85 170" export profile_scsadp05[0]="171 255" export profile_scsadp01[1]="-1 -1" export profile_scsadp04[1]="85 170|0 42" export profile_scsadp05[1]="171 255|43 84" i access these variable using substitution in ksh script: i can access each variable using syntax, working: result=${ profile_scsadp01 [${profile_active}]} however need bold part variable, not fixed. i have tired syntax: temp="profile_scsadp01" result=${$temp[${profile_active}]} however bad substituion error. have tried workaround, cannot find working, ksh has typeset -n command ( see here ), think preferred solution: typeset -n tmp="profile_scsadp01" result=${tmp[${profile_active}]} you use eval ( be careful ) this: tmp="profile_scsadp01" result=$(eval echo \${$tmp[${profile...

How to create list of list by grouping on the basis of one list element using scala? -

i have following list structure- list(("localhost","esx","192.168.1.1","33.36","93.80", "vms can not added"), ("star","esx","192.168.1.2","62.61","47.20","vms can added"), ("mars","esx","192.168.1.3","27.41","47.38","vms can added), ("moon","esx","192.168.1.4","23.58","69.40", "vms can not added")) i want following output - list(("vms can added",list(("star","esx","192.168.1.2","62.61","47.20"), ("mars","esx","192.168.1.3","27.41","47.38"))), ("vms can not added",list(("localhost","esx","192.168.1.1","33.36","93.80"), ("moon","esx","192.168.1.4"...

Show Grid As Static Height In JqGrid..? -

i have grid contain 25 records, in page size property set 10 records per page , have 3 pages in final page displays 5 rows, here want show 10 rows. (first 5 records next 5 empty rows) please me.thanks in advance your question not full clear because don't posted javascript code use. typically 1 use either rownum: 10, height: "auto" or rownum: 10, height: 230, // 23px row scrolloffset: 0

eclipse - How to understand the code flow in nuxeo -

recently have downloaded nuxeo code, sdk , nuxio ide development purpose. able build project run sdk , importing project eclipse. nuxeo guys know, it's huge project , document doesn't contains details code flow. so, sucked. develop , fix bugs need know existing code structure, functionality of each projects(modules/bundles) , how identify code flow if user click on button. so, please me it depends on ui want debug. if it's jsf ui, buttons associated "action" contributed xml file. can follow thread. your question generic give more details. development guidelines and/or how-to fix bugs? in latter case, depends on each kind of bug, nuxeo version, original code writer (nuxeo legacy code or customized code), use of nuxeo studio or not...

Excel 2013 does not display default sheet after adding in C# -

in excel 2013 can't add worksheet after creating workbook. c#-program did this, if set application on visible = true, there no worksheet in it. program can rename sheets, copy sheets, can't show me them. after done in program, need saved, doesnt work, because there nothing displayed can saved! this code: excel.application appversion = new excel.application(); appversion.visible = true; excel.workbook databook = excelapp.workbooks.add(); datasheet = databook.worksheets[1]; // <- sheet not visible datasheet.visible = excel.xlsheetvisibility.xlsheetvisible; // not work datasheet.name = seiten[0]; // program continues after adding workbook excel starts this: workbook without sheet but default sheet? without that, can't save anything. in excel 2010 sheets need appear , can see how program works.

javascript - Ajax call duplicated each time -

i have page form. form dinamically loaded jquery.load in document.ready loop. $('#storico').load('bp/storico.php?az=<?php echo $id; ?>'); i have created delegated event handle form submission: $(document).on('click','#update',function(e){ e.preventdefault(); var att_stor = $('#attivo_storico').val(); var pass_stor = $('#passivo_storico').val(); var az = <?php echo $id; ?>; $.ajax({ type: "post", url: "bp/storico1.php", data: {attivo_storico: att_stor, passivo_storico: pass_stor, azione: az}, success: function(data){ data1=data.split("|"); if(data1[0].trim() == "successo"){ $("#storico").empty().html('<center><p class="success">'+data1[1]+'</p></center>').animate({opacity:1}, 'slow'); }else if(data1[0].trim() == "errore"){ $("#storico...

asp.net mvc - How to access data annotation through wcf service layer of a model -

i have created model , want access model data annotation displayname . have access model through wcf service layer. wcf service remove data annotation of model. [displayname("student name")] public virtual string studentname { { return this.m_studentname; } set { this.m_studentname= value; } } i want access display name in view null value in displayname method in through property a wcf service not remove anything. however, building service reference making copy of classes have. , copy smallest set neccessary run service. if need full classes, put classes , interfaces want shared common library both service and client reference. commonly called contract assembly . can either call service directly through code or if want keep wizard, can use checkbox says "use classes in project" when generating new types.

ios - Swift: Storing pattern information and assigning it to pictures -

i have list of roughly 100 patterns , different shapes. example, 1 ' arrow left, arrow down, arrow right '. i looking way store information once random pattern has been selected, can loaded algorithm detects whether pattern user inputs same pattern has been loaded. problem here how store arrow/shapes in different pattern s. one way could done using enums , know. there object called pattern1 contains array of objects called arrowl, arrowu, arrowr, arrowd. however i'm not sure how program kind of incidence , appreciate help. if use two or 3 examples demonstrate use of enum , grateful. thank you, will to store pattern, said, use array containing respective list of directions. let's have following directions: enum direction { case up, down, left, right } now can create array using directions: var pattern : [direction] = [.up, .up, .left, .right] you can create array of patterns (or array of arrays of directions): var patterns : [[direct...

Django in Ajax request send empty response if i not used request.POST -

on local server work normal. on production not work. if send response way: @csrf_exempt def ajax_get_delete_modal(request): data = { 'status': 'success', 'data': 'test') } data = json.dumps(data) return httpresponse(data, 'application/json') i empty response. but if send response way: @csrf_exempt def ajax_get_delete_modal(request): print request.post data = { 'status': 'success', 'data': 'test') } data = json.dumps(data) return httpresponse(data, 'application/json') i normal response. why happening? production server running on ngix-uwsgi.

java - Could not deserialize multimap with XStream / Jettison -

i'm trying serialize , deserialize guava's multimap using xstream , jettison. here's simple test illustrate: final xstream xstream = new xstream(new jettisonmappedxmldriver()); final multimap<testenum, string> test = hashmultimap.create(); test.put(testenum.e1, "test"); final string json = xstream.toxml(test); final multimap<testenum, string> result = (multimap<testenum, string>)xstream.fromxml(json); it gives following error: com.thoughtworks.xstream.converters.conversionexception: not call com.google.common.collect.hashmultimap.readobject() : com.test.test$testenum cannot cast java.lang.integer ---- debugging information ---- message : not call com.google.common.collect.hashmultimap.readobject() cause-exception : java.lang.classcastexception cause-message : com.test.test$testenum cannot cast java.lang.integer class : com.google.common.collect.hashmultimap required-type : co...

Ansible & Vagrant: deploy in local and production with same playbook -

i've been working in recipe vagrant+virtualbox+ansible lately. have issues want reuse code of recipe able provision not local staging , production environment. playbook is: - hosts: sudo: true pre_tasks: roles: - common - webserver - database - php post_tasks: and vagrantfile # -*- mode: ruby -*- # vi: set ft=ruby : vagrantfile_api_version = "2" vagrant.configure(vagrantfile_api_version) |config| config.vm.box = "ubuntu/precise64" config.vm.network "private_network", ip: "10.10.10.101" config.vm.synced_folder ".", "/vagrant", type: "nfs" config.vm.provider "virtualbox" |vb| vb.gui = true vb.customize ["modifyvm", :id, "--memory", "512"] vb.name = "testing" end config.vm.provision :ansible |ansible| ansible.playbook = "playbook.yml" ansible.limit = "local" ansible.i...

Zebra MZ320 - feeds few lines after black mark is found -

i working zebra mz320 printer integrate black mark. facing issue when black mark set true. printer feeds 2-3 line after black mark encountered on paper the command used calibrate black mark : ! df config.sys ! utilities bar-sense label print sample print text : ! 0 200 200 700 1 country uk country uk text 4 0 0 0 ----------------------------------- text 4 0 0 20 xxxxxxxxxxxxxxxxxxxxxxxxxxx text 4 0 0 50 xxxxxxxxxxxxxxxxxxxxxxxxxxx text 4 0 0 80 xxxxxxxxxxxxxxxxxxxxxxxxxxx text 4 0 0 120 xxxxxxxxxxxxxxxxxxxxxxxxxxx text 4 0 0 150 xxxxxxxxxxxxxxxxxxxxxxxxxxx text 4 0 0 180 xxxxxxxxxxxxxxxxxxxxxxxxxxx text 4 0 0 220 xxxxxxxxxxxxxxxxxxxxxxxxxxx text 4 0 0 260 xxxxxxxxxxxxxxxxxxxxxxxxxxx text 4 0 0 310 xxxxxxxxxxxxxxxxxxxxxxxxxxx text 4 0 0 350 xxxxxxxxxxxxxxxxxxxxxxxxxxx ! df config.sys ! utilities bar-sense setff 0 0 label print i have seen many links prevent feeding work form ...

c# - Visual Studio 2013. dbml file not updating -

i working on visual studio project uses asp.net/c# linqtosql. all has been going fine, until changes made 1 of database tables. after that, table in question removed dbml database diagram, , new version added in using server explorer. trouble is, vs2013 still not see new fields, , not compile if reference them. new table structure visible in dbml database diagram. rebuild project , should see changes.

What are the symptoms/effects of too high a tick rate in a RTOS? -

i grateful if offer explanation of effects of high tick rate in rtos or direct me resource explains clearly? the context of question... running ucos-ii tick rate of 10000 (os_ticks_per_sec=10000). outside recommended setting of 10 100. while investigating issue noticed setting , flagged anomaly. there no detail in ucos manual (i can see) explaining why recommended range. have 8 tasks (plus interrupts) running different priorities assume higher tick rate means switching in highest priority task faster. in our case ensuring user interface addressed on less important maintenance tasks. from can see consensus recommend against setting tick rate in rtos "too" high due "overhead". seems common suggest use of interrupts lower tick rates. fair enough but, unclear on detectable downsides tick rate increases. example, freertos documentation states "the rtos demo applications use tick rate of 1000hz. used test rtos kernel , higher required." go on tasks of e...

xcode - WebView not run JS -

Image
i trying run js script on webview. script return's 2 script (1 lib + 1 image creator). when run on browser runs perfect. when run on mobile (webview) cant see anything. nsstring * script = [nsstring stringwithformat:@"<body><body><script data-server=\"adman|http://adman.gr/\">(function() {document.write('<sc'+'ript data-ws=\"1015\" data-h=\"sport-fm.adman.gr\" data-s=\"320x50\" data-iframe=\"false\" data-kw=\"\" data-p=\"\" src=\"http://static.adman.gr/adman.js\"></sc'+'ript>');}());</script></body></body>"]; [_webview loadhtmlstring:script baseurl:nil]; [ _webview stringbyevaluatingjavascriptfromstring: @"function()" ]; ah, met issue before. here solution: put script js file. load script, static nsstring *jshandler; jshandler = [nsstring stringwithcontentsofurl:[[nsbundle mainbundle] u...

java - JFREECHART line chart : Want X axis to be collection of date ranges -

i new jfreechart. requirement display x axis (time-axis) following (time ranges configurable per user input) line chart suppose 3 variables: 3rdaug-8thaug..10thaug-15thaug.. [ , on ] currently graph's x axis : 1..2..3..4..5 .. [unable attach screenshots] my demo code follows : private jfreechart createchart(final xydataset dataset) { // create chart... final jfreechart chart = chartfactory.createxylinechart( "line chart demo ", // chart title "x", // x axis label "y", // y axis label dataset, // data plotorientation.vertical, true, // include legend true, // tooltips false // urls ); // optional customisation of chart... chart.setbackgroundpaint(color.white); // reference plot further customisation... final xyplot plo...

Binding a function to a prototype in a JavaScript inheritance hierarchy -

what want retrofit serialisation method existing javascript type, member of inheritance tree. working, function operating on parent type rather type trying associate with. take basic example: function animal( species, population ) { this.species = species; this.population = population; } animal.prototype.getdetail = function() { return "species: "+this.species+" population: "+this.population; } function mammal( species, population, bodytemperature ) { animal.apply(this, [species, population]); this.bodytemperature = bodytemperature; } mammal.prototype= new animal(); mammal.constructor = mammal; var serialise= { init: function() { mammal.prototype.serialise = this.serialisemammal.bind(mammal.prototype); }, serialisemammal: function() { return { species: this.species, population: this.population, bodytemperature: this.bodytemperature }; } } serialise.init(); var...

javascript - Replacing chart datasets with d3.js / c3.js -

demo here in demo attempting unload current datasets , load new ones this: using c3.js chart.unload(); chart.load({ columns: [ ['data1', 130, 120, 150, 140, 160], ['data2', 30, 20, 50, 40, 60, 50], ], }); this not correct way handle process demo shows, not work correctly. the c3 tutorial states data sets should replaced this: chart.load({ columns: [ ['data1', 130, 120, 150, 140, 160], ['data2', 30, 20, 50, 40, 60, 50], ], unload: ['data3', 'data4', 'data5'], }); again demo shows works correctly however... question how can unload all current datasets , replace them new ones without having specify individual data names ( data3 , data4 ) etc? note: the data sets variable in name , quanity, hence why want unload all. fundamentally want replace data sets new ones on click. i don't know if usefull you, in past have used (unload in same function...

.htaccess - Reverse Proxy htaccess -

i need setup reverse proxy on server i.e. from: http://info.futures.co.uk/info/sitemap.xml to: http://api.info.futures.co.uk/sitemap.xml i in ,htaccess. did research on google , found this: rewriteengine on rewriterule ^index\.html/(http://info.futures.co.uk/info/sitemap.xml)$ $1 [p,l] rewriterule ^index\.html/http://api.info.futures.co.uk/sitemap.xml)$ $1 [p,l] firstly dont understand code secondly not work..? there better way or doing mistake here this proxy info/sitemap.xml http://api.info.futures.co.uk/sitemap.xml , file (images , on not displayed): rewriteengine on rewriterule ^info/sitemap.xml http://api.info.futures.co.uk/sitemap.xml [p] this proxy pages in info http://api.info.futures.co.uk/ : rewriteengine on rewriterule ^info/(.*) http://api.info.futures.co.uk/$1 [p] please remember enable mod_proxy , mod_proxy_http in httpd.conf! use caution! if http://api.info.futures.co.uk available client suggest not proxy , use redirect instead. ...

ibm mq - Starting a jms Connection with standalone MQ Clientdriver -

i want check if jms-connection remote queuing working. should kind of j-unit test can't use server (in case websphere. there driver implementation or api use initialize connection ? no; without backend queuemanager there's nothing respond connection. messaging inherently distributed / networked product. there isn't 'mock' queuemanager. in order connection created mock need implement lot of real function.

Compiling android apps with delphi 7 -

this question has answer here: how create android apps using delphi 7 answers i wondering if it's possible compile android apps borland delphi 7 ide, know it's possible using lazarus there other way because can't download lazarus right now.. please help no, can't produce android applications using delphi 7, android support introduced in delphi xe5 .

python - Create ModelForm dynamically -

i have equal modelforms , want make 1 general instead of them. please see below code samples class createstudent(forms.modelform): class meta: model = student fields = [field.name field in model._meta.fields if not field.name == 'id'] class creategroup(forms.modelform): class meta: model = group fields = [field.name field in model._meta.fields if not field.name == 'id'] i want able this: class createitem(forms.modelform): class meta: model = custom_model_name #here need pass model request somehow fields = [field.name field in model._meta.fields if not field.name == 'id'] i want have links /create/group , /create/user , want pass last part of url ( group or user ) form constructor , generate form basing on it. you can't way. meta stuff evaluated @ define time, can't change depending on request @ runtime. however since you've got limited number of models, , you'...

iis - Where can I find ISAPI-DLL entry in ApplicationHost.config file -

Image
i need verify applicationhost.config file iis configuration website, programmatically. here reading applicationhost.config file , making sure configuration exists per website needs. facing problem while verifying 'edit feature permissions' isapi-dll under 'handler mapping' . when change feature permission isapi-dll execute not getting updated value in applicationhost.config file. please me on ? attached screenshot i solved problem. looking in wrong file. iis made changes in web.config file of application folder. validate whether execute permission given isapi-dll handler read attribute accesspolicy of node handlers below sample xml. <handlers accesspolicy="read, execute, script"> <remove name="isapi-dll" /> <add name="isapi-dll" path="*.dll" verb="*" modules="isapimodule" scriptprocessor="d:\software\_webneo_sql_sample_site_1\rest\ttmrestsr...

c - Making a new matrix from existing matrix -

i trying write code in c gets elements of existing (made before) matrix , make new matrix them. imagine have matrix r[1][303] , , want create new matrix k[303 - n + 1][1] stores elements of matrix r column n until final column (i.e. column 303). have loop on n , , code started write like: (n=1; n<=201; n++) { float k[303-n+1][1]=???? } if want write in matlab, write: n=1:201 k=[]; k(1:303-n+1,1)=r(n:end); end but have no idea how have write part r(n:end) in c . appreciate if can give me hint. i think looking for #include <stdio.h> int main(){ int r[1][10]={{0,1,2,3,4,5,6,7,8,9}}; int j[10][1]; //printf("row %d column %d",sizeof(r)/sizeof(r[0]),sizeof(r[0])/sizeof(r[0][0])); int i; for(i=9; >5; i--){ j[i][0]=r[0][i]; } for(i=6; < 10; i++){ printf("%d \n",j[i][0]); } return 0; }

vlc - libvlc_media_player_stop 30secondes to return -

i'm using libvlc retrieve raw frame media (rtsp, mjpeg, mp4, avi...) using smem callbacks , playing fine. but problem when call libvlc_media_player_stop or libvlc_media_player_release freeze program during 30 secondes. i lot of search , try many workarounds : make new thread call stop : doesn't solve problem because if want play anew media, mediaplayer still hang in main thread. call stop main thread not on mouse event : stuck 30 secondes too. i try different version 2.1.3 lastest git 3.0.0 , problem remain same, how call stop ? initialisation : char smem_options[1000]; sprintf(smem_options , "#transcode{vcodec=rv24}:smem{" "video-prerender-callback=%lld," "video-postrender-callback=%lld," "video-data=%lld}," , (long long int)(intptr_t)(void*)&cbvideoprerender , (long long int)(intptr_t)(void*)&cbvideopostrender , (long long int)(void*)this); const char * const vlc_args[] = { "-i", "dummy", ...

java - Use different aggregation strategy in camel depending on some header -

what correct way use different aggregation strategy in camel depending on header? following way fine or there other cleaner approach this? from("direct:start") .choice() .when(header("foo").equalto("bar")) .aggregate(header("id"), new bodyinaggregatingstrategy()).completiontimeout(3000).endchoice() .when(header("foo").equalto("foobar")) .aggregate(header("id"), new bodyoutaggregatingstrategy()).completiontimeout(3000) .to("mock:aggregated"); you need implement own compound aggregation strategy, , aggregate accordingly header value, eg camel pov there 1 strategy , calls aggregate method. figure out depending on header value. can delegate aggregation strategy on behalf. then not need content based router.

olap - Saiku report is exporting to excel with uncorrect values -

i've got problem exporting saiku reports excel. for example in saiku i've got table this text1 521 text2 75 text3 0 .... and after export excel looks like text1 521.000000123 text2 75.0000000123 text3 1.23e-8 where can problem? maybe should add format rules? and also, when i'm opening xlsx file libreoffice - numbers formatted correctly.

Generate XML file in Sql Server in a different way -

i have created 2 tables employer , reportpage. the employerid common field 2 tables. want generate xml tables. write queries , execute. the query here: select e.employername employername, e.employerid employerid, ( select rp.employerid employerid, rp.pagenumber pagenumber, rp.title title, rp.score score reportpage rp rp.employerid = e.employerid xml auto, type, elements) employer e employerid = 09340 xml auto, type, elements, root ; it gives output xml this: <?xml version = '1.0' encoding = 'utf-8' standalone = 'no'?> <root> <e> <employername>company, inc.</employername> <employerid>09340</groupnumber> <rp> <employerid>09340</employerid> <pagenumber>1</pagenumber> <title>executive summary</title> <score>67</score> </rp>...

jquery - Can't append rows from dynamic table but can append whole table -

i'm not seeing obvious, why can't append part of dynamically generated table (first 2 rows in case) div, can append whole table. <div id="divarea"></div> var table = '<table id="abc">'; (var i=0; i<15; i++) { table += '<tr>'; table += '<td>one</td>'; table += '<td>two</td>'; table += '<td>three</td>'; table += '<td>four</td>'; table += '<td>five</td>'; table += '<td>six</td>'; table += '<td>seven</td>'; table += '<td>eight</td>'; table += '</tr>'; } table += '</table>'; // var limittable = $('#abc tr:lt(2)'); // $('#output').append(limittable); doesn't work $('#output').append(table); // works edit: table id= "abc" added jsfiddle you ...

python - Scrapy xml output <![CDATA[<html lang="en" -

in scrapy script crawling webpage source , save output in xml format. in xml output content starting "<!doctype html> <!--[if ie 7]><html lang="en" " but need in output xml " <![cdata[<html lang="en" " how can in scrapy script? my code given below.. import scrapy scrapy.spider import basespider scrapy.selector import htmlxpathselector dell.items import dellitem scrapy.http.request import request scrapy.contrib.spiders import crawlspider, rule scrapy.contrib.linkextractors.sgml import sgmllinkextractor scrapy.contrib.spiders import csvfeedspider class dellspider(scrapy.spider): name = "dell" allowed_domains = ["dell.com"] start_urls = ( 'http://jobs.dell.com/united-states-jobs/', ) def parse(self, response): item = response.meta['item'] response = requests.get(response.url) html =re...

windows phone 8 - How can I send arbitrary data through a push notification? -

i need send data windows phone 8 app. want implement through push notifications. i'm serializing data json , place in wp:param field in push notification. while app running in foreground, receive notification fine, can deserialize field , use data. however, when app isn't in foreground, toast won't displayed @ all. when remove wp:param field notification, toast appear again, i'm assuming wp8 doesn't me putting json data in wp:param field. how can send data , still have toast appear if app isn't in foreground. the value provided in wp:param has url windows phone process , display toast. the valid formats are: /page1.xaml – defines screen navigate in app when app starts. string must begin "/". /page1.xaml?value1=1234 &amp;value2=9876 – defines screen navigate when app starts, along name/value pairs of info. string must begin "/". ?value1=1234 &amp;value2=9876 – contains name/value pairs of info passed d...

javascript - Web Audio APIs - Capture audio - Disable low pass filter -

i use tutorial: http://typedarray.org/from-microphone-to-wav-with-getusermedia-and-web-audio/ and live demo page: http://typedarray.org/wp-content/projects/webaudiorecorder/ to create high frequency analyzer. my problem web audio api, thing, default cut off high frequencies. when record wav , play 10000hz signal, wav contain freq. if play 17000hz signal, wav don't contain freq. how disable low pass filter? code: function success(e){ // creates audio context audiocontext = window.audiocontext || window.webkitaudiocontext; context = new audiocontext(); // creates gain node volume = context.creategain(); // creates audio node microphone incoming stream audioinput = context.createmediastreamsource(e); // connect stream gain node audioinput.connect(volume); /* spec: value controls how audioprocess event dispatched , how many sample-frames need processed each call. lower values buffer size result in lower (better) ...

jdbc - How it works; "executeUpdate()"? -

i new jdbc , testing purpose passed select queries in executeupdate() instead of dml queries ; , result got, made me confused. i tested on scott user's tables of oracle 11g. for dept , salgrade table returns integer no. 4 , 5 no. of records in these tables think. , emp table should return 14, returned 10 ; why ? my code is: import java.sql.*; public class jdbctest2 { public static void main(string args[])throws exception { class.forname("oracle.jdbc.oracledriver"); connection con = drivermanager.getconnection("jdbc:oracle:thin:@localhost:1521:orcl","scott","tiger"); statement st=con.createstatement(); system.out.println(st.executeupdate("select * dept")); system.out.println(st.executeupdate("select * salgrade")); system.out.println(st.executeupdate("select * emp")); st.close(); con.close(); } } i know executeup...

matlab - subscript indices must be real positive in cummswapcfbytrintree.m -

Image
i have copied code matlab example file bermudanswaption.m in effort calibrate hull white 1 factor model given market data. use subset 30 or fewer swaptions calibration set, able arrive @ interior solution. when use larger set of instruments, weird error: below code: valuationdate = '10-01-2014'; settle = datenum(valuationdate); % 0 rate data market data, bootstrapped bloomberg , reuters quotes curvedates = [735874; 735882; 735906; 735936; 735950; 736040; 736133; 736224; 736314; 736424; 736606; 736788; 736971; 737153; 737336; 737518; 737701; 737884; 738069; 738251; 738433; 738615; 738797; 738979; 739162; 739345; 739528; 739710; 739893; 740075; 740260; 740442; 740624; 740806; 740989; 741171; 741354; 741536; 741719; 741901; 742084; ...

jqGrid: Restore FilterToolBar chosen values after destroyFilterToolBar -

i`m trying implement dynamic content of filter dropdowns, in beforerequest request analyze filters value, prepare dropdown values , call updatedropdownvalues: var updatedropdownvalues = function(dropdownvalues){ $("#securityjqgrid").jqgrid("destroyfiltertoolbar"); for(var columnname in dropdownvalues) { $("#securityjqgrid").jqgrid("setcolprop", columnname, { searchoptions: {value: dropdownvalues[columnname]} }); } $("#securityjqgrid").jqgrid('filtertoolbar', {stringresult: true}); var postdata = jquery($("#securityjqgrid")).jqgrid("getgridparam", "postdata"); postdata.filters = lastfilters; } the problem after filtertoolbar creation doesn`t restore value of previous filtering. if choose value dropdown filter data new value instead of combination of 2 values - new 1 , previous. there way restore filtertoolbar state?

objective c - Invalid color System, labelColor (warning given only once) -

i getting following warning on os x 10.9 console @ time of nib load( nswindowcontroller ). invalid color system, labelcolor (warning given once) i using xcode 6 , os x 10.10 compile code. warning coming because of nscolor exposes new system colors in 10.10 static text , related elements: labelcolor, secondarylabelcolor, tertiarylabelcolor, , quaternarylabelcolor . how fix warning? change textfield's color in xib file from: <color key="textcolor" name="labelcolor" catalog="system" colorspace="catalog"/> to: <color key="textcolor" name="textcolor" catalog="system" colorspace="catalog"/> since "labelcolor" not formal color name in osx 10.9.

perl - How to pass optional arguments to a function -

i'm trying make function module accept optional arguments in form of: function(arg1, optional1 => opt1, optional2 => opt2, ..); yet can't find anywhere shows explanation how this. came following solution accept email , alpha , html arguments, it's extremely convoluted , can't believe there isn't shorter way accomplish this: sub test { ($s, @args) = @_; $alpha = 1; $html = 0; $email = 0; for(my $i = 0; $i < scalar(@args); $i++) { if($args[$i] eq "alpha") { $i++; $alpha = $args[$i]; } elsif($args[$i] eq "email") { $i++; $email = $args[$i]; } elsif($args[$i] eq "html") { $i++; $html = $args[$i]; } } return ($alpha, $email, $html); } ($a, $b, $c) = test("stuff", ndhgffs => 1, email => 1, alpha => 0); print $a . $b . $c; edit...