Posts

Showing posts from April, 2010

Generating xml file with "&" using java -

i need write <name> dolce & gabanna </name> in xml file using java. however, gets generated <name> dolce &amp; gabanna </name> . is there method can use in java "&" displayed in xml, instead of "&amp;" ? thanks. i need write <name> dolce & gabanna </name> in xml file using java. no, don't. not unless you're trying create invalid file. whatever code you're using doing right thing - xml parser reading file unescape &amp; & appropriate. from xml 1.0 specification, section 2.4 : the ampersand character ( & ) , left angle bracket ( < ) must not appear in literal form, except when used markup delimiters, or within comment, processing instruction, or cdata section. if needed elsewhere, must escaped using either numeric character references or strings " &amp; " , " &lt; " respectively.

javascript - Change element attributes and re-render -

i'm creating image elements directly div. var mydiv = document.getelementbyid("mydiv"); function createimages(){ for(var = 0, piece = 1; < 10; i++){ for(var j = 0; j < 10; j++, piece++){ var lin = i*100, col = j*100; var img = document.createelement("img"); img.src = '../'+piece+'.jpg'; img.style.position = "absolute"; img.style.top = ''+lin+'px'; img.style.left = ''+col+'px'; img.style.border = '1px solid #000000'; mydiv.appendchild(img); } } } this works fine! i'm trying give images onclick event calls function changes attributes, don't know if i'm adding onclick event right way. img.onclick = change(); also don't know how re-render images automaticaly after changes take effect. it needs in simple javascript. any appreciated! chang

ios - Send data to php file and pull stuff from data base based on that data not working objective c -

in application, user has ability post , others can comment on it. anyway, view post see title of on tableview pushes detail view. segue carries post id. display comments, must send post id php file. pull data database based on post id , echo in json array objective c can read , display it. problem never echoing data because either post id not getting transferred php file or else happening. i use same objective c code below in other files send , insert data database , works fine not sure problem is. here objective c: -(void) getdata:(nsdata *) data{ nserror *error; json = [nsjsonserialization jsonobjectwithdata:data options:kniloptions error:&error]; } -(void) start{ nsmutablestring *poststring = [nsmutablestring stringwithstring:krecieveurl]; [poststring appendstring:[nsstring stringwithformat:@"?%@=%@", kid, _post_id]]; [poststring setstring:[poststring stringbyaddingpercentescapesusingencoding:nsutf8stringencoding]]; nsmutableurlrequest *request = [[

python - Django: How to get exception instance in error handlers -

django has built-in default views used automatically when exceptions such permissiondenied , http404 , suspiciousoperation , etc. raised. convenient feature of django love, seems have limitation. i raising exception message: raise permissiondenied('you not xyz , have no access foobar') is there context variable containing original exception instance available in templates (i.e. 403.html ) called original error handlers can access message? if not, possible hold of original exception custom handler ( settings.handler403 , etc.) can inject context? note: believe can create custom middleware process_exception , avoid if possible since guess duplicating lot of existing django logic , it's cleaner reuse it. also, looks custom process_exception override logging in django.core.handlers.base amongst other behaviors. re-implementing sake of injecting exception info error template seemed kind of silly. this feature has been implemented ticket 24733 . in dja

reminders - Slack integration for alarms or alerts -

i new slack. can't find integrations "alarm clock"-type integration, explained below. what i'm looking reminder post 1 of our slack channels on set schedule. instance: each weekday @ 9 am, our #bug-fix channel gets message "do bug fix xyz thing." i've searched slack's integrations page can't find this. can recommend integration this, or point me resource might able find one? many in advance. edit: i've found ifttt recipe looks promising, i'll share here in case 1 else has same question: https://ifttt.com/recipes/177138-post-a-daily-reminder-to-a-slack-channel however, don't know slack integrations ecosystem well. other suggestions appreciated. i not sure if looking generalizable alarm clock static messages, or custom. can use incoming web hooks write own custom integration. create simple script schedule cron job run @ 9am. if it's weekend, script can exit, otherwise can grab data needs post (from whate

How to convert a list to a csv in python -

i have list: ['1','2','3'] , want convert 1,2,3 i.e. no brackets or quotation marks. if want generate canonical csv file, use csv module. example docs: >>> import csv >>> spamwriter = csv.writer(open('eggs.csv', 'wb'), delimiter=' ', ... quotechar='|', quoting=csv.quote_minimal) >>> spamwriter.writerow(['spam'] * 5 + ['baked beans']) >>> spamwriter.writerow(['spam', 'lovely spam', 'wonderful spam'])

ios - How to update managed object data? -

i have started first core data application. working 1 entity right called 'folder'. the first view controller displays folders in tableview, can add , reloads data. works fine because uses fetch request populate table. override func viewwillappear(animated: bool) { var error: nserror? let request = nsfetchrequest(entityname: "folder") request.sortdescriptors = [nssortdescriptor(key: "date", ascending: true)] self.events = moc?.executefetchrequest(request, error: &error) as! [folder] self.uitable.reloaddata() } however when segueing view controller via table cell pass on selected folder data controller using index path. e.g. override func prepareforsegue(segue: uistoryboardsegue, sender: anyobject!) { if segue.identifier == "showdetails" { let destinationvc = segue.destinationviewcontroller as! folderdetailsviewcontroller let indexpath = uitable.indexpathforselectedrow() let

cordova - PouchDB / SQLite indexing crashes - needs to much memory on IOS -

intro i have build ios app pouchdb , ionic , cordova stuff, i'm failing database , can't see solution... sqlite sqlite plugin , synchronization works great, want access data pouchdb starts indexing uses memory , app crashes. here sampleapp prepared interested helpers reproduce crash sampleapp github websql in websql can't sync database, because "quotaexceedederror" error. there way ask more space in ios uiwebview? indexeddb indexedb isn't usable , cause of many bugs. , not better in ios 9 so ideas ideas or hints? the solution problem of storage limits on ios indeed use sqlite plugin. can't exceed 50mb on websql. sqlite plugin , synchronization works great, want access data pouchdb starts indexing uses memory , app crashes. are sure bug pouchdb , not sqlite plugin? if it's crash in objective-c land, belongs sqlite plugin. if it's crash in javascript land, belongs pouchdb. either way, if provide test reproduce,

apache - Address Bar not changing - PHP -

i using header('location:') redirect user webpage. but, instead of overwriting previous address on address bar, new 1 gets appended 1 present. example: the address bar holds: localhost/v2/admin and there header('location:'.diradmin.'login.php'); diradmin constant defined as define(diradmin,'localhost/v2/admin/'); then, after redirect, new address bar be localhost/v2/admin/localhost/v2/admin/login.php i thought because of server, using. using uniform server zero. installed wamp , problem continues. i still noob, have no idea causing , if problem because of mod_rewrite, on both servers module active. checked of problems redirect-php header(location:..) among others. did google search no end. how can solve problem? header_remove(); will not work first address typed in manually , not set header(); define define('diradmin','localhost/v2/admin/); as define('diradmin','http://localhost/v2/admin/

java - FileNotFoundException for the jar name -

i tried generate jar, got following error: java.io.filenotfoundexception: ass6game.jar (no such file or directory) @ java.io.fileinputstream.open(native method) @ java.io.fileinputstream.<init>(fileinputstream.java:106) @ java.io.fileinputstream.<init>(fileinputstream.java:66) @ sun.tools.jar.main.run(main.java:131) @ sun.tools.jar.main.main(main.java:1022) this command used: jar -cmf ass6game.jar manifest.txt -c bin . -c src resources . the point of origin classpath contains bin , src folders, manifest.txt file , makefile. i have in bin folder various packages , stuff , resources folder inside src folder want beside packages inside jar. once again, did wrong?

regex - scala replace string with underscore joined -

i have general question how replacing string parts. say have 2 strings: a = "i going watch game of throne tonight on throne" b = "game_of_throne" what efficient way replace game of throne game_of_throne (i.e adding under score treat 1 string subject). if regex: val c = """_""".r.replaceallin(b," ").r val c.replaceallin(a, c) how ask draw underscore? i trying avoid splitting string since increases computation time quite lot. edit: have million pair of these, need able use map , variable , b. a.replaceall(b.replaceall("_", " "), b) not sure if there more pure scala way should do.

How to access kwargs created in an other function using python? -

i'm working on large finite element analysis code lot functions. pass variables between different functions make use of python's kwargs. opted can call functions in lot of different ways, creating great flexibility. however i'm dealing problem. main function call function using kwargs. second function processes input , adds new kwargs. problem new kwargs created in function not accessible in first one. there pythonic way of doing this? created following code example: # create main function def main(**kwargs): # add key word argument kwargs["textmain"] = "text added in main" # call function existing kwargs , new 1 functiona(textnew = "text added in new" ,**kwargs) # test in kwargs after subfunction called print("\ntest kwargs after subfunction called:") if "textmain" in kwargs: print(kwargs["textmain"]) if "textnew" in kwargs: print(kwargs["t

cakephp - Cake PHP 3 plugin's controller not visible -

Image
i moved working plugin /plugins/pluginname directory /vendor/myname /pluginname url on call plugin controller http://domain.local/pluginname/index before moving first directory another, plugin working expected. moved plugin new directory make reusable other cake php apps. plugin installed composer. why have message "error: controller class index not found.". controllers plugin not visible on app, throws same error. error thrown line 79 file \vendor\cakephp\cakephp\src\routing\dispatcher.php in main bootstrap.php file put line: plugin::load('myname/pluginname', ['bootstrap' => false, 'routes' => true]); why plugin in vendor directory not working in case? if plugin installed composer, not move it. whether installed @ plugin or vendor folder determined author of plugin. if need load plugin in bootstrap, use plugin::load('pluginname', ['bootstrap' => false, 'routes' =>

javascript - How can i change array in directive, and then reflect that change in my controller? -

i made directive isolated scope "=" method, in directive pass empty array, push data on array.... how change can reflected on original array in controller? here example: angular.module('mymodule').controller('mycontroller', ['$scope', function($scope) { $scope.test = []; }]); angular.module('mymodule').directive('mydirective', function() { return { scope: { test: "=", bread: "=" }, restrict: 'e', link: function(scope, element, attribute) { scope.test.push('one more') }, replace: true, templateurl: 'some template' }; }); html <div ng-controller='mycontroller'> <mydirective test='test'></mydirective> <div ng-bind='test'> </div> </div> when push on array dont have reflection of in controller.

oracle sqldeveloper - Create a temp table from a select query -- dbVisualizer vs SQL Developer -

i've got query: select < column names > <#temp_table> < table > < stuff > it runs fine in dbvisualizer. however, running in oracle sql developer gives me error "the executequery method must return result set." what happening here, , how can fix in sql developer? edit: in response tanner, errors when try following things (tell me if try invalid. i'm new sql): this: select * #temp_table status produces this: executequery method must return result set. this: select * #temp_table status; select * #temp_table; produces this: invalid object name '#temp_table'. and this: select * from( select * #temp_table status) produces this: incorrect syntax near keyword 'into'. i'm lost, ladies , gentledudes. if have query like: select * #temp table_a that creating , inserting data temp table. what need return temp table, after have run code need t

matrix - Rows containing minimum value of a column in R -

i work vectors , matrices in r. in matrix, want return rows has minimum value of particular column (for example, 9th column). values of column can "not available" also. how can this? to check not available values tried data <- data[data[,9] != "not available"] didn't give me result expected. for example - code name number 1 india 2.3 2 america 3.5 3 china not available 4 europe 1.2 5 japan 1.2 i want rows has minimum value of column number . required output code name number 4 europe 1.2 5 japan 1.2 not available values have neglected by having 'non-numeric' element in column, column converted 'character' or 'factor' class when read data read.csv/read.table . if use stringsasfactors=false , column class 'character', otherwise 'factor' default. suppose read dataset stringsasfactors=false , can change column 'numeri

Android Action Bar not showing -

i had made program code , want put action bar in top right hand corner of 1 of screen, however, action bar not show or worse, can't direct page. had tried sorts of methods have been taught online, still have same problem. can me out please? this code having problems with: public class playactivity extends actionbaractivity { public static final int menu_item_restart = menu.first; public static final int menu_item_clear_notes = menu.first + 1; public static final int menu_item_fill_in_notes = menu.first + 2; public static final int menu_item_undo = menu.first + 3; public static final int menu_item_help = menu.first + 4; public static final int menu_item_settings = menu.first + 5; public static final int menu_item_set_checkpoint = menu.first + 6; public static final int menu_item_undo_to_checkpoint = menu.first + 7; private static final int dialog_restart = 1; private static final int dialog_well_done = 2; private static final i

date - SSRS Expression inversed return -

Image
so have expression calculates number of weekdays between 2 dates (excluding these dates). expression seems give opposite results of want , don't know why. here's expression: =iif(isnothing(fields!end_date.value) or isnothing(fields!report_submitted_date.value) or fields!report_submitted_date.value>fields!end_date.value,"invalid data", (datediff(dateinterval.day,fields!end_date.value,fields!report_submitted_date.value)+1) - (datediff(dateinterval.weekofyear,fields!end_date.value,fields!report_submitted_date.value)*2) - iif(weekday(fields!end_date.value,1) = 1,1,0) - iif(weekday(fields!end_date.value,1) = 7,1,0) - iif(weekday(fields!report_submitted_date.value,1) = 1,1,0) - iif(weekday(fields!report_submitted_date.value,1) = 7,1,0)-2) so, result expression every situation end date smaller report submitted date text invalid data , rest #error or negative numbers. now know can solve switching true , false clause understand why these results switched bec

version control - Perforce to git migration -

i need migrate repos perforce git history. tried searching through web, didn't find clear documentation mentioning each , every step in detail. saw utility called git-p4 didn't find clear documentation related utility too. can explain me on how can perform or provide me documentation helpful. regards there's official documentation available on git-p4. addresses specific scenario describe: to reproduce entire p4 history in git, use @all modifier on depot path: $ git p4 clone //depot/path/project@all note if have labels in perforce depot you'll need add --import-labels option them. if have branches in perforce, you'll want @ --detect-branches option well. note after running command you'll have p4 remote in git repo. that's people plan submit git p4, since mentioned migrating can safely delete it.

iis - Shibboleth - Is it possible to move a site between computers without reissuing metadata -

i have site implements shibboleth sso. when metadata issued service provider pass idp saw metadata had machine name in it. need know if moving site new server different machine name means metadata need reissued idp. machine setup windows/iis

java - Random number generation algorithm -

i encountered naive algorithm random number generation produce series of numbers follows: for (int = 0; < max; i++) if (rand.nextint(100) >= 100 - probability) // probability between 0 , 100 randomnumberslist.add(i); i wondering if there's way achieve statistically equivalent results without iterating through each number between 0 , max. let's denote p=probability/100 , q=1-p . consider first number added. probability q 0; probability (1-q)*q 1, probability (1-q)^2*q 2 , on. geometric distribution . can generate random number distributed according geometric distribution using following approach: generate random number u uniformly distributed in [0,1] , calculate x=⌊ln(u)/ln(q)⌋ — x have geometric distribution (see this question ). so how can calculate first number add. now consider difference between second , first numbers. distributed geometrically (only starting @ 1, not @ 0), can calculate difference same way , obtain second numb

ios - Set Image inline with text to UITextView in Objective C -

Image
i want add image inline text uitextview below screenshot have try using nstextattachment , nsattributedstring put 1 line before & after image. please me sort out. you need use 'uibezierpath' for example, txtvhtmlstring.text = @“your long text…….”; imgview = [[uiimageview alloc] initwithframe:cgrectmake(120, 100, 152, 128)]; imgview.image = [uiimage imagenamed:@"smily.png"]; imgview.layer.cornerradius = 10; [txtvhtmlstring addsubview:imgview]; then don't forget update bezierpath in viewdidlayoutsubviews if text updated. - (void)viewdidlayoutsubviews {     uibezierpath *exclusionpath = [uibezierpath bezierpathwithrect:imgview.frame];     txtvhtmlstring.textcontainer.exclusionpaths  = @[exclusionpath]; }

html - Hide row div for medium or large screens -

i have site needs alternative home page xs screens. have hidden controls on xs screens struggling control show on xs screen. cant see regarding visibility on chrome debugger (f12) maybe order in state bootstrap parameters showing , hiding col. the following simplified code not show on xs screen. help! <div class="row row-top col-xs-12 visible-xs hidden-md hidden-lg"> <a href="/home.html">test</a> </div> sorry, got - need have 2 divs, 1 row class , col class. bad. <div class="row row-top hidden-md hidden-lg"> <div class="col-xs-12"> <a class="navbar-brand" href="/home.html">m.f.o'hare & associates</a> </div> </div>

Gridview header check box selection is always false in asp.net(populated using jquery ajax) -

on button click have populated grid view using jquery ajax using below code. $(document).ready(function () { $("#btnshowdata").click(function () { $('#gvdata').empty(); load_data(0, 30); }); }); function load_data(ipageindex, ipagesize) { $.ajax({ type: "post", contenttype: "application/json; charset=utf-8", url: "gridajaxdotnetspan.aspx/bindemployees", data: json.stringify({ ipageindex: ipageindex, ipagesize: ipagesize }), datatype: "json", success: function (result) { $('#gvdata').empty(); $('#gvdata').append("<tr><th><input type='checkbox' id='chkorgheader' name='chkorgheader' onclick='selectall();' /></th><th>empid </th><th>empname </th><th>empsal </th><th>empaddr &l

cmusphinx - Build NEW Acoustic model, Dictionary , Language model for uncommon language speech recognition -

i want build new acoustic model ,new dictionary ,new language model " sinhala language speech recognition " sinhala language characters unicode based. example a=අ,i=ඉ,u=උ,ka=ක,ba=බ. did go through cmusphinx tutorial developers . did not me. works english language. language model should arpa model. , how can map sinhala unicode english phonemes , how train language model different voices. there tool available generate unicode based language model? overall, not complex. first need split task on parts: build phonetic dictionary, build language model, build acoustic model. start phonetic dictionary. you need write python script map unicode input transliteration: රට r tt එකඟයි e k ng yi අවසර දිම v s r d m basically every write corresponding transliteration. need do, later can feed list of words script , dictionary in cmusphinx format. part covered in tutorial http://cmusphinx.sourceforge.net/wiki/tutorialdict once have transliteration tool can proce

Display 404 error document for invalid urls from apache without hitting rails application -

is possible show 404.html error document invalid urls using rewriterule apache before hits rails application. we have routes /website/stats_for_season/1031475/23 in our application. reason google bot accessing urls /website/stats_for_season/1031475 without last part. i have added below rule apache .conf file, without success. rewriterule ^website/stats_for_season/([0-9]+)/$ '' [r=404] [l]

node.js - how to install sails auth for manually configured mongoose ORM -

hi removed waterline orm sails js , added mongoose, followed steps specified in following link http://laurentschaffner.com/blog/from-waterline-to-mongoose-in-sails/ facing issues in installing sails-auth module can me out please. i haven't tried install sails-auth have integrated mongoose sails in manner think more friendly blog link referenced. created gist here help: gist: adding mongoose sails in manner binds promisified mongoose functions model.mongoose , preserves blueprints (auto-generated action routes), , importantly not remove waterline orm. note: code below uses es2015 sails-babel hook. https://gist.github.com/austinmao/83524cecd87ea1685b32

Run Python binaries under Windows XP -

i compiled pyside application both x32 , x64 mode , it's work under windows 7+. found application can't start under windows xp. should use tricks in spec-file additionally? current pyinstaller script shown below in app.spec file: pyinstaller src/app.spec # -*- mode: python -*- import os import platform pyside import qtcore onefile = false console = false platform_name = platform.system().lower() app_name = {'linux': 'app', 'darwin': 'app', 'windows': 'app.exe'}[platform_name] # include imageformats plugins plugins=os.path.join(os.path.dirname(qtcore.__file__), "plugins\\imageformats") static_files = tree(plugins, 'plugins\\imageformats') static_files += [('app.ico', 'src\\app.ico', 'data')] # analyze sources = analysis(['src\\app.py'], hiddenimports=['pkg_resources'], hookspath=none, runtim

php - Disable Download video from facebook video player -

i have posted video using meta tags , plays, want remove download option right click context menu of player. possible? i have used flash player , following code have used share videos on facebook - <meta property="og:title" content="title" > <meta property="fb:app_id" content="app id" /> <meta property="og:url" content="url"/> <meta property="og:link" content="detail link"/> <meta property="og:image" content="image url"/> <meta property="og:description" content="description" /> <meta property="og:type" content="video"/> <meta property="og:video:url" content="video url"/> <meta property="og:video:secure_url" content="video secure url"/> <meta property="og:video:width" content="640"/> <meta property="og:video:heig

Print Select Option Using Ajax, Jquery and a PHP Echo -

i have looked throughout stackoverflow , seen numerous examples of none give answer how echo. have select dropdown on page called testing.php: <form id="projects" action="project-add.php" method="post"> <select name="territory" id="territory"> <option value="australia">australia</option> <option value="argentina">argentina</option> </select> // fair few more form fields here <input type="submit" value="submit project"> </form> i need whatever selected here available echo php variable later down form without need press button. i have following script in : <script type='text/javascript'>//<![cdata[ $(window).load(function(){ $('#territory').change(function(e) { e.preventdefault(); var selectedoption = $(this).find('option:selected'); $('#territory option').removeattr('selecte

postgresql - Inserting an Array into Postgres Database from a Ruby File -

i'm trying transfer information ruby file postgres database. able transfer information when not have array column, assuming error message getting because of array column trying add. error message getting is: in `exec_prepared': error: missing dimension value (pg::invalidtextrepresentation) here code used connect ruby file postgres database: require 'pg' class postgres # create connection instance. scraping name of database adding information def connect @conn = pg.connect(:dbname => 'scraping') end # create our venue table def createvenuetable @conn.exec("create table venues (venue_number varchar(15) unique,...,img_array varchar[]);") end ... def prepareinsertvenuestatement @conn.prepare("insert_venue", "insert venues(venue_number,...,img_array) values ($1,...,$24)") end # add venue prepared statement. def addvenue(venue_number,...,img_array) @conn.exec_prepared("insert_v

node.js - How to correctly use JavaScript with Jade working with parameters passed in on render -

so question correct place link external javascript files in child jade template, , passing data (if possible?) these javascript files. so using express, , rendering jade files passed in data so: router.get('/', function(req, res, next) { tflsentimentanalysis.fetchtflsentiments(credentials, function(results){ res.render('twitterinsights', results); }); }); the data accessible normal way in twitterinsights.jade using #{results.attributename} i have simple jade file, extends jade template, so: extend layout block content h2 title of page p page contents go here and need include 2 javascript files. firstly d3.js library in bower_components , secondly own javascript file in public/javascripts. script(src="/bower_components/d3/d3.min.js") script(src="/public/javascripts/twittervisualisation.js") where best position in jade template link javascript files? my javascript file (twittervisualisation.js) requires d

android - How to switch between fragments through a navigation drawer? -

i have basic question related navigation drawer. have made app has navigation drawer, have no idea how change view on selection of item in nav drawer, can display toast on every click, means issue in switching fragments during runtime. this main code: import android.app.fragment; import android.app.fragmentmanager; import android.app.fragmenttransaction; import android.content.res.configuration; import android.support.v4.widget.drawerlayout; import android.support.v7.app.actionbaractivity; import android.os.bundle; import android.support.v7.app.actionbardrawertoggle; import android.support.v7.widget.linearlayoutmanager; import android.support.v7.widget.recyclerview; import android.support.v7.widget.toolbar; import android.view.gesturedetector; import android.view.layoutinflater; import android.view.menu; import android.view.menuitem; import android.view.motionevent; import android.view.view; import android.widget.adapterview; import android.widget.linearlayout; import android.

python 2.7 - scipy.minimize 'SLSQP' appears to return sub optimal weights values -

im trying run minimization function ensemble of logloss values, when using scipy.minimize function appears return sub optimal value. the data comes in pandas table: click, prob1, prob2, prob3 0, 0.0023, 0.0024, 0.012 1, 0.89, 0.672, 0.78 0, 0.43, 0.023, 0.032 from scipy.optimize import minimize math import log import numpy np import pandas pd def logloss(p, y): p = max(min(p, 1 - 10e-15), 10e-15) return -log(p) if y == 1 else -log(1 - p) def ensemble_weights(weights, probs, y_true): loss = 0 final_pred = [] prob_length = len(probs) in range(prob_length): w_sum = 0 index, weight in enumerate(weights): w_sum += probs[i][index] * weight final_pred.append(w_sum) index, pred in enumerate(final_pred): loss += logloss(pred, y_true[index]) print loss / prob_length, 'weights :=', weights return loss / prob_length ## w0 initial guess minimum of function 'fun' ## initial guess weights equal w0 = [1/probs.sha

How to run laravel 5.0 project on localhost without use php artisan serve -

i have created laravel 5.0 project php artisan serve, need know how run laravel 5.0 project run without start php artisan serve, have browse lot of websites no 1 me.. you need change "server.php" "index.php" copy ".htaccess" public root directory. see: https://stackoverflow.com/a/30053989/3948755

javascript - IHTMLDOMNode::appendChid() won't always work as expected -

i writing bho in c++ involves 2 stages. stage 1: open new window bho , navigate website url (from bho), inject javascript code document once dispid_documentcomplete event fires appropriate url, invoke code js. js engine crunch more code , point window @ other url means of window.location.href . stage 2: once dispid_documentcomplete fires inside bho new url flow goes same route: inject script, etc. trouble. happens on win 7 32 bits + ie11, not happen on win xp 32bits + ie8 issue stage 2 - injection fails. have tried appendchild on both first body tag , first head tag same result. there tests hresult return values involved , validity of interface pointers returned , pass but when time comes invoke function script, getidsofnames() returns hresult of -2147352570 (unknown name) when passing name of function javascript code. inspecting dom in ie reveals js code not injected this happens when ie launched , no more mouse clicks or keyboard events occur. happens, however, in 5%

symfony entity catching up inversed Values in many to many -

i'm trying setup many many between fos userbundle , own group bundle can group users. working fine. can set new group , can add many users group to. when want check if user in group, index join column error. think didn't understand usage of manytomany correct way nice if can me getting point. my entities like: user: class user extends baseuser { /** * @orm\column(type="integer") * @orm\id * @orm\generatedvalue(strategy="auto") */ protected $id; /** * @orm\column(type="string", length=255, nullable=true) */ protected $usergroups; //....// and group entity looks like: /** * @orm\manytomany(targetentity="pruserbundle\entity\user", inversedby="id") * @orm\joincolumn(name="id", referencedcolumnname="id") * @var user */ private $user; //.... /** * add user * * @param \pruserbundle\entity\user $user * @return lieferanten

rest - Restful Web Services Issue -

can tell me how can solve issue in netbeans when create restful web services using entity classes using netbeans ide? warning: supported source version 'release_6' annotation processor 'org.eclipse.persistence.internal.jpa.modelgen.canonicalmodelprocessor' less -source '1.7' note: creating static metadata factory ... note: optional file not found: meta-inf/orm.xml continuing generation. note: optional file not found: meta-inf/eclipselink-orm.xml continuing generation. note: optional file not found: meta-inf/orm.xml continuing generation. note: optional file not found: meta-inf/eclipselink-orm.xml continuing generation. note: input files use unchecked or unsafe operations. note: recompile -xlint:unchecked details. 1 warning kind regards, indunil sanjeewa

sql - dynamic Procedure, remove last string chars -

i have parameter dynamically generates union depends on input. select @cmd +=n' set nocount on; select count(case when rfrd.queutypeid=4 rfrd.queutypeid end) requiredaqueue ,count(distinct rfrd.leaddocumentid) repeat,concat('''+rf+''' ,'' '') riskfactorid fct.riskmng_fact_riskfactorresultdetails rfrd union select count(case when rfrd.queutypeid=4 rfrd.queutypeid end) requiredaqueue ,count(distinct rfrd.leaddocumentid)as repeat,concat('''+rf+''' ,''*'') riskfactorid fct.riskmng_fact_riskfactorresultdetails rfrd' -------------- #cte rf exec sys.sp_executesql @cmd at end want connect them 1 long union, added union in end: select @cmd +=n' set nocount on; select count(case when rfrd.queutypeid=4 rfrd.queutypeid

MongoDB $redact to filter out some elements of an array -

i trying formulate query on sample bios collection http://docs.mongodb.org/manual/reference/bios-example-collection/ : retrieve persons , awards received before receiving turing award. i have come query: db.bios.aggregate([ {$match: {"awards.award" : "turing award"}}, {$project: {"award1": "$awards", "award2": "$awards", "first_name": "$name.first", "last_name": "$name.last"}}, {$unwind: "$award1"}, {$match: {"award1.award" : "turing award"}}, {$unwind: "$award2"}, {$redact: { $cond: { if: { $eq: [ { $gt: [ "$award1.year", "$award2.year"] }, true]}, then: "$$keep", else: "$$prune" } } } ]) and answer: /* 0 */ { "result" : [ { "_id" : 1, "award1" : {

jquery - Javascript Timeline Issue -

creating timeline scroll left right.. running js in console , returning following error uncaught referenceerror: select $('a.next').click(function () { selector.children('.dates-bar').children('a.next').click(function(){ var actual_scroll = scroll_count; var c = selector.children('.dates-bar').children('a:not(.prev, .next, .noevent):visible()').length if(scrolled + scroll_count >= c) actual_scroll = (c - scrolled)-1 if(parseint(selector.children('.dates-bar').children('a:not(.prev, .next, .noevent):visible():eq(0)').css('width'))*actual_scroll > selector.children('.dates-bar').width()) while(parseint(selector.children('.dates-bar').children('a:not(.prev, .next, .noevent):visible():eq(0)').css('width'))*actual_scroll > selector.children('.dates-bar').width() &&

c# - Xaml - Bind listviewitem source object -

i use observablecollecion in vm. collection bind view in listview. in items try element create item. add in commandparameter , thing. here's vm : public relaycommand<selectioncommandparameter> cmdremovefromquiz { get; set; } public observablecollection<question> selectedquiz { { return _selectedquiz; } set { _selectedquiz = value; raisepropertychanged("selectedquiz"); } } private void removefromquiz(selectioncommandparameter selection) { if (selection.parameter question) { observablecollection<question> tempquiz = selectedquiz; question _question = (question)selection.parameter; tempquiz.remove(_question); selectedquiz = tempquiz; } } the problem start removebtn start command, , selection stay null want observablecollection<question> object use in listviewitem now view : <usercontrols:charmflyout x:name="cfoquizlist" x:uid=&

php - Moodle coding error detected -

my moodle gave me error: "coding error detected, must fixed programmer: invalid state passed moodle_page::set_state. in state 0 , state 3 requested." i googled bit, couldn't find exact solution error. have never encountered myself before. if need information on code or file, sure tell me. this can happen if $output->footer() called $output->header() hasn't. page should in 1 of these states: /** state of page before has printed header **/ const state_before_header = 0; /** state page in temporarily while header being printed **/ const state_printing_header = 1; /** state page in while content presumably being printed **/ const state_in_body = 2; /** * state page when footer has been printed , function * complete. */ const state_done = 3; probably custom code. switch on debugging developer level find out where. in config.php add $cfg->debug = e_all | e_strict; $cfg->debugdisplay = true;

How to write transactional spout for storm trident -

i have written demo trident. in demo, want generate series batches of data in transaction spout , persistentaggregate operation them. the normal processing this: step1: txid=1, {"aaa 3", "bbb 2"}==>persist db(ok) step2: txid=2, {"ccc 6", "ddd 7"}==>persist db(ok) in case operation of persist db abnormal in step1, suppose process should be step1: txid=1, {"aaa 3", "bbb 2"}==>persist db(ng) step2: txid=1, {"aaa 3", "bbb 2"}==>persist db(ok) but test result following: step1: txid=1, {"aaa 3", "bbb 2"}==>persist db(ng) step2: txid=1, {"ccc 6", "ddd 7"}==>persist db(ok) i think process not correct.but not know why happen. have checked zookeeper, in path "meta/1, value null. i wrote transactional spout myself implement interface itridentspout, think might problem spout have written. anyone can give me advice? or give me im

search - Seo, pagerank - query in url -

i have question pagerank. i want know, if google counting different pagerank these urls, or if query presence in url never mind , pagerank of these url counted 1 "site.com/dir/": a) site.com/dir/ b) site.com/dir/?q=875445 c) site.com/dir/?q=adssda or a) site.com/dir/index.php b) site.com/dir/index.php?q=875445 c) site.com/dir/index.php?q=adssda thank you google gives ranks pages e.g a) site.com/dir/ b) site.com/dir/?q=875445 c) site.com/dir/?q=adssda = page, b = different page, c = different page if want check ranks pages on go you can download extension google chrome called seoquake lets see kinds of stuff current page looking at. so doesn't matter how pages url like,if it's different page it's different page e.g different page rank