Khan Academy API displayed on Geektool - api

I have been experimenting with the Khan Academy API found here
http://api-explorer.khanacademy.org/api/v1/user
and tried to find a way to display a user's points (and maybe some other information) on the desktop using geektool. I tried this
stackoverflow.com/questions/12514722/khan-academy-php-oauth-code
and
github.com/Khan/khan-api/
but nothing seems to work. The first link is the khan academy API provided as is. The second is someone with a similar problem who found a solution. He wrote a PHP script according to the temboo library and said to replace a few fields of the PHP and add both the PHP and the Temboo source code to the webroot. So, I added a folder called "php-sdk" into the webroot which is in /Library/WebServer/Documents/ and inside that folder was another folder "src" which contained the Khan Academy API and the Temboo library. Here is what I had.
cl.ly/image/2c2Z1B3T443L
Then I took a look at this and followed the steps until 6:19. Then I started the Apache server by entering this in terminal...
sudo apachectl restart
I opened a web browser, and typed in this...
localhost/php-sdk/src/khanAcademy.php
and I got this...
Warning: require(php-sdk/src/temboo.php): failed to open stream: No such file or directory in /Library/WebServer/Documents/php-sdk/src/khanAcademy.php on line 66
Fatal error: require(): Failed opening required 'php-sdk/src/temboo.php' (include_path='.:') in /Library/WebServer/Documents/php-sdk/src/khanAcademy.php on line 66
any ideas on what this could mean or how I could fix this? I am not advanced in PHP, or python, but I really would love to find a solution to this problem and I am willing to try anything that might work.

This error:
Warning: require(php-sdk/src/temboo.php): failed to open stream: No such file or directory in /Library/WebServer/Documents/php-sdk/src/khanAcademy.php on line 66
indicates that the path you're using for require is likely incorrect. Currently your PHP is trying to find a file called temboo.php here:
/Library/WebServer/Documents/php-sdk/src/php-sdk/src/temboo.php
Note the repeated directory structure. I'll make an assumption that your temboo.php is in the same directory as your khanAcademy.php file. In that case, simply change require "php-sdk/src/temboo.php" to require "temboo.php". If my assumption is incorrect, just adjust the include path accordingly.

Related

how to solve module build failed after changing file extension ( *.ts => *.tsx )?

after changing a specific file's extension from .ts to .tsx I get:
Compiled with problems:X
ERROR in ./src/components/SomeComp/someFile.ts
Module build failed (from ./node_modules/source-map-loader/dist/cjs.js):
Error: ENOENT: no such file or directory, open '.../someFile.ts'
ERROR
No files matching 'C:\Users...\src\components\SomeComp\someFile.ts' were found.
it has happened recently and somehow figured out on its own,
then i switched branches and when returned it happened again
I tried what was suggested here, clearing the browser cache How to get Chrome to reload source maps?
also restarted the react dev server couple of times
but still it tries to find the file with the old .ts extension...
searched as much as I could but didn't find a solve...
edit:
after changing the extension back and forth and restarting the dev server it has figured out, but I would still love to know what was happening and what perhaps what should be done to handle this situation correctly in the future

Missing PHPUnit_Extensions_Story_TestCase when using codecept.phar and yii

There are a lot of questions about "phpunit/phpunit_story" module, and here is another one:
We're using Yii with Codeception, which contains PHPUnit, but missing the PHPUnit_Extensions_Story_TestCase.php module. We're also not using pear or composer. Everytime I'm running /utests I'm getting following warning:
PHP Warning: include(PHPUnit_Extensions_Story_TestCase.php): failed to open stream: No such file or directory in /*/framework/YiiBase.php on line 421
There are a lot of answers about how to fix this problem with pear or composer, but is there any other way to deal with this warning?
This usually happens when your autoloader is too eager, ie. when it tries to load sourcecode files for classes it is not responsible for.

SimplePie: Autoloader.php opening stream

Good afternoon, using Simplepie to load RSS feeds onto my site. Godaddy hosted site, with a WP blog for the RSS feed. Have read through Simplepie docs, and searched forums, but can't seem to figure this out. I'm wondering if my folder permissions aren't correct for the ../cache folder?
Error MSG:
Warning: require_once(../php/autoloader.php) [function.require-once]: failed to open stream: No such file or directory in D:\Hosting\12074013\html\test.php on line 15
Fatal error: require_once() [function.require]: Failed opening required '../php/autoloader.php' (include_path='.;C:\php\pear') in D:\Hosting\12074013\html\test.php on line 15
Thanks for your help!!!
It's not permissions on the cache directory, it's likely a problem with how you set up the SimplePie directories or your include statement.
The file you are running is in D:\Hosting\12074013\html\test.php
and it's trying to include the autoloader.php file, which the include
require_once(../php/autoloader.php)
thinks is in D:\Hosting\12074013\php, which is below the web root. Check your install path and set the include to the correct directory path.

Yii:: WARNING unable to include files on some pages; please explain

I have been recently running into this issue once I uploaded my Application to an online server,
I keep receiving Warnings such as:
YiiBase::include(CJuiInputWidget.php) [<a href='yiibase.include'>yiibase.include</a>]: failed to open stream: No such file or directory
--OR--
YiiBase::include(YiiMailer.php) [<a href='yiibase.include'>yiibase.include</a>]: failed to open stream: No such file or directory
--OR--
YiiBase::include(CGridColumn.php) [<a href='yiibase.include'>yiibase.include</a>]: failed to open stream: No such file or directory
The real issue here is that all of these pages are working perfectly on my localhost or on other pages on
the online server.
When I hid the warnings, some pages are displayed normally while others are not, I know the error is still there.
My Localhost specs are:
XAMPP, Windows 7 OS, PHP Version 5.3.8
Online Server Specs:
XAMPP, Windows 7 OS, PHP Version 5.2.6
I am currently solving the issue by importing the required widgets in main.
What is also crazy for example is that CGridColumn and CJuiInputwidget are working perfectly on other pages ,
I have made sure that case sensitivity is considered.
Can anyone point me in the right direction or give me any pointers or thoughts on what is happening, any tips or advices are amazingly appreciated!
Here is also a stack trace of whats going on:
**Stack trace:
#0 D:\...\yii\framework\YiiBase.php(395): spl_autoload_call()
#1 D:\...\yii\framework\YiiBase.php(395): autoload()
#2 D:\...\yii\framework\YiiBase.php(296): autoload()
#3 D:\...\yii\framework\YiiBase.php(196): import()
#4 D:\...\yii\framework\zii\widgets\grid\CGridView.php(363):
createComponent()**
as you can see the major issue has to do with the autoload
Thank you, for taking the time to read this,
Could be the common problem of developing on windows, hosting on Linux. Windows doesn't care about the case of the filename, Linux does. I'd have a check through any widgets you've written or are including and any custom package definitions you have. Just ensure the case is correct.
Well I added this to the Index.php in order to hide warnings...very dirty in my POV
ini_set('error_reporting', E_NOTICE);
and the problem dissolved, still I can't comprehend what was happening!

XUL standalone application not starting

I recently took on a project built on XUL (standalone, using xulrunner) - However I can't get it to properly run.
I'm getting this error when I attempt to start it using the command line (xulrunner.exe ../application.ini -jsconsole):
No chrome package registered for chrome://case_scenario_builder/content/case_scenario_builder.xul
The chrome.manifest file looks like this:
content case_scenario_builder file:chrome/case_scenario_builder/content/ contentaccessible=yes
content jslib jar:chrome/jslib.jar!/
skin case_scenario_builder skin file:chrome/case_scenario_builder/skin/
locale case_scenario_builder en-US chrome/case_scenario_builder/locale/en-US/
Any ideas on where I could start debugging?
I figured it out!
In case anyone else runs into this as well:
It was due to the caching system in place by default and the use of .jar containers instead of folders.
The XUL environment had cached both JS and XUL files - and even after disabling those, I had to extract everything that was in the .jar file to the content folder and update the chrome.manifest file.
Thanks for your suggestions on debugging! - they helped the process.
I guess your manifest just isn't getting loaded. To test that I'd introduce an intentional syntax error and check the error console. E.g. if you put
asdfasd
on its own line, you should get a Warning: Ignoring unrecognized chrome manifest directive 'asdfasd'. in the Error console.
(Note to other experts: initially I wanted to suggest dropping 'file:' prefix and avoiding underscores in the package name, but I tested it on a Firefox nightly, and it works fine.)
Your chrome package clearly didn't get registered. From what I can tell, the reason is the bogus file: prefix, you should drop it when specifying relative paths:
content case_scenario_builder chrome/case_scenario_builder/content/ contentaccessible=yes
Btw, I suspect that you copied contentaccessible=yes from somewhere - you should drop it as well unless you know what it does.