Posts

Showing posts from March, 2014

Running Enthought Canopy Python as root cannot import pandas -

i want access files , directories may require root permission command line call python script using enthought canopy python. running python root gives me system distributed python. $ python enthought canopy python 2.7.6 | 64-bit | (default, sep 15 2014, 17:36:10) [gcc 4.1.2 20080704 (red hat 4.1.2-54)] on linux2 type "help", "copyright", "credits" or "license" more information. $ sudo python python 2.7.6 (default, mar 22 2014, 22:59:56) [gcc 4.8.2] on linux2 type "help", "copyright", "credits" or "license" more information. same results using default bash terminal (ubuntu linux 14.04) , using canopy command line (canopy 1.5.2). i reinstalled canopy root (i.e. re-ran shell script root) , same problem still occurs. is there easy way run canopy root? not trying distribute number of users on system run python script on files need root permissions. it sounds sudo not using current path ...

android - Resource ID is not returning correct value -

Image
i having difficulty displaying images in listview. the output want should contain different images different list items. getting this: as can see icons being displayed same (booking). figure out until method itemimagesviews.setimageresource(itemsimages.getresourceid(position, r.drawable.booking)) itemadapter.java file not returning expected value. here repo: https://github.com/amar0891/aroma-holiday i don't know code in itemadapter.java. need this, if want see booking icon: itemimagesviews.setimageresource(r.drawable.booking); note: don't know code setup have getresourceid() , maybe main problem. another solution, recommended google, think is: resources resources = getresources(); itemimagesviews. setimagedrawable(resources.getdrawable(r.drawable.myfirstimage)); note: itemimagesviews imageview. setimagedrawable method supposed more efficent large images.

vba - Run macro by clicking away from any ActiveX textbox in a document -

i'm looking vba script run whenever click away of activex textboxes in document. alternative have run whenever click on textbox (without clicking away). how can done without assigning subs each textbox individually? double click on textbox , bring default method textbox, in testing textbox1_change(). method run every time type textbox. you see 2 dropdown boxes @ top of vba editor. drop down on 1 on right , you'll see other available methods textbox, 1 of lostfocus reckon suit purposes. clicking on creates sub execute every time textbox loses focus. see how go that. cheers

vb.net - .net failed to load assembly Microsoft.SqlServer.Management.IntegrationServicesEnum -

Image
it vb.net regular windows forms, showing charts thru report builder. application calls ssis packages , processes chosen data mining model programmaticly. message pops when client tries run data mining model... don't know missing. sql 2012 , visual studio 2012 also. client machine 64 bit windows7. database objects in dbo schema , client has owner privileges schema. client can including viewing charts except processing data mining structure.

groovy - Extract all particular field from JSON in mule esb -

i have json payload, want collect externallistingid in 1 shot - { "listings": { "numfound": 3, "listing": [ { "status": "inactive", "priceperticket": { "amount": 100, "currency": "usd", }, "paymenttype": "1", "externallistingid": "12208278", "city": "new york" }, { "status": "active", "priceperticket": { "amount": 4444, "currency": "usd" }, "paymenttype": "1", "externallistingid": "cid1421798897102:151681733", "city": "seattle" } ] } } i using mvel expression - <enr...

Dynatrace integration with Apache webserver -

i have apache webserver php module display information. i'd able data dynatrace , put data in webserver through cronjob. problem have no clue on how push data dynatrace server. there apis or different way of doing this? thanks in advance. dynatrace provides rest reporting interface can pull out data dynatrace can put on dashboard , in consumable such csv, xml, json, ... - here link public doc page on reporting interface: https://community.compuwareapm.com/community/display/docdt61/server-+and+clientside+xml+reporting so - need following 1: create dashboard , put charts on show measures interested in, e.g: apache thread count, cpu, throughput, ... 2: save dashboard on dynatrace server 3: use rest interface query data , put external system if have more questions on feel free post them on our own dynatrace community forum: https://community.compuwareapm.com/community/display/dtforum/dynatrace+forums+home andi

Java Hibernate.merge may in any circunstance return null? -

hello have snippet this. public void update(student student) { student=super.merge(student); currentsession().update(student); return; } but code throws java.lang.illegalargumentexception: attempt create saveorupdate event null entity. i wondering how possible merge may return null in circunstance?  because have checked student not null because if null merge throw. exception in thread "main" java.lang.illegalargumentexception: attempt create merge event null entity the situation think happening stuff if merge returning null possible?? sorry if question simple lot best regards venezuela.. merge() used merge detached object attached object (both have same id). example, passed in student1 object in method update(), has id , status detached: public void update(student student1) { //student1 in detached status, may modify if not yet done student1.setname("abc"); //now load student2 db same id, note student2 in pe...

Treeview to XML with proper indentation c# -

i'm having trouble exporting treeview xml file proper indentation, looked through forum not find anything. here link on how write xml treeview recursion, parsing xml file attributes treeview c# here code attempting export treeview xml public void exporttoxml(treeview tv, string filename) { sr = new streamwriter(filename, false, system.text.encoding.utf8); //write header sr.writeline("<?xml version=\"1.0\" encoding=\"utf-8\" ?>"); //write our root node sr.writeline("<" + treeview1.nodes[0].text + ">"); foreach (treenode node in tv.nodes) { savenode(node.nodes); } //close root node sr.writeline("</" + treeview1.nodes[0].text + ">"); sr.close(); } private void savenode(treenodecollection tnc) { fore...

Force R base plot to end on tick mark -

the powers demand plots end on tick marks. know can done in ggplot expand = c(0,0) , how can using base r? use xaxs , yaxs options,e.g.: plot(1:3,1:3,xaxs='r',yaxs='r') ?par says: xaxs style of axis interval calculation used x-axis. possible values "r", "i", "e", "s", "d". styles controlled range of data or xlim, if given. style "r" (regular) first extends data range 4 percent @ each end , finds axis pretty labels fits within extended range. style "i" (internal) finds axis pretty labels fits within original data range. style "s" (standard) finds axis pretty labels within original data range fits. style "e" (extended) style "s", except ensures there room plotting symbols within bounding box. style "d" (direct) specifies current axis should used on subsequent plots. (only "r" , "i" styles have be...

c# - Adding interactive 3D object into WinForms project -

so i'm making 3d ttt game , i'd love add 3d interactive cube live feedback, because game may hard grasp greater audience. i've chosen visual studio 2013 project , write in c#. game looks 7 isolated squares containing 7^2 buttons. idea add 7^3 cube of 343 cells better navigation form. obviously, each cell within cube have linked each wf button. so far i've spent goodly time on internet , teacher unable provide answer, come you. there way it? you try slimdx: http://slimdx.org/ free open source framework enables developers build directx applications using c# opentk http://www.opentk.com/ option.

c# - How to check for a double type response in an if statement -

i'm trying check if user's response double or int , int specific, whereas double not, made right mess of explaining it, here's code: console.writeline("\n 2) q: how old sally? \n"); int nsallyage = convert.toint32(console.readline()); double dsallyage = convert.todouble((nsallyage)); if (nsallyage == 62 || dsallyage == 62.0) { // increase score suser1score++; console.writeline("\n a: correct, sally's age 62, have been awarded 1 point. \n"); console.readline(); } what i'm trying do, instead of dsallyage has equal 62.0 , has equal double figure. i approach problem first creating method gets double user (that will, of course, accept int). removes error handling main code. note in code below, math.truncate can replaced math.floor , same result: private static double getdoublefromuser(string prompt) { double input; while (true) { if (prompt != null) console.write(prompt); if (d...

Dapper.net dynamic OR query -

new using dapper , need little help. have .csv file read dynamically generate select statement. the .csv file contents this: id,fromdate,todate 1,20100101,20110101 2,20110101,20120101 3,20100101,20120101 etc... the query need dynamically generate should be: select * targettable (id = 1 , cdate between 20100101 , 20110101) or (id = 2 , cdate between 20110101 , 20120101) or or (id = 3 , cdate between 20100101 , 20120101) how can dapper? why not building query? assuming have data in form after reading csv , push classes: public class data { public int id { get; set; } public int fromdate { get; set; } public int todate { get; set; } } i'd pass query string: list<string> lines = new list<string>(); foreach (var data in listdata) // listdata ... list<data> { string line = string.format("(id = {0} , cdate between {1} , {2})", data.id,data.fromdate, data.todate); lines.add(line); } string additionalquery = ...

bash - zsh not finding terminal command -

i'm trying read every line of file gems, instance line gems.txt : active_directory -v 1.6.0 . while read line "gem dependency $line --remote" done < gems.txt and i'm getting zsh: command not found: gem dependency active_directory -v 1.6.0 --remote i have no clue why happening. i removed quotes following cyrus advice , worked.

PHP MySQL Assign foreign keys duplicated in DB -

i have following code: $fkquery = "select table_constraints.table_name, key_column_usage.column_name, key_column_usage.referenced_table_name, key_column_usage.referenced_column_name information_schema.table_constraints right outer join information_schema.key_column_usage on information_schema.table_constraints.constraint_name = information_schema.key_column_usage.constraint_name information_schema.key_column_usage.constraint_name <> 'primary' , information_schema.table_constraints.constraint_type = 'foreign key' , information_schema.table_constraints.table_schema = '".$dbname."';"; $fkqueryresult = $newlink->query($fkquery); $a = 0; while($fkey = $fkqueryresult->fetch(pdo::fetch_assoc)) { $testf[] = $fkey; $assocf = $testf[$a]; $newtablename = $assocf['table_name']; $newcolumnname = $assocf['column_name']; $newreftablename = $assocf['referenced_table_name']; $newrefc...

SQL Azure resource_stats view is empty -

Image
we're having trouble reliability of our sql azure database , , in effort see if consuming excessive resources tried view our stats records. msdn offers initial guidance on querying sys.resource_stats our sys.resource_stats view returns no records @ all. if try view monitoring in azure portal, error server not retrieve metrics. we have no idea why view not return records or how fix it. there known issue causes telemetry not displayed. fix issue beeing roll-out. you can query sys.dm_db_resource_stats in database (not master) utilization data last hour. view has advantage of showing finer granular data sys.dresource_stats in master.

ruby on rails - Pass a variable from view to controller from form submit -

i trying access variable sent through submit form. not appear present once form submitted. see hidden field on line: 2 <%= form_for @import, html: { multipart: true } |f| %> <%= f.hidden_field :tree_id, :value => @tree.id %> <%= f.label :new_branch_data %> <div class="help-text">locate file import. (.xls, .xlsx file type)</div> <%= f.file_field :attachment %> <%= f.submit "import", class: "btn btn-primary" %> <% end %> after hitting submit action called in controller: def index @tree = tree.find(params[:tree_id]) ... ... end hangs on @tree = tree.find(params[:tree_id]) , returns "activerecord::recordnotfound" @ /imports couldn't find tree without id how can correct @tree variable referenced in form can passed controller? you can inspect params you're getting guess have tree_id on params[:import] ... def index @tree = tree.find(params[:import]...

.htaccess - htaccess redirect domain to https, subdomain to http and www to non-www -

i’m trying that: force https main domain. http or https://www.domain.com -> https://domain.com http or https://domain.com -> https://domain.com but not subdomains http or https://www.subdomain.domain.com -> http://subdomain.domain.com http or https://subdomain.domain.com -> http://subdomain.domain.com and removing www. now have that: rewritecond %{http_host} ^www\.(.*)$ [nc] rewriterule ^(.*)$ http://%1/$1 [r=301,l] rewritecond %{https} off rewriterule (.*) https://%{http_host}%{request_uri} [r=301,l] this redirects www non-www , http https not subdomains. subdomain remains www , https. thanks you can use these 2 rules: # main domain rewritecond %{http_host} ^(www\.)?domain\.com$ [nc] rewritecond %{https} off [or] rewritecond %{http_host} ^www\. [nc] rewriterule ^ https://domain.com%{request_uri} [r=301,l,ne] # sub domain rewritecond %{http_host} ^(www\.)?subdomain\.domain\.com$ [nc] rewritecond %{https} on [or] rewritecond %{http_host} ^...

sql server - Sub query returning all values and then applying where condition -

i having issue query in 1 particular environment/database if data similar. here simplified scenario: table - 1 column - id (long) id 1 2 3 table b - 2 columns - value(varchar) , field2(varchar) value field2 1)abc notkey 2)test notkey 3)1 key 4)1.56 notkey when run query select * table id in(select value table b field2 = 'key') i error result: conversion failed when converting varchar value 'abc' (earlier had value erraneously 'notkey') data type int. on 1 database. in 3 other databases, value returns correctly "1". i using sql server 2008. might issue here? you gave wrong filter filter leads error. the errror happens when select: select * tablea id in(select value tableb field2 = 'notkey') you have cast 1 of columns select * tablea cast( id nvarchar(20)) in(select value tableb field2 = 'notkey') http://sqlfiddle.com/#!6/e9223/23

Proper way to add data in the R package -

i creating package data in using devtools package. far package works functions stored in package, however, cannot make data on package work. i tried follow format used hadley in ggplot2 documentation. have simple data far has 6 rows , 2 columns. i used following documentation on r file. #' jdutils package #' @name jdutils #' @doctype package null #' sample state plane coordinates #' #' dataset containing x coordinates , y coordinates in state plane coordinate #' system in feet. #' #' \itemize{ #' \item x_coord_as_numeric. x coordinate of station #' \item y_coord_as_numeric. y coordinate of station #' } #' #' @doctype data #' @name samplestations #' @keywords datasets #' @usage data(samplestations) #' @format dataframe 6 rows , 2 variables null after creating package , installing it, when try run following command load data error. > data(samplestations) warning message: in data(samplestations) ...

php - When I do a successful insert, mysql_insert_id() returns 0 -

i have class db. when insert (a success one) calling function singlequery , $id=mysql_insert_id(); returns me 0. why? i want auto_increment id. what doing wrong? thanks! class database{ //atributos private $connectionstring="mysql:host=localhost;dbname=practica"; private $user="root"; //usuario de la bbdd con permisos filtrados private $password="root"; private $db; private function connect(){ $flag=true; try{ $this->db = new pdo($this->connectionstring, $this->user, $this->password); }catch(pdoexception $e) { $flag=false; } return $flag; } private function disconnect(){ $this->db=null; } public function singlequery($sql,$vector){ //insert, update, delete if($this->connect()){ $fla="products"; $posicion = strpos($sql,$fla); if ($posicion === f...

Gettext in PHP requires setlocale(LC_MESSAGES, NULL) to be called -

when using php 5.5.9 on ubuntu, gettext isn't working although set correctly. the lines use set gettext following ones: putenv('lang=es_es.utf8'); setlocale(lc_messages, 'es_es'); bindtextdomain('messages', './i18n'); bind_textdomain_codeset('messages', 'utf-8'); textdomain('messages'); this should contain needed. gettext returning default locale's strings (the ones passed in), never correct translations. calling locale -a lists languages needed, set correctly, too. the phpinfo() proves gettext (and intl extension) installed correctly: gettext support = enabled intl version = 1.1.0 icu version = 52.1 icu data version = 52.1 ubuntu has been rebooted, of course. and, finally, directory specified contain required translation files gettext. to put short, seems set correctly -- doesn't work. however, when add setlocale(lc_messages, null); before call setlocale(lc_messages, 'es_es'); , get...

c# - How to convert string to int32 from data table? -

i approached issue trying convert string (movie name) int32 (movie id #) when typed movie name print out movie id number. doing wrong here? causes error stated: unable cast object of type 'system.data.sqlclient.sqlconnection' type 'system.iconvertible' my code: string filename, connectioninfo; sqlconnection db; this.listbox1.items.clear(); filename = "netflix.mdf"; connectioninfo = string.format(@"data source=(localdb)\v11.0;attachdbfilename=|datadirectory|\{0};integrated security=true;", filename); db = new sqlconnection(connectioninfo); db.open(); sqlcommand cmd = new sqlcommand(); cmd.connection = db; string moviename = textbox1.text; cmd.commandtext = string.format( @"select movieid movies moviename = '{0}';", moviename); sqldataadapter adapter = new sqldataadapter(cmd); dataset ds = new dataset(); adapter.fill(ds); db.close(); int id = system.convert.toint32(...

php - Making Posts on Blogspot Automatically -

hello trying develop function make posts blog within code without sort of authorization or action website viewer. i need send 2 parameters, post title , post content. we can assign $title , $content i have been working , researching 2 weeks now. there 0 documentation on how this, , documentation exist out dated , difficult use. any desperately appreciated. i have been able configure api key correctly using blogger v3 api public key. have been getting valid return of json data, although need know how make posts. thank you! <?php function file_get_contents_curl($url) { $ch = curl_init(); curl_setopt($ch, curlopt_header, 0); curl_setopt($ch, curlopt_returntransfer, 1); //set curl return data instead of printing browser. curl_setopt($ch, curlopt_url, $url); $data = curl_exec($ch); curl_close($ch); return $data; } $blogid = '2139447653782748476'; $apikey = '***'; $requesturl = "https://www.googleapis.com/blogger/v3/blogs/{$blogid}?key={$apik...

java - Android NullPointerException in ArrayAdapter<String> due to AsyncTask onPostExecute() -

i'm having trouble null pointer exception on android project when using asynctask. exception follows: 03-17 02:17:36.774 14084-14084/me.ashkelon.sunshine w/dalvikvm﹕ threadid=1: thread exiting uncaught exception (group=0x41934ce0) 03-17 02:17:36.784 14084-14084/me.ashkelon.sunshine e/androidruntime﹕ fatal exception: main process: me.ashkelon.sunshine, pid: 14084 java.lang.nullpointerexception @ android.widget.arrayadapter.createviewfromresource(arrayadapter.java:394) @ android.widget.arrayadapter.getview(arrayadapter.java:362) @ android.widget.abslistview.obtainview(abslistview.java:2255) @ android.widget.listview.makeandaddview(listview.java:1790) @ android.widget.listview.filldown(listview.java:691) @ android.widget.listview.fillspecific(listview.java:1349) @ android.widget.listview.layoutchildren(listview.java:1608) @ android.widget.abslistview.onlayout(abslistvie...

javascript - Change picture when audio is playing (jQuery, HTML5) -

i need this: <script> $(window).load(function(){ function swapimages(){ var $active = $('#mygallery .active'); var $next = ($('#mygallery .active').next().length > 0) ? $('#mygallery .active').next() : $('#mygallery img:first'); $active.fadeout(function(){ $active.removeclass('active'); $next.fadein().addclass('active'); }); } $('#audio').click(function() { alert("yessssssssssss!"); setinterval("swapimages()", 5000); }); }); </script> the "click function" doesn't work. have mention, audio part loaded php file after previous jquery call action. so, can do? thanks! <audio controls='controls' id='audio'> <source src=". $final_file ." type='audio/mp3'/> </audio> if...

angularjs - Can I run Angular-U/UI-Router with Notepad++? -

is there way run ui-router without running bower/npm, etc? https://github.com/angular-ui/ui-router i tried linking (just angular), didn't work. tried saving locally in .js file , referencing it. didn't work either. missing or trying impossible? edit: alternatively, there anywhere test this? plunkr or something? here's source think latest. think should able link in <script /> tag in index.html : http://angular-ui.github.io/ui-router/release/angular-ui-router.js or copy text file , run locally, since think you're trying test out. if didn't work, maybe make sure have of dependencies, if any. of course looks it's package in plunkr, should able try there. added , latest angular (haven't tested though): http://plnkr.co/edit/jdx6prn6nohh1jop5ch6?p=catalogue

ruby on rails - Heroku Postgresql SET datestyle To european -

i addressing issue cannot copy data postgresql in rails because date format not in matching default postgresql iso mdy. on local machine changed datestyle european dmy data matches correctly. as usual, not easy on heroku production server. using steps below try change datestyle, works, doesn't persist (as shown exiting, going in , asking postgres show me datestyle). any ideas how can persist this. research has show not , change code convert data mdy pulling millions of rows legacy system defaults dmy , using postgresql copy command fastest way possible. seems easier tell postgresql change datestyle fix else :/ $ heroku pg:psql app-name::crimson=> set datestyle 'european'; set app-name::crimson=> show datestyle; datestyle ----------- iso, dmy (1 row) app-name::crimson-> \q $ heroku pg:psql ---> connecting heroku_postgresql_crimson_url (database_url) psql (9.4.1, server 9.3.6) ssl connection (protocol: tlsv1.2, cipher: jibberish, bits: 256, com...

multithreading - Java Interthread Communication not passing message object -

to communicate between threads, followed oracle guarded blocks example , readily compiles , runs. architecture different, consumer spawns producer task, though tried variation example , works perfectly. the pertinent code main program; public static void main(string[] args) { ... framemsg framemsg = new framemsg(); awarenessanalytics awarenessanalytic = new awarenessanalytics(framemsg); awarenessanalytic.start(); the pertinent code consumer thread; public class awarenessanalytics extends thread implements motioneventlistener{ framemsg framemsg; framewithmotiondetection framewithmotiondetection; public awarenessanalytics(framemsg framemsg) { this.framemsg = framemsg; system.out.println("awarenessanalytic framemsg = " + this.framemsg.hashcode()); } advancedvideoanalytics tempintermediateva; tempintermediateva = new advancedvideoanalytics(framemsg); public void run() { tempintermediateva.start(); while (...

javascript - How to detect whether an html input object is a button or not? -

i working on trying pull inputs form, excluding buttons, not radio buttons. getting inputs via .find() method of form element. have inputs, unable restrict them inputs other submit button or similar button. have tried jquery .is(), .type(), both no luck suggestions/ references helpful have not found of yet. here code using pull forms. var inputs = formlist.find(":input"); if (inputs ? inputs.length > 0 : false) { for(j = 0;j < inputs.length; j++) { console.log("input: " + inputs[j]); if (inputs[j].name != "") { webforms.push({"inputname": inputs[j].name}); }else if (inputs[j].id != "") { webforms.push({"inputname": inputs[j].id}); } } } like said, have tried .is , .type no luck. here example of how using .is() var formlist = $(...

php - codeigniter and fpdf code blockin during pdf output -

i have big problem fpdf in page have lot of code , @ end create pdf file sample: require('fpdf.php'); $pdf = new fpdf(); $pdf->addpage(); $pdf->setfont('arial','b',16); $pdf->cell(40,10,'hello world!'); ob_end_clean(); $pdf->output(); the result creatioin of pdf make , other code no ! first code of sample is: require('fpdf.php'); $pdf = new fpdf(); $pdf->addpage(); $pdf->setfont('arial','b',16); $pdf->cell(40,10,'hello world!'); //ob_end_clean(); $pdf->output(); like code before execute without problem not pdf , receive on browser: fpdf error: data has been output, can't send pdf file can me ? im newbie fpdf libraries that because php code has already outputted data browser. check php not write data browser yet ( except headers ) before calling $pdf->output() , avoiding sending unknown data has pdf binary data appended @ end. the ob_end_clean() function call e...

ruby on rails - AWS S3 404 errors slowing down performance significantly -

i'm uploading images rails app directly s3. when load index page shows images, retrieving image url directly s3. what i'm trying check if s3 image exists using 'exists?' method in api documentation, , if image exists, show image, , if doesn't exist, show default image that's stored in asset pipeline. i'm able this, performance becomes slow (10 sec load time!) , logs, due 404 keynotfound errors returns images don't exist. when retrieve images without doing exists? check, page loads faster (less 1 sec - images aren't there blanks on web page). how can around this? show default image in case of missing image. store images on s3, keep view fragment caches containing images on server. the first page access tries show image incur cost, thereafter, cache hits mitigate response time other attempts show image. with relatively simple fragment cache management logic, can work out quite caching pieces of views take "too time" ass...

angularjs - ng-mousedown handler attaching to ng-mouseup's event -

Image
i trying use ng-mousedown , ng-mouseup in concert, ng-mousedown firing twice , ng-mouseup not firing @ all. example, following code causes count increment 2 instead of going on press , down on release: <!doctype html> <html> <body ng-app> <div> <div style="background-color: blue; width: 80px;" ng-mousedown="count = count + 1" ng-mouseup="count = count - 1" ng-init="count=0">click me</div> <div>{{count}}</div> </div> <script src="http://ajax.googleapis.com/ajax/libs/angularjs/1.3.14/angular.min.js"></script> </body> </html> if change angular version 1.1.1 works expected. doing wrong or bug in angular? i've tested in chrome , firefox. works in firefox, not chrome. update: after further testing appears may fail work in chrome on linux 64. might bug in chrome. i loaded test file chrome directly , found worke...

php - Setting up Zend Loader License path in .htaccess -

i'm trying set zend loader need set zend_loader.license_path= in php.ini. sadly server provider doesn't allow editing of php.ini, i'm trying set in .htaccess file. tried : php_value zend_loader.license_path /licensefiles/polski.zl but doesn't work. using php_value zend_loader.license_path=/licensefiles/polski.zl gives me 500 internal error any ideas how work ? your server provider may preventing setting these kinds of values via htaccess files. try putting path in quotes: php_value zend_loader.license_path "/licensefiles/polski.zl" once have set value, run phpinfo() function , verify it's not being picked up. if not, try , change other php settings via same method , see if are/aren't being picked up. even though server provider may block setting of values via htaccess may provide way set parameters this. example, server providers allow drop in local "php.ini" file hosting directory picked , processed. che...

debian - What is the best way to watch and signal file changes to a node.js app? -

i periodically rsync code changes production server. have following cluster code creates workers main app. var cluster = require('cluster'); function startworker() { var worker = cluster.fork(); console.log('cluster: worker %d started', worker.id); } if(cluster.ismaster){ require('os').cpus().foreach(function(){ startworker(); }); // log workers disconnect; if worker disconnects, // should exit, we'll wait exit event spawn // new worker replace cluster.on('disconnect', function(worker){ console.log('cluster: worker %d disconnected cluster.', worker.id); }); // when worker dies (exits), create worker replace cluster.on('exit', function(worker, code, signal){ console.log('cluster: worker %d died exit code %d (%s)', worker.id, code, signal); startworker(); }); } else { // start our app on worker; see meadowlark.js requi...

javascript - Ember.js: redirect in router if certain condition is satisfied in controller? -

basically objective render account page if user logged in, otherwise redirect login page. i have following routes: app.router.map(function() { this.resource('account', { path: '/'}); this.route('login', { path: '/login' }); }) my current code tries access loggedin attribute in account controller in route: app.accountroute = ember.route.extend({ rendertemplate: function(controller) { var loggedin = controller.get('loggedin'); // error: controller undefined if (!loggedin) { this.transitionto('login'); } } }); should implement logic in router? why controller undefined in route? thanks! here couple ideas might you: your controller not exist. created ember when needs first time. can use chrome extension ember debugging see controllers created. in case should available though since in rendertemplate hook. in general, redirects should done either in beforemodel hook or redirect hook: redi...

c - How to concatenate two strings in assembly? -

hello trying concatenate 2 strings. i load strings 1, 2, & 3. need store final string in r2. i load strings memory using ldr , can store them using str . code anyone know effective way concatenate them? adding them above not right? registers limited 1 byte of data maybe doing else wrong.. i noob. sonething that. assume strings aren't null terminated because doesn't appear in code example. also you'd want store string1 , string2 in .text section (read permanent memory), while string3 .data section, since buffer in ram. ;stings aren't \0 terminated (like in c) should deal size ourselves mov r4, #string1_size loop1: ldrb r3, [r0], #1 ;copy string1 srtring3 strb r3, [r2], #1 subs r4, #1 bne loop1 mov r4, #string2_size loop2: ldrb r3, [r1], #1 ;copy string2 string3 strb r3, [r2], #1 subs r4, #1 bne loop2 ;done

c# - user input initialized array example and implicit conversion -

is there way cast unhandled exception line "input string" in "correct" int "format"? don't remember work around type of incompatible implicit conversion...unhandled exception @ statement in first loop. public class arraytest { public static void main() { // initialize array int[] myarray; console.writeline("enter size of array"); int arrayvariable = convert.toint32(console.readline()); myarray = new int[arrayvariable]; console.writeline("element @ index {0}", arrayvariable); console.writeline("enter elements of array"); (int = 0; < arrayvariable; i++) { myarray[i] = convert.toint32(console.readline()); } (int = 0; < arrayvariable; i++)// display array elements { console.writeline("element @ index {0} {1}: ", ...

python - Safe method parsing text files with a user provided script -

i'm looking way parse text url has been provided user, parser script has been provided user. eval easy enough, super scary. end goal allow user point server data source , tell server how read data. what best safest way this? python or node preferred, i'm not limited specific language. so example. cvs document, i'll have text file. url: http://www.ams.usda.gov/mnreports/lm_xb803.txt this python script can read file url, , stored on database: expected_length = 6 requiredfeilds = ['low','high'] requirednonzero = ['low','high'] response = urllib2.urlopen(url) reader = csv.reader(response) grade = none date = none first_row = true keep_list = [] row in reader: if len(row) != expected_length: continue if first_row: date_text = row[2] date_object = datetime.strptime(date_text, '%m/%d/%y') date = date_object.strftime("%y-%m-%d") first_row = false row_label = row[0].strip() row_...

swift - How to prevent a 'Array index out of range' error? -

is there way, similar using if let and/or optionals, test whether index empty buffer in swift? define own: extension array { func ref (i:int) -> t? { return 0 <= && < count ? self[i] : nil } } the ref() function returns optional, can nil , , can use if let syntax access returned value ref() when exists. use such: var mya = [10,20,30] if let val = mya.ref(index) { // use 'val' if index < 3 } else { // if index high }