This question already has answers here:
D3 Bar Graph example not working locally
(3 answers)
Closed 7 years ago.
I'm trying to play around with this Simple d3.js Graph, yet whenever I load the file locally, the graph won't render.
I'm not sure if this has something to do with loading the D3.js library? I have the CSV file in the directory.
I know this is kind of a vague question, but any ideas as to why this won't work locally?
Change the line trying to load data.csv to request the version he is hosting at http://bl.ocks.org/d3noob/raw/b3ff6ae1c120eea654b5/a1f7e8f2a609bfab778b8c48eaa0f7c90f3f6f80/data.csv
You cannot load files locally.
If you're using Chrome, it may prevent you from opening the file properly because of cross domain security restrictions. Try Firefox to see if that's the case (it will probably let you load the file correctly).
If that is the problem, you will want to install a local web server like WAMP (if you're running Windows) or follow instructions on the wiki page here: https://github.com/mbostock/d3/wiki
Good luck
javascript is not allowed to load files from local disk. which is what the csv file becomes when saved to local, and the d3.js tries to refer to it. if you have a local webserver, you can make it work.
Related
I have been using TeamCity 9.0.5 for a while now. But today when i started up the server i was greeted with the "TeamCity First Start" which i had last seen some months ago. I also see the version at the bottom has changed from 9.0.5 to 9.1.4.
I did not run any updates so i am wondering what happened. Also, it expects to find the data directory at "/root/.BuildServer" now and the "/root/" does not exist. I have all projects and TC data stored at "home//.BuildServer" but it's not picking that up.
So, the question why did it really upgrade on it's own? Also, how do i setup the data directory path? I have looked at official link like this but everything seems fine according to that. I have the teamcity-startup.properties file which points to correct path.
I have added the screenshot for further clarification.
I have to use d3 graph at my web page. I never worked with d3. That's why, I'm facing some problem using it. Basically, I've to work at dropbox folder. So, my clients can see the worked file locally at their browser. Consider, I put a d3 chart at file.html file and my folder structure is like this
D:\Projects\Dropbox (Company)\MyName\FolderName\file.html
But, I saw that to run and see/show d3 examples I need run web server or run a python server. So, I've downloaded Python 3.4.1 and installed by double click. It's installed at this directory: C:\Python34
After that, I tried to follow d3's documentation for installing python server. So, I opened my cmd and type:
python -m http.server 8888 &
But, it gives me this error:
So, my question is:
How can I install python web server?
After installing that web server, is it possible see the d3 chart via this link: file:///D:/Projects/Dropbox (Company)/MyName/FolderName/file.html or I've put my files inside htdocs and run via http://localhost/folderName/file.html (I don't want to put files inside htdocs. It'll be tough for my clients see the output of the files directly from their pc)?
If it can't be seen without putting inside htdocs folder, I may find solution for running d3.js locally without installing any additional software/server(though I've found this type of solution for some d3.js chart but not for all). Thanks in advance and please don't mind if it's a lame question. Basically, it's my first day working with d3.js and I'm only ameture level skilled with javascript and jQuery.
OK, browsers are designed with security in mind, by default they don't let scripts go and grab a file from anywhere for very good reasons. They allow you to grab a file from the server or through requests. So to share your work with your client you will either need to use a hosting service - I would recommend bl.ocks, design your visualisation so it doesn't require any external data or provide instructions on how to disable browser security. You can read more about this here, here and here.
On python, in many cases python is already installed on people machines, so running a server from python shouldn't be an issue. All you have to do (on a windows machine) is launch your command prompt navigate to your directory and start your python server. Then open a browser and navigate to the localhost. Please note that python needs to be set as an environmental variable (i.e. your system path), the python documentation might help you here.
I downloaded the latest version of phpcrawler, and I can access a test website of my own.
I only have an image and some text on this site, I run the crawler and I receive the text minus the image because I did the proper $crawler->addNonFollowMatch("/.(jpg|gif|png)$/ i");
I cannot get it to save the tmp file It does not save the unique tmp file in the folder I run the crawler from, I have tried to save a named file no luck.
I did run into many depreciated errors on different lines in all the php files, for example: #fopen, the # cause problems in different area's. I use PHP and can also do Regex.
David.
I answered my own question, since I see that PHPCrawler questions really do not get answered; I saw a question from last year not answered. I will answer it also, though it might be too late to do any good. This is the answer.
I added in a modified phpcrawler I adjusted for my needs:
$fp = fopen('c:/test/poopoo.txt','w');
fwrite($fp,($page_data['source']));
fclose($fp);
You put it before flushing the file and create your instance of class.
I found out using PHP Simple HTML DOM Parser from this project works well. If you need more control use RegExp, but that does have a steep learning curve.
I want to put several screenshots of a project I'm working on, in the wiki and project pages for the project on Google Code. How do I host or attach the image files? If this isn't possible, where should I put them?
Update0
This question has spawned another: Get certificate fingerprint of HTTPS server from command line?
Yes, you can put these files in the same repository that holds the wiki - i.e. http://code.google.com/p/pydlnadms/source/checkout?repo=wiki.
These files will be served under http://wiki.pydlnadms.googlecode.com/hg/.
This question already has answers here:
Closed 10 years ago.
Possible Duplicate:
How can I stop Filezilla changing my linebreaks?
For some reason Filezilla sometimes removes line breaks on my php files making the code appear on a single line giving me a bunch of errors when I upload my projects, I was looking around and changed my transfer type to Binary but I still have the same issues, downloaded CuteFTP as well but same problem.
Does anyone know what can I do to fix this?
Thanks in advance!
EDIT: Now that I check, when I upload the files to my hosting they look in one line as well, but it doesn't give me any errors, the problem is when I upload to my clients host, could it be some configuration on the hosting or something?
change the "Transfer" to "Binary" (Do not keep it as a "Auto"). Restart Filezilla and upload files as it is.
Well, I managed to solve my problem, I dont exactly know how I just deleted the folder, uploaded as ASCII again, changed to Binari, restarted Filezilla, deleted the files again, and re-upload it as Binari again. For some reason it works now, maybe you have to restart Filezilla to apply the changes correctly.
Sounds like it may not be the FTP that is entirely the issue. If you're saving these files using the wrong encoding, this undesired result can be achieved. What program are you saving these files in?
If you have a file on the server in question that is formatted properly, download it with the FTP programs, then upload it without re-saving it. Check the downloaded copies and the uploaded copies to see if the issue is still occurring.