Posts

Showing posts from January, 2015

office365api - Profile details in outlook rest api -

starting here: https://dev.outlook.com/restapi/tutorial/php scopes: private static $scopes = array("openid" ,"profile" ,"offline_access" ,"https://outlook.office.com/calendars.read" ,"https://outlook.office.com/contacts.read" ); when authenticate in id_token basic info profile. with: https://outlook.office.com/api/v2.0/me/contacts i nice details contacts, phone numbers i'm specially interested in case. is possible same level of details current user profile 1 of contacts when accessed through api? how using microsoft graph api: get https://graph.microsoft.com/v1.0/me the response should following: http/1.1 200 ok content-type: application/json content-length: 491 { "businessphones": [ "businessphones-value" ], "displayname": "displayname-value", "givenname": "givenname-value", "jobtitle": "jobtit

node.js - trouble with configuring client using node-xmpp-client -

i'm trying create xmpp http gateway in nodejs using node-xmpp-client , adastra.re xmpp server. i've never worked xmpp before , i'm having trouble configuring client. var client = new xmpp.client({ jid: ???, password: '***', host: " https://adastra.re/ " bosh: ???? }) what jid , bosh? thought jid email of client want log in , password password email. appears not case. , i've been having trouble understanding bosh too. appreciated. xmpp server not understand http protocol. bosh work mediator between your http request , xmpp server. jid user id registered in xmpp server. example xmpp server adastre.re , mahesh@adastre.re. i hope helps.

node.js - login using passport always get error 400 bad request -

hi i'm using express implements passport, don't knows when i'm hit login url error 400 bad request. code : main.js : var express = require('express'); var app = express(); require('./config/passport'); require('./config/static')(app, express); require('./config/routes')(app); require('./config/seed')(); app.listen(3000, function () { console.log('example app listening on port 3000!'); }); passport.js : var passport = require('passport'); var user = require('../api/model/user.model'); var localstrategy = require('passport-local').strategy; passport.use(new localstrategy({ usernamefield: 'email', passwordfield: 'password' }, function(username, password, done) { user.findone({ username: username }, function (err, user) { if (err) { return done(err); } if (!user) { return done(null, false); } if (!user.verifypassword(password)) { return done

.htaccess - Enable CORS in Wordpress to use JSON -

i'm trying enable cors in wordpress. found lot of documentation. nothing works me. same error. xmlhttprequest cannot load 'access-control-allow-origin' header contains invalid value ''. origin 'file://' therefore not allowed access. try put code in .htaccess , in header.php file in wordpress. test url in http://client.cors-api.appspot.com/ , get. fired xhr event: loadstart fired xhr event: readystatechange fired xhr event: progress fired xhr event: error xhr status: 0 xhr status text: fired xhr event: loadend i'm lost, try everithing nothing works.

jquery - HTML/JavaScript - Populate radio button if checkbox is checked -

i'm trying write javascript code if of checkboxes in group selected, radio button should populated. following code i'm working on: <html> <head> <title>radio buttons , checkboxes</title> </head> <body> <form> <h3>radio buttons</h3> <input type="radio" name="radio1" id="radio1"> radio 1 <br> <input type="radio" name="radio2" id="radio2">radio 2 <br> <br> <h3>checkbox groups</h3> <h4><u>group 1</u></h4> <p align="center"><u>pd</u></p> <ul> <li><input type="checkbox" name="g1pd1">g1 pd1</li> <li><input type="checkbox" name="g1pd2">g1 pd2</li> </ul>

gwt - Calling Java Method from within JSNI method -

i trying call java method within jsni method. not getting type of error window.alert() never gets called. package com.mywebsite.myapp.client; public class myapp implements entrypoint(){ /// other stuff.... public native void gettoserver(string trainername)/*-{ $wnd.$.get( "http://testdastuff.dev/trainerstats", { trainer: trainername} ) .fail(function() { $wnd.console.log("error"); }) .done(function( data ) { if(data == "nodata"){ alert("no data"); this.@com.mywebsite.myapp.client.myapp::testjsni()(); } }); }-*/; public void testjsni(){ window.alert("working"); } } it alerting "no data" know wrong way calling method. cant static method. inside of done callback have lost this (it point else now). you need preserve via bind or local variable ( var self = this ).

phpunit - Unit testing of a class reading a configuration file -

i have class "configuration" has method "getconfig" reads configuration file "config.ini" have app configs (database credentials , host, apis keys, .....) for have unit test tests if database entry exists in config file , @ same time confirms array returned method "getconfig" has key "database": function testconfigfilehasdatabaseentry() { $configuration = configuration::getinstance(); $arrconfig = $configuration->getconfig(); $this->assertarrayhaskey('database', $arrconfig); } i have unit test confirms "getconfig" returns variable of type array. my question following: in terms of unit testing best practices, in case test enough confirm function getconfig tested or better confirm every key exists in config file. think confirming entries in config file maybe falls under category of testing, want sure. let me know best practice in case. base on answer of gcontrollez realized better post c

java - XMotion dealing with JComponents -

this question has answer here: how move image (animation)? 2 answers i having trouble. want draw rect onto jpanel added jframe contentpane. want x @ set pos moving -x , restarting +x begins. i.e. if have jpanel 800 x 400, want rext take in parameters moving along xaxis (x - velx) repainting @ 800 , continuing in - x direction. know isn't sufficient info, none of books have touch base on trying lack proper terminology. // here example of doing this public class animatedboat { public static void main(string[] args) { new animatedboat(); } public animatedboat() { eventqueue.invokelater(new runnable() { @override public void run() { try { uimanager.setlookandfeel(uimanager.getsystemlookandfeelclassname()); } catch (classnotfoundexception | instantiationexception | illegalaccessexception | u

Is there any difference between this and self when assigning curried functions inside an object in JavaScript? -

suppose have following code: <html> <head> <title>test</title> </head> <body> <header><h1>test</h1></header> <script type="text/javascript"> function myfunction2wrapper(arg1) { return function() { console.log("state of arg1 in curried function is: " + arg1); } } function myobject() { var internalstate1 = "a"; function myfunction1() { console.log("state of internalstate1: " + internalstate1); } myfunction1(); this.myfunction2 = myfunction2wrapper(internalstate1); //self.myfunction2 = myfunction2wrapper(internalstate1); myfunction2(); //console.log(myfunction2); console.log("done!"); }; myobject(); </script> </body> </html&

Aurelia <compose> model.bind what triggers a change event? -

in aurelia have ability dynamically compose viewmodels , views using <compose> element. can supply object of data via model.bind accessible via activate method of provided viewmodel. my question is, conditions trigger change event on provided model data? if change property on object provide, activate method gets object first parameter see change? or entire object need replaced trigger change? the activate(model) gets called once when model bound view model. when model attributes change, changes reflected in composed view model because model reference, not copy. for example, have view / view model target route follows (this example not clean example because experimenting other things well, should clear enough): view: view creates 2 sections separated <hr> . top displays model.message each view. bottom creates <compose> each view. <template> <div repeat.for="view of openviews"> <p>${view.model.message}<

c++ - Helpt with error C2259: cannot instantiate abstract class -

i trying write program homework, , wasn't throwing c2259 error until added createlist function. can't figure out problem originating from. new @ c++ might easy fix, lost. here main function: #include <iostream> #include "binarysearchtree.h" #include "orderedlinkedlist.h" using namespace std; int main() { bsearchtreetype<int> treeroot; //error c2259: 'bsearchtreetype<int>' //cannot instantiate abstract class orderedlinkedlist<int> newlist; int num; cout << "enter numbers ending -999" << endl; cin >> num; while (num != -999) { treeroot.insert(num); cin >> num; } cout << endl << "tree nodes in inorder: "; treeroot.inordertraversal(); cout << endl; cout << "tree height: " << treeroot.treeheight() << endl; treeroot.createlist(newlist); cout &l

Why can't php pthread modify an object? -

i'm using php5.4, , wirte following code test. pass object worker thread, , try modify object in thread, doesn'g work expected. <?php class workerthread extends thread { var $foo = null; public function __construct($foo) { $this->foo = $foo; } public function run() { echo "thread started.\n"; $this->foo->val = 2; echo "\n"; echo $this->foo->val; echo "\n"; echo "thread exit${val}.\n"; } } class { var $val = 1; } $foo = new a(); var_dump($foo); $thread = new workerthread($foo); $thread->start(); sleep(1); var_dump($foo); $foo2 = $foo; $foo2->val = 3; var_dump($foo); ?> this output get: object(a)#1 (1) { ["val"]=> int(1) } thread started. 1 # expect 2 here thread exit. object(a)#1 (1) { ["val"]=> int(1) # expect 2 here } object(a)#1 (1) { # expected ["

cordova - ionic platform error when adding android platform -

i trying add android platform ionic when add keeps getting error adding android project... creating cordova project android platform: path: platforms\android package: com.ionicframework.carmart632655 name: carmart activity: mainactivity android target: android-23 android project created cordova-android@5.1.1 installing "cordova-plugin-console" android failed install 'cordova-plugin-console':error: cmd: command failed exit code enoent @ childprocess.whendone (c:\users\uvindu\appdata\roaming\npm\node_modules\cordova\node_modules\cordova-lib\node_modules\cordova-common\src\superspawn.js:169:23) @ emitone (events.js:90:13) @ childprocess.emit (events.js:182:7) @ process.childprocess._handle.onexit (internal/child_process.js:198:12) @ onerrornt (internal/child_process.js:344:16) @ nexttickcallbackwith2args (node.js:474:9) @ process._tickcallback (node.js:388:17)error: cmd: command failed exit code en

javascript - running gulp & express simultaneously -

set gulp, set node, express. i'm running gulp, it's watching tasks. set express, it's running on port 3001, gulp 3000 default? i go localhost:3000, see index.html, go localhost:3001 (the express port) , see index.html, without css. going on here , how can work both on 1 port? possible? keep gulp , node server running? new js. here's files: package.json { "name": "hour-hour", "version": "0.0.1", "private": true, "description": "find best local happy hours , drink specials near you.", "main": "server.js", "scripts": { "test": "echo \"error: no test specified\" && exit 1" }, "author": "corey maret", "license": "isc", "devdependencies": { "browser-sync": "^2.12.3", "del": "^2.2.0", "express":

html - PHP and mysql Table -

so developing basic website reports locations of items stored in database. trying create table of results tables stored within phpmyadmin. what want make each table row link page item expanded more detail (individual page result). e.g. person clicks on row relating shop directed page shop. how do using php. see code below while($row = mysqli_fetch_assoc($results)){ $ratingstars = ""; $ratingno = $row[rating]; for($i=0; $i<$ratingno; $i++){ $ratingstars .= "&#9733; "; } echo "<form action='' method='post'>"; echo "<tr id=". $row['id'] .">"; echo "<td class='lrg-tbl-row'>" . $row["hotspot-name"] . "</td>"; echo "<td class='lrgz-tbl-row'>" . $row["address"] . "</td>"; echo "<td class='lrg-tbl-row'>" . $row["suburb&quo

android - Structure for SQLite database info to ListView -

i've seen few answers here, lot of answers either going on head or can't relate them app. wondering if break down little more me i'm kind of new programming . i'm trying fill expandablelistview data sqlite database in android. have class called databasehelper creates database/tables , adds , removes data, can recall information through cursor display data in alertdialog. i'm trying have information dynamically loaded expandablelistview. i have method in database helper: public cursor getalldata() { sqlitedatabase db = this.getwritabledatabase(); cursor res = db.rawquery("select * "+ table_name, null); return res; which returns cursor object table inside. fill listview understanding need use simplecursoradapter , apply listview. need create seperate class simplecursoradapter? , if how apply simplecursoradaptor expandablelistview? all code below. mainactivity.java public class mainactivity extends appcompatactivity { databasehe

arguments - Use Python Argparse with several subparsers -

hi trying configure argparse several subparsers accepting specific long arguments. here below code import argparse parser = argparse.argumentparser(prog='program', description='prog description') subparsers = parser.add_subparsers(help='choices') parser.add_argument('--choice', '-c', choices=['a', 'apple', 'b', 'banana', 'l', 'lemmon', 'p', 'papaya'], type=str, help='menu choices', required=true) a_parser = subparsers.add_parser("a") b_parser = subparsers.add_parser("b") l_parser = subparsers.add_parser("l") p_parser = subparsers.add_parser("p") a_parser.add_argument("--peel") b_parser.add_argument("--peel") l_parser.add_argument("--lamount") p_parser.add_argument("--pamount",required=true,type=str) but failing @ following points. subparsers should accept both short form , long forms.

arrays - Fetch values from a table using jquery on basis of a checkbox update -

i fetched date using api , displaying in table using this code: this resulted in 176 values checkbox . want if checkbox state changed should able fetch value , associated td value in array. can me not able think of solution. here screenshot of output along want achieve: i'd suggest giving each td element associated value class, can use jquery grab value. suppose gave class name of 'value'. then, try this: $('checkbox').on('click', getvalue); function getvalue() { var value = $(this).closest('tr').find('.value').text(); } i hope helps!

angular - Elvis Operator with *ngFor -

is legal use elvis operator *ngfor (place question mark after users , since array might null @ moment)? <tr *ngfor="#user of users?"> <td> {{user.username}}</td> </tr if array users null, elvis operator in {{user.username}} redundant because <td>...</td> never gets created , {{user.username}} isn't evaluated @ all.

Is hoisting really necessary in javascript to enable mutual recursion? -

in online course, kyle simpson says following code demonstrates necessity of hoisting in javascript, because without hoisting "one of functions declared late." a(1) // 39 function a(foo){ if (foo > 20) return foo return b(foo+2) } function b(foo){ return c(foo) + 1 } function c(foo){ return a(foo*2) } but works fine. var = function(foo){ if (foo > 20) return foo return b(foo+2) } var b = function(foo){ return c(foo) + 1 } var c = function(foo){ return a(foo*2) } a(1) // 39 so what's story? convenience , placement of invocation aside, there situations require hoisting? the claim i've made non-hoisted js being unable support mutual recursion conjecture illustration purposes. it's designed understand need language know variables available in scope(s). it's not prescription exact language behavior. a language feature hoisting -- hoisting doesn't exist, it's metaphor variables being declared in scope

jquery - what is slowing down this webpage in my local server? -

this jsfiddle $(document).ready(function(){ $(".red").click(function(){ $(".red").addclass("selected"); $(".orange").removeclass("selected"); $(".yellow").removeclass("selected"); $(".green").removeclass("selected"); $(".lightblue").removeclass("selected"); $(".darkblue").removeclass("selected"); $(".pink").removeclass("selected"); $(".brown").removeclass("selected"); $(".black").removeclass("selected"); $(".white").removeclass("selected"); }); $(".orange").click(function(){ $(".orange").addclass("selected"); $(".red").removeclass("selected"); $(".yellow").removeclass("selected");

javascript - Difference between normal (popup) Chrome extension and an extension that adds a tab in developer tools -

as long title suggests, know differences between normal extension (popup) , 1 adds new tab in developer tools. example latter observe point . i new chrome extensions. tried research it, failed find answer. there seems little information extensions hidden, observe point. i need know if possible intercept response server using normal extension. nice know differences between them. thank in advance! "normal" extensions popup.html using popups , , popups can specified through browser action or page action . extensions observe point devtools extension , extending devtools , add functionality chrome devtools. as "intercept response", has no direct relationship type of extension is, long declare webrequest along host permissions in manifest.json , observer, analyze, intercept, block or modify network requests in-flight wish. more details take @ chrome.webrequest , there detailed examples. updated: modifying http responses, see thread chrome ex

ios - How to upgrade database version in sqlite and add new column in table in swift -

i've created sqlite tables app, want add new column in table database. alter table me in problem first want check database version. using pragma user_version check user version , update user_version returning user_version 0. var database: fmdatabase? = nil class func getinstance() -> modelmanager{ if(sharedinstance.database == nil){ sharedinstance.database = fmdatabase(path: util.getpath("xxxx.sqlite")) } return sharedinstance } func userversion(){ sharedinstance.database!.open() var userver = int() let resultset = sharedinstance.database?.executequery("pragma user_version", withargumentsinarray: nil) userver = int(resultset!.intforcolumn("user_version")) print("user version : ",userver) sharedinstance.database!.close() } func updateuserversion(){ sharedinstance.database!.open() sharedinstance.database?.execut

c++ - Conditional std::future and std::async -

i need conditional behavior. std::future<int> f = pointer ? std::async(&class::method, ptr) : 0; // ... code x = f.get(); so assign x result async result of ptr->method() call or 0 if ptr nullptr . is code above ok? can (assign 'int' 'std::futture'? or maybe there better solution? std::future have no conversion constructor code not valid (as have noticed if tried compile code). what can use default-constructed future, , check if it's valid before use future.

ios - Xcode not creating default container for iCloud and CloudKit: "Add the iCloud containers entitlement to your App ID" fails -

the apple docs here xcode automatically generates default container when enable cloudkit , icloud. other posts on same thing. however, xcode fails generate default container after enabling icloud , cloudkit. in capabilities tab, in icloud section, there error step add "icloud containers" entitlement app id . other steps show checkmark. clicking fix issue not, in fact, fix issue. the developer portal shows icloud has been enabled app , provisioning profile, seems supported fact first step (i.e., add "icloud" entitlements app id ) checked. do have manually create container, or how can xcode generate container automatically? i went through , fixed generating new development provisioning profile , downloading using xcode (preferences -> select account -> view details -> download) when app id changes, existing development provisioning profile invalidated. once create new development provisioning profile , import it, error should disa

build - CMake generate Xcode project :ld: library not found for -lQuadProgpp -

my cmake project works independently in terminal. however, when use cmake generate xcode project. cannot build project. it says: ld: library not found -lquadprogpp clang: error: linker command failed exit code 1 (use -v see invocation) who can tell me problem is? , how fix problem? thanks

javascript - Format credit card number -

how format , validate credit card number spaces between each 4 digit while typing: eg: 4464 6846 4354 3564 i have tried: $('.creditno').keyup(function() { cc = $(this).val().split("-").join(""); cc = cc.match(new regexp('.{1,4}$|.{1,4}', 'g')).join("-"); $(this).val(cc); }); please help try this: function cc_format(value) { var v = value.replace(/\s+/g, '').replace(/[^0-9]/gi, '') var matches = v.match(/\d{4,16}/g); var match = matches && matches[0] || '' var parts = [] (i=0, len=match.length; i<len; i+=4) { parts.push(match.substring(i, i+4)) } if (parts.length) { return parts.join(' ') } else { return value } } note: check detailed information https://www.peterbe.com/plog/cc-formatter . to restrict user enter number only: javascript way <input type="text" id="txt_

Connection to remote MySQL db from Python 3.4 -

i'm trying connect 2 mysql databases (one local, 1 remote) @ same time using python 3.4 i'm struggling. splitting problem three: step 1: connect local db. working fine using pymysql. (mysqldb isn't compatible python 3.4, of course.) step 2: connect remote db (which needs use ssh). can work linux command prompt not python... see below. step 3: connect both @ same time. think i'm supposed use different port remote database can have both connections @ same time i'm out of depth here! if it's relevant 2 dbs have different names. , if question isn't directly related, please tell me , i'll post separately. unfortunately i'm not starting in right place newbie... once can working can happily go basic python , sql take pity on me , give me hand started! for step 2, code below. seems quite close sshtunnel example answers question python - ssh tunnel setup , mysql db access - though uses mysqldb. moment i'm embedding connection para

Under heavy load, client connecting to a socket.io may miss the first packet with node.js -

i on node.js v4.1.1 , working socket.io when client connected server socket , start exchanging packages @ time first packet missed on server. have guys idea reason behind this? please note have around 900 connection @ time. var http = module.exports = require('http'); var app = module.exports = express(); var httpsoptions = { key: fs.readfilesync('server.key'), cert: fs.readfilesync('certificate.crt') }; var server = https.createserver(httpsoptions, app); var io = module.exports = require('socket.io').listen(server); io.set("transports", ["xhr-polling", "web socket", "polling", "htmlfile"]); io.sockets.on("connection", function(socket) { client.on('msg', function(request) { console.log("event --> " + request); }); client.on('error', function(exc) { console.log("ignoring exception: " + exc); }); client.on('

javascript - getting function itself among its parameters -

have simple function applying given attributes dom-element: object.prototype.setattr = function(attr) { // attr object ( var in attr ) this.setattribute( i, atr[i] ); }; in addition passed parameters i'm getting function setattr itself. can explain behavior? you need use hasownproperty avoid looping through prototype chain. since attr object , have added setattr prototype of object , attr has access setattr method through prototype chain. object.prototype.setattr = function(attr) { // attr object (var in attr) { if (attr.hasownproperty(i)) this.setattribute(i, attr[i]); } }; item.setattr({ b: 1 }); <pre id="result"></pre> <p id="item">item</p>

c++ - Installing OpenCV with GUI on Ubuntu -

it seems have messed things up. forgot install dependencies of opencv on ubuntu. specific, want install opencv on ubuntu 14.04 gui support. noticed there package named gtk+-2.0 required opencv. did sudo apt-get install libgtk2.0-dev or thing that. installed alright. installed other dependencies specified here . however, when run cmake according tutorial, says that gtk+-2.0` not found so opencv built without gui support. there environmental variable should set before run cmake ? i can detect gtk+-2.0 by pkg-config --modversion gtk+-2.0` which outputs 2.24.23 . also, remember adding search path gtk+-2.0 , thing /usr/lib/x86_64-linux-gnu/pkgconfig is there this? thanks. install dependencies sudo apt-get install build-essential checkinstall cmake pkg-config yasm sudo apt-get install libtiff4-dev libjpeg-dev libjasper-dev sudo apt-get install libavcodec-dev libavformat-dev libswscale-dev libdc1394-22-dev libxine-dev libgstreamer0.10-dev libgstream

amazon web services - Throttling while registering activities in Simple Work Flow -

we have started experience failures when our processes start during registration of activities. problem happening in genericactivityworker.registeractivitytypes. the exception generate is: caused by: amazonserviceexception: status code: 400, aws service: amazonsimpleworkflow, aws request id: 78726c24-47ee-11e3-8b49-534d57dc0b7f, aws error code: throttlingexception, aws error message: rate exceeded @ com.amazonaws.http.amazonhttpclient.handleerrorresponse(amazonhttpclient.java:686) @ com.amazonaws.http.amazonhttpclient.executehelper(amazonhttpclient.java:350) @ com.amazonaws.http.amazonhttpclient.execute(amazonhttpclient.java:202) @ com.amazonaws.services.simpleworkflow.amazonsimpleworkflowclient.invoke(amazonsimpleworkflowclient.java:3061) @ com.amazonaws.services.simpleworkflow.amazonsimpleworkflowclient.registeractivitytype(amazonsimpleworkflowclient.java:2231) @ com.amazonaws.services.simpleworkflow.flow.worker.genericactivityworker.registeractivityty

c# - How to call/find a reference for windows form? -

private void sensorskeletonframeready(object sender, skeletonframereadyeventargs e) { skeleton[] skeletons = new skeleton[0]; using (skeletonframe skeletonframe = e.openskeletonframe()) { if (skeletonframe != null) { skeletons = new skeleton[skeletonframe.skeletonarraylength]; skeletonframe.copyskeletondatato(skeletons); } if (skeletons.length != 0) { foreach (skeleton skel in skeletons) { if (skel.trackingstate == skeletontrackingstate.tracked) { this.tracked(skel); this.trackedleft(skel); } } } } } i can not seems find "skeletonarraylength" , "skeletontrackingstate" anywhere

batch processing - taskkill windows command prompt not killing all processes php -

i running windows 7 64bit wamp 2 server. i running program batch script using windows com component ex: c:\wamp\bin\php\php5.3.13\php.exe c:\wamp\www\test\command.php $wshshell = new com("wscript.shell"); $oexec = $wshshell->run($command, 7, false); now when find how many "cmd.exe" programs running, list me processes using below command: tasklist /svc /fi "imagename eq cmd.exe" and kill them below command using php script: $output = shell_exec('taskkill /f /im "cmd.exe"'); here, happens is, not cmd.exe windows getting closed. what might error in above code? some windows closed, while remains open executing command. please help. found solution [though open better suggestions] first needs check , kill if php tasks exists , command prompt kill : // first list out `php.exe` tasks running $output = shell_exec('tasklist /svc /fi "imagename eq php.exe"'); print_r($output); echo "

Stop g++ compiler from including specific header files -

as title stated, want compiler fail when include header files; example, <cmath> is possible compiler flags? or have delete headers? #include <cmath> has nothing library, , header file. assuming mean want compilation fail if include particular header file, should able leverage gcc's support specifying include directories through environment variables . to so, create or edit appropriate environment file. if using gnu bash on debian, example, can create file /etc/profile.d/gcc-include-dirs . readable in /etc/profile.d sourced when shell launched, apply shells started after point. (to absolutely certain, may want log out , in once, issue env | grep include confirm.) create such file favorite editor , add following it: export c_include_path=/usr/local/include/fail:${c_include_path} export cplus_include_path=/usr/local/include/fail:${cplus_include_path} make sure file readable ( chmod 644 /etc/profile/gcc-include-dirs ) , owned root ( chown root:root /e